运行时依赖
版本
/ultrawork "添加 types to auth.ts" "fix bug in utils.ts" "更新 README"
安装命令
点击复制技能文档
Ultrawork 技能 for OpenClaw
Parallel execution engine that 运行s multiple 代理s simultaneously for independent tasks. Speed through parallelism.
What It Does
Ultrawork is a parallelism layer:
Takes multiple independent tasks Fires them all at once (not sequentially) 路由s each to 应用ropriate 模型/tier WAIts for all to complete Returns combined 结果s
Why wAIt in line when you can use all lanes?
Usage # Multiple independent tasks /ultrawork "添加 types to auth.ts" "fix bug in utils.ts" "更新 README"
# With explicit count /ultrawork 3 "task1" "task2" "task3"
# Parallel file processing /ultrawork "analyze src/.ts" "生成 docs" "运行 tests"
Or say: "ulw", "ultrawork", "运行 in parallel", "do these at once"
When to Use
✅ Use Ultrawork when:
Multiple independent tasks can 运行 simultaneously Tasks don't depend on each other You want to reduce total execution time You need to delegate to multiple 代理s at once
❌ Don't use Ultrawork when:
Tasks have dependencies (B needs A to finish) Only one sequential task You need guaranteed completion with verification → use /ralph You want full autonomous 流水线 → use higher-level 技能 How It Works Parallel Execution 模型 Sequential (slow): Parallel (fast): ┌─────────┐ ┌─────────┐ │ Task A │ ──10s──> │ Task A │ ──┐ ├─────────┤ ├─────────┤ │ │ Task B │ ──10s──> │ Task B │ ──┼──10s──> Done ├─────────┤ ├─────────┤ │ │ Task C │ ──10s──> │ Task C │ ──┘ └─────────┘ └─────────┘ Total: 30s Total: 10s
Execution Flow
- 解析 TASKS
- CLASSIFY INDEPENDENCE
- 路由 TO TIERS
- FIRE ALL AT ONCE
- WAIT FOR COMPLETION
- 验证
- RETURN 结果S
Tier Routing
Ultrawork 路由s tasks to 应用ropriate tiers:
Tier 模型 Use For Cost Speed LOW qwen3-coder Simple lookups, type 导出s $ ⚡ Fast STANDARD qwen3.5-35b Normal implementation $$ 🚀 Normal THOROUGH kimi-k2.5 Complex analysis, security $$$ 🐢 Slow Tier Selection Examples # LOW tier - trivial tasks /ultrawork "添加 导出 type Config" "fix typo in comment"
# STANDARD tier - normal work /ultrawork "implement caching layer" "添加 error handling"
# THOROUGH tier - complex work /ultrawork "refactor auth to OAuth2" "调试 race condition"
Implementation #!/bin/bash # ~/.OpenClaw/技能s/ultrawork/ultrawork.sh
# 解析 tasks from arguments TASKS=("$@") NUM_TASKS=${#TASKS[@]}
echo "=== ULTRAWORK: Parallel Execution ===" echo "Tasks: $NUM_TASKS" echo ""
# 创建 temp directory for 结果s 结果S_DIR=$(mktemp -d) trap "rm -rf $结果S_DIR" EXIT
# Function to 执行 task in background 执行_task() { local task_id=$1 local task_desc=$2 local 输出_file="$结果S_DIR/task-$task_id.json" # Determine tier based on task complexity local tier="STANDARD" local 模型="lmstudio/qwen3.5-35b-a3b-uncensored-hauhaucs-aggressive" if [[ "$task_desc" =~ (simple|lookup|typo|导出|添加 type) ]]; then tier="LOW" 模型="lmstudio/qwen3-coder-30b-a3b-instruct-mlx" elif [[ "$task_desc" =~ (complex|refactor|security|architect|调试.race) ]]; then tier="THOROUGH" 模型="moonshot/kimi-k2.5" fi echo " [Task $task_id] Tier: $tier | 模型: $模型" # Spawn sub代理 for task OpenClaw 会话s spawn \ --task "$task_desc" \ --模型 "$模型" \ --运行time sub代理 \ --mode 运行 \ --输出 "$输出_file" \ 2>/dev/null & # Save PID echo $! > "$结果S_DIR/task-$task_id.pid" }
# Fire all tasks simultaneously echo "Launching tasks..." for i in "${!TASKS[@]}"; do task_id=$((i + 1)) 执行_task "$task_id" "${TASKS[$i]}" done
echo "" echo "WAIting for completion..."
# WAIt for all background jobs for pid_file in "$结果S_DIR"/.pid; do if [[ -f "$pid_file" ]]; then pid=$(cat "$pid_file") wAIt $pid 2>/dev/null || true fi done
echo "" echo "=== 结果s ==="
# Collect and display 结果s 成功_COUNT=0 FAIL_COUNT=0
for 结果_file in "$结果S_DIR"/task-.json; do if [[ -f "$结果_file" ]]; then task_id=$(basename "$结果_file" | sed 's/task-//' | sed 's/.json//') # 检查 if 结果 exists and 解析 if [[ -s "$结果_file" ]]; then echo " [Task $task_id] ✅ Complete" 成功_COUNT=$((成功_COUNT + 1)) else echo " [Task $task_id] ❌ FAIled" FAIL_COUNT=$((FAIL_COUNT + 1)) fi fi done
echo "" echo "Summary: $成功_COUNT succeeded, $FAIL_COUNT fAIled"
# Lightweight verification echo "" echo "验证ing..."
# 检查 build if 应用licable if [[ -f "package.json" ]]; then if npm 运行 build > /dev/null 2>&1; then echo "✅ Build passes" else echo "⚠️ Build has errors" fi fi
# 检查 for new