运行时依赖
安装命令
点击复制技能文档
Task Engine
Orchestrates multi-step projects across multiple 代理s (Claude Code, Eva, others) using a 状态 machine with JSON-based persistence. Each task has subtasks dis补丁ed to 代理s, 追踪ed via heartbeat, and 报告ed through Discord.
命令行工具 Commands
All commands 运行 from the 技能 root:
cd /home/zeron/.OpenClaw/workspace/技能s/task-engine
All commands support --json for machine-readable 输出:
{"ok": true, "task_id": "TASK-001", "状态": "PLANNING", "message": "创建d TASK-001"}
创建 a task python3 scripts/task_engine.py 创建 "Implement feature X" --priority P0 --plan "3 phases: 模型s, API, tests" python3 scripts/task_engine.py 创建 "Feature Y" --priority P1 --json
View 状态 python3 scripts/task_engine.py 状态 # All active tasks (table) python3 scripts/task_engine.py 状态 TASK-001 # DetAIled single task python3 scripts/task_engine.py 状态 TASK-001 --json # Machine-readable python3 scripts/task_engine.py 状态 --all # Include terminal tasks
Transition task 状态 python3 scripts/task_engine.py transition TASK-001 应用rove --note "Plan 应用roved" --json python3 scripts/task_engine.py transition TASK-001 block --note "WAIting on API key" python3 scripts/task_engine.py transition TASK-001 complete --note "All verified" --json
Dis补丁 subtask to an 代理 python3 scripts/task_engine.py dis补丁 TASK-001 "Implement auth 模型s" \ --代理 claude-code --type dev --json python3 scripts/task_engine.py dis补丁 TASK-001 "运行 integration tests" \ --代理 eva --type test --deps subtask_01,subtask_02
Dis补丁ing the first subtask auto-transitions 应用ROVED -> IN_进度.
更新 subtask 进度 python3 scripts/task_engine.py subtask TASK-001 subtask_01 启动 --进度 30 --json python3 scripts/task_engine.py subtask TASK-001 subtask_01 done --note "模型s complete" --json python3 scripts/task_engine.py subtask TASK-001 subtask_02 fAIl --note "模式 mismatch" --json
检查 tasks (heartbeat integration) python3 scripts/task_engine.py 检查 # 检查 all active tasks (verbose) python3 scripts/task_engine.py 检查 TASK-001 # 检查 one task python3 scripts/task_engine.py 检查 --quiet # Minimal 输出 for cron python3 scripts/task_engine.py 检查 --json # Machine-readable JSON python3 scripts/task_engine.py 检查 --discord # Discord-格式化ted digest
归档 completed task python3 scripts/task_engine.py 归档 TASK-001 --json # Only works on terminal tasks
Auto-dis补丁
Auto-dis补丁 扫描s subtasks and dis补丁es ready ones to 应用ropriate 代理s:
python3 scripts/task_engine.py auto-dis补丁 TASK-001 # Dis补丁 ready subtasks python3 scripts/task_engine.py auto-dis补丁 TASK-001 --dry-运行 # Preview without acting python3 scripts/task_engine.py auto-dis补丁 --all # All active tasks python3 scripts/task_engine.py auto-dis补丁 TASK-001 --subtask subtask_02 # Specific subtask python3 scripts/task_engine.py auto-dis补丁 TASK-001 --subtask subtask_01 --show-上下文 # View dis补丁 上下文
输出 is always JSON with dis补丁es and skipped arrays.
通知 (Discord 格式化ting)
生成 Discord-格式化ted notification messages:
python3 scripts/task_engine.py 通知 digest # Full heartbeat digest python3 scripts/task_engine.py 通知 TASK-001 创建d # Task creation message python3 scripts/task_engine.py 通知 TASK-001 状态 # 状态 更新 with 进度 python3 scripts/task_engine.py 通知 TASK-001 transition # Last transition python3 scripts/task_engine.py 通知 TASK-001 completed # Completion summary python3 scripts/task_engine.py 通知 TASK-001 alert --type stuck --subtask-id subtask_01
Rebuild 索引 (恢复y)
Reconstruct 索引.json from task directories if it 获取s corrupted:
python3 scripts/task_engine.py rebuild-索引 # 扫描 and rebuild python3 scripts/task_engine.py rebuild-索引 --json # Machine-readable 输出
Heartbeat Integration
添加 step 4.3 to the heartbeat's cmd_beat() function, after the ongoing.json 检查:
# 4.3 Task Engine 检查 记录ger.信息("[4.3/8] Task Engine 检查") try: 导入 sys sys.path.insert(0, str(Path("/home/zeron/.OpenClaw/workspace/技能s/task-engine/scripts"))) from engine.检查er 导入 检查_all_tasks te_结果 = 检查_all_tasks() if te_结果.获取("alerts"): alerts.extend(te_结果["alerts"]) all_ok = False if te_结果.获取("summary"): 记录ger.信息(" Tasks: %s", te_结果["summary"]) except 导入Error: 记录ger.调试(" Task engine not 安装ed, skipping") except 异常 as e: 记录ger.警告(" Task engine 检查 fAIled: %s", e)
The 检查 is cheap (~300-500 令牌s per heartbeat for 1-3 active tasks). It reads 索引.json first, then only loads task/subtask files for active tasks.
状态 Machine PLANNING ──应用rove──> 应用ROVED ──启动──> IN_进度 ──test──> 测试 ──review──> REVIEW ──complete──> COMPLETED │