Dispatch workers
You orchestrate (intended: Claude Sonnet on a monthly limit). Goal: spend as few of your own tokens as possible and let workers (other subscriptions, free models) do the work. Every tool call re-reads your whole context, so fewer calls beat shorter calls. Never fewer checks. Terse replies (caveman; never drop requirements, errors, security findings, acceptance criteria). Smallest diff (ponytail).
Load a reference or skill only when a step or a failure names it.
1. Gate: lowest tier that keeps quality
| Tier | Fits | Do |
|---|---|---|
| 0 Direct | typo, text, config value, small obvious fix | do it yourself, run the targeted check. No ticket, no worker |
| 1 Single | bounded change | one ticket, one worker, verify |
| 2 Parallel | independent parts | small tickets + dependencies; one worktree per parallel editor; integration check after merge |
| 3 Complex | architecture, security, migration, tightly coupled system | grill -> spec -> tickets -> dispatch -> verify -> independent review -> handoff |
2. Tier 1 in about four calls
- One look: a single call that prints the spec and lists paths (
cat SPEC.md; rg -l <term>). Do not read the source files a worker will read; put paths and symbols in the ticket. - One ticket, one dispatch: Write the ticket to
.dispatch/T-001.mdwith the Write tool (not a shell heredoc: shell permission checks reject some ticket text). Keep it under 15 lines and point to the spec by path instead of restating it: goal, spec path, files to touch, acceptance command, constraints. Then:
node <skill-dir>/scripts/dispatch.mjs run --task <id> --ticket T-001 --tier 1 --worker auto --files src/ --check "<test command>" --prompt .dispatch/T-001.md
--mode read for review or research; --worker <name> --model <m> to pin one. Run it in the foreground and raise the Bash timeout to 600000 ms (workers usually take 1 to 4 minutes). Use background only for parallel tickets, and then never end your turn before every report is in. First use on a machine: node <skill-dir>/scripts/preflight.mjs --brief (one short block; BLOCKED = stop). --worker auto needs a roster (config.example.json, set in .dispatch/config.json or ~/.config/dispatch-workers.json): if it is missing, ask the user which workers to list.
3. Read the one-line JSON report (status, failure_class, next, changed_files, check). Follow next; a refusal is a limit, not something to route around. Open references/routing.md only when next is not verify.
4. Verify by risk (below), then finish. One-off helper calls (opencode models, --help, re-reading files the runner already summarised) are wasted turns.
3. Verify: a worker report is a claim, not a result
The runner already compares the claim with the working tree and ran your --check. You still own the decision:
- Low (docs, config, isolated function with tests):
status: successandcheck.exit: 0is enough. - Medium: also read
git diffonce; run tests for neighbours the check did not cover. A green--checkproves only what the visible tests cover: before accepting, list the spec's error cases and edge cases (bad input, empty, limits, error messages) and confirm each is tested. If one is not, run one more ticket (or a one-line script) that tests it. Do not read the whole implementation for this. - High (auth, security, money, data writes, migrations, concurrency): the above, integration tests, an adversarial test, review by a different model than the author (
--mode readon another worker). Confirm each finding in code before fixing.
Empty or cut-off output = not done. Name the suites you skipped. Record only if you did more than the runner: dispatch.mjs verify --task <id> --ticket T-001 --result pass|fail.
4. Close
- Commit only if the user wants it: by name (
git add <files>, readgit diff --cached, never-a). - Never push, deploy or do anything irreversible unless the user said so for this change. Give the exact one-line commands and wait.
handoffwhen work continues elsewhere. Report workers and models used anddispatch.mjs summary --task <id>(unmeasured = "unavailable").
Stop and ask
Irreversible or outward-facing step; an edit needs --allow-unattended or a classifier blocks a flag; sending private code to a free or data-collecting model; paid API spend; workers disagree on a decision that is the user's; retry or budget limit hit; cheap workers exhausted and much work left.
Skills
grill-with-docs, to-spec, to-tickets for unclear or Tier 3 work; code-review for review; handoff to close. If a skill is user-invoked only (preflight lists them), read its SKILL.md or ask the user to run it.
References
references/routing.md: worker choice, limits, retry and escalation, shared state.references/workers.md: CLI facts per worker, permission flags, caveats.references/free-models.md: free model lists.references/contract.md: report format, status rules, usage log.references/tools.md: optional RTK, Serena, ccusage, context-mode.references/lessons.md: tests and DB, partial work, reviews, deploy.references/benchmark.md: comparing versions of this skill.
