Skip to content

Commit 1ad1f91

Browse files
authored
feat(workflows): add brownfield epic scoping to detect file churn (#1823) (#1826)
Add design completeness gate, file overlap check, and validation to prevent unnecessary file churn when epics target the same component.
1 parent 350688d commit 1ad1f91

2 files changed

Lines changed: 40 additions & 4 deletions

File tree

src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-02-design-epics.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ Load {planning_artifacts}/epics.md and review:
5555
2. **Requirements Grouping**: Group related FRs that deliver cohesive user outcomes
5656
3. **Incremental Delivery**: Each epic should deliver value independently
5757
4. **Logical Flow**: Natural progression from user's perspective
58-
5. **🔗 Dependency-Free Within Epic**: Stories within an epic must NOT depend on future stories
58+
5. **Dependency-Free Within Epic**: Stories within an epic must NOT depend on future stories
59+
6. **Implementation Efficiency**: Consider consolidating epics that all modify the same core files into fewer epics
5960

6061
**⚠️ CRITICAL PRINCIPLE:**
6162
Organize by USER VALUE, not technical layers:
@@ -74,6 +75,18 @@ Organize by USER VALUE, not technical layers:
7475
- Epic 3: Frontend Components (creates reusable components) - **No user value**
7576
- Epic 4: Deployment Pipeline (CI/CD setup) - **No user value**
7677

78+
**❌ WRONG Epic Examples (File Churn on Same Component):**
79+
80+
- Epic 1: File Upload (modifies model, controller, web form, web API)
81+
- Epic 2: File Status (modifies model, controller, web form, web API)
82+
- Epic 3: File Access permissions (modifies model, controller, web form, web API)
83+
- All three epics touch the same files — consolidate into one epic with ordered stories
84+
85+
**✅ CORRECT Alternative:**
86+
87+
- Epic 1: File Management Enhancement (upload, status, permissions as stories within one epic)
88+
- Rationale: Single component, fully pre-designed, no feedback loop between epics
89+
7790
**🔗 DEPENDENCY RULES:**
7891

7992
- Each epic must deliver COMPLETE functionality for its domain
@@ -82,21 +95,38 @@ Organize by USER VALUE, not technical layers:
8295

8396
### 3. Design Epic Structure Collaboratively
8497

85-
**Step A: Identify User Value Themes**
98+
**Step A: Assess Context and Identify Themes**
99+
100+
First, assess how much of the solution design is already validated (Architecture, UX, Test Design).
101+
When the outcome is certain and direction changes between epics are unlikely, prefer fewer but larger epics.
102+
Split into multiple epics when there is a genuine risk boundary or when early feedback could change direction
103+
of following epics.
104+
105+
Then, identify user value themes:
86106

87107
- Look for natural groupings in the FRs
88108
- Identify user journeys or workflows
89109
- Consider user types and their goals
90110

91111
**Step B: Propose Epic Structure**
92-
For each proposed epic:
112+
113+
For each proposed epic (considering whether epics share the same core files):
93114

94115
1. **Epic Title**: User-centric, value-focused
95116
2. **User Outcome**: What users can accomplish after this epic
96117
3. **FR Coverage**: Which FR numbers this epic addresses
97118
4. **Implementation Notes**: Any technical or UX considerations
98119

99-
**Step C: Create the epics_list**
120+
**Step C: Review for File Overlap**
121+
122+
Assess whether multiple proposed epics repeatedly target the same core files. If overlap is significant:
123+
124+
- Distinguish meaningful overlap (same component end-to-end) from incidental sharing
125+
- Ask whether to consolidate into one epic with ordered stories
126+
- If confirmed, merge the epic FRs into a single epic, preserving dependency flow: each story must still fit within
127+
a single dev agent's context
128+
129+
**Step D: Create the epics_list**
100130

101131
Format the epics_list as:
102132

src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-04-final-validation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ Review the complete epic and story breakdown to ensure EVERY FR is covered:
9090
- Dependencies flow naturally
9191
- Foundation stories only setup what's needed
9292
- No big upfront technical work
93+
- **File Churn Check:** Do multiple epics repeatedly modify the same core files?
94+
- Assess whether the overlap pattern suggests unnecessary churn or is incidental
95+
- If overlap is significant: Validate that splitting provides genuine value (risk mitigation, feedback loops, context size limits)
96+
- If no justification for the split: Recommend consolidation into fewer epics
97+
- ❌ WRONG: Multiple epics each modify the same core files with no feedback loop between them
98+
- ✅ RIGHT: Epics target distinct files/components, OR consolidation was explicitly considered and rejected with rationale
9399

94100
### 5. Dependency Validation (CRITICAL)
95101

0 commit comments

Comments
 (0)