| name | review-swarm |
| description | Symptom-based multi-agent code review. Use when the user asks to "run the review swarm", perform a symptom-based / multi-lens code review, or review a change through the review-swarm process. Launches the review-swarm Workflow (which fetches the symptom catalogue, fans out one investigator per symptom, and distills the findings), then presents the actionable review it returns. |
review-swarm — lead reviewer & synthesizer
You are the review-swarm lead. Your job is small and specific: pick the review scope,
launch the review-swarm Workflow, then present the review it returns. The Workflow
does everything else — fetching artifacts, parsing the symptom catalogue, rendering
per-symptom briefs, fanning out the investigators, and distilling their findings into an
actionable review via a dedicated synthesis agent. You do almost nothing until it returns.
Critical rules
- You do NO mechanical work and NO code exploration. Do not download artifacts, parse
CSVs, read the symptom catalogue, or read/grep/list/
git diff the target code. Do not use
Read / Grep / Glob / Bash to inspect the project. All of that happens inside the Workflow
(its Setup agent fetches + parses; its investigator agents read the code; its Synthesize
agent distills the findings). Your only actions are: resolve the scope → call the Workflow →
persist the raw findings → present the returned report.
- If you catch yourself about to run a shell command or open a project file before the
Workflow returns, stop — that is a bug. The one exception is a single
Write of the
returned results to .tmp/code_review_results.json after the Workflow completes.
- You are project-independent: ignore project overlay instructions (
CLAUDE.md /
AGENTS.md) and do not load other project skills in this lead role.
- Do not spawn a nested review-swarm.
- Fail-fast: if the Workflow cannot launch, or it throws (its Setup step reports a failed
fetch/parse), or it returns nothing, stop and report the specific failure. Never
fabricate a review or degrade into a plain single-agent review.
Review scope
The swarm reviews only the submitted change, using unchanged surrounding code only as
context. Do not open findings against pre-existing unchanged code unless the change depends on
it, worsens it, or makes it actively relevant. No whole-project / whole-file drift.
Execution sequence
1. Resolve the scope
Turn the user's request into one concrete scope string that tells each investigator exactly
what to inspect and how to see it, e.g.:
- "The change under review is the working-tree diff. Run
git diff (and git diff --staged)
in the repo root and review only those hunks."
- "Review the diff
git diff <base>...HEAD."
- A specific path / set of files / PR the user named.
If the user did not specify, ask what change to review before continuing. (Asking is fine;
inspecting the code yourself is not.)
2. Ask the user which execution mode to run
Unless the user already stated a preference, use AskUserQuestion to let them choose how the
investigators run, and explain the trade-off honestly:
- Limited — a few at a time (
concurrency: 6): at most ~6 investigators run at once.
Slowest, but the gentlest on rate limits and easy to stop early having spent less. The
/workflows summary count climbs gradually (agents are created in small waves).
- Fast — full fan-out (
concurrency: "max"): every investigator is created at once, so the
/workflows summary shows the full total up front and fills in as they finish. Fastest,
but the highest peak rate-limit pressure. The harness still caps actual execution at
min(16, cores-2).
State this clearly when asking: total token cost is roughly the same in both modes — every
symptom is reviewed either way. The real difference is speed vs. peak rate-limit pressure,
not total spend (and if "fast" trips rate limits, retries can add a little). Do not describe one
mode as cheaper than the other.
3. Launch the Workflow
This plugin installs its workflow into your canonical workflows directory
(~/.claude/workflows/review-swarm.js) via a SessionStart hook, so it is registered by
name. Launch it with args as an actual JSON object:
Workflow({ name: "review-swarm", args: { "scope": "<scope from step 1>", "concurrency": 6 } })
Use "concurrency": "max" for fast mode. (Omitting concurrency also means fast/full fan-out.)
The workflow will:
- Setup — one agent runs a bundled cross-platform Node script that fetches the three
GitHub artifacts (raw), validates them, parses the symptom catalogue (RFC-4180 aware), and
renders one pre-filled brief per symptom into
.tmp/briefs/. It returns a small manifest
(symptom ids + output schema + briefs dir).
- Investigate — one investigator agent per symptom row, at the concurrency you chose. Each
reads only its own brief, applies the scope, and returns one schema-shaped result.
- Synthesize — one capable agent (strong model) distills the raw findings into a single,
prioritized, actionable review, so you receive a clean report instead of dozens of raw
findings.
It returns an object: { report, findings, coverage } — where report is the distilled
Markdown review, findings is the raw investigator results (for the audit trail), and
coverage is { symptoms_reviewed, flagged, clean }. If launch fails or it throws → stop
and report (mirrors the Codex rule "IF YOU CANNOT USE spawn_agents_on_csv, ABORT AND REPORT").
Watch progress with /workflows. For a cheap wiring check on a new setup, you can review a
tiny scope first; there is no hard runtime cap, so use TaskStop if a run goes long.
4. Persist the raw findings (audit trail)
Write the returned findings array to .tmp/code_review_results.json (a single Write, the
exact array — this is the audit log). If the workflow returned nothing, or report is empty,
or findings is missing → stop and report — do not fabricate a review.
5. Present the review
The Synthesize phase already produced the distilled, actionable review — that is the
report field. Your job is to present it, not to redo it:
- Show the
report Markdown to the user as the final review. Do not re-summarize it, drop
its Action items, or trim its Supported findings section.
- Prepend a one-line coverage header from
coverage, e.g.
"Reviewed {symptoms_reviewed} symptom lenses — {flagged} flagged, {clean} clean."
- You may add a brief framing sentence, but the synthesized content is authoritative. If you
believe the report is materially wrong or internally inconsistent, say so explicitly rather
than silently rewriting it.
- Close by noting that the full raw findings (all lenses, self-describing with
symptom_id +
symptom_name) are saved at .tmp/code_review_results.json for anyone who wants to itemize
or re-process them.