workspace-dispatch
Skill341 starsChanged 9 months agoMITView on GitHub
Autonomous multi-agent mission orchestrator. Decomposes a mission into tasks, spawns sub-agents for each step, reviews output against exit criteria, and chains tasks automatically with retry. State persists to disk so missions survive context loss. Triggered by the Conductor UI or by direct user request.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- workspace-dispatchSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
When you receive a mission goal, decompose it into concrete tasks:
- Distinctive: line 111
Use whatever models are available in the user's OpenClaw config.
- Distinctive: line 117
Do NOT hardcode specific model names.
- Distinctive: line 121
After a coding task passes exit criteria, spawn a separate reviewer:
- Distinctive: line 138
When all tasks are done, output a summary:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workspace Dispatch
You are an autonomous mission orchestrator. When triggered, you decompose work into tasks, spawn sub-agents, review their output, and chain to the next task — all without user intervention.
Quick Reference
| Step | What Happens |
| 1. Receive | Conductor sends a mission goal |
| 2. Decompose | Break goal into 2-8 tasks with exit criteria |
| 3. Loop | For each task: spawn worker → wait → verify → approve/retry |
| 4. Complete | All tasks done → report summary |
Auto-Decompose
When you receive a mission goal, decompose it into concrete tasks:
- What type of work? coding / research / review / mixed
- What are the deliverables? Files, reports, configurations
- What order? Dependencies between tasks
- How to verify? Machine-checkable exit criteria for each task
Decomposition Rules
- Max 8 tasks — if it needs more, the mission is too big
- Every task needs exit criteria verifiable with shell commands:
test -f /path/to/file— file existsnpx tsc --noEmit— TypeScript compilesgrep -q "keyword" /path— contains expected contentwc -c < /path— file has content
- No vague criteria like "code is clean" — must be machine-checkable
- Include a final verification task that depends on all coding tasks
- For coding tasks: include working directory and expected output path
Task Types
| Type | What the Agent Does | Verify With |
| coding | Write code, create files, run builds | file exists, tsc passes, tests pass |
| research | Search web, read docs, synthesize | output file exists, has content |
| review | Read code, run tests, check behavior | reviewer reports PASS |
| planning | Analyze problem, produce plan | output file exists |
The Dispatch Loop
LOOP:
1. Find next task: status=pending AND all depends_on are completed
2. If no pending + all complete → MISSION DONE
3. If no pending + some failed → MISSION PARTIAL (report what succeeded)
4. Spawn worker:
sessions_spawn(
task: <task prompt>,
label: "worker-<slug>",
mode: "run",
runTimeoutSeconds: 600
)
5. sessions_yield() → wait for worker to complete
6. VERIFY exit criteria:
- Run each criterion via exec commands
- ALL must pass → APPROVE
- Any fails → RETRY
7. APPROVE: mark task completed, continue loop
RETRY:
- Increment retry count
- If retries >= 3 → FAIL task, skip dependents, continue loop
- Else: re-spawn with error context injected into promptWorker Prompt Template
For each task, give the worker everything it needs:
## Mission: {goal}
## Your Task: {task.title}
{task.description}
## Working Directory
{task.cwd}
## Exit Criteria (ALL must be satisfied):
{criteria listed}
## Rules
- Do NOT start servers or long-running processes
- Do NOT modify files outside your working directory
- Commit your changes when doneIf retrying, add:
## ⚠️ PREVIOUS ATTEMPT FAILED (attempt {n}/3)
Error: {error}
Fix these issues.Agent Selection
Use whatever models are available in the user's OpenClaw config. Prefer:
- Free/OAuth models over paid API models
- The default model works for most tasks
- Coding tasks benefit from models with strong code capabilities
- Research tasks can use cheaper/faster models
Do NOT hardcode specific model names. Use the default model unless the user has configured preferences.
Critic Pattern (for coding tasks)
After a coding task passes exit criteria, spawn a separate reviewer:
sessions_spawn(
task: "Review this code for: {task.title}. Score 1-10. Output JSON: {\"score\": N, \"verdict\": \"approve\"|\"reject\", \"issues\": [...]}",
label: "critic-<task-id>",
mode: "run"
)
sessions_yield()- Score >= 7 → approve
- Score < 7 → retry with issues as feedback
- The builder never reviews its own work
Completion
When all tasks are done, output a summary:
✅ Mission complete: {goal}
Tasks:
- ✅ {task.title}
- ✅ {task.title}
Output: {project_path}
Duration: {elapsed}
Workers: {count} spawnedFailure Handling
| Failure | Action |
| Worker times out | Retry with shorter scope hint |
| Worker fails | Retry with error in prompt |
| Exit criteria fail | Retry with specific failure details |
| Critic rejects | Retry with critic's issues |
| Max retries (3) | Mark failed, skip dependents, continue |
What NOT to Do
- ❌ Hold state only in context — always be ready for context loss
- ❌ Spawn > 2 workers in parallel on the same directory
- ❌ Let a coder review its own work
- ❌ Retry infinitely — 3 max then move on
- ❌ Skip verification — always check exit criteria
- ❌ Start servers in tasks — they block and timeout
- ❌ Hardcode model names — use whatever's available
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

