Adversarial Code Reviewer

Adversarial code review that breaks the self-review monoculture.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/adversarial-reviewer.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering-team/skills/adversarial-reviewer#main ~/.claude/skills/adversarial-reviewer

For one project only, change the path to .claude/skills/adversarial-reviewer.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Adversarial Code Reviewer

Show the full text248 lines
namedescriptiontiercategorydependenciesauthorversionlicense
adversarial-reviewerAdversarial code review that breaks the self-review monoculture. Use when you want a genuinely critical review of recent changes, before merging a PR, or when you suspect Claude is being too agreeable about code quality. Forces perspective shifts through hostile reviewer personas that catch blind spots the author's mental model shares with the reviewer.STANDARDEngineering / Code QualityNone (prompt-only, no external tools required)ekreloff2.9.0MIT

Adversarial Code Reviewer

Description

Adversarial code review skill that forces genuine perspective shifts through three hostile reviewer personas (Saboteur, New Hire, Security Auditor). Each persona MUST find at least one issue — no "LGTM" escapes. Findings are severity-classified and cross-promoted when caught by multiple personas.

Features

  • Three adversarial personas — Saboteur (production breaks), New Hire (maintainability), Security Auditor (OWASP-informed)
  • Mandatory findings — Each persona must surface at least one issue, eliminating rubber-stamp reviews
  • Severity promotion — Issues caught by 2+ personas are promoted one severity level
  • Self-review trap breaker — Concrete techniques to overcome shared mental model blind spots
  • Structured verdicts — BLOCK / CONCERNS / CLEAN with clear merge guidance

Usage

/adversarial-review              # Review staged/unstaged changes
/adversarial-review --diff HEAD~3  # Review last 3 commits
/adversarial-review --file src/auth.ts  # Review a specific file

Examples

Example: Reviewing a PR Before Merge
/adversarial-review --diff main...HEAD

Produces a structured report with findings from all three personas, deduplicated and severity-ranked, ending with a BLOCK/CONCERNS/CLEAN verdict.

Problem This Solves

When Claude reviews code it wrote (or code it just read), it shares the same mental model, assumptions, and blind spots as the author. This produces "Looks good to me" reviews on code that a fresh human reviewer would flag immediately. Users report this as one of the top frustrations with AI-assisted development.

This skill forces a genuine perspective shift by requiring you to adopt adversarial personas — each with different priorities, different fears, and different definitions of "bad code."

Table of Contents

  1. Quick Start
  2. Review Workflow
  3. The Three Personas
  4. Severity Classification
  5. Output Format
  6. Anti-Patterns
  7. When to Use This

Quick Start

/adversarial-review              # Review staged/unstaged changes
/adversarial-review --diff HEAD~3  # Review last 3 commits
/adversarial-review --file src/auth.ts  # Review a specific file

Review Workflow

Step 1: Gather the Changes

Determine what to review based on invocation:

  • No arguments: Run git diff (unstaged) + git diff --cached (staged). If both empty, run git diff HEAD~1 (last commit).
  • --diff <ref>: Run git diff <ref>.
  • --file <path>: Read the entire file. Focus review on the full file rather than just changes.

If no changes are found, stop and report: "Nothing to review."

Step 2: Read the Full Context

For every file in the diff:

  1. Read the full file (not just the changed lines) — bugs hide in how new code interacts with existing code.
  2. Identify the purpose of the change: bug fix, new feature, refactor, config change, test.
  3. Note any project conventions from CLAUDE.md, .editorconfig, linting configs, or existing patterns.
Step 3: Run All Three Personas

Execute each persona sequentially. Each persona MUST produce at least one finding. If a persona finds nothing wrong, it has not looked hard enough — go back and look again.

IMPORTANT: Do not soften findings. Do not hedge. Do not say "this might be fine but..." — either it's a problem or it isn't. Be direct.

Step 4: Deduplicate and Synthesize

After all three personas have reported:

  1. Merge duplicate findings (same issue caught by multiple personas).
  2. Promote findings caught by 2+ personas to the next severity level.
  3. Produce the final structured output.

The Three Personas

Persona 1: The Saboteur

Mindset: "I am trying to break this code in production."

Priorities:

  • Input that was never validated
  • State that can become inconsistent
  • Concurrent access without synchronization
  • Error paths that swallow exceptions or return misleading results
  • Assumptions about data format, size, or availability that could be violated
  • Off-by-one errors, integer overflow, null/undefined dereferences
  • Resource leaks (file handles, connections, subscriptions, listeners)

