/gauntlet:reviewfrom gauntlet
Performs a two-pass adversarial code review: hostile pass surfaces every possible issue, neutral audit filters confirmed findings. Focuses on security, API consistency, and UX.
Ships in gauntlet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two phases, in order. The hostile pass finds; the neutral pass filters. Skipping phase 2 means delivering noise.
This skill runs in Claude Code and Codex.
<SKILL-PATH> from the active SKILL.md path supplied by the host. Do not depend on
CLAUDE_PLUGIN_ROOT, PLUGIN_ROOT, or another plugin-root environment variable./gauntlet:review. Codex invocation: $gauntlet:review.Treat the code as a suspect, not a colleague. Goal: surface everything that could be wrong.
Resolve target before reviewing:
git diff <base>...HEAD (and read full files for changed regions, not just hunks)Always read enough surrounding context to understand callers and invariants. Hunks alone hide bugs.
Measure surface BEFORE reading code:
git diff --stat <base>...HEAD (changed-file count, lines added+removed)wc -l <files> for LOC.Before starting, mkdir -p .gauntlet/tmp and delete stale .gauntlet/tmp/review-* files from previous runs. .gauntlet/ should be git-ignored; if it is not, warn the user rather than editing .gitignore — report-only review makes no tracked-file changes, so it never edits .gitignore itself (the opt-in handoff / campaign path may add it). Never rm -rf .gauntlet/ — everything under it except tmp/ is a campaign's durable state. Intermediate file paths are fixed — concurrent reviews in the same checkout collide; run one at a time.
Pick by the larger of file count or LOC:
| Surface | Strategy |
|---|---|
| ≤ 5 files AND ≤ 1000 LOC | Single-pass: review all three lenses yourself |
| 6–30 files OR 1000–5000 LOC | Parallel by lens: spawn 3 subagents (security, api, ux), each covers the full target |
| 30–200 files, single package or small cluster | Parallel by lens × area: subdivide each lens across bounded areas (one subagent per lens × area) |
| > 200 files, whole-repo audit, or sprawling multi-package | Triage-then-depth (see "Whole-codebase mode" below) |
A whole-codebase adversarial review IS in scope. Do not narrow the target, sample a "representative subset", or push back on size. Pick the strategy and dispatch. Coverage gaps go in the "Unreviewed" section, not in a refusal.
In parallel mode, you are a dispatcher, not a reviewer. Spawn subagents in one parallel dispatch batch, wait for all to finish, then merge their outputs. Do NOT also review the code yourself — that produces duplicate findings and burns the main context. Your only Phase 1 reading is whatever sizing requires.
Bounded parallelism: dispatch at most ~8 subagents per parallel batch. For larger fan-outs, run waves of 8, merging output between waves. This keeps each subagent's findings reviewable and avoids overwhelming the runtime.
Triggered by the > 200 files / whole-repo row. The codebase is too big to deep-audit every file with equal rigor in one pass; coverage is by tier, not uniform.
Spawn ONE read-only subagent to enumerate the codebase and rank files into tiers:
unsafe blocks, FFI/CGO, raw SQL, shell exec, template rendering, IPC.Output: .gauntlet/tmp/review-tiers.md with files grouped by tier, plus a short rationale per tier. Subagent prompt should explicitly say "do NOT review code — only classify by risk surface".
Run the full parallel-by-lens × area flow on T1 files only. All three lenses, full rigor, no severity floor.
Spawn one subagent per lens with a tightened prompt:
This is a BREADTH SCAN, not a deep audit. Cover the assigned files for
the top defect classes of your lens only — do not exhaustively enumerate.
Lens: <LENS>
Severity floor: MEDIUM (drop LOW findings; raise borderline cases instead
of recording nits).
Top defect classes to look for:
security → injection, missing auth, secret leaks, broken crypto
api → broken symmetric pairs, inconsistent error/return shapes,
mixed naming for the same concept
ux → footguns, silently-wrong defaults, missing required-init traps
Otherwise follow Phase 1 rules from the SKILL.
ONE subagent does a rapid pass for CRITICAL-only findings across T3: hardcoded secrets, obvious injection, world-writable artifacts, panics on user input, committed .env-style files. Anything below CRITICAL is dropped.
Merge all tier outputs into the standard .gauntlet/tmp/review-findings.md, tagging each finding with its tier ([T1], [T2], [T3]). Run sharded Phase 2 as defined below. Sort chunks so T1 findings get audited first — that's where confirmation matters most.
The final report's "Unreviewed" section must explicitly state what tiering chose to scan-only or skip, so the user can escalate any tier on a follow-up run.
For each lens, spawn one read-only subagent. Issue ALL subagent calls in a single parallel dispatch batch.
<SKILL-PATH> below is this file's own absolute path. Resolve it from the active skill path before
you substitute it into the prompt: the subagent does not inherit the dispatcher's skill path or
plugin-root variables.
Subagent prompt template:
You are running Phase 1 of an adversarial code review. Lens: <LENS>.
Read <SKILL-PATH> and apply
ONLY the "<LENS>" subsection of "Lenses". Do not review the other lenses.
Repository root: <absolute path>
Review target: <git ref / files / dir as given by user>
Files in scope: <explicit list, or the command that produces it>
Area assignment (sharded mode only): <subset of files this subagent owns>
Read each in-scope file fully. Read enough surrounding code (callers,
init, validators, middleware, type defs) to make accurate claims about
reachability and invariants.
Output: write findings to .gauntlet/tmp/review-findings-<lens>[-<area>].md
using the format, severity scale, and ID prefixes (SEC-/API-/UX-) defined
in the SKILL. Number sequentially within your lens (and area, if sharded).
End with an "Unreviewed" section listing what you did NOT examine and why.
Do NOT edit code. Do NOT verify findings — that is Phase 2's job. Bias
toward overclaiming.
After all subagents return, the dispatcher:
.gauntlet/tmp/review-findings.md.file:line + same root cause → keep the more specific finding, drop the duplicate. Different defects at the same line stay separate.If a subagent returns a thin or empty report for a lens that obviously has surface (e.g., security lens on a package with HTTP handlers), re-dispatch it with a sharper file list — do not paper over with your own findings.
Apply each lens explicitly. Do NOT collapse them — each finds different defects.
Check, in order:
.env / config files committed?math/rand where crypto/rand required? Cert verification disabled?Check across the package / module, not just the changed function:
Get/Fetch/Load mixed for same operation? Plural vs. singular for collections?ctx first? Receiver/subject before modifier? Same order across sibling funcs?Open/Close, Lock/Unlock, Begin/Commit+Rollback, Subscribe/Unsubscribe, Add/Remove, Create/Delete, Encode/Decode, Marshal/Unmarshal — both halves present? Identical signatures where applicable?(T, bool) vs. (T, error) mixed for similar lookups? Nil vs. zero-value vs. error conventions consistent?*Foo when interface suffices, or vice versa)?"User" = downstream caller, integrator, operator, end user — whichever applies. Check each that applies:
Write findings to .gauntlet/tmp/review-findings.md. One section per lens. Within each section, one finding per bullet:
[ID] [SEVERITY] <file>:<line> — <one-line defect>
Trigger: <how to reproduce / when this fires>
Impact: <what breaks, who notices>
Fix: <concrete change, not "consider X">
ID = SEC-1, API-1, UX-1, ... — stable IDs so phase 2 can reference them.
Severity: CRITICAL (exploitable / data loss / silent corruption), HIGH (likely bug or hostile-input crash), MEDIUM (inconsistency, footgun, poor error), LOW (nit with rationale).
Also list unreviewed areas explicitly. "I didn't look at X" is a finding, not a gap to hide.
file:line. No floating claims.Verify every finding from phase 1. Default: spawn a subagent so the audit runs in a fresh context with no commitment to the hostile framing.
Use one context-isolated subagent. Keep it read-only unless the audit must run verification commands.
Single audit (≤ 10 findings): one subagent verifies all findings.
Sharded audit (> 10 findings): split findings into chunks of 5–8 by ID. Keep related findings
together where possible (e.g., findings citing the same file or chain of callers in one chunk —
co-located findings share read context). Spawn one audit subagent per chunk in a single parallel
dispatch batch, each restricted to its assigned IDs. Each writes to
.gauntlet/tmp/review-verdicts-<chunk>.md. Dispatcher concatenates into
.gauntlet/tmp/review-verdicts.md.
Subagent prompt template:
You are auditing a code review for accuracy. You are NOT the original
reviewer. Your job is to either confirm or refute each finding by reading
the cited code and its surrounding context.
Findings file: .gauntlet/tmp/review-findings.md
Assigned IDs (audit ONLY these; ignore others): <e.g., SEC-1, SEC-2, API-3>
Repository root: <absolute path>
Review target: <branch/PR/dir as given by user>
For each assigned finding, read the cited file:line AND enough surrounding
code (callers, validators, auth middleware, init code) to judge whether
the trigger is actually reachable in this codebase.
Ground external-API claims. When a finding's reasoning depends on how a
stdlib / framework / third-party function behaves (e.g. "tls.Conn.SetDeadline
doesn't propagate to the underlying conn", "json.Decoder accepts trailing
data", "context.Background().Deadline() panics"), DO NOT accept that
claim at face value from Phase 1. Open the dependency source or
authoritative doc and verify the actual behavior. Cite the source you
read (e.g. `$GOROOT/src/crypto/tls/conn.go:<line>`, official doc URL,
package's own godoc) in the verdict. A claim about external behavior you
cannot ground is grounds for UNCERTAIN, not CONFIRMED. The hostile pass
overclaims about external semantics as often as about local ones —
verifying these is Phase 2's job.
For each finding, emit one verdict:
- CONFIRMED — defect real, trigger reachable, severity correct.
- ADJUSTED — defect real but severity wrong / fix wrong / trigger
narrower than claimed. State the correction.
- REFUTED — finding is wrong. State which guarantee / validator /
invariant invalidates it, with file:line.
- UNCERTAIN — cannot determine from code alone. State what info is
needed.
Verdict honesty:
- "CONFIRMED with caveat" is not a verdict. If you can articulate the
caveat, the verdict is either ADJUSTED (defect narrower / less severe
than claimed) or REFUTED (caveat invalidates the claim). Forcing
yourself to pick one of the four labels exposes hedges as the audit
dodging its job.
- "Pre-refactor parity" / "behavior matches prior code" is NOT a verdict
modifier on its own. Resolve it: either the prior code was correct
(→ REFUTED for the new code, since both are correct) or the prior
code was also buggy (→ CONFIRMED as a pre-existing defect, with
trigger and impact stated independently of when it was introduced).
"Same as before, so confirmed but not a regression" is hedging.
- "Sloppy but not exploitable", "design issue exists in both versions",
"technically a leak but unreachable in practice" — same pattern. Pick
REFUTED, ADJUSTED, or CONFIRMED with a specific trigger.
Bias toward REFUTED and ADJUSTED. The hostile pass overclaims by design.
Confirming a finding requires evidence it is reachable, not absence of
evidence it isn't.
Output: write verdicts to .gauntlet/tmp/review-verdicts[-<chunk>].md,
one block per finding ID. Do not rewrite the findings — only judge them.
When subagents return, read findings + verdicts and merge.
If subagent unavailable or user declines, do the audit yourself, but explicitly switch stance:
Same-context bias is real. Default to harsher self-criticism than feels natural.
Phase 2 subagents can miss things too. Before merging verdicts into the final report, spot-check every CONFIRMED and ADJUSTED verdict for the two failure modes most likely to produce false confirmations:
A 30-second pass over the 8–10 confirmed findings is cheaper than shipping a final report that misleads the user about which fixes matter. Past failure: a Phase 2 audit confirmed a TLS handshake-deadline finding by repeating Phase 1's (incorrect) claim that *tls.Conn.SetDeadline doesn't delegate to the underlying conn. The grounding step — reading crypto/tls/conn.go — would have refuted both in one minute.
The dispatcher spot-check above catches hedges in audit verdicts. But the dispatcher's own final report — especially the "Top N fixes" recommendation and any prose summarizing confirmed findings — is a NEW piece of writing that can introduce its own hedges and ungrounded claims. Apply the same rules to your own writing. A spot-check that doesn't apply to the spot-checker has a blind spot exactly where it matters most.
Before producing the final report, walk every item in your "Top N" recommendation through these checks:
Hedge ban on your own prose. Re-read each top-N entry with the question: "if the user implements this exactly, will it fix a real defect, or am I recommending a defensive cleanup whose justification reduces to 'a future caller might'?" If the latter, drop or downgrade. Watch especially for: "validation asymmetry between X and Y" (resolve to: which is correct?), "the in-tree codepath is safe today but..." (then it's REFUTED), "low-level primitive vs high-level wrapper" (if the wrapper is the user-facing API, the primitive is internal — REFUTED on convention grounds), "consistency improvement" (cleanups are not the same as fixes — separate them).
External-API claims in the report must cite source. Every "X function panics on Y" / "stdlib doesn't validate Z" / "Go arithmetic overflows here" — back it with a $GOROOT/... file:line or authoritative doc URL inline in the report. If you can't cite it in 30 seconds, demote to UNCERTAIN or omit. Do this BEFORE writing the recommendation, not after the user pushes back.
Math claims in particular. Overflow / truncation / underflow claims require an arithmetic sanity check. For Go: uint32 * time.Second cannot overflow int64 (max value 4.29e9 * 1e9 = 4.29e18 ≪ 9.22e18). Don't recommend a fix for an overflow that can't happen.
Prefer narrow fixes over new API surface, especially on stable libraries. Before recommending a new option, a new typed budget, a new error class, a new extension point — ask in order:
context.WithTimeout for CPU bounds, rate-limit at the edge, request-size cap at the proxy)? Document it; do not duplicate it in the library.Only after all four fail does a new option earn its place. Each new option on a stable library is a permanent tax on every reader of the API, and "5 knobs to defend against 1 attack class" almost always means the defect is narrower than the proposal. Watch for: "WithMax* / WithBudget* / WithLimit*" appearing more than once in the same top-N (smell of overengineering), "we need this for defense-in-depth" (collapses to #4), and "systematic" framings that fan out into N options when 1 default tweak would do.
This step takes ~60 seconds for an 8-item top-N. Skipping it means recommending fixes the user will reasonably reject after they read the code — wasting their time and your credibility.
Past failures:
time.Duration overflow claim — uint32 * time.Second was assumed to overflow int64 but cannot — and one with a "future external caller might forget" footgun). Both were dropped when the user re-applied the rules. The fix-rate of the recommended top-3 was 33% — and the user noticed before code was changed. Apply checks 1–3 before, not after.Merge phase 1 findings with phase 2 verdicts. Group by verdict, not by lens. Keep the default report to one complete line per finding; the scratch findings and verdict files retain the detail for an on-request expansion.
## Confirmed (N)
[SEC-1] [HIGH] path/file.go:42 — <defect>; audit: confirmed — <why>
## Adjusted (N)
[API-2] [was MEDIUM, now LOW] path/file.go:88 — <defect>; audit: adjusted — <what changed>
## Refuted (N)
[UX-3] path/file.go:120 — <original claim>; audit: refuted — <guarantee, file:line>
## Uncertain (N)
[SEC-5] path/file.go:200 — <defect>; audit: uncertain — <what would resolve it>
Add Trigger, Impact, or Fix detail only when the one-line entry would not let the reader act or when the
user asks for the expanded report. End with:
Default is report-only. Everything above makes no source/tracked-file changes and no GitHub changes —
it opens no PRs and edits no committed files (it may write ephemeral .gauntlet/tmp review scratch).
This section is the ONLY path where this skill changes tracked state (writing code, opening PRs), and
it runs only on an explicit "yes".
After delivering the confirmed-findings report, offer exactly once:
Open a PR per confirmed fix and run the gauntlet on them? [y/N]
gauntlet:campaign. Fix-implementation lives here now
(salvaged from the old campaign fan-out); the campaign itself never writes fixes from scratch.On "yes", first resolve the base branch — for a PR/branch review target it's the PR's base / the branch's upstream; for a package/dir/single-file target where no base was resolved, use the repo's default branch or ask the user (never branch off an unresolved base). Then, for each Confirmed or Adjusted finding only (skip Refuted and Uncertain), in its own branch off that resolved base:
Implement the fix — exactly the change in the finding's Fix:, nothing more; no drive-by edits.
"Nothing more" bounds the DEFECTS you fix, not the SITES one fix touches. If the change alters a
DEFINITION (a rule, a command, a schema, a format) or a FACT (a count, a name, an API behavior), then
SWEEP the tree for every place that RESTATES it and correct each one in this same PR: a definition
left with a stale restatement is a definition that lies, and that sweep is part of the fix, not a
drive-by. Report every site you found and its disposition, including any you deliberately left alone.
Sweep the way the contract says — it defines the method; this paragraph does not. (This paragraph is a
non-authoritative summary of the same contract campaign puts in every fix subagent's prompt —
../campaign/references/fix-subagent-contract.md, resolved from this skill directory, is the complete
DEFINITION and wins over this wherever they differ; read it, never reconstruct it from this
summary.)
git commit the fix, then git push the branch.
gh pr create one PR for that finding. Title from the finding; body cites the finding ID,
trigger, impact, and fix. Do NOT apply any gauntlet-run-* owner label — review does not know
a campaign run-id, and pre-labelling with a fabricated run-id would make campaign's adoption refuse
the PR (pr-adoption rejects a PR already owned by a different run). Leave each PR with no
run-owner label, and apply no status label either: a gate label carries the PR's verdict tally
(campaign/references/stage-2-review-gate.md, "Status labels mirror the review gate"), which review has
not run and cannot know. Campaign applies the right one at adoption, creating it if the repo lacks it.
DO apply the gauntlet-authored label to every PR you open here (gh label create gauntlet-authored --force, then gh pr create … --label gauntlet-authored). It is not a status and it
is not an owner label: it is the durable record that this pipeline wrote this PR, and campaign reads
it at adoption into pr_origin (campaign/references/pr-adoption.md). It is what later permits
campaign to rescope or restructure the PR autonomously if the review loop stops converging on it —
a thing it must never do to a PR a human wrote (campaign/references/repair-pass.md, "The
ownership guardrail"). Omitting it is safe (the PR is then treated as someone else's, so a
whole-PR repair may only re-author its intent or abort); applying it to a PR you did not author is
not.
One finding = one PR. Never batch multiple findings into a single PR.
Then invoke the campaign on exactly those PRs.
Claude Code:
/gauntlet:campaign #<pr1> #<pr2> ...
Codex:
$gauntlet:campaign #<pr1> #<pr2> ...
Campaign mints its own run-id, adopts the PRs — applying its gauntlet-run-<run-id> owner label to
each during adoption (a fresh handoff PR carries no owner label, so it adopts cleanly) — gates each
through its tier's reviews plus CI, and merges. It only gates and merges what this handoff opened, and
never re-writes these fixes. Agent-facing changes (a SKILL.md, AGENTS.md, CLAUDE.md, prompt, or
reference file) always draw the full two-pass gate there, same as source.
Handoff rules:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lestrrat-ai/claude-code-plugins --plugin gauntlet6 skills in this plugin
/address-followupsWorks Gauntlet's durable follow-up queue end to end instead of only listing it. Each open entry is resumed at the step its lifecycle state has already reached: a fresh read-only subagent must reproduce or refute a still-unverified claim, only a corroborated entry is taken up, a separate scoped subagent then authors the fix and opens ONE PR for that follow-up, and the PRs opened this invocation are handed to gauntlet:campaign to gate and merge. Use when the user asks to work, drive, clear, action, or process follow-ups. To only SEE the queue, use gauntlet:followups. Args (distinct modes): (no args) | --id fuN | --limit N/campaignGates PRs to merge. A self-looping review-to-merge campaign: existing PRs are adopted into a run (pass PR numbers, or discover this run's labelled PRs), each PR is triaged to a review tier, and a per-PR review gauntlet (tier-dependent fresh, context-isolated SATISFIED verdicts on the whole PR diff, reviewed one at a time) plus event-driven CI monitoring gate an auto-merge. Multiple isolated runs (each keyed by a run-id, with a lease so only one agent drives each) can run concurrently in one repo. Drives its own loop through the active host's heartbeat or bounded-wait mechanism — invoke once. Campaign never writes fixes from scratch; to find issues first use gauntlet:review. Args (distinct modes): #PR... | --new #PR... | --run ID | no args/copilot-address-reviewsEvaluate and address GitHub Copilot PR review items for a GitHub pull request. Use when user provides a GitHub PR link and wants Copilot review comments checked, verified, fixed, committed, and summarized. Fetch review items with `gh`, verify each claim against source/tests before changing code, ask user before making subjective or constraint-driven changes, then work items one by one./followupsShow Gauntlet's durable follow-up queue through its existing read-only table command. Use when the user asks to list or inspect Gauntlet follow-ups, deferred work candidates, or hidden and rejected follow-up entries./ledgerShow a Gauntlet campaign ledger through its existing read-only table command. Use when the user asks for campaign status, a campaign ledger, PR state for a named or current campaign run, or hidden, merged, and aborted campaign entries.Other plugins' skills for the same job