Install
openclaw skills install task-dispatchTask scheduling and dispatching for task boards. Use when setting up periodic task dispatch, checking for dispatchable tasks, creating subagents to execute tasks, or verifying task completion. Supports task board APIs like ClawBoard.
openclaw skills install task-dispatchAutomated task scheduling and execution for task management systems.
用户说"设置任务调度"或"部署 ClawBoard"时,按以下流程引导:
# 检查 Node.js
node --version # 需要 >= 18
# 检查 ClawBoard 是否已安装
ls -la ~/ClawBoard 2>/dev/null || echo "ClawBoard not installed"
# 克隆仓库
git clone https://github.com/CCCaptain0129/ClawBoard.git ~/ClawBoard
cd ~/ClawBoard
# 安装依赖并初始化
./clawboard install
# 生成访问 token(自动保存到 .env)
./clawboard token --generate
cd ~/ClawBoard
./clawboard start
# 检查状态
./clawboard status
在 Agent 工作目录创建 .env 文件:
# 获取 token
TOKEN=$(cat ~/ClawBoard/.env | grep BOARD_ACCESS_TOKEN | cut -d= -f2)
# 写入 Agent 工作目录
echo "TASKBOARD_API_URL=http://127.0.0.1:3000" >> ~/.openclaw/workspace-<name>/.env
echo "TASKBOARD_ACCESS_TOKEN=$TOKEN" >> ~/.openclaw/workspace-<name>/.env
.env 中的 BOARD_ACCESS_TOKEN 登录用户说"设置定时调度"时:
{
"name": "ClawBoard 调度巡检",
"schedule": { "kind": "every", "everyMs": 300000 },
"payload": {
"kind": "agentTurn",
"message": "执行 task-dispatch 调度检查。无任务时返回 HEARTBEAT_OK。"
},
"sessionTarget": "isolated",
"delivery": { "mode": "none" }
}
You are a dispatcher, not an executor.
| What | Source |
|---|---|
| Task data | API endpoint (e.g., http://127.0.0.1:3000/api/tasks/...) |
| Task files | tasks/*.json (written by API) |
| Project docs | projects/<project-name>/docs/ |
| NOT source of truth | Frontend dashboard (view only) |
./clawboard install)| Command | Description |
|---|---|
./clawboard install | Install dependencies, create .env |
./clawboard start | Start frontend + backend services |
./clawboard stop | Stop all services |
./clawboard status | Check service health |
./clawboard token | Show current access token |
./clawboard token --generate | Generate new token |
After deployment, verify:
curl http://127.0.0.1:3000/healthcurl -H "Authorization: Bearer $TOKEN" http://127.0.0.1:3000/api/tasks/projects| Issue | Solution |
|---|---|
| Port 3000 in use | lsof -i :3000 then kill process |
| Port 5173 in use | lsof -i :5173 then kill process |
| Token not working | Regenerate with ./clawboard token --generate |
| Services not starting | Check logs in ~/ClawBoard/logs/ |
This skill enables agents to:
触发一次 → 循环执行直到无任务 → 结束
而不是:
触发一次 → 派发一个任务 → 等待下次触发
def dispatch_loop():
while True:
task = select_dispatchable_task()
if not task:
return HEARTBEAT_OK # 本轮结束
# 派发并等待完成
result = spawn_and_wait(task)
# 验收
if result.success:
update_task(task.id, status="review")
else:
update_task(task.id, status="failed", blockingReason=result.error)
# 【关键】立即继续下一轮,不返回
# 循环会自动检查下一个任务
GET {TASKBOARD_API_URL}/api/tasks/projects
Authorization: Bearer {TOKEN}
GET {TASKBOARD_API_URL}/api/tasks/projects/{projectId}/tasks
Authorization: Bearer {TOKEN}
POST {TASKBOARD_API_URL}/api/tasks/projects
Authorization: Bearer {TOKEN}
Content-Type: application/json
{
"id": "my-project",
"name": "My Project",
"description": "...",
"taskPrefix": "MP",
"color": "#3B82F6",
"icon": "📁"
}
POST {TASKBOARD_API_URL}/api/tasks/projects/{projectId}/tasks
Authorization: Bearer {TOKEN}
Content-Type: application/json
{
"title": "Task title",
"description": "...",
"status": "todo",
"priority": "P1",
"executionMode": "auto",
"assignee": "agent-id"
}
PUT {TASKBOARD_API_URL}/api/tasks/projects/{projectId}/tasks/{taskId}
Authorization: Bearer {TOKEN}
Content-Type: application/json
{
"status": "in-progress",
"claimedBy": "agent-id"
}
A task is dispatchable if ALL conditions are met:
| Condition | Requirement |
|---|---|
executionMode | "auto" |
status | "todo" or "in-progress" (unclaimed) |
assignee | Empty or null |
claimedBy | Empty or null |
dependencies | All have status: "done" |
P0 > P1 > P2 > P3createdAt firstBefore spawning subagent, prepare context using the Dispatch Template:
See references/dispatch-template.md for full template.
Required fields to fill:
Use sessions_spawn with the dispatch context:
{
"runtime": "subagent",
"mode": "run",
"task": "<filled dispatch template>",
"timeoutSeconds": 300
}
The main agent should:
completion_signal from responseSubagent must return a completion_signal block:
task_id: <taskId>
status: done | blocked
summary: <one sentence summary>
deliverables: <comma-separated paths>
next_step: <N/A if done; blocking reason if blocked>
Parse this block to determine task outcome:
status: done → Verify deliverables, update to reviewstatus: blocked → Update to failed with blockingReasontodo → in-progress → review → done
↓ ↓
failed failed
Important: Tasks go to review after subagent completes, not directly to done. User or main agent verifies before done.
After subagent completes, verify:
Deliverables exist
deliverables arrayAcceptance criteria met
Update status
reviewfailed with blockingReasonWhen triggered by cron/heartbeat:
HEARTBEAT_OK (silent, no message to user)When a task fails or has no valid execution:
blockingReason fieldclaimedBy)todo or in-progress)| Scenario | Action |
|---|---|
| Subagent timeout | Set failed, clear claimedBy, log reason |
Subagent returns blocked | Set failed with blockingReason |
| Deliverables missing | Set failed, clear claimedBy |
| API error | Log error, skip this round, try next time |
executionMode=auto taskstodo first, then unclaimed in-progressassignee is setreview first, then done after verificationSee references/config.md for:
"部署 ClawBoard 看板"
"帮我设置任务调度系统"
"检查任务看板,派发所有待执行任务"
"设置每10分钟自动检查任务"
The cron will trigger the dispatch loop, which runs until no tasks remain.