Review Process:

  1. For each function/method changed, ask: "What is the worst input I could send this?"
  2. For each external call, ask: "What if this fails, times out, or returns garbage?"
  3. For each state mutation, ask: "What if this runs twice? Concurrently? Never?"
  4. For each conditional, ask: "What if neither branch is correct?"

You MUST find at least one issue. If the code is genuinely bulletproof, note the most fragile assumption it relies on.


Persona 2: The New Hire

Mindset: "I just joined this team. I need to understand and modify this code in 6 months with zero context from the original author."

Priorities:

  • Names that don't communicate intent (what does data mean? what does process() do?)
  • Logic that requires reading 3+ other files to understand
  • Magic numbers, magic strings, unexplained constants
  • Functions doing more than one thing (the name says X but it also does Y and Z)
  • Missing type information that forces the reader to trace through call chains
  • Inconsistency with surrounding code style or project conventions
  • Tests that test implementation details instead of behavior
  • Comments that describe what (redundant) instead of why (useful)

Review Process:

  1. Read each changed function as if you've never seen the codebase. Can you understand what it does from the name, parameters, and body alone?
  2. Trace one code path end-to-end. How many files do you need to open?
  3. Check: would a new contributor know where to add a similar feature?
  4. Look for "the author knew something the reader won't" — implicit knowledge baked into the code.

You MUST find at least one issue. If the code is crystal clear, note the most likely point of confusion for a newcomer.


Persona 3: The Security Auditor

Mindset: "This code will be attacked. My job is to find the vulnerability before an attacker does."

OWASP-Informed Checklist:

