with one click
swarm
// Use when multiple ready tasks can be worked in parallel — triage, batch non-overlapping work, launch isolated worktrees, review plans, land safely.
// Use when multiple ready tasks can be worked in parallel — triage, batch non-overlapping work, launch isolated worktrees, review plans, land safely.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | swarm |
| description | Use when multiple ready tasks can be worked in parallel — triage, batch non-overlapping work, launch isolated worktrees, review plans, land safely. |
| recommended_model | high |
Recommended model: high — triage, overlap prediction, and multi-teammate coordination degrade sharply on smaller models.
Use this skill when a project has multiple ready tasks that can be worked in parallel with good isolation.
This skill includes local helper scripts under swarm/scripts/:
swarm/scripts/swarm-discover.py — git-derived defaults plus any structured
swarm config the repo exposesswarm/scripts/swarm-triage.py --input <json> — batch normalized task data
into unblocked frontier, wait queues, and skips. Run --help for the input
schema and output category enum.swarm/scripts/swarm-worktree-verify.py — verify the current checkout is
the expected linked worktree on the expected branchswarm/scripts/swarm-post-land.py --hook <name> --landing-target <branch> --primary <branch> — run a named post-land hook after a successful land. Use by script path, not python3 <script>.Invoke these helpers by script path, not python3 <script>, so approvals stay
scoped to the script. They require python3 on PATH. If python3 is
unavailable, fall back to the prose workflow and perform checks manually.
Keep tracker fetching outside these helpers. Use the project's tracker workflow to gather tasks, then normalize them into the triage input format.
If a batch overflows the current run, persist remaining task IDs in
runtime-local state so a later invocation can resume without re-querying the
tracker. See swarm/references/continuation-state.md for runtime state roots,
continue.txt/handoff.md formats, and any runtime-specific pre-flight.
beads-issue-flow for claiming and closing.github-issue-flow.launch-work for the exact branch and worktree bootstrapping rules.land-work for the final landing procedure when project docs do not
define a stricter swarm-specific landing flow.Before triage, read the project's local instructions and determine:
~/.local/share/worktrees/<repo>/<branch> when the repo does not document a
different durable rootWhen the project exposes a structured swarm config, run the discovery helper for the current runtime:
swarm/scripts/swarm-discover.py --runtime claude # or --runtime codex
This loads the matching runtime-specific config if present and otherwise falls
back to the shared swarm-config.json at the repo root. Use the output as the
deterministic base layer, then fill remaining gaps from repo docs.
If the project does not document these items clearly enough to swarm safely, stop and ask the user to narrow the scope or clarify the workflow.
When the project can supply normalized task data, prefer:
swarm/scripts/swarm-triage.py --input triage.json
Run swarm-triage.py --help for the input schema and the output categories
(parallel_batch, wait_queue, overflow, skipped,
deferred_due_to_dependencies, deferred_due_to_active_overlap). The script
is tracker-agnostic; tracker-specific skills convert tasks into this format.
Use the runtime's managed multi-agent flow, not ad hoc background workers. Follow the runtime-specific launch and lifecycle requirements supplied with the generated skill payload.
For each launched task: exactly one branch, exactly one worktree, and the prompt must include task details, expected scope, overlap risks, required quality gates, and the row number from the triage table. Include the landing target branch in the teammate prompt so the teammate knows which branch their work merges into. Require the teammate to stop and report back if the task is broader or more coupled than expected.
Teammate instructions must treat worktree placement as part of setup, not an
implementation detail. Require a durable dedicated root and reject placements
under /tmp, the top level of the user's home directory, the project parent,
or inside the checked-out repository unless the project explicitly documents
one of those locations.
The teammate must verify working directory and branch before any edits:
swarm/scripts/swarm-worktree-verify.py --require-linked-worktree
Reject any teammate setup that cannot show they are inside the intended worktree on the intended branch.
Review each teammate plan for correct scope (no opportunistic extras), explicit worktree+branch verification, correct quality gates, test coverage appropriate to the task, no unresolved overlap with active teammates, and any required pre-completion step. Reject plans that reference the primary checkout or do not explain how the task will be verified.
Land one completed branch at a time onto the landing target (default: the detected primary branch). Use the project's documented landing workflow (see land-work unless project docs define a stricter flow):
swarm/scripts/swarm-post-land.py --hook <name> --landing-target <branch> --primary <branch> --apply
If the hook fails, stop and report — do not continue landing more branches until the hook succeeds.When teammates are safely landed or explicitly deferred, close the runtime resources that were created for them.
After all approved tasks are landed:
Backgrounded teammates cannot reach the user directly — the user typically
only watches the lead's window. Any teammate step that requires human
attention (visual review, manual test approval, destructive-op confirmation,
ambiguous-scope escalation, a project-supplied hook that exits with a
"requires human handoff" status — see bento-2xe) routes through the lead
using this protocol. Visual review is one example, not the only one.
Teammate parks and idles. When the teammate hits a human-gated step,
it leaves the work in a safe state: branch unmerged, tracker issue still
open and in-progress, linked worktree intact, no destructive cleanup, no
land-work invocation. It SendMessages the lead with a structured
handoff (see format below) and then idles. It does not poll, retry, or
advance until the lead routes a decision back.
Lead serializes user attention. The lead is the single user-attention surface. When handoff messages arrive, the lead surfaces ONE review request at a time in its own window, or sends a single batched message with explicit ordering when several are pending. Multiple teammates must never ping the user in parallel through different channels.
Lead routes the decision back. The user replies to the lead. The lead SendMessages the originating teammate with the decision (approve / revise / reject, plus any specifics). The teammate never reads the user directly and never assumes silence means approval.
Handoff message format. Every handoff includes:
pnpm test:manual auth-flow, git diff main..<branch> -- path/, or a
project-specific review command).Launch teammates with Claude Code's managed team flow:
TeamCreate.TaskCreate.Agent, setting both team_name and a descriptive
name.When the last Claude Code teammate in the batch is done, delete the team.