debating-code-reviews
Use this skill when orchestrating multi-agent adversarial code reviews using Claude Code agent teams. Activates when conducting thorough code reviews, setting up review debate teams, spawning specialized review personas, or synthesizing findings from multiple reviewers. Provides spawn prompts, debate protocol, and synthesis templates.
What this skill does
# Adversarial Debate Code Reviews
Orchestrate a team of 4 specialized reviewers who independently analyze code, then debate each other's findings. Adversarial debate between diverse review perspectives catches significantly more bugs than single-pass review.
## Why Debate Works
Single-reviewer code review suffers from blind spots - each reviewer has biases and areas of focus. Adversarial debate forces findings to survive scrutiny:
- **Independent analysis** prevents groupthink
- **Cross-examination** eliminates false positives
- **Diverse techniques** (path tracing, pre-mortem, adversarial testing) cover different bug categories
- **Devil's advocate** challenges ensure every finding has real evidence
## Prerequisites
Agent teams are experimental and disabled by default. Enable them by adding the following to your `settings.json` or shell environment:
```json
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
```
## When to Use
Use the full debate protocol for:
- **High-risk changes** - Authentication, payment, data migration, security-sensitive code
- **Complex cross-module changes** - Changes touching 5+ files or multiple system boundaries
- **AI-authored code** - Code generated by AI that needs confidence before merging
- **Critical bug fixes** - Fixes where getting it wrong is worse than the original bug
See "When to Skip" at the bottom for lighter alternatives.
## The Review Team
| Reviewer | Role | Primary Technique | Focus |
|----------|------|-------------------|-------|
| **The Tracer** | Correctness | Execution path tracing | Logic errors, edge cases, state bugs |
| **The Architect** | Design | Pre-mortem analysis | Patterns, complexity, coupling |
| **The Breaker** | Adversarial Tester | Adversarial input + test review | Breaking inputs, test quality gaps |
| **The Prosecutor** | Devil's Advocate | Five Whys + assertion verification | False positives, overstated severity |
Each reviewer is available as a custom agent in `../../agents/` and is configured with Opus, read-only tools, and this skill preloaded. See `./references/reviewer-personas.md` for detailed persona rationale and thinking styles.
## Running the Debate
### Step 1: Create the Agent Team
Create an agent team with the 4 reviewer agents. They are pre-configured in this plugin's `agents/` directory (`tracer`, `architect`, `breaker`, `prosecutor`).
Teammates don't inherit the lead's conversation history - they only get project context (CLAUDE.md, skills, MCP servers) plus the spawn prompt. Include enough detail about the code change in the prompt for reviewers to work independently.
```
Create an agent team to review [describe the code change - include file paths,
what the change does, and why].
Spawn 4 teammates using the tracer, architect, breaker, and prosecutor agents.
Require plan approval for the prosecutor (it must wait for Round 1 findings).
Create tasks with dependencies:
- Round 1 tasks (no dependencies, run in parallel):
- "Tracer: review [files] for correctness" → assign to tracer
- "Architect: review [files] for design" → assign to architect
- "Breaker: review [files] for adversarial inputs and test quality" → assign to breaker
- Round 2 tasks (depend on all Round 1 tasks):
- "Prosecutor: challenge Round 1 findings" → assign to prosecutor
- "All reviewers: respond to challenges and each other's findings"
- Round 3 task (depends on Round 2):
- "All reviewers: state final positions with confidence levels"
After Round 3, synthesize all findings into a single report.
```
### Step 2: Round 1 - Independent Review (Parallel)
Tracer, Architect, and Breaker review the code independently. All three run in parallel via the shared task list.
The Prosecutor is in plan approval mode during Round 1 - the lead won't approve its plan until Round 1 tasks are complete.
Each reviewer produces findings with:
- **Severity:** BLOCKING / WARNING / NOTE
- **Evidence:** Code quotes, execution traces, or specific scenarios
- **Impact:** What happens if not fixed
### Step 3: Round 2 - Challenge (Sequential)
Round 2 tasks automatically unblock when Round 1 completes (via task dependencies).
1. Lead broadcasts Round 1 findings to all teammates (use broadcast sparingly - it sends to every teammate and costs scale with team size)
2. Prosecutor's plan is approved - it reviews every finding and provides verdicts (CONFIRMED / DISPUTED / DISMISSED)
3. Lead messages Tracer, Architect, and Breaker individually with the Prosecutor's challenges and each other's findings. Each responds.
See `./references/debate-protocol.md` for detailed messaging patterns.
### Step 4: Round 3 - Final Positions
Each reviewer states final findings with confidence levels (HIGH / MEDIUM / LOW).
The Prosecutor provides final triage for each finding.
### Step 5: Synthesize
The lead produces the final report using the template in `./references/synthesis-template.md`.
The report sections:
1. **Confirmed Findings** - Survived debate, ranked by severity
2. **Disputed Findings** - Reviewers disagreed, needs human judgment
3. **Dismissed Findings** - False positives or retracted
4. **Test Quality Assessment** - From the Breaker's test review
5. **Debate Highlights** - Notable disagreements and discoveries
## Severity Definitions
| Severity | Meaning | Action |
|----------|---------|--------|
| **BLOCKING** | Incorrect behavior, data loss, or security issue | Must fix before merge |
| **WARNING** | Design issue, missing edge case, or test gap | Should fix, may defer with justification |
| **NOTE** | Minor improvement or observation | Consider, no action required |
## Verdicts
| Verdict | When to Use |
|---------|-------------|
| **APPROVE** | No BLOCKING findings, warnings are minor |
| **APPROVE WITH CHANGES** | No BLOCKING findings, but warnings worth addressing |
| **REQUEST CHANGES** | One or more confirmed BLOCKING findings |
## When to Skip
The full 4-reviewer debate is thorough but has a cost (time and tokens). Use lighter approaches for lower-risk changes:
| Change Type | Recommended Approach |
|-------------|---------------------|
| High-risk, cross-module, AI-authored | Full debate (4 reviewers, 3 rounds) |
| Medium-risk, single module | 2 reviewers (Tracer + Breaker), no Prosecutor |
| Low-risk, small change | Single reviewer (Tracer for logic, Architect for design) |
| Documentation, config, formatting | Standard code review, no debate needed |
## Quick Reference
- **Reviewer agents:** `../../agents/` (tracer, architect, breaker, prosecutor)
- **Persona rationale and thinking styles:** `./references/reviewer-personas.md`
- **Round structure and messaging:** `./references/debate-protocol.md`
- **Report template and triage:** `./references/synthesis-template.md`
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.