Plan issues using AI debate between Claude (opus) and Codex (gpt-5.2). Best for complex or architectural work requiring deep analysis and multi-round debate.
Plan and create issues for complex work requiring thorough discovery and multi-round collaborative debate.
This command receives context from two sources:
This is a two-phase process: discovery first, then planning with collaborative debate.
Use BOTH approaches for comprehensive discovery:
Use the Explore subagent with "very thorough" setting to understand:
Run a focused Explore query using the verification command discovery process in ../shared/bead-workflow.md (see "Verification Command Discovery" section).
Use the codex MCP tool for additional discovery:
mcp__codex__codex
prompt: "Explore [topic]. Find all relevant code, patterns, edge cases, and potential issues. Report findings comprehensively."
Cross-reference Codex findings with Explore results to ensure nothing is missed.
Before planning, consolidate findings into a brief summary:
This summary becomes the input for Phase 2.
Use multi-round refinement for thorough planning:
Use the Plan subagent to design implementation approach based on discovery synthesis.
Claude (Opus) and Codex debate back-and-forth to refine the plan:
Round 1 - Dual Critique:
mcp__codex__codex:prompt: "Review this implementation plan: [plan]. List 5-10 specific gaps, conflicts, or risks. For each issue: (1) What could break? (2) What assumption might be wrong? (3) Suggest a concrete mitigation."
Round 2 - Address & Counter:
mcp__codex__codex:prompt: "Claude proposes these revisions: [revisions]. For each: (1) Does it actually solve the concern? (2) What breaks if Claude's assumption is wrong? (3) Suggest 1-2 concrete alternatives for weak points."
Round 3 - Final Consensus (skip if Round 2 achieved consensus):
mcp__codex__codex:prompt: "Final plan review: [plan]. Verify: (1) All discovered edge cases addressed or explicitly deferred? (2) Error/failure paths defined? (3) Testing strategy clear? (4) Dependencies sequenced correctly? List any gaps."
Round 4 - Escalation (only if Round 3 has unresolved critical issues):
Before creating issues, confirm:
Read and follow the bead creation process in ../shared/bead-workflow.md. This covers:
After the epic exists (its ID comes back from the Create Epic step), preserve the full debate as a comment on the epic. The conclusions landed in the epic's ## Design Decisions, but the arguments and counterarguments โ why specific tradeoffs were accepted or rejected โ are the reasoning future readers (implementers, reviewers, a later planner revisiting this work) need when judging whether the chosen approach still holds under new context.
Compose the transcript from the debate rounds above, using this structure. Omit rounds that did not run:
# Planning Debate Transcript โ <EPIC_ID>
## Round 1: Dual Critique
### Claude's critique
[verbatim list from Round 1]
### Codex response
[verbatim from mcp__codex__codex output]
### Synthesis
[what overlapped, what was accepted, what was deferred]
## Round 2: Address & Counter
[same shape: Claude's proposed revisions, Codex's counter, synthesis]
## Round 3: Final Consensus
[Claude's refined plan, Codex's validation, any unresolved disagreements]
## Round 4: Escalation
[only if triggered โ the assumption that caused the conflict and the safer path chosen]
## Final consensus
[what was agreed; any points left unresolved and the reason for leaving them]
Write the transcript to /tmp/<EPIC_ID>-debate.md and attach:
br comments add <EPIC_ID> --file /tmp/<EPIC_ID>-debate.md
Skip this step only when the debate was trivial (one round, immediate agreement). Whenever there was real back-and-forth โ disputed edge cases, rejected alternatives, assumptions that had to be re-examined โ attach. A 4-8K-word transcript is typical and manageable as a comment.
After creating and publishing beads, output a clear summary:
Created X bead(s) from AI debate planning (opus + codex):
- bd-xxx: [title] (P2, open)
- bd-xxx: [title] (P2, open, blocked by bd-xxx)
- bd-xxx: [title] - final verification (P2, open, blocked by all above)
Epic: bd-xxx - [epic title]
Design decisions from debate:
- [Decision 1] - Chose X over Y because Z
- [Decision 2] - Deferred Z for future optimization
Ready for implementation.
When discovery or planning reveals blocking issues:
$ARGUMENTS