Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user wants to review code, audit a diff, get a second opinion on changes, or run an adversarial review of files in the current working tree. Common triggers include "review this code", "audit this diff", "find issues in", "second opinion on this", "harsh review of", "adversarial review", and "security review of". Picks one or more reviewer personas (adversarial, security, architecture, performance). Reviews local files, `git diff`, or `git diff --staged` only —
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 336% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 187% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 322% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 92% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 198% | 0% |
Reviews code in the current working tree through a chosen persona. Reference docs in references/ are loaded on demand — load only the persona and mode refs the user picks.
$ARGUMENTS — one of:
src/foo.ts, src/)diff — review git diffstaged — review git diff --stagedResolve $ARGUMENTS to a concrete set of files + diff:
| Input | Action | | ------------- | ------------------------------------------------------------ | | File/dir path | Read the file(s) directly | | diff | git diff | | staged | git diff --staged | | empty | Ask: "What should I review? (file path / diff / staged)" |
Ask the user which review angle. In Claude Code use AskUserQuestion with multiSelect: true; in other agents use the equivalent multi-select prompt. Always present these exact 5 options (4 personas + an "All" convenience option):
references/personas/adversarial.mdreferences/personas/security.mdreferences/personas/architecture.mdreferences/personas/performance.mdIf the user picks "All", treat it as [adversarial, security, architecture, performance]. Don't omit the "All" option even when the user already named a persona in their request — they may want to broaden it.
Only load the references the user actually picked. Don't pre-load all four unless they chose "All" — that's the whole point of progressive disclosure.
If the user picked more than one persona, prefer a parallel mode in step 3 (multi-bg-agent or agent-team). Sequential in-process across multiple personas is slow and pollutes context.
Four modes, ordered by review quality (best → worst). The reviewing agent should default to the highest-quality option that's actually available on the host:
| Mode | Quality | Best for | Reference | | ----------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | | Cross-model handoff | ★★★ Recommended | Any review where bias / blind spots matter. A different model on the same machine catches what the current one missed — especially for adversarial / security / architecture lenses. Pair with secret-shield. | references/cross-model-handoff.md | | Agent team | ★★ Baseline (multi) | Multi-persona parallel review when the host has a native team primitive (Claude Code Teams). Same model, but each persona gets a fresh context. | references/parallel-execution.md | | Multi-bg-agent | ★★ Baseline (multi) | Multi-persona parallel review on agents without a team primitive. Same model, fresh contexts. | references/parallel-execution.md | | In-process | ★ Fallback only | Last resort — same agent, same context, same model. Most biased option. Only use if no other CLI is available and parallel spawn isn't supported. | (no extra ref) |
Why cross-model is the recommendation: code review is an independence problem. A second model — even a smaller one — has different training data, different priors, and different blind spots, so it surfaces issues the first model rationalizes past. Same-model parallel agents (bg-agent / team) reduce context-pollution but share the model's biases. In-process review compounds both problems: same biases, same context.
First, detect available CLIs — this drives the recommendation:
bashnode scripts/detect-clis.mjs --available-only --pretty
The script outputs JSON of available AI CLIs on $PATH (codex, gemini, aider, etc.).
Recommendation logic, applied in order:
Ask the user (AskUserQuestion or equivalent) to confirm the recommended mode before running. Load only the reference(s) for the chosen mode.
In-process: apply the loaded persona reference as the guiding lens. Read the code in scope, produce findings. If multiple personas were selected and the user accepted in-process anyway, run them one at a time and merge findings using the rules in references/parallel-execution.md §"Step 4 — Merge".
Cross-model: see references/cross-model-handoff.md — uses the bundled invoke-cli.mjs with secret-shield preflight + prompt-shield wrap. Capture the child CLI's stdout verbatim as the review.
Multi-bg-agent / Agent team: see references/parallel-execution.md — fan out one persona per agent with shared scope, collect each agent's findings, merge into one three-tier report with persona tags.
Apply references/review-output-format.md:
error / warn / info — matches our skill-toolkit tiers)file:line references so the user can click to sourcefile:line; do not paste code or diff lines into output (the user already has the file open)<example> <input>"review the auth refactor in src/auth/" with adversarial persona</input> <output>
src/auth/.references/personas/adversarial.md.detect-clis.mjs --available-only — codex is on $PATH. Recommend cross-model via codex (less biased than running adversarial in the same model). User accepts; load references/cross-model-handoff.md.git diff src/auth/ | node scripts/invoke-cli.mjs codex --instructions references/personas/adversarial.md --untrusted-content - --secret-mode redact --timeout 120. Capture stdout verbatim.# Code review (via OpenAI Codex 0.128.0)).</output> </example>
<example> <input>"all reviews on src/auth/" — multi-persona, no other CLI on this machine</input> <output>
src/auth/.[adversarial, security, architecture, performance], load all four persona refs.detect-clis.mjs --available-only — empty. No cross-model option. Host is Claude Code, so recommend agent team (same-model parallel; baseline quality). User accepts; load references/parallel-execution.md.team_name set. Each agent gets the persona body + scope + output-format spec inlined. Wait for all four. Merge findings: dedupe by (file, line, normalized-message), regroup by severity, tag with persona.# Code review — agent-team (4 personas).</output> </example>
<example> <input>"security review of the staged changes via codex" — cross-model second opinion</input> <output>
git diff --staged.references/personas/security.md.node scripts/detect-clis.mjs --available-only. Pick codex.--instructions at the persona ref already on disk. git diff --staged | node scripts/invoke-cli.mjs codex --instructions references/personas/security.md --untrusted-content - --secret-mode redact --timeout 120. Capture stdout.</output> </example>
<example> <good> Loaded only references/personas/adversarial.md because the user picked "adversarial". Other persona refs stayed on disk. After CLI detection landed on cross-model, loaded cross-model-handoff.md only; parallel-execution.md stayed unloaded. </good>
<bad> Pre-loaded all four persona references, cross-model-handoff.md, and parallel-execution.md "just in case". Wastes context budget on every dispatch. </bad>
<bad> Defaulted to in-process for a single-persona review without first running detect-clis.mjs. Cross-model is the recommended mode whenever another CLI is available — silently picking in-process gives a more biased review. </bad>
The bad examples violate the skill's design: progressive disclosure (load only what's needed) and independence-by-default (prefer a different model when one is on the machine).
Cross-model mode forwards local file / diff content to a third-party AI CLI on the same machine. That crosses a trust boundary even though the source content is local: code under review can contain embedded secrets (API keys, tokens) and prompt-injection-style markers (intentionally or accidentally). Two complementary mitigations are built into scripts/invoke-cli.mjs and fire when the agent uses the --instructions <file> --untrusted-content <file> form.
Credential exfiltration: the script runs a regex-based secret scan on the content before composing the prompt. Default --secret-mode scan refuses to forward when any known secret format (AWS, GitHub, OpenAI, Anthropic, Slack, Stripe, Google API, JWT, PEM private keys) is detected. --secret-mode redact substitutes [REDACTED-{type}-{n}] placeholders. --secret-mode allow skips the check (use only when you've already audited the content). Source: scripts/secret-shield/.
Prompt injection: the script generates a fresh 12-hex salt per invocation and wraps the content in <untrusted-{{salt}}>...</untrusted-{{salt}}> with an anti-injection preamble before piping to the child CLI. Attacker-embedded closing tags (whether intentional or accidental) can't escape the wrap because they can't predict the salt. Source: scripts/prompt-shield/.
In-process review, multi-bg-agent, and agent-team do not cross trust boundaries — they all run within the same agent harness on the local machine, no external sink, no preflight needed. Cross-model is the only mode where preflight applies. Background and threat model: contributing/prompt-injection.md.
references/personas/adversarial.md — harsh, devil's-advocate personareferences/personas/security.md — security-focused review lensreferences/personas/architecture.md — design / coupling / modularityreferences/personas/performance.md — complexity, memory, I/Oreferences/cross-model-handoff.md — how to invoke detected CLIsreferences/parallel-execution.md — multi-bg-agent + agent-team fan-out and mergereferences/review-output-format.md — three-tier output specscripts/detect-clis.mjs — node script, ships with the skill, probes for ~20 AI CLIs and emits JSONOther measured skills in the registry, with their headline benchmark lift.