debating-implementation-plans
Use this skill when orchestrating multi-agent adversarial planning debates before code is written. Activates when planning complex implementations, coordinating pre-implementation discovery, stress-testing implementation approaches, or producing validated plans for coding agents. Provides discovery prompts, debate protocol, and plan templates.
What this skill does
# Adversarial Debate Implementation Plans
Orchestrate a team of 4 planning specialists who independently analyze a task, then debate to produce a validated implementation plan. Adversarial debate before coding catches issues when revising a plan costs nothing, instead of after coding when fixing means rewriting.
## Why Debate Before Coding
Planning failures are expensive:
- **Incomplete discovery** - The implementer misses existing utilities and reinvents them
- **First-approach anchoring** - The first viable approach gets chosen without considering alternatives
- **Cross-system blind spots** - Changes break downstream systems nobody checked
- **Optimistic complexity** - "This is straightforward" turns into a multi-day rewrite
Debate forces independent perspectives to collide before a single line of code is written.
## 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:
- **Complex cross-module changes** - Touching multiple system boundaries or modules
- **New architecture** - Introducing patterns, abstractions, or systems that don't exist yet
- **Unfamiliar codebase** - Working in code you (or the AI) haven't explored deeply
- **High-risk implementations** - Changes where getting the plan wrong wastes significant effort
See "When to Skip" at the bottom for lighter alternatives.
## The Planning Team
| Agent | Role | Primary Technique | Focus |
|-------|------|-------------------|-------|
| **The Scout** | Discovery | Exhaustive codebase exploration | Existing patterns, utilities, types, affected systems, test patterns |
| **The Planner** | Design | Concrete implementation planning | Step-by-step approach, file manifest, alternatives considered |
| **The Critic** | Pre-mortem | Failure mode analysis | Missed dependencies, integration risks, specification gaps, complexity |
| **The Prosecutor** | Devil's Advocate | Challenge all claims | Verifies Scout's findings, challenges Planner's assumptions, tests Critic's concerns |
Each agent is available as a custom agent in `../../agents/` and is configured with Opus, read-only tools, and this skill preloaded. See `./references/planner-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 planning agents. They are pre-configured in this plugin's `agents/` directory (`scout`, `planner`, `critic`, `prosecutor-planning`).
Teammates don't inherit the lead's conversation history - they only get project context (CLAUDE.md, skills, MCP servers) plus the spawn prompt. Include the full task specification in the prompt.
```
Create an agent team to plan the implementation of [describe the task - include
the full specification, acceptance criteria, and any constraints].
Spawn 4 teammates using the scout, planner, critic, and prosecutor-planning agents.
Require plan approval for the prosecutor-planning agent (it must wait for Round 1 outputs).
Create tasks with dependencies:
- Round 1 tasks (no dependencies, run in parallel):
- "Scout: explore codebase for [task context]" → assign to scout
- "Planner: draft implementation plan for [task context]" → assign to planner
- "Critic: pre-mortem analysis of [task context]" → assign to critic
- Round 2 tasks (depend on all Round 1 tasks):
- "Prosecutor: challenge Round 1 outputs" → assign to prosecutor-planning
- "All agents: respond to challenges and cross-pollinate findings"
- Round 3 task (depends on Round 2):
- "Planner: produce final revised plan"
- "Critic: state final risk assessment"
- "Prosecutor: provide final verdicts"
After Round 3, synthesize into the final plan document.
```
### Step 2: Round 1 - Independent Analysis (Parallel)
Scout, Planner, and Critic analyze the task 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.
**Why parallel, not sequential:** The Planner's draft plan will miss things the Scout finds - that delta is where the value lives. The Critic can pre-mortem from the task description alone without needing the plan.
### Step 3: Round 2 - Challenge and Cross-pollination (Sequential)
Round 2 tasks automatically unblock when Round 1 completes (via task dependencies).
1. Lead broadcasts all Round 1 outputs to all teammates
2. Prosecutor's plan is approved - it challenges all three agents' work
3. Lead messages each agent individually with the Prosecutor's challenges and each other's outputs:
- **Planner** sees Scout's discoveries (patterns it missed, utilities it reinvented) and Critic's risks (gaps in the draft plan)
- **Critic** sees the actual plan (can identify specific vulnerabilities)
- **Scout** sees the plan (can flag missing exploration areas)
See `./references/planning-debate-protocol.md` for detailed messaging patterns.
### Step 4: Round 3 - Final Outputs
- **Planner** produces a revised plan incorporating all feedback
- **Critic** states final risk assessment (confirmed risks, dismissed risks)
- **Prosecutor** provides final verdicts on all claims
### Step 5: Synthesize
The lead produces the final plan document using the template in `./references/plan-template.md`.
The plan document is designed to be directly consumable by a coding agent. It includes:
1. **Discovery Summary** - Patterns, utilities, and constraints from the Scout
2. **Implementation Plan** - Revised steps from the Planner
3. **Risk Mitigations** - Confirmed risks with mitigations from the Critic
4. **Test Strategy** - Testing approach grounded in existing conventions
## When to Skip
The full 4-agent debate is thorough but costs time and tokens. Use lighter approaches for simpler work:
| Change Type | Approach | Agents | Rounds |
|-------------|----------|--------|--------|
| Complex cross-module, new architecture | Full debate | 4 | 3 |
| Medium complexity, single module | Scout + Planner | 2 | 1 |
| Simple, well-understood | Solo Scout (discovery check) | 1 | 1 |
| Trivial (docs, config) | Skip entirely | 0 | 0 |
## Quick Reference
- **Planning agents:** `../../agents/` (scout, planner, critic, prosecutor-planning)
- **Persona rationale and thinking styles:** `./references/planner-personas.md`
- **Round structure and messaging:** `./references/planning-debate-protocol.md`
- **Final plan template:** `./references/plan-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.