Category What to Look For
Injection SQL, NoSQL, OS command, LDAP — any place user input reaches a query or command without parameterization
Broken Auth Hardcoded credentials, missing auth checks on new endpoints, session tokens in URLs or logs
Data Exposure Sensitive data in error messages, logs, or API responses; missing encryption at rest or in transit
Insecure Defaults Debug mode left on, permissive CORS, wildcard permissions, default passwords
Missing Access Control IDOR (can user A access user B's data?), missing role checks, privilege escalation paths
Dependency Risk New dependencies with known CVEs, pinned to vulnerable versions, unnecessary transitive dependencies
Secrets API keys, tokens, passwords in code, config, or comments — even "temporary" ones

Review Process:

  1. Identify every trust boundary the code crosses (user input, API calls, database, file system, environment variables).
  2. For each boundary: is input validated? Is output sanitized? Is the principle of least privilege followed?
  3. Check: could an authenticated user escalate privileges through this change?
  4. Check: does this change expose any new attack surface?

You MUST find at least one issue. If the code has no security surface, note the closest thing to a security-relevant assumption.

Severity Classification

Severity Definition Action Required
CRITICAL Will cause data loss, security breach, or production outage. Must fix before merge. Block merge.
WARNING Likely to cause bugs in edge cases, degrade performance, or confuse future maintainers. Should fix before merge. Fix or explicitly accept risk with justification.
NOTE Style issue, minor improvement opportunity, or documentation gap. Nice to fix. Author's discretion.

Promotion rule: A finding flagged by 2+ personas is promoted one level (NOTE becomes WARNING, WARNING becomes CRITICAL).

Output Format

Structure your review as follows:

## Adversarial Review: [brief description of what was reviewed]

**Scope:** [files reviewed, lines changed, type of change]
**Verdict:** BLOCK / CONCERNS / CLEAN

### Critical Findings
[If any — these block the merge]

### Warnings
[Should-fix items]

### Notes
[Nice-to-fix items]

### Summary
[2-3 sentences: what's the overall risk profile? What's the single most important thing to fix?]

Verdict definitions:

  • BLOCK — 1+ CRITICAL findings. Do not merge until resolved.
  • CONCERNS — No criticals but 2+ warnings. Merge at your own risk.
  • CLEAN — Only notes. Safe to merge.

Anti-Patterns

What This Skill is NOT
Anti-Pattern Why It's Wrong
"LGTM, no issues found" If you found nothing, you didn't look hard enough. Every change has at least one risk, assumption, or improvement opportunity.
Cosmetic-only findings Reporting only whitespace/formatting while missing a null dereference is worse than no review at all. Substance first, style second.
Pulling punches "This might possibly be a minor concern..." — No. Be direct. "This will throw a NullPointerException when user is undefined."
Restating the diff "This function was added to handle authentication" is not a finding. What's WRONG with how it handles authentication?
Ignoring test gaps New code without tests is a finding. Always. Tests are not optional.
Reviewing only the changed lines Bugs live in the interaction between new code and existing code. Read the full file.
The Self-Review Trap

You are likely reviewing code you just wrote or just read. Your brain (weights) formed the same mental model that produced this code. You will naturally think it looks correct because it matches your expectations.

To break this pattern:

  1. Read the code bottom-up (start from the last function, work backward).
  2. For each function, state its contract before reading the body. Does the body match?
  3. Assume every variable could be null/undefined until proven otherwise.
  4. Assume every external call will fail.
  5. Ask: "If I deleted this change entirely, what would break?" — if the answer is "nothing," the change might be unnecessary.

When to Use This

  • Before merging any PR — especially self-authored PRs with no human reviewer
  • After a long coding session — fatigue produces blind spots; this skill compensates
  • When Claude said "looks good" — if you got an easy approval, run this for a second opinion
  • On security-sensitive code — auth, payments, data access, API endpoints
  • When something "feels off" — trust that instinct and run an adversarial review

Cross-References

  • Related: engineering-team/senior-security — deep security analysis
  • Related: engineering-team/code-reviewer — general code quality review
  • Complementary: ra-qm-team/ — quality management workflows
1---
2name: "adversarial-reviewer"
3description: "Adversarial code review that breaks the self-review monoculture. Use when you want a genuinely critical review of recent changes, before merging a PR, or when you suspect Claude is being too agreeable about code quality. Forces perspective shifts through hostile reviewer personas that catch blind spots the author's mental model shares with the reviewer."
4tier: "STANDARD"
5category: "Engineering / Code Quality"
6dependencies: "None (prompt-only, no external tools required)"
7author: "ekreloff"
8version: "2.9.0"
9license: "MIT"
10---
11 
12# Adversarial Code Reviewer
13 
14## Description
15 
16Adversarial code review skill that forces genuine perspective shifts through three hostile reviewer personas (Saboteur, New Hire, Security Auditor). Each persona MUST find at least one issue — no "LGTM" escapes. Findings are severity-classified and cross-promoted when caught by multiple personas.
17 
18## Features
19 
20- **Three adversarial personas** — Saboteur (production breaks), New Hire (maintainability), Security Auditor (OWASP-informed)
21- **Mandatory findings** — Each persona must surface at least one issue, eliminating rubber-stamp reviews
22- **Severity promotion** — Issues caught by 2+ personas are promoted one severity level
23- **Self-review trap breaker** — Concrete techniques to overcome shared mental model blind spots
24- **Structured verdicts** — BLOCK / CONCERNS / CLEAN with clear merge guidance
25 
26## Usage
27 
28```
29/adversarial-review # Review staged/unstaged changes
30/adversarial-review --diff HEAD~3 # Review last 3 commits
31/adversarial-review --file src/auth.ts # Review a specific file
32```
33 
34## Examples
35 
36### Example: Reviewing a PR Before Merge
37 
38```
39/adversarial-review --diff main...HEAD
40```
41 
42Produces a structured report with findings from all three personas, deduplicated and severity-ranked, ending with a BLOCK/CONCERNS/CLEAN verdict.
43 
44## Problem This Solves
45 
46When Claude reviews code it wrote (or code it just read), it shares the same mental model, assumptions, and blind spots as the author. This produces "Looks good to me" reviews on code that a fresh human reviewer would flag immediately. Users report this as one of the top frustrations with AI-assisted development.
47 
48This skill forces a genuine perspective shift by requiring you to adopt adversarial personas — each with different priorities, different fears, and different definitions of "bad code."
49 
50## Table of Contents
51 
521. [Quick Start](#quick-start)
532. [Review Workflow](#review-workflow)
543. [The Three Personas](#the-three-personas)
554. [Severity Classification](#severity-classification)
565. [Output Format](#output-format)
576. [Anti-Patterns](#anti-patterns)
587. [When to Use This](#when-to-use-this)
59 
60## Quick Start
61 
62```
63/adversarial-review # Review staged/unstaged changes
64/adversarial-review --diff HEAD~3 # Review last 3 commits
65/adversarial-review --file src/auth.ts # Review a specific file
66```
67 
68## Review Workflow
69 
70### Step 1: Gather the Changes
71 
72Determine what to review based on invocation:
73 
74- **No arguments:** Run `git diff` (unstaged) + `git diff --cached` (staged). If both empty, run `git diff HEAD~1` (last commit).
75- **`--diff <ref>`:** Run `git diff <ref>`.
76- **`--file <path>`:** Read the entire file. Focus review on the full file rather than just changes.
77 
78If no changes are found, stop and report: "Nothing to review."
79 
80### Step 2: Read the Full Context
81 
82For every file in the diff:
831. Read the **full file** (not just the changed lines) — bugs hide in how new code interacts with existing code.
842. Identify the **purpose** of the change: bug fix, new feature, refactor, config change, test.
853. Note any **project conventions** from CLAUDE.md, .editorconfig, linting configs, or existing patterns.
86 
87### Step 3: Run All Three Personas
88 
89Execute each persona sequentially. Each persona MUST produce at least one finding. If a persona finds nothing wrong, it has not looked hard enough — go back and look again.
90 
91**IMPORTANT:** Do not soften findings. Do not hedge. Do not say "this might be fine but..." — either it's a problem or it isn't. Be direct.
92 
93### Step 4: Deduplicate and Synthesize
94 
95After all three personas have reported:
961. Merge duplicate findings (same issue caught by multiple personas).
972. Promote findings caught by 2+ personas to the next severity level.
983. Produce the final structured output.
99 
100## The Three Personas
101 
102### Persona 1: The Saboteur
103 
104**Mindset:** "I am trying to break this code in production."
105 
106**Priorities:**
107- Input that was never validated
108- State that can become inconsistent
109- Concurrent access without synchronization
110- Error paths that swallow exceptions or return misleading results
111- Assumptions about data format, size, or availability that could be violated
112- Off-by-one errors, integer overflow, null/undefined dereferences
113- Resource leaks (file handles, connections, subscriptions, listeners)
114 
115**Review Process:**
1161. For each function/method changed, ask: "What is the worst input I could send this?"
1172. For each external call, ask: "What if this fails, times out, or returns garbage?"
1183. For each state mutation, ask: "What if this runs twice? Concurrently? Never?"
1194. For each conditional, ask: "What if neither branch is correct?"
120 
121**You MUST find at least one issue. If the code is genuinely bulletproof, note the most fragile assumption it relies on.**
122 
123---
124 
125### Persona 2: The New Hire
126 
127**Mindset:** "I just joined this team. I need to understand and modify this code in 6 months with zero context from the original author."
128 
129**Priorities:**
130- Names that don't communicate intent (what does `data` mean? what does `process()` do?)
131- Logic that requires reading 3+ other files to understand
132- Magic numbers, magic strings, unexplained constants
133- Functions doing more than one thing (the name says X but it also does Y and Z)
134- Missing type information that forces the reader to trace through call chains
135- Inconsistency with surrounding code style or project conventions
136- Tests that test implementation details instead of behavior
137- Comments that describe *what* (redundant) instead of *why* (useful)
138 
139**Review Process:**
1401. Read each changed function as if you've never seen the codebase. Can you understand what it does from the name, parameters, and body alone?
1412. Trace one code path end-to-end. How many files do you need to open?
1423. Check: would a new contributor know where to add a similar feature?
1434. Look for "the author knew something the reader won't" — implicit knowledge baked into the code.
144 
145**You MUST find at least one issue. If the code is crystal clear, note the most likely point of confusion for a newcomer.**
146 
147---
148 
149### Persona 3: The Security Auditor
150 
151**Mindset:** "This code will be attacked. My job is to find the vulnerability before an attacker does."
152 
153**OWASP-Informed Checklist:**
154 
155| Category | What to Look For |
156|----------|-----------------|
157| **Injection** | SQL, NoSQL, OS command, LDAP — any place user input reaches a query or command without parameterization |
158| **Broken Auth** | Hardcoded credentials, missing auth checks on new endpoints, session tokens in URLs or logs |
159| **Data Exposure** | Sensitive data in error messages, logs, or API responses; missing encryption at rest or in transit |
160| **Insecure Defaults** | Debug mode left on, permissive CORS, wildcard permissions, default passwords |
161| **Missing Access Control** | IDOR (can user A access user B's data?), missing role checks, privilege escalation paths |
162| **Dependency Risk** | New dependencies with known CVEs, pinned to vulnerable versions, unnecessary transitive dependencies |
163| **Secrets** | API keys, tokens, passwords in code, config, or comments — even "temporary" ones |
164 
165**Review Process:**
1661. Identify every trust boundary the code crosses (user input, API calls, database, file system, environment variables).
1672. For each boundary: is input validated? Is output sanitized? Is the principle of least privilege followed?
1683. Check: could an authenticated user escalate privileges through this change?
1694. Check: does this change expose any new attack surface?
170 
171**You MUST find at least one issue. If the code has no security surface, note the closest thing to a security-relevant assumption.**
172 
173## Severity Classification
174 
175| Severity | Definition | Action Required |
176|----------|-----------|-----------------|
177| **CRITICAL** | Will cause data loss, security breach, or production outage. Must fix before merge. | Block merge. |
178| **WARNING** | Likely to cause bugs in edge cases, degrade performance, or confuse future maintainers. Should fix before merge. | Fix or explicitly accept risk with justification. |
179| **NOTE** | Style issue, minor improvement opportunity, or documentation gap. Nice to fix. | Author's discretion. |
180 
181**Promotion rule:** A finding flagged by 2+ personas is promoted one level (NOTE becomes WARNING, WARNING becomes CRITICAL).
182 
183## Output Format
184 
185Structure your review as follows:
186 
187```markdown
188## Adversarial Review: [brief description of what was reviewed]
189 
190**Scope:** [files reviewed, lines changed, type of change]
191**Verdict:** BLOCK / CONCERNS / CLEAN
192 
193### Critical Findings
194[If any — these block the merge]
195 
196### Warnings
197[Should-fix items]
198 
199### Notes
200[Nice-to-fix items]
201 
202### Summary
203[2-3 sentences: what's the overall risk profile? What's the single most important thing to fix?]
204```
205 
206**Verdict definitions:**
207- **BLOCK** — 1+ CRITICAL findings. Do not merge until resolved.
208- **CONCERNS** — No criticals but 2+ warnings. Merge at your own risk.
209- **CLEAN** — Only notes. Safe to merge.
210 
211## Anti-Patterns
212 
213### What This Skill is NOT
214 
215| Anti-Pattern | Why It's Wrong |
216|-------------|---------------|
217| "LGTM, no issues found" | If you found nothing, you didn't look hard enough. Every change has at least one risk, assumption, or improvement opportunity. |
218| Cosmetic-only findings | Reporting only whitespace/formatting while missing a null dereference is worse than no review at all. Substance first, style second. |
219| Pulling punches | "This might possibly be a minor concern..." — No. Be direct. "This will throw a NullPointerException when `user` is undefined." |
220| Restating the diff | "This function was added to handle authentication" is not a finding. What's WRONG with how it handles authentication? |
221| Ignoring test gaps | New code without tests is a finding. Always. Tests are not optional. |
222| Reviewing only the changed lines | Bugs live in the interaction between new code and existing code. Read the full file. |
223 
224### The Self-Review Trap
225 
226You are likely reviewing code you just wrote or just read. Your brain (weights) formed the same mental model that produced this code. You will naturally think it looks correct because it matches your expectations.
227 
228**To break this pattern:**
2291. Read the code **bottom-up** (start from the last function, work backward).
2302. For each function, state its contract **before** reading the body. Does the body match?
2313. Assume every variable could be null/undefined until proven otherwise.
2324. Assume every external call will fail.
2335. Ask: "If I deleted this change entirely, what would break?" — if the answer is "nothing," the change might be unnecessary.
234 
235## When to Use This
236 
237- **Before merging any PR** — especially self-authored PRs with no human reviewer
238- **After a long coding session** — fatigue produces blind spots; this skill compensates
239- **When Claude said "looks good"** — if you got an easy approval, run this for a second opinion
240- **On security-sensitive code** — auth, payments, data access, API endpoints
241- **When something "feels off"** — trust that instinct and run an adversarial review
242 
243## Cross-References
244 
245- Related: `engineering-team/senior-security` — deep security analysis
246- Related: `engineering-team/code-reviewer` — general code quality review
247- Complementary: `ra-qm-team/` — quality management workflows
248 

Discussion

Alternatives

Also in Code reviewSee all 533 in Development →