swarm
Fan out N parallel workers, drain them, and return one report. Use for /swarm, 'swarm this', or parallel coverage, races, gauntlets, and exploration.
- License 许可
- MIT
- 最近更新
- 2026-08-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- swarm
- description
- Fan out N parallel workers, drain them, and return one report. Use for /swarm, 'swarm this', or parallel coverage, races, gauntlets, and exploration.
- disable-model-invocation
- true
03 SKILL.md 正文
Swarm
Fan out N parallel workers, each in its own worktree. They may cover separate slices, race the same brief, or mix both. The parent waits, aggregates, and returns one report.
Start
Open a todolist with one entry per phase before launching anything.
- Frame
- Fan out
- Aggregate
- Report
Phase A: Frame
- State the done predicate and the artifact or report the swarm must return.
- Choose the shape. Partition into slices, race N workers on identical briefs, or mix both. For a race or mixed shape, declare
first pass,rank all, orbest-ofbefore spawning. - Set N from the user or derive it from the shape. N is total workers, not how many run at once.
- Pick the worker model from
swarm workersin~/.claude/pstack-models.mdwhen present. Otherwise usesonnet. For a model race, name each arm's model up front. - Give each worker its own writable output when it writes. Use a worktree, branch, or
/tmp/swarm-<slug>/worker-<n>/.
Phase B: Fan out
Spawn all N workers in one message with subagent_type: "pstack-worker" and the configured model. That agent already carries isolation: "worktree", so every worker gets its own checkout and the one-writer-per-worktree rule holds by construction. Subagents run in the background by default; there is no flag to set.
Use subagent_type: "Explore" instead when the slice is read-only. It cannot write, which is the guarantee you want from a coverage sweep, and it skips the worktree setup.
When a worker must start from a non-default branch, say so in its brief. The worker checks that branch out inside its own worktree as its first step.
Every brief stands alone. Include the goal, scope, exact slice or race arm, how to verify, and what to report. Reports use PASS, ISSUES, or BLOCKED with evidence.
If a worker drops out, proceed with N-1 and note it.
Phase C: Aggregate
Read the terminal results. ListAgents shows which workers are still running; SendMessage resumes one that stopped early with something left to do. Never resume a worker merely to ask how it is going, which costs a turn and tells you nothing a completion would not. For coverage, every required slice needs a result. For a race, apply the selection rule declared up front. Use first pass, rank all, or best-of. Do not paste raw worker dumps.
Keep a compact result table, one-line evidenced issues, and explicit gaps or dropouts.
Phase D: Report
Return one consolidated in-chat report with the table, issue one-liners, gaps or dropouts, and the race rule when used.
04 同仓库更多 Skills
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
unslop
Cut AI tells from any writing. Must always apply.
typescript-best-practices
TypeScript best practices. Use when reading or editing any .ts or .tsx file.
technical-writing
Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for /technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.
teach
Explain a body of work plainly so a person actually understands it. Runs the `how` and `why` skills and weaves what they find into one clear explanation. Use for 'teach me this', 'help me really understand X', 'explain this change or subsystem to me'.
tdd
Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.