Plan complex work with collaborative AI debate, create bd issues with dependencies
Plans complex work through collaborative AI debate and creates bd issues with dependencies
/plugin marketplace add abatilo/vimrc/plugin install abatilo-core@abatilo-pluginsoptional focus areaReview the conversation history above to identify work that needs planning. Extract requirements, decisions, and context discussed—these inform the bd issues you create. If the user provided additional instructions below, incorporate those as well.
This is a two-phase process: discovery first, then planning with collaborative debate.
Gather context from the conversation history and find verification commands.
Run a focused Explore query to find exact development commands:
Find the ACTUAL commands used in this project for verification. Search in order:
1. mise.toml / .mise.toml (mise task runner - https://github.com/jdx/mise)
2. package.json scripts / pyproject.toml / Makefile / Justfile
3. .github/workflows (CI jobs are authoritative)
4. docs/CONTRIBUTING.md or README.md
For each category, report the EXACT command string:
- Linting/formatting (e.g., `mise run lint`, `go fmt ./...`)
- Static analysis / type checking (e.g., `mise run check`, `staticcheck ./...`, `golangci-lint run`)
- Unit tests (e.g., `mise run test`, `go test ./...`)
- Scoped E2E tests - run specific tests (e.g., `mise run test:e2e -- -run TestAuth`, `go test ./e2e/... -run TestAuth`)
- Full E2E tests - run entire suite (e.g., `mise run test:e2e`, `go test ./e2e/...`)
Output format: "CATEGORY: [exact command]"
Stop searching a category once you find an authoritative source.
Consolidate findings from conversation history into planning input:
This synthesis becomes the input for Phase 2.
Use multi-round refinement for thorough planning.
Treat planning as a minimization problem. The goal is not to design a comprehensive solution—it's to find the smallest, fastest path to the desired outcome.
Ask at every decision point: "Is there a simpler way?" If the answer is yes, take it.
Use the Plan subagent with model: "opus" to design the minimum viable implementation based on discovery synthesis. The plan should answer: "What is the smallest change that achieves the goal?"
Claude (Opus) and Codex (gpt-5.2-codex) debate back-and-forth to refine the plan. The number of rounds depends on complexity and whether feedback converges:
Round 1 - Dual Critique:
mcp__codex__codex with model "gpt-5.2-codex":
prompt: "Review this implementation plan with a minimization mindset: [plan]. The goal is the smallest, simplest path to the outcome. For each part of the plan: (1) Is this necessary or can it be cut? (2) Is there a simpler approach? (3) What's the minimum viable version? Also list any genuine gaps or risks, with concrete mitigations."
Round 2+ - Address & Counter (repeat until convergence or Round 5):
mcp__codex__codex with model "gpt-5.2-codex":
prompt: "Claude proposes these revisions: [revisions]. Evaluate with a bias toward simplicity: (1) Does this revision add or remove complexity? (2) Is there an even simpler fix? (3) Should this concern be deferred rather than addressed now? Flag any revision that makes the plan bigger rather than smaller."
Final Round - Consensus Check (when exiting):
mcp__codex__codex with model "gpt-5.2-codex":
prompt: "Final minimization check: [plan]. Verify: (1) Is this the smallest possible implementation? (2) Can anything else be cut or deferred? (3) Are there any 'nice to haves' hiding as requirements? (4) Is the testing strategy proportional (not over-tested)? Approve only if the plan is truly minimal."
Before creating issues, confirm:
Create bd issues using the bd-issue-tracking skill. Each issue must:
## Verification
- [ ] `[discovered lint command]` passes
- [ ] `[discovered static analysis command]` passes
- [ ] `[discovered test command]` passes
- [ ] `[discovered scoped e2e command]` passes (if applicable)
Use exact commands from Phase 1 discovery. Omit categories if no command exists.After creating all implementation issues, create one final bd issue to run the full test suite:
Create the issue:
Set up dependencies:
Use bd dep add <final-issue> <implementation-issue> --type blocks for EACH implementation issue.
This ensures the final verification runs only after all implementation work is complete.
Example:
# If implementation issues are bd-001, bd-002, bd-003 and final is bd-004:
bd dep add bd-004 bd-001 --type blocks
bd dep add bd-004 bd-002 --type blocks
bd dep add bd-004 bd-003 --type blocks
IMPORTANT: Every planned task MUST have an epic, even simple single-issue tasks. Workflow automation depends on epic completion tracking. A simple task = one epic with one issue under it.
Goal: Create the smallest shippable units of work. Prefer many small epics over few large ones.
An epic is the right size when:
Before finalizing epics, ask these questions:
File overlap test: Do any two issues modify the same files?
Ship independently test: Can this epic be merged to main without the others?
Value test: Does this epic deliver user-visible value or enable future work?
Parallel work test: Could two developers work on different epics simultaneously without conflicts?
For each epic:
bd create "[epic name]" --type epic --description "$(cat <<'EOF'
# Overview
[Brief description of this epic's scope]
# Why This Is One Epic
[Explain the boundary: what makes this atomic and self-contained?
Why can't it be split further? Why doesn't it need other epics to ship?]
# Implementation Issues
- bd-xxx: [issue title]
- bd-xxx: [issue title]
- bd-xxx: Run verification for this epic
# Files Modified
[List primary files this epic touches—used for conflict detection]
# Verification Commands
- Lint: `[discovered lint command]`
- Static analysis: `[discovered static analysis command]`
- Tests: `[discovered test command]`
- Scoped E2E: `[discovered scoped e2e command]`
- Full E2E: `[discovered full e2e command]`
# Success Criteria
[What "done" looks like for this epic]
EOF
)" --json
Link issues to their epic:
bd dep add bd-xxx <epic-id> --type parent-child
# ... repeat for each issue in this epic
Check progress: bd epic status
When discovery or planning reveals blocking issues:
$ARGUMENTS