/adversarial-review — Critical Review
Enforces an honest, critical review instead of a courtesy review.
Minimum 5 findings — if fewer are found, look again.
Source: BMAD (review-adversarial-general + PromptSentinel v1.2) Community Pattern
Problem
LLMs tend toward positive reviews: "Looks good", "Well structured",
"No problems found". This is almost never true — every codebase has room for improvement.
Courtesy reviews are worthless.
Modes
| Mode |
Trigger |
What gets reviewed |
code |
/adversarial-review code |
Code changes (git diff or files) |
audit |
/adversarial-review audit |
Audit report for completeness and quality |
plan |
/adversarial-review plan |
Implementation plan for gaps and risks |
Mode: code
Critical code review focused on real problems.
Process
Determine scope:
- Read
git diff (unstaged + staged)
- Or: User specifies files/directories
- Or: Last commit (
git diff HEAD~1..HEAD)
Apply three parallel review tracks:
Track A — Adversarial: "How does this code break under load?"
- Concurrent access, race conditions, deadlocks
- Network errors, timeouts, API outages
- Unexpected inputs (null, empty, max, min, Unicode)
- Security: Injection, XSS, CSRF, secrets
Track B — Failure Mode Catalog: Systematically scan against 17 modes:
| # |
Mode |
Look for... |
| 1 |
Silent Exceptions |
Exception caught but not propagated |
| 2 |
Missing Input Validation |
Type/bounds not checked |
| 3 |
Implicit Dependencies |
Assumes prior state, not verified |
| 4 |
Over/Under Validation |
1000 lines of validation OR none at all |
| 5 |
Non-Determinism |
Timing, random order, unordered maps |
| 6 |
Double Negation |
Complex boolean logic |
| 7 |
Implicit Initialization |
Assumes prior setup |
| 8 |
Type Gaps |
Parameter type assumed, not validated |
| 9 |
Unprotected Extensibility |
API extensible, untested |
| 10 |
No Progress Tracking |
Long tasks without logging/checkpoints |
| 11 |
Redundant Code |
Re-implements stdlib |
| 12 |
Outdated Patterns |
Callbacks instead of async/await, var instead of let |
| 13 |
Undocumented API |
Return value unclear |
| 14 |
No Fallback |
External API call without timeout/retry |
| 15 |
Unclear Completion |
Function done? Exception or return? |
| 16 |
Monolithic Function |
>200 lines, should be split |
| 17 |
Hardcoded Values |
Should be config/ENV |
Track C — Path Tracer: Walk through every execution path:
- Entry condition unambiguous?
- All inputs validated?
- State consistent across branches?
- Resources cleaned up? (Streams, connections, handles)
Goal-Backward Verification:
- What was the goal of the change? (Commit message, PR description)
- Was the goal achieved?
- Are there side effects?
Stub Detection:
- Functions that only
return null/undefined/true?
- Empty catch blocks or error swallowing?
- Config files with only default values?
- Test assertions that always pass (
expect(true).toBe(true))?
- "File exists" != "Check passed" — apply 4-level verification
Minimum 5 findings — if <5 found:
- Look again: Testability, edge cases, documentation
- If truly <5 (very small diff): Reduce minimum to 3
- 0 findings is NEVER acceptable
Severity with Risk Assessment
| Severity |
Definition |
Defect Rate |
| CRITICAL |
System outage, data loss |
~1-5% |
| HIGH |
Data corruption, security vulnerability |
~0.1-1% |
| MEDIUM |
Degraded UX/performance |
~0.01-0.1% |
| LOW |
Code smell, maintainability |
<0.01% |
Wave-Based Review (Large Codebases)
For large reviews (>50 files changed or >2000 lines), conduct the review in systematic waves rather than a single pass. This prevents reviewer fatigue and ensures thoroughness across all dimensions.
| Wave |
Focus |
What to check |
| Wave 1: Structural |
File organization, naming, dead code, imports |
Module boundaries, unused exports, circular dependencies |
| Wave 2: Logic |
Business logic correctness, edge cases, error handling |
Off-by-one, null paths, state transitions, race conditions |
| Wave 3: Security |
OWASP checks, input validation, auth/authz |
Injection, XSS, CSRF, secrets, privilege escalation |
| Wave 4: Integration |
Cross-file consistency, API contracts, test coverage |
Interface mismatches, missing tests, contract violations |
Each wave produces its own findings before proceeding to the next. The three parallel tracks (Adversarial, Catalog, Path Tracer) are applied within each wave's focus area.
For smaller reviews (<50 files), the single-pass approach with all three tracks remains appropriate.
Reference: gsd-v2 v2.66.0 uses multi-wave adversarial review.
Finding Format
### {ID}: {Short Title}
**Severity:** {CRITICAL|HIGH|MEDIUM|LOW}
**Failure-Mode:** {# from catalog, e.g. #1 Silent Exception}
**File:** `{path}:{line}`
**Problem:** {What is the problem}
**Suggestion:** {How to fix it}
Mode: audit
Review of an audit report for completeness and quality.
Process
- Read audit report (AUDIT-REPORT-.md or PROJECT-AUDIT-REPORT-.md)
- Read state file (.audit-state.json or .project-audit-state.json)
- Check:
- Were all phases completed? (State vs. report)
- Are there phases with <80% mandatory checks?
- Are severity ratings plausible? (MEDIUM that should actually be HIGH?)
- Are obvious finding categories missing? (e.g., no security finding for a web project)
- Are recommendations concrete and actionable?
- Are there copy-paste findings (same problem, different IDs)?
- Goal-Backward: Does the report cover the entire project?
- Minimum 5 findings on the report itself
Report Review Findings
### R-{ID}: {Short Title}
**Category:** Gap | Severity Error | Incomplete | Quality
**Reference:** {Phase or Finding-ID}
**Problem:** {What is missing or wrong}
**Suggestion:** {How the report can be improved}
State Write-Back (Category "Gap")
When the review finds findings of category "Gap" (missing checks, skipped validations), these can be written back as new findings to the audit state:
- Read audit state (
.audit-state.json or .project-audit-state.json)
- For each "Gap" finding:
- Create new finding with next available ID (e.g.,
SEC-07)
"status": "open", "notes": "From adversarial-review R-{ID}"
- Derive phase and severity from the review finding
- Update state file (summary + findings array)
- Inform user: "{N} findings from review added to audit state"
Rules:
- ONLY category "Gap" is written back — not "Severity Error", "Incomplete", or "Quality"
- "Severity Error" — user manually corrects in state
- "Incomplete" / "Quality" — meta-findings about the report, not the project
- Write-back only after user confirmation (AskUserQuestion)
Mode: plan
Review of an implementation plan for gaps and risks.
Process
- Read plan (Markdown, CLAUDE.md, or current plan mode)
- Check:
- Are all dependencies identified?
- Is there a rollback scenario?
- What happens if step X fails?
- Are the estimates realistic?
- Are steps missing? (Tests, documentation, deployment)
- Are there unvalidated assumptions?
- Goal-Backward:
- Does the planned artifact actually exist at the end?
- Is it substantial (not just a placeholder)?
- Is it wired up (referenced, deployed, configured)?
- Minimum 5 findings on the plan itself
Rules
- Minimum 5 findings — 0 = stop + review again, never "all good"
- No praise first — problems first, then (optionally) positives
- Rate severity honestly — when in doubt, rate higher
- Concrete suggestions — not just "should be improved"
- Goal-Backward always — Does it exist? Substantial? Wired up?
- No scope creep — only review what was requested
- On re-review after fixes: Only new/changed findings, no repetitions
- Anti-rationalization — Resist the urge to soften findings or reduce severity. See
_shared/anti-rationalization.md
Smart Next Steps
After completing the review, suggest appropriate follow-up actions to the user:
| Mode |
Condition |
Recommendation |
audit |
Findings with category "Gap" |
"Regenerate report after fixes: /audit report or /project-audit report" |
audit |
Findings with category "Severity Error" |
"Correct severity in state, then update report" |
code |
>3 HIGH findings |
"Implement fixes, then run /adversarial-review code again" |
plan |
Findings present |
"Revise plan, then run /adversarial-review plan again" |
When to Recommend
- Before every deploy or push
- After an audit report
- For architecture decisions
- When the user asks "does this look good?"
Files
adversarial-review/
└── SKILL.md ← This file
1---2name: adversarial-review3description: Critical review (min. 5 findings). Modes: code, audit, plan. Use when: "review", "critical review", "code review", "plan review", "audit review".4---56<!-- AI-QUICK-REF7## /adversarial-review — Quick Reference8- **Modes:** code | audit | plan9- **Arguments:** `/adversarial-review $0` e.g. `/adversarial-review code`10- **Minimum:** 5 findings — 0 findings = repeat review11- **3 Tracks:** Adversarial (creatively break) | Catalog (17 modes) | Path Tracer (paths)12- **Goal-Backward:** Artifact exists? Substantial? Wired up?13- **No praise** until at least 5 problems have been named14- **Severity:** CRITICAL (~1-5%) > HIGH (~0.1-1%) > MEDIUM (~0.01%) > LOW (<0.01%)15- **Large reviews (>50 files / >2000 lines):** Use wave-based review (Structural → Logic → Security → Integration)16- **Output:** Findings list with failure mode + risk + overall assessment17-->1819# /adversarial-review — Critical Review2021Enforces an honest, critical review instead of a courtesy review.22Minimum 5 findings — if fewer are found, look again.2324**Source:** BMAD (review-adversarial-general + PromptSentinel v1.2) Community Pattern2526## Problem2728LLMs tend toward positive reviews: "Looks good", "Well structured",29"No problems found". This is almost never true — every codebase has room for improvement.30Courtesy reviews are worthless.3132## Modes3334| Mode | Trigger | What gets reviewed |35|------|---------|-------------------|36| `code` | `/adversarial-review code` | Code changes (git diff or files) |37| `audit` | `/adversarial-review audit` | Audit report for completeness and quality |38| `plan` | `/adversarial-review plan` | Implementation plan for gaps and risks |3940---4142## Mode: code4344Critical code review focused on real problems.4546### Process47481. **Determine scope:**49 - Read `git diff` (unstaged + staged)50 - Or: User specifies files/directories51 - Or: Last commit (`git diff HEAD~1..HEAD`)52532. **Apply three parallel review tracks:**5455 **Track A — Adversarial:** "How does this code break under load?"56 - Concurrent access, race conditions, deadlocks57 - Network errors, timeouts, API outages58 - Unexpected inputs (null, empty, max, min, Unicode)59 - Security: Injection, XSS, CSRF, secrets6061 **Track B — Failure Mode Catalog:** Systematically scan against 17 modes:6263 | # | Mode | Look for... |64 |---|------|-------------|65 | 1 | Silent Exceptions | Exception caught but not propagated |66 | 2 | Missing Input Validation | Type/bounds not checked |67 | 3 | Implicit Dependencies | Assumes prior state, not verified |68 | 4 | Over/Under Validation | 1000 lines of validation OR none at all |69 | 5 | Non-Determinism | Timing, random order, unordered maps |70 | 6 | Double Negation | Complex boolean logic |71 | 7 | Implicit Initialization | Assumes prior setup |72 | 8 | Type Gaps | Parameter type assumed, not validated |73 | 9 | Unprotected Extensibility | API extensible, untested |74 | 10 | No Progress Tracking | Long tasks without logging/checkpoints |75 | 11 | Redundant Code | Re-implements stdlib |76 | 12 | Outdated Patterns | Callbacks instead of async/await, var instead of let |77 | 13 | Undocumented API | Return value unclear |78 | 14 | No Fallback | External API call without timeout/retry |79 | 15 | Unclear Completion | Function done? Exception or return? |80 | 16 | Monolithic Function | >200 lines, should be split |81 | 17 | Hardcoded Values | Should be config/ENV |8283 **Track C — Path Tracer:** Walk through every execution path:84 - Entry condition unambiguous?85 - All inputs validated?86 - State consistent across branches?87 - Resources cleaned up? (Streams, connections, handles)88893. **Goal-Backward Verification:**90 - What was the goal of the change? (Commit message, PR description)91 - Was the goal achieved?92 - Are there side effects?93944. **Stub Detection:**95 - Functions that only `return null/undefined/true`?96 - Empty catch blocks or error swallowing?97 - Config files with only default values?98 - Test assertions that always pass (`expect(true).toBe(true)`)?99 - "File exists" != "Check passed" — apply 4-level verification1001014. **Minimum 5 findings** — if <5 found:102 - Look again: Testability, edge cases, documentation103 - If truly <5 (very small diff): Reduce minimum to 3104 - 0 findings is NEVER acceptable105106### Severity with Risk Assessment107108| Severity | Definition | Defect Rate |109|----------|-----------|-------------|110| CRITICAL | System outage, data loss | ~1-5% |111| HIGH | Data corruption, security vulnerability | ~0.1-1% |112| MEDIUM | Degraded UX/performance | ~0.01-0.1% |113| LOW | Code smell, maintainability | <0.01% |114115### Wave-Based Review (Large Codebases)116117For large reviews (>50 files changed or >2000 lines), conduct the review in systematic waves rather than a single pass. This prevents reviewer fatigue and ensures thoroughness across all dimensions.118119| Wave | Focus | What to check |120|------|-------|---------------|121| **Wave 1: Structural** | File organization, naming, dead code, imports | Module boundaries, unused exports, circular dependencies |122| **Wave 2: Logic** | Business logic correctness, edge cases, error handling | Off-by-one, null paths, state transitions, race conditions |123| **Wave 3: Security** | OWASP checks, input validation, auth/authz | Injection, XSS, CSRF, secrets, privilege escalation |124| **Wave 4: Integration** | Cross-file consistency, API contracts, test coverage | Interface mismatches, missing tests, contract violations |125126Each wave produces its own findings before proceeding to the next. The three parallel tracks (Adversarial, Catalog, Path Tracer) are applied within each wave's focus area.127128For smaller reviews (<50 files), the single-pass approach with all three tracks remains appropriate.129130Reference: gsd-v2 v2.66.0 uses multi-wave adversarial review.131132### Finding Format133134```135### {ID}: {Short Title}136**Severity:** {CRITICAL|HIGH|MEDIUM|LOW}137**Failure-Mode:** {# from catalog, e.g. #1 Silent Exception}138**File:** `{path}:{line}`139**Problem:** {What is the problem}140**Suggestion:** {How to fix it}141```142143---144145## Mode: audit146147Review of an audit report for completeness and quality.148149### Process1501511. Read audit report (AUDIT-REPORT-*.md or PROJECT-AUDIT-REPORT-*.md)1522. Read state file (.audit-state.json or .project-audit-state.json)1533. Check:154 - Were all phases completed? (State vs. report)155 - Are there phases with <80% mandatory checks?156 - Are severity ratings plausible? (MEDIUM that should actually be HIGH?)157 - Are obvious finding categories missing? (e.g., no security finding for a web project)158 - Are recommendations concrete and actionable?159 - Are there copy-paste findings (same problem, different IDs)?1604. **Goal-Backward:** Does the report cover the entire project?1615. **Minimum 5 findings** on the report itself162163### Report Review Findings164165```166### R-{ID}: {Short Title}167**Category:** Gap | Severity Error | Incomplete | Quality168**Reference:** {Phase or Finding-ID}169**Problem:** {What is missing or wrong}170**Suggestion:** {How the report can be improved}171```172173### State Write-Back (Category "Gap")174175When the review finds findings of category **"Gap"** (missing checks, skipped validations), these can be written back as new findings to the audit state:1761771. Read audit state (`.audit-state.json` or `.project-audit-state.json`)1782. For each "Gap" finding:179 - Create new finding with next available ID (e.g., `SEC-07`)180 - `"status": "open"`, `"notes": "From adversarial-review R-{ID}"`181 - Derive phase and severity from the review finding1823. Update state file (summary + findings array)1834. Inform user: "{N} findings from review added to audit state"184185**Rules:**186- ONLY category "Gap" is written back — not "Severity Error", "Incomplete", or "Quality"187- "Severity Error" — user manually corrects in state188- "Incomplete" / "Quality" — meta-findings about the report, not the project189- Write-back only after user confirmation (AskUserQuestion)190191---192193## Mode: plan194195Review of an implementation plan for gaps and risks.196197### Process1981991. Read plan (Markdown, CLAUDE.md, or current plan mode)2002. Check:201 - Are all dependencies identified?202 - Is there a rollback scenario?203 - What happens if step X fails?204 - Are the estimates realistic?205 - Are steps missing? (Tests, documentation, deployment)206 - Are there unvalidated assumptions?2073. **Goal-Backward:**208 - Does the planned artifact actually exist at the end?209 - Is it substantial (not just a placeholder)?210 - Is it wired up (referenced, deployed, configured)?2114. **Minimum 5 findings** on the plan itself212213---214215## Rules2162171. **Minimum 5 findings** — 0 = stop + review again, never "all good"2182. **No praise first** — problems first, then (optionally) positives2193. **Rate severity honestly** — when in doubt, rate higher2204. **Concrete suggestions** — not just "should be improved"2215. **Goal-Backward always** — Does it exist? Substantial? Wired up?2226. **No scope creep** — only review what was requested2237. **On re-review** after fixes: Only new/changed findings, no repetitions2248. **Anti-rationalization** — Resist the urge to soften findings or reduce severity. See `_shared/anti-rationalization.md`225226## Smart Next Steps227228After completing the review, suggest appropriate follow-up actions to the user:229230| Mode | Condition | Recommendation |231|------|-----------|---------------|232| `audit` | Findings with category "Gap" | "Regenerate report after fixes: `/audit report` or `/project-audit report`" |233| `audit` | Findings with category "Severity Error" | "Correct severity in state, then update report" |234| `code` | >3 HIGH findings | "Implement fixes, then run `/adversarial-review code` again" |235| `plan` | Findings present | "Revise plan, then run `/adversarial-review plan` again" |236237---238239## When to Recommend240241- Before every deploy or push242- After an audit report243- For architecture decisions244- When the user asks "does this look good?"245246## Files247248```249adversarial-review/250└── SKILL.md ← This file251```