
adversarial-reviewer
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.
- Installs
- 818
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/alirezarezvani/claude-skills --skill adversarial-reviewer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads adversarial-reviewer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
- Quick Start
- Review Workflow
- The Three Personas
- Severity Classification
- Output Format
- Anti-Patterns
- 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, rungit diff HEAD~1(last commit). --diff <ref>: Rungit 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:
- Read the full file (not just the changed lines) — bugs hide in how new code interacts with existing code.
- Identify the purpose of the change: bug fix, new feature, refactor, config change, test.
- 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:
- Merge duplicate findings (same issue caught by multiple personas).
- Promote findings caught by 2+ personas to the next severity level.
- 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:
- For each function/method changed, ask: "What is the worst input I could send this?"
- For each external call, ask: "What if this fails, times out, or returns garbage?"
- For each state mutation, ask: "What if this runs twice? Concurrently? Never?"
- 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
datamean? what doesprocess()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:
- 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?
- Trace one code path end-to-end. How many files do you need to open?
- Check: would a new contributor know where to add a similar feature?
- 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:
- Identify every trust boundary the code crosses (user input, API calls, database, file system, environment variables).
- For each boundary: is input validated? Is output sanitized? Is the principle of least privilege followed?
- Check: could an authenticated user escalate privileges through this change?
- 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:
- Read the code bottom-up (start from the last function, work backward).
- For each function, state its contract before reading the body. Does the body match?
- Assume every variable could be null/undefined until proven otherwise.
- Assume every external call will fail.
- 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
FAQ
What does the adversarial-reviewer skill do?
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.
How do I install adversarial-reviewer?
Run npx skills add https://github.com/alirezarezvani/claude-skills --skill adversarial-reviewer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/adversarial-reviewer/ (personal) or .claude/skills/adversarial-reviewer/ (project).
Which AI agents can use adversarial-reviewer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is adversarial-reviewer safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains adversarial-reviewer?
It is published by alirezarezvani in alirezarezvani/claude-skills. It has 818 recorded installs.
More from alirezarezvani/claude-skills
engineering-skills
alirezarezvani/claude-skills
Index of the engineering-team skills bundle for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw, and 6 more tools. Architecture, frontend, backend, QA, DevOps, security, AI/ML, data engineering, Playwright, Stripe, AWS, MS365 (stdlib-only Python tools). Use when browsing or choosing among engineering-team role skills — load only the one specialist SKILL.md you need, never bulk-load the bundle.
finance-skills
alirezarezvani/claude-skills
Router/index for the finance skills bundled in this plugin: financial-analyst (ratio analysis, DCF valuation, budget variance, rolling forecasts), saas-metrics-coach (ARR/MRR, churn, CAC/LTV, NRR, quick ratio) and month-end-close (close calendar, reconciliations, flux review). Use when a finance request doesn't obviously match one skill and you need to pick the right one (e.g., 'analyze these financials', 'how healthy are my SaaS metrics').
marketing-skills
alirezarezvani/claude-skills
Directory and router for the marketing skills library. Use when you need to find the right marketing skill for a task, see what marketing capabilities exist, or get oriented in this plugin. 44 specialist skills across 8 pods (content, SEO + AEO, CRO, channels, growth, intelligence, sales enablement, ops), 59 stdlib Python tools. Routes to one skill — it does not execute marketing work itself.
business-growth-skills
alirezarezvani/claude-skills
Router/index for the 4 business & growth skills bundled in this plugin: customer-success-manager (health scoring, churn risk, expansion), sales-engineer (RFP analysis, competitive matrices, PoC planning), revenue-operations (pipeline, forecast accuracy, GTM efficiency), and contract-and-proposal-writer. Use when a growth/revenue request doesn't obviously match one skill and you need to pick the right one (e.g., 'which accounts are at risk', 'should we bid on this RFP').
engineering-advanced-skills
alirezarezvani/claude-skills
Index of 37 advanced engineering agent skills for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Use when browsing or choosing among the POWERFUL-tier engineering skills: agent design, RAG, MCP servers, CI/CD, database design, observability, security auditing, changelog/release automation, reliability (SLO/chaos/flags/operators), platform ops.
product-skills
alirezarezvani/claude-skills
Use when coordinating product work across the 12 bundled product sub-skills (RICE, OKRs, UX research, design tokens, competitive teardown, analytics, experiments, discovery, roadmaps, spec-to-repo, landing pages, SaaS scaffolding) or the 4 standalone product-team plugins (user stories, Apple HIG, code-to-PRD, research summarizer). Triggers on 'help me prioritize', 'plan a product experiment', 'we ship features nobody uses', 'run the discovery loop', 'is our OST sound'. Forks context to route to one sub-skill via a deterministic signal router and returns a digest; can also drive a continuous-discovery loop (Torres cadence tracker + OST linter as machine gates) or a full goal→plan→execute→verify→close run through the repo-wide agent-harness. Distinct from project-management (how to deliver vs what to build), marketing/landing (from-scratch pages), and engineering/agent-harness (the generic loop engine this orchestrator plugs into).
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.