Sequence bd epics to minimize merge conflicts and reduce refactor risk
Determines optimal epic execution order to minimize merge conflicts and refactor risk.
/plugin marketplace add abatilo/vimrc/plugin install abatilo-core@abatilo-pluginsoptional epic filterDetermine the optimal execution order for epics to minimize merge conflicts and reduce refactor risk across the project.
When Epic A blocks Epic B, all tasks within Epic B are automatically blocked. This transitive blocking through parent-child relationships means:
Before starting, ensure:
Run these commands to collect the epic inventory:
bd epic status --json # All epics with progress
bd blocked --json # Show blocked issues and their blockers
For each epic, check its dependency tree:
bd dep tree <epic-id> --direction=both --json # See what blocks/is blocked by this epic
What you'll need for Phase 2:
Use Explore subagent (haiku) to predict module impacts for each epic.
Output two things:
Use existing codebase module granularity.
Use mcp__codex__codex (gpt-5.1-codex-mini) to independently verify module predictions:
bd epic status --json and bd show <epic-id> to understand epicsConsolidate findings into a reference document:
**Epic Inventory:**
| Epic ID | Title | Priority | Affected Modules |
|-----------|--------------------|----------|------------------|
| epic-001 | Auth Refactor | P1 | auth, core |
| epic-002 | API Client | P2 | api, core |
**Overlap Map:**
- epic-001 + epic-002: both affect [core]
**Existing Dependencies:**
- epic-001 blocks epic-003 (from bd dep tree / bd blocked)
**Consensus Points:**
- Epics with zero overlaps can be sequenced in any order
- Foundational epics (those with dependents) must come first
Two rounds of debate between Claude and Codex to determine optimal epic order.
Use Plan subagent (haiku) to propose epic sequence.
Constraints (priority order):
blocks dependenciesOutput: Numbered sequence with modules listed, plus rationale for key decisions.
Claude (Haiku) Critique: Identify up to 5 concerns. For each:
Codex Critique:
Use mcp__codex__codex to analyze adjacent pairs:
Synthesis: If 2+ suggestions propose same reordering, mark as high-priority fix.
Claude (Haiku) Revision: Address top 3 concerns only. For each move:
Codex Validation:
Use mcp__codex__codex to verify:
Synthesis:
Before proceeding to Phase 3:
blocks dependencies are respectedFor the final epic sequence, create blocks dependencies:
# Example: If final sequence is epic-A → epic-B → epic-C
bd dep add epic-A epic-B --type blocks # epic-A blocks epic-B
bd dep add epic-B epic-C --type blocks # epic-B blocks epic-C
Critical reminder: In bd dep add A B --type blocks, A blocks B (A must complete before B starts).
What happens automatically:
bd ready --json # Show ready work
bd blocked --json # Show blocked issues
bd epic status --json # Show epic blocking relationships
Expected result:
$ARGUMENTS