name: fan-out description: Run independent slices in parallel as named, timeboxed workers (subagents), each in its own git worktree and branch, and keep every worker visible until it hands back. Use when the user says fan out, parallelise, parallelize, in parallel, at once, spin up agents or subagents, dispatch workers, swarm, or asks whether workers or agents are stuck, idle, hung, or need a nudge or restart. Not for splitting an outcome into slices (plan-slices) or resuming an old session (pickup). metadata: phase: build
Fan out
Independent slices running at the same time as named, timeboxed workers in separate worktrees, with a board that shows each worker's state before anyone has to ask.
When to use
- Two or more slices from
plan-slicestouch different files and need no ordering between them. - The user asks to parallelise, spin up agents, or run several fixes at once.
- A worker is quiet past its check-in time, or the user asks "are they stuck?".
Not for: splitting the outcome into slices (plan-slices), resuming a run in a new session (pickup), or slices that share files or must land in order. Give those to one owner.
Steps
- Check independence. For each slice, list the files it will touch and anything it must wait for (a schema before its callers, an API before its client). Merge slices that share a file into one, and move slices that wait on another into a later wave. Done when: no two slices in a wave share a file or an ordering.
- Name the slots and move the rows. Name each worker after its slice,
W<wave>-<slot>(W1-api,W1-docs,W2-client).LEDGERis../ledger/scripts/ledger.pyfrom this folder (Claude Code:${CLAUDE_SKILL_DIR}/../ledger/scripts/ledger.py). Move each rowplan-slicesopened todoingwith the worker as owner; the same command creates a missing row:python3 -I "$LEDGER" --root <workspace> track --task <task> --id W1-api --title '<slice>' --owner W1-api --issue <url> --state doingDone when: every worker has a row with an owner. - Make one worktree per worker. From the repository root:
git fetch origin && git worktree add ../.worktrees/<slug> -b <type>/<slug> origin/main, where<type>isfeat,fix,docs,refactor,testorchore(clean-shared-hosts). In Claude Code, the Agent tool'sisolation: "worktree"can create the worktree instead; the brief still names the<type>/<slug>branch the worker creates first. Done when:git worktree listshows one path per worker, each on its own branch. - Write each brief as a file. Fill
../istack-mode/templates/brief.mdper worker and save it (in run mode,run/briefs/<worker>.mdbeside the ledger'srun/evidence/). Its first line points toworker.mdby absolute path, because the worker runs in another folder. Fill every field: files it may change, checkable "Done when", exact verify commands, a time limit in minutes, and what it may do (commit only, push, open a PR) within the stake tier. Name secrets by variable ($API_TOKEN), never by value (secrets-stay-out). Done when: no brief has a<...>placeholder left. - Fix the model once. Use the worker model the profile names, else your own model. Write it on the board. If a rate limit or error would force a different model, don't switch quietly: say so in the next report, record it with
decide --decision '<model change>' --why '<limit hit>', and follow the profile's model policy (wait, ask, or switch with notice) (parallel-and-visible). Done when: the board names each worker's model and every change has a decision entry. - Dispatch the wave. Start every worker in the wave together, in the background, with its brief file as the prompt (in Claude Code, the pack's
workersubagent). Write each start time and deadline (start + limit) on the board. For long external waits such as CI, run a cheap background watcher (the pack'sci-watcheragent) instead of holding a full worker on it. Done when: every worker in the wave is running and the board shows its deadline. - Check at half time and at the deadline. Schedule two checks per worker. At each, read the worker's latest output, its commits (
git -C <path> log --oneline origin/main..), its uncommitted files (git -C <path> status --short) and whether its process is alive. Then act, stopping at the first that fits:- Inspect: new commits or tests running. Note "on track" on the board.
- Nudge: stuck on a question or a wrong turn. Send one message with the answer or the correction.
- Restart: hung, looping or crashed. Stop it and start a fresh worker on the same brief plus one line saying where the last one stopped. Keep the row; set the owner to
W1-api.2. - Take over: second failure, or past the deadline with no progress. Stop it, read its handback or transcript tail, do its remaining items yourself, and record it:
track --id W1-api --owner lead --note 'took over: <reason>; remaining: <items>'. Done when: no worker is past a check point without one of these four on the board.
- Collect handbacks. Each worker ends in the
STATUS / CHANGED / EVIDENCE / NOT DONE / NEXTshape from../istack-mode/worker.md. A handback with no command and result under EVIDENCE is not done: send it back once, then take over. Move each row to match (pr-open --pr <url>, orblocked --note '<reason>'). Done when: every worker in the wave has a handback and its row matches it. - Start the next wave or hand on. Start the next wave from a fresh
origin/mainonce the slices it waits on have landed. Hand finished slices toreview-change, thenland. Remove the worktree of a dropped slice withgit worktree remove <path>; merged ones go tocleanup. Done when: every slice is with its next skill, or blocked with one exact human step.
Red flags
| If you're thinking | Do this instead |
|---|---|
| "These two slices only share one small file; git will merge it." | A shared file means one owner. Merge the slices or put them in different waves. |
| "The worker has been quiet for a while; it's probably fine." | Check it now. Silence past half time is a finding: inspect, nudge, restart or take over. |
| "Rate limit hit, I'll restart everyone on the smaller model." | Say so, record a decision, and follow the profile's model policy. A weaker model changes every slice's quality. |
| "Workers can share the main checkout; worktrees are overhead." | One worktree per worker. A shared checkout mixes changes and shares one stash stack. |
| "The worker says done." | Read its EVIDENCE line. No command and result means not done. |
| "I'll write the user the steps to restart the stuck agent." | Stop it and restart or take over yourself (no-homework). |
| "I'll put the token in the brief so the worker can call the API." | Name the variable; the worker reads it from its environment (secrets-stay-out). |
| "I'll fan out the migration and its callers together to save time." | Ordered work is one owner, or two waves. |
Verify
- No two slices in a wave share a file or an ordering.
- Every worker has a brief file, a worktree, a
<type>/<slug>branch, a time limit and a tracker row with an owner. - Every worker was checked at half time and at its deadline, and the result is on the board.
- No model change happened without a decision entry and a line in the report.
- Every handback has the
worker.mdshape and real evidence.
Reply
Wave <n>: <k> workers, <m> handed back, model <name>.
| Worker | Slice | Deadline | State | Last check | Evidence |
Escalations: <worker> → <nudge | restart | take over>, <why>. (omit if none)
Model changes: <from → to, why, decision id>. (omit if none)
Next: <next wave, or the skill each finished slice went to>.
Credits
The standalone brief, wave dispatch and handback aggregation follow pstack's swarm skill and its worker.md contract by Lauren Tan. The cheap background watcher for slow external waits comes from the Cursor team kit's ci-watcher agent.