adversarial-code-review is a risk-adaptive, evidence-driven review skill for AI coding agents. It independently reviews working-tree changes, staged changes, commits, or pull requests, treating implementations, tests, descriptions, and completion claims as evidence to verify rather than facts to trust.
The skill keeps reviews read-only by default, scales depth to observable risk, and reports only defects supported by a concrete failure scenario and impact.
Code review often looks thorough while leaving the highest-risk assumptions untested:
| Common approach | What goes wrong | How adversarial-code-review handles it |
|---|---|---|
| Review only the visible diff | Requirements, adjacent execution paths, and hidden regressions are missed | Reconstruct the requirements and trace the real production path before judging the change |
| Treat passing tests as proof | Rewritten assertions, shallow mocks, or tests aimed at the wrong layer create false confidence | Check whether each test would fail for the defect it claims to prevent |
| Apply the same checklist to every change | Small changes receive ceremony while risky changes receive shallow coverage | Select focused, adaptive, or full mode from observable scope and risk signals |
| Trust the PR description or completion report | Claims can be stale, incomplete, or unverifiable | Confirm material claims against the exact diff, repository context, and fresh command output |
| Look only for implementation bugs | Scope creep, over-engineering, weakened tests, and pseudo-regression coverage survive review | Always screen scope and test integrity, with two mandatory independent passes for large or important changes |
- Independent by default: act as a skeptical senior reviewer and verify every material claim.
- Risk-adaptive depth: spend review effort where the diff shows real risk instead of mechanically expanding every review.
- Facts before conclusions: derive the review boundary, requirements, execution paths, and verification evidence from current sources.
- Evidence-backed findings: require a concrete trigger, actual versus expected behavior, impact, confidence, and correction direction.
- Read-only review: do not edit files, mutate Git state, install dependencies, approve changes, or reply to comments unless separately authorized.
- Coverage you can audit: record every relevant risk domain as deeply reviewed, screened, not applicable, or unverified.
flowchart LR
A["Review target"] --> B["Requirements and exact diff"]
B --> C{"Choose review mode"}
C -->|"Focused"| D["Named risk + fixed review trunk"]
C -->|"Adaptive"| E["Triggered domains + screened remainder"]
C -->|"Full"| F["All relevant domains + two independent passes"]
D --> G["Safe verification"]
E --> G
F --> G
G --> H["Evidence-scaled verdict and findings"]
| Mode | When it applies | Depth |
|---|---|---|
| Adaptive | Default for ordinary changes | Run the fixed review trunk, deeply inspect triggered domains, and screen the rest |
| Full | Comprehensive requests, large or important changes, broad architectural or contract impact, or weakened tests | Review all relevant domains and run both independent scope and test-integrity passes |
| Focused | The user names a specific risk domain | Deeply review that domain while retaining requirements, core logic, test credibility, adjacent regression risk, and verification coverage |
Full mode is mandatory when the change crosses the skill's observable thresholds, including at least 10 non-generated files, at least 500 effective changed lines, at least 3 affected modules or layers, or a change to a public API, database schema, dependency, or architecture boundary. Refactoring mixed with behavior changes and substantially weakened tests also trigger full mode.
Every review screens both areas below. Full-mode and large or important reviews run them as separately named independent passes:
- Scope discipline and over-engineering — reconstruct the required surface, challenge unrelated abstractions and infrastructure, and compare the diff with the smallest credible implementation.
- Test integrity and pseudo-regression protection — reconstruct protected guarantees, inspect rewritten or deleted assertions, challenge mocks and test boundaries, and identify missing failure paths.
After an ordinary review, the skill offers these two independent passes unless they already ran, the user declined them, or the report must be non-interactive.
The review routes observable diff signals into the relevant domains:
- requirement alignment, core logic, and edge cases;
- API, dependency, command, and configuration authenticity;
- security and trust boundaries;
- data integrity, transactions, concurrency, retries, and idempotency;
- performance and resource usage;
- compatibility, migrations, deployment, observability, and rollback;
- language- and database-specific correctness checks;
- verification integrity and final-diff reinspection.
- Read repository instructions, requirements, designs, tests, and CI conventions.
- Confirm the exact target and comparison boundary.
- Inventory the diff and classify its size and importance.
- Select one review mode and route every relevant risk domain.
- Trace real execution paths and assess whether tests protect the changed behavior.
- Run the narrowest safe verification commands and read their complete output.
- Reinspect repository status and the exact diff for accidental mutations.
- Report a merge verdict, severity-ranked findings, verification evidence, coverage, residual risks, and a final recommendation.
Install the skill and choose a target agent:
npx skills add contrueCT/adversarial-code-reviewOptionally install it globally for Codex and Claude Code:
npx skills add contrueCT/adversarial-code-review -g -a codex -a claude-codeAsk the agent to review a concrete Git boundary:
Use $adversarial-code-review to independently review the current working-tree changes.
Use $adversarial-code-review to perform a full review of this pull request against its base branch.
The agent can also select the skill automatically when the request matches its trigger description.
The repository follows the shared Agent Skills layout. The core workflow and references are plain Markdown and can be reused by Codex, Claude Code, and other coding agents that support Agent Skills or custom instruction packages.
Codex can use agents/openai.yaml for UI metadata. Other agents can rely on the standard frontmatter and instructions in SKILL.md; support for automatic selection and manual invocation depends on the agent's own Skill integration.
adversarial-code-review/
├── SKILL.md
├── agents/
│ └── openai.yaml
├── references/
│ ├── language-checks.md
│ ├── review-domains.md
│ └── scope-and-test-integrity.md
├── docs/
│ └── README.zh-CN.md
└── README.md