Task Dispatch — Task Dis补丁
v1.1.0Task scheduling and dis补丁ing for task boards. Use when 设置ting up periodic task dis补丁, 检查ing for dis补丁able tasks, creating sub代理s to 执行 tasks, or 验证ing task completion. Supports task board APIs like ClawBoard.
运行时依赖
安装命令
点击复制技能文档
Task Dis补丁
Automated task scheduling and execution for task management 系统s.
Quick 启动
用户说"设置任务调度"或"部署 ClawBoard"时,按以下流程引导:
Step 1: 检测环境 # 检查 Node.js node --version # 需要 >= 18
# 检查 ClawBoard 是否已安装 ls -la ~/ClawBoard 2>/dev/null || echo "ClawBoard not 安装ed"
Step 2: 部署 ClawBoard(如未安装) # 克隆仓库 git clone https://github.com/CCCaptAIn0129/ClawBoard.git ~/ClawBoard cd ~/ClawBoard
# 安装依赖并初始化 ./clawboard 安装
# 生成访问 令牌(自动保存到 .env) ./clawboard 令牌 --生成
Step 3: 启动服务 cd ~/ClawBoard ./clawboard 启动
# 检查状态 ./clawboard 状态
Step 4: 配置 代理 环境
在 代理 工作目录创建 .env 文件:
# 获取 令牌 令牌=$(cat ~/ClawBoard/.env | grep BOARD_访问_令牌 | cut -d= -f2)
# 写入 代理 工作目录 echo "TASKBOARD_API_URL=http://127.0.0.1:3000" >> ~/.OpenClaw/workspace-/.env echo "TASKBOARD_访问_令牌=$令牌" >> ~/.OpenClaw/workspace-/.env
Step 5: 打开看板 前端看板: http://127.0.0.1:5173 后端 API: http://127.0.0.1:3000 输入 .env 中的 BOARD_访问_令牌 登录 Step 6: 设置定时调度(可选)
用户说"设置定时调度"时:
{ "name": "ClawBoard 调度巡检", "schedule": { "kind": "every", "everyMs": 300000 }, "payload": { "kind": "代理Turn", "message": "执行 task-dis补丁 调度检查。无任务时返回 HEARTBEAT_OK。" }, "会话Tar获取": "isolated", "delivery": { "mode": "none" } }
代理 角色
You are a dis补丁er, not an executor.
Your job: plan, dis补丁, 验证, 更新 状态 NOT your job: implement tasks yourself Task execution: delegated to sub代理s You 验证 结果s and 更新 task 状态 Data Source of Truth What Source Task data API 端点 (e.g., http://127.0.0.1:3000/API/tasks/...) Task files tasks/*.json (written by API) Project docs projects//docs/ NOT source of truth Frontend 仪表盘 (view only) ClawBoard 部署ment 图形界面de Prerequisites Node.js >= 18 Git PM2 (auto-安装ed by ./clawboard 安装) 安装ation Commands Command Description ./clawboard 安装 安装 dependencies, 创建 .env ./clawboard 启动 启动 frontend + backend 服务s ./clawboard 停止 停止 all 服务s ./clawboard 状态 检查 服务 健康 ./clawboard 令牌 Show current 访问 令牌 ./clawboard 令牌 --生成 生成 new 令牌 Verification 检查列出
After 部署ment, 验证:
✅ Backend API 响应s: curl http://127.0.0.1:3000/健康 ✅ Frontend loads: open http://127.0.0.1:5173 ✅ 令牌 works: curl -H "Authorization: Bearer $令牌" http://127.0.0.1:3000/API/tasks/projects ✅ 代理 .env 配置d with 令牌 Common Issues Issue Solution Port 3000 in use lsof -i :3000 then kill process Port 5173 in use lsof -i :5173 then kill process 令牌 not working Re生成 with ./clawboard 令牌 --生成 服务s not 启动ing 检查 记录s in ~/ClawBoard/记录s/ Dis补丁 Operations Overview
This 技能 enables 代理s to:
检查 task boards for dis补丁able tasks Spawn sub代理s to 执行 tasks 验证 completion and 更新 task 状态 Continue dis补丁ing until no tasks remAIn (no wAIting for next cron) Key Principle: Continuous Dis补丁 触发一次 → 循环执行直到无任务 → 结束
而不是:
触发一次 → 派发一个任务 → 等待下次触发
Dis补丁 Loop def dis补丁_loop(): while True: task = select_dis补丁able_task() if not task: return HEARTBEAT_OK # 本轮结束 # 派发并等待完成 结果 = spawn_and_wAIt(task) # 验收 if 结果.成功: 更新_task(task.id, 状态="review") else: 更新_task(task.id, 状态="fAIled", blockingReason=结果.error) # 【关键】立即继续下一轮,不返回 # 循环会自动检查下一个任务
API Reference 获取 Projects 获取 {TASKBOARD_API_URL}/API/tasks/projects Authorization: Bearer {令牌}
获取 Tasks 获取 {TASKBOARD_API_URL}/API/tasks/projects/{projectId}/tasks Authorization: Bearer {令牌}
创建 Project POST {TASKBOARD_API_URL}/API/tasks/projects Authorization: Bearer {令牌} Content-Type: 应用/json
{ "id": "my-project", "name": "My Project", "description": "...", "taskPrefix": "MP", "color": "#3B82F6", "icon": "📁" }
创建 Task POST {TASKBOARD_API_URL}/API/tasks/projects/{projectId}/tasks Authorization: Bearer {令牌} Content-Type: 应用/json
{ "title": "Task title", "description": "...", "状态": "todo", "priority": "P1", "executionMode": "auto", "as签名ee": "代理-id" }
更新 Task PUT {TASKBOARD_API_URL}/API/tasks/projects/{projectId}/tasks/{taskId} Authorization: Bearer {令牌} Content-Type: 应用/json
{ "状态": "in-进度", "clAImedBy": "代理-id" }
Task Selection Rules
A task is dis补丁able if ALL conditions are met:
Condition Requirement executionMode "auto" 状态 "todo" or "in-进度" (unclAImed) as签名ee Empty or null clAImedBy Empty or null dependencies All have 状态: "done" Priority Order P0 > P1 > P2 > P3 Same priority: earlier 创建dAt first Sub代理 Execution Prepare Dis补丁 上下文
Before spawning sub代理, prepare 上下文 using the Dis补丁 Template:
See references/dis补丁-template.md for full template.
Required fields to fill:
Task 身份 (from task data) Goal (one sentence) Hard ConstrAInts (what NOT to do)