bmad-method 6.0.0-alpha.4 → 6.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/.claude/commands/bmad/bmm/agents/architect.md +0 -1
  2. package/.claude/commands/bmad/bmm/agents/sm.md +1 -1
  3. package/.claude/commands/bmad/bmm/agents/tech-writer.md +82 -0
  4. package/.claude/commands/bmad/bmm/workflows/README.md +1 -1
  5. package/.claude/commands/bmad/bmm/workflows/epic-tech-context.md +15 -0
  6. package/.claude/commands/bmad/core/workflows/README.md +10 -0
  7. package/.claude/settings.local.json +4 -8
  8. package/CHANGELOG.md +305 -0
  9. package/README.md +88 -39
  10. package/bmad/_cfg/agent-manifest.csv +2 -1
  11. package/bmad/_cfg/agents/bmm-tech-writer.customize.yaml +42 -0
  12. package/bmad/_cfg/files-manifest.csv +40 -62
  13. package/bmad/_cfg/ides/claude-code.yaml +1 -1
  14. package/bmad/_cfg/manifest.yaml +4 -3
  15. package/bmad/_cfg/task-manifest.csv +4 -1
  16. package/bmad/_cfg/tool-manifest.csv +1 -0
  17. package/bmad/_cfg/workflow-manifest.csv +3 -1
  18. package/bmad/bmb/config.yaml +2 -2
  19. package/bmad/bmb/workflows/audit-workflow/instructions.md +1 -1
  20. package/bmad/bmm/README.md +79 -120
  21. package/bmad/bmm/README.md.bak +169 -0
  22. package/bmad/bmm/agents/analyst.md.bak +67 -0
  23. package/bmad/bmm/agents/architect.md +0 -1
  24. package/bmad/bmm/agents/architect.md.bak +73 -0
  25. package/bmad/bmm/agents/dev.md.bak +69 -0
  26. package/bmad/bmm/agents/pm.md.bak +76 -0
  27. package/bmad/bmm/agents/sm.md +1 -1
  28. package/bmad/bmm/agents/sm.md.bak +85 -0
  29. package/bmad/bmm/agents/tea.md.bak +72 -0
  30. package/bmad/bmm/agents/tech-writer.md +82 -0
  31. package/bmad/bmm/agents/ux-designer.md.bak +71 -0
  32. package/bmad/bmm/config.yaml +2 -2
  33. package/bmad/bmm/docs/README.md +235 -0
  34. package/bmad/bmm/docs/agents-guide.md +1057 -0
  35. package/bmad/bmm/docs/brownfield-guide.md +471 -972
  36. package/bmad/bmm/docs/enterprise-agentic-development.md +680 -0
  37. package/bmad/bmm/docs/faq.md +589 -0
  38. package/bmad/bmm/docs/glossary.md +321 -0
  39. package/bmad/bmm/docs/party-mode.md +224 -0
  40. package/bmad/bmm/docs/quick-spec-flow.md +64 -57
  41. package/bmad/bmm/docs/quick-start.md +72 -47
  42. package/bmad/bmm/docs/scale-adaptive-system.md +332 -778
  43. package/bmad/bmm/docs/troubleshooting.md +680 -0
  44. package/bmad/bmm/{workflows/3-solutioning/architecture/README.md → docs/workflow-architecture-reference.md} +130 -77
  45. package/bmad/bmm/{workflows/document-project/README.md → docs/workflow-document-project-reference.md} +45 -2
  46. package/bmad/bmm/docs/workflows-analysis.md +670 -0
  47. package/bmad/bmm/docs/workflows-implementation.md +1758 -0
  48. package/bmad/bmm/docs/workflows-planning.md +1086 -0
  49. package/bmad/bmm/docs/workflows-solutioning.md +726 -0
  50. package/bmad/bmm/tasks/daily-standup.xml +1 -1
  51. package/bmad/bmm/workflows/2-plan-workflows/tech-spec/workflow.yaml.bak +60 -0
  52. package/bmad/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml +1 -1
  53. package/bmad/bmm/workflows/techdoc/documentation-standards.md +2 -1
  54. package/bmad/bmm/workflows/techdoc/documentation-standards.md.bak +238 -0
  55. package/bmad/bmm/workflows/workflow-status/init/instructions.md +623 -242
  56. package/bmad/bmm/workflows/workflow-status/init/workflow.yaml.bak +27 -0
  57. package/bmad/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +120 -0
  58. package/bmad/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +108 -0
  59. package/{src/modules/bmm/workflows/workflow-status/paths/brownfield-level-3.yaml → bmad/bmm/workflows/workflow-status/paths/method-brownfield.yaml} +33 -31
  60. package/{src/modules/bmm/workflows/workflow-status/paths/greenfield-level-2.yaml → bmad/bmm/workflows/workflow-status/paths/method-greenfield.yaml} +31 -21
  61. package/{src/modules/bmm/workflows/workflow-status/paths/brownfield-level-1.yaml → bmad/bmm/workflows/workflow-status/paths/quick-flow-brownfield.yaml} +18 -18
  62. package/bmad/bmm/workflows/workflow-status/paths/{greenfield-level-1.yaml → quick-flow-greenfield.yaml} +16 -18
  63. package/bmad/bmm/workflows/workflow-status/workflow-status-template.yaml +4 -4
  64. package/bmad/cis/agents/brainstorming-coach.md.bak +62 -0
  65. package/bmad/cis/agents/creative-problem-solver.md.bak +62 -0
  66. package/bmad/cis/agents/design-thinking-coach.md.bak +62 -0
  67. package/bmad/cis/agents/innovation-strategist.md.bak +62 -0
  68. package/bmad/cis/agents/storyteller.md.bak +59 -0
  69. package/bmad/cis/config.yaml +2 -2
  70. package/bmad/core/agents/bmad-master.md.bak +15 -13
  71. package/bmad/core/config.yaml +2 -2
  72. package/bmad/core/tasks/workflow.xml +1 -11
  73. package/package.json +1 -1
  74. package/src/core/tasks/workflow.xml +1 -11
  75. package/src/modules/bmb/workflows/audit-workflow/instructions.md +1 -1
  76. package/src/modules/bmm/README.md +1 -1
  77. package/src/modules/bmm/agents/architect.agent.yaml +0 -4
  78. package/src/modules/bmm/agents/game-dev.agent.yaml +8 -12
  79. package/src/modules/bmm/agents/sm.agent.yaml +1 -1
  80. package/src/modules/bmm/agents/{paige.agent.yaml → tech-writer.agent.yaml} +4 -4
  81. package/src/modules/bmm/docs/README.md +9 -9
  82. package/src/modules/bmm/docs/agents-guide.md +46 -98
  83. package/src/modules/bmm/docs/brownfield-guide.md +211 -90
  84. package/src/modules/bmm/docs/enterprise-agentic-development.md +380 -740
  85. package/src/modules/bmm/docs/faq.md +10 -10
  86. package/src/modules/bmm/docs/glossary.md +36 -42
  87. package/src/modules/bmm/docs/party-mode.md +110 -1122
  88. package/src/modules/bmm/docs/quick-spec-flow.md +33 -33
  89. package/src/modules/bmm/docs/quick-start.md +29 -29
  90. package/src/modules/bmm/docs/scale-adaptive-system.md +303 -453
  91. package/src/modules/bmm/docs/troubleshooting.md +1 -1
  92. package/src/modules/bmm/docs/workflows-implementation.md +20 -21
  93. package/src/modules/bmm/docs/workflows-solutioning.md +1 -1
  94. package/src/modules/bmm/tasks/daily-standup.xml +1 -1
  95. package/src/modules/bmm/workflows/2-plan-workflows/create-ux-design/instructions.md +1 -19
  96. package/src/modules/bmm/workflows/2-plan-workflows/prd/checklist.md +10 -9
  97. package/src/modules/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/epics-template.md +23 -34
  98. package/src/modules/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/instructions.md +105 -331
  99. package/src/modules/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/workflow.yaml +23 -11
  100. package/src/modules/bmm/workflows/2-plan-workflows/prd/instructions.md +23 -38
  101. package/src/modules/bmm/workflows/2-plan-workflows/prd/workflow.yaml +2 -2
  102. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/epics-template.md +38 -16
  103. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/instructions.md +1 -19
  104. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/user-story-template.md +35 -32
  105. package/src/modules/bmm/workflows/2-plan-workflows/tech-spec/workflow.yaml +2 -2
  106. package/src/modules/bmm/workflows/3-solutioning/architecture/instructions.md +7 -18
  107. package/src/modules/bmm/workflows/3-solutioning/solutioning-gate-check/instructions.md +1 -18
  108. package/src/modules/bmm/workflows/3-solutioning/solutioning-gate-check/workflow.yaml +6 -6
  109. package/src/modules/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml +1 -1
  110. package/src/modules/bmm/workflows/techdoc/documentation-standards.md +1 -1
  111. package/src/modules/bmm/workflows/workflow-status/init/instructions.md +623 -242
  112. package/src/modules/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +120 -0
  113. package/src/modules/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +108 -0
  114. package/{bmad/bmm/workflows/workflow-status/paths/brownfield-level-3.yaml → src/modules/bmm/workflows/workflow-status/paths/method-brownfield.yaml} +33 -31
  115. package/{bmad/bmm/workflows/workflow-status/paths/greenfield-level-2.yaml → src/modules/bmm/workflows/workflow-status/paths/method-greenfield.yaml} +31 -21
  116. package/{bmad/bmm/workflows/workflow-status/paths/brownfield-level-1.yaml → src/modules/bmm/workflows/workflow-status/paths/quick-flow-brownfield.yaml} +18 -18
  117. package/src/modules/bmm/workflows/workflow-status/paths/{greenfield-level-1.yaml → quick-flow-greenfield.yaml} +16 -18
  118. package/src/modules/bmm/workflows/workflow-status/workflow-status-template.yaml +4 -4
  119. package/bmad/bmm/tasks/retrospective.xml +0 -104
  120. package/bmad/bmm/testarch/README.md +0 -311
  121. package/bmad/bmm/workflows/1-analysis/brainstorm-project/README.md +0 -113
  122. package/bmad/bmm/workflows/1-analysis/product-brief/README.md +0 -180
  123. package/bmad/bmm/workflows/1-analysis/research/README.md +0 -454
  124. package/bmad/bmm/workflows/2-plan-workflows/README.md +0 -258
  125. package/bmad/bmm/workflows/3-solutioning/README.md +0 -1
  126. package/bmad/bmm/workflows/3-solutioning/solutioning-gate-check/README.md +0 -177
  127. package/bmad/bmm/workflows/4-implementation/README.md +0 -221
  128. package/bmad/bmm/workflows/4-implementation/code-review/README.md +0 -69
  129. package/bmad/bmm/workflows/4-implementation/correct-course/README.md +0 -73
  130. package/bmad/bmm/workflows/4-implementation/create-story/README.md +0 -146
  131. package/bmad/bmm/workflows/4-implementation/dev-story/README.md +0 -206
  132. package/bmad/bmm/workflows/4-implementation/epic-tech-context/README.md +0 -195
  133. package/bmad/bmm/workflows/4-implementation/retrospective/README.md +0 -77
  134. package/bmad/bmm/workflows/4-implementation/sprint-planning/README.md +0 -156
  135. package/bmad/bmm/workflows/4-implementation/story-context/README.md +0 -234
  136. package/bmad/bmm/workflows/README.md +0 -256
  137. package/bmad/bmm/workflows/document-project/templates/README.md +0 -38
  138. package/bmad/bmm/workflows/testarch/README.md +0 -26
  139. package/bmad/bmm/workflows/testarch/atdd/README.md +0 -672
  140. package/bmad/bmm/workflows/testarch/automate/README.md +0 -869
  141. package/bmad/bmm/workflows/testarch/ci/README.md +0 -493
  142. package/bmad/bmm/workflows/testarch/framework/README.md +0 -340
  143. package/bmad/bmm/workflows/testarch/nfr-assess/README.md +0 -469
  144. package/bmad/bmm/workflows/testarch/test-design/README.md +0 -493
  145. package/bmad/bmm/workflows/testarch/test-review/README.md +0 -775
  146. package/bmad/bmm/workflows/testarch/trace/README.md +0 -802
  147. package/bmad/bmm/workflows/workflow-status/README.md +0 -260
  148. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-0.yaml +0 -54
  149. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-2.yaml +0 -76
  150. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-4.yaml +0 -88
  151. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-0.yaml +0 -45
  152. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-3.yaml +0 -73
  153. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-4.yaml +0 -75
  154. package/src/modules/bmm/docs/brownfield-guide.md.backup +0 -1324
  155. package/src/modules/bmm/docs/workflows-testing.md +0 -1572
  156. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-0.yaml +0 -54
  157. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-2.yaml +0 -76
  158. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-4.yaml +0 -88
  159. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-0.yaml +0 -45
  160. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-3.yaml +0 -73
  161. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-4.yaml +0 -75
  162. /package/bmad/bmm/agents/{paige.md → paige.md.bak} +0 -0
@@ -1,799 +1,398 @@
1
1
  # BMad Method Brownfield Development Guide
2
2
 
3
- ## Overview
3
+ **Complete guide for working with existing codebases**
4
4
 
5
- This guide provides comprehensive guidance for using BMad Method v6 with existing codebases (brownfield projects). Whether you're fixing a single bug, adding a small feature, or implementing a major system expansion, BMad Method adapts to your project's complexity while ensuring AI agents have the context they need to work effectively.
5
+ **Reading Time:** ~35 minutes
6
6
 
7
- **Core Principle:** In brownfield development, producing contextual artifacts for agents is paramount. AI agents require comprehensive documentation to understand existing patterns, constraints, and integration points before they can effectively plan or implement changes.
8
-
9
- ## What is Brownfield Development?
7
+ ---
10
8
 
11
- Brownfield projects involve working within existing codebases rather than starting fresh. This includes:
9
+ ## Quick Navigation
12
10
 
13
- - **Bug fixes** - Single file changes to resolve issues
14
- - **Small features** - Adding functionality to existing modules
15
- - **Feature sets** - Multiple related features across several areas
16
- - **Major integrations** - Complex additions requiring architectural changes
17
- - **System expansions** - Enterprise-scale enhancements to existing platforms
11
+ **Jump to:**
18
12
 
19
- The key difference from greenfield development: you must understand and respect existing patterns, architecture, and constraints.
13
+ - [Quick Reference](#quick-reference) - Commands and files
14
+ - [Common Scenarios](#common-scenarios) - Real-world examples
15
+ - [Troubleshooting](#troubleshooting) - Problem solutions
16
+ - [Best Practices](#best-practices) - Success tips
20
17
 
21
- ## Scale-Adaptive Workflow System
18
+ ---
22
19
 
23
- BMad Method v6 uses a **scale-adaptive** approach that automatically routes brownfield projects through appropriate workflows based on complexity:
20
+ ## What is Brownfield Development?
24
21
 
25
- ### Brownfield Complexity Levels
22
+ Brownfield projects involve working within existing codebases rather than starting fresh:
26
23
 
27
- | Level | Scope | Story Count | Workflow Approach | Documentation Depth |
28
- | ----- | ---------------------- | ------------- | ---------------------------------------- | ------------------------------------------------------ |
29
- | **0** | Single atomic change | 1 story | Lightweight tech-spec only | Quick understanding of affected area |
30
- | **1** | Small feature addition | 1-10 stories | Tech-spec with epic breakdown | Focused documentation of integration points |
31
- | **2** | Medium feature set | 5-15 stories | PRD + tech-spec | Comprehensive docs for affected systems |
32
- | **3** | Complex integration | 12-40 stories | PRD → architecture → implementation | Full system documentation + integration planning |
33
- | **4** | Enterprise expansion | 40+ stories | Full methodology with strategic planning | Complete codebase documentation + architectural review |
24
+ - **Bug fixes** - Single file changes
25
+ - **Small features** - Adding to existing modules
26
+ - **Feature sets** - Multiple related features
27
+ - **Major integrations** - Complex architectural additions
28
+ - **System expansions** - Enterprise-scale enhancements
34
29
 
35
- ### How Scale Determination Works
30
+ **Key Difference from Greenfield:** You must understand and respect existing patterns, architecture, and constraints.
36
31
 
37
- When you run `workflow-init`, it asks about YOUR work first, then uses existing artifacts as context:
32
+ **Core Principle:** AI agents need comprehensive documentation to understand existing code before they can effectively plan or implement changes.
38
33
 
39
- #### Step 1: Understand What You're Working On
34
+ ---
40
35
 
41
- The workflow asks you first:
36
+ ## Getting Started
42
37
 
43
- 1. **Project name**: "What's your project called?"
38
+ ### Understanding Planning Tracks
44
39
 
45
- 2. **If it finds existing work** (code or planning documents):
46
- - Shows what it found (PRD, epics, stories, codebase)
47
- - Asks a clear question:
40
+ For complete track details, see [Scale Adaptive System](./scale-adaptive-system.md).
48
41
 
49
- > **"Looking at what I found, are these:**
50
- >
51
- > a) **Works in progress you're finishing** - continuing the work described in these documents
52
- > b) **Documents from a previous effort** - you're starting something NEW and different now
53
- > c) **The proposed work you're about to start** - these describe what you want to do
54
- > d) **None of these** - let me explain what I'm actually working on"
42
+ **Brownfield tracks at a glance:**
55
43
 
56
- **If you choose (a) or (c):** System analyzes the artifacts to get project details
57
- **If you choose (b) or (d):** System asks you to describe your NEW work
44
+ | Track | Scope | Typical Stories | Key Difference |
45
+ | --------------------- | -------------------------- | --------------- | ----------------------------------------------- |
46
+ | **Quick Flow** | Bug fixes, small features | 1-15 | Must understand affected code and patterns |
47
+ | **BMad Method** | Feature sets, integrations | 10-50+ | Integrate with existing architecture |
48
+ | **Enterprise Method** | Enterprise expansions | 30+ | Full system documentation + compliance required |
58
49
 
59
- 3. **Asks about your work**: "Tell me about what you're working on. What's the goal?"
50
+ **Note:** Story counts are guidance, not definitions. Tracks are chosen based on planning needs.
60
51
 
61
- 4. **Analyzes your description** using keyword detection:
52
+ ### Track Selection for Brownfield
62
53
 
63
- **Level 0 Keywords:** "fix", "bug", "typo", "small change", "update", "patch"
64
- **Level 1 Keywords:** "simple", "basic", "small feature", "add", "minor"
65
- **Level 2 Keywords:** "dashboard", "several features", "admin panel", "medium"
66
- **Level 3 Keywords:** "platform", "integration", "complex", "system"
67
- **Level 4 Keywords:** "enterprise", "multi-tenant", "multiple products", "ecosystem"
54
+ When you run `workflow-init`, it handles brownfield intelligently:
68
55
 
69
- **Examples:**
56
+ **Step 1: Shows what it found**
70
57
 
71
- - "I need to update payment method enums" → **Level 0**
72
- - "Adding forgot password feature" → **Level 1**
73
- - "Building admin dashboard with analytics" → **Level 2**
74
- - "Adding real-time collaboration to document editor" → **Level 3**
75
- - "Implementing multi-tenancy across our SaaS" → **Level 4**
58
+ - Old planning docs (PRD, epics, stories)
59
+ - Existing codebase
76
60
 
77
- 5. **Suggests and confirms**: "Based on your description: Level X brownfield project. Is that correct?"
61
+ **Step 2: Asks about YOUR work**
78
62
 
79
- #### How It Handles Old Artifacts
63
+ > "Are these works in progress, previous effort, or proposed work?"
80
64
 
81
- **Scenario: Old Level 3 PRD, New Level 0 Work**
65
+ - **(a) Works in progress** Uses artifacts to determine level
66
+ - **(b) Previous effort** → Asks you to describe NEW work
67
+ - **(c) Proposed work** → Uses artifacts as guidance
68
+ - **(d) None of these** → You explain your work
82
69
 
83
- ```
84
- System: "I found: PRD.md (Level 3, 30 stories, modified 6 months ago)"
85
- System: "Are these works in progress you're finishing, or documents from a previous effort?"
70
+ **Step 3: Analyzes your description**
86
71
 
87
- You: "b - Documents from a previous effort"
72
+ - Keywords: "fix", "bug" Quick Flow, "dashboard", "platform" → BMad Method, "enterprise", "multi-tenant" → Enterprise Method
73
+ - Complexity assessment
74
+ - Confirms suggested track with you
88
75
 
89
- System: "Tell me about what you're working on"
90
- You: "I need to update payment method enums"
76
+ **Key Principle:** System asks about YOUR current work first, uses old artifacts as context only.
91
77
 
92
- System: "Level 0 brownfield project. Is that correct?"
93
- You: "yes"
78
+ **Example: Old Complex PRD, New Simple Work**
94
79
 
95
- ✅ Result: Level 0 workflow
96
80
  ```
97
-
98
- **Key Principle:** The system asks about YOUR current work first, then uses old artifacts as context, not as the primary source of truth.
99
-
100
- ## The Five Phases of Brownfield Development
101
-
102
- ### Phase 0: Documentation (Conditional)
103
-
104
- Phase 0 has three possible scenarios based on your existing documentation state:
105
-
106
- #### Scenario A: No Documentation
107
-
108
- **When:** Codebase lacks adequate documentation for AI agents
109
- **Action:** Run `document-project` workflow to create comprehensive documentation from scratch
110
-
111
- #### Scenario B: Documentation Exists, But No Index
112
-
113
- **When:** You have README, architecture docs, or other documentation BUT no `index.md` (master AI retrieval source)
114
- **Action:** Run the `index-docs` task to generate `index.md` from existing documentation
115
-
116
- **The `index-docs` Task** (from `bmad/core/tasks/index-docs.xml`):
117
-
118
- - Scans your documentation directory
119
- - Reads each file to understand its purpose
120
- - Creates organized `index.md` with file listings and descriptions
121
- - Provides structured navigation for AI agents
122
- - Lightweight and fast (just indexes, doesn't scan codebase)
123
-
124
- **Why This Matters:** The `index.md` file is the primary entry point for AI agents. Without it, agents must hunt through multiple files. Even with good existing docs, the index provides structured navigation and ensures agents can quickly find relevant context.
125
-
126
- **When to Use `document-project` Instead:**
127
- If your existing docs are inadequate or you need comprehensive codebase analysis:
128
-
129
- - Use `document-project` workflow with appropriate scan level (deep/exhaustive)
130
- - It will discover your existing docs in Step 2 and show them to you
131
- - It will generate NEW documentation from codebase analysis
132
- - Final `index.md` will link to BOTH existing docs AND newly generated docs
133
- - Result: Comprehensive documentation combining your existing docs with AI-friendly codebase analysis
134
-
135
- #### Scenario C: Complete Documentation with Index
136
-
137
- **When:** You have comprehensive documentation including `docs/index.md`
138
- **Action:** Skip Phase 0 entirely and proceed to Phase 1 or Phase 2
139
-
140
- #### The `document-project` Workflow
141
-
142
- This critical workflow analyzes and documents your existing codebase:
143
-
144
- **What It Does:**
145
-
146
- - Detects project type (web, backend, mobile, CLI, etc.)
147
- - Identifies tech stack and dependencies
148
- - Analyzes architecture patterns
149
- - Documents API routes and data models
150
- - Maps component structure
151
- - Extracts development workflows
152
- - **NEW:** Can incorporate existing documentation and generate master index
153
-
154
- **Three Scan Levels:**
155
-
156
- 1. **Quick Scan** (2-5 min) - Pattern-based analysis without reading source
157
- - Use for: Fast project overview, initial understanding, index generation
158
- - Reads: Config files, manifests, directory structure, existing docs
159
-
160
- 2. **Deep Scan** (10-30 min) - Reads critical directories
161
- - Use for: Brownfield PRD preparation, focused analysis
162
- - Reads: Key paths based on project type (controllers, models, components)
163
- - Incorporates: Existing documentation as input
164
-
165
- 3. **Exhaustive Scan** (30-120 min) - Reads ALL source files
166
- - Use for: Migration planning, complete system understanding
167
- - Reads: Every source file (excludes node_modules, dist, .git)
168
- - Incorporates: All existing documentation
169
-
170
- **Output Files:**
171
-
172
- - `index.md` - Master documentation index (primary AI retrieval source)
173
- - `project-overview.md` - Executive summary
174
- - `architecture.md` - Detailed architecture analysis
175
- - `source-tree-analysis.md` - Annotated directory structure
176
- - `api-contracts.md` - API documentation (if applicable)
177
- - `data-models.md` - Database schemas (if applicable)
178
- - Additional conditional files based on project type
179
-
180
- **Working with Existing Documentation:**
181
-
182
- If you have existing docs (README, ARCHITECTURE.md, CONTRIBUTING.md, etc.) you have two options:
183
-
184
- **Option 1: Just need an index (`index-docs` task)**
185
-
186
- - Fast, lightweight approach
187
- - Run the `index-docs` task from `bmad/core/tasks/index-docs.xml`
188
- - Scans your docs directory and generates organized `index.md`
189
- - Reads each file to create accurate descriptions
190
- - Links to all existing documentation
191
- - Perfect when docs are good but need structured navigation for AI agents
192
-
193
- **Option 2: Need comprehensive codebase documentation (`document-project` workflow)**
194
-
195
- - Scans the actual codebase to generate technical documentation
196
- - Discovers existing docs (README, ARCHITECTURE.md, etc.) in Step 2
197
- - Shows you what it found and asks for additional context
198
- - Generates NEW documentation files from codebase analysis:
199
- - `project-overview.md` - Executive summary from codebase
200
- - `architecture.md` - Architecture analysis from code
201
- - `api-contracts.md` - API documentation from routes/controllers
202
- - `data-models.md` - Database schemas from models
203
- - `source-tree-analysis.md` - Annotated directory structure
204
- - Creates `index.md` that links to BOTH existing docs AND newly generated docs
205
- - Complements your existing documentation with AI-friendly codebase analysis
206
-
207
- **Deep-Dive Mode:** If you already have documentation but need exhaustive analysis of a specific area (e.g., authentication system, dashboard module), you can run the workflow in deep-dive mode to create comprehensive documentation for just that subsystem.
208
-
209
- **Example Usage:**
210
-
211
- ```bash
212
- # Scenario A: No documentation
213
- bmad analyst workflow-status
214
- # → Directs to document-project
215
- bmad analyst document-project
216
- # → Choose: Deep scan (recommended for brownfield)
217
-
218
- # Scenario B: Has docs but no index
219
- # Option 1: Just generate index from existing docs
220
- # Run the index-docs task directly (lightweight, fast)
221
- # Load bmad/core/tasks/index-docs.xml
222
- # Specify your docs directory (e.g., ./docs)
223
-
224
- # Option 2: Need comprehensive codebase docs too
225
- bmad analyst document-project
226
- # → Choose: Deep or Exhaustive scan
227
- # → Creates index.md AND additional codebase documentation
228
-
229
- # Scenario C: Complete with index
230
- bmad analyst workflow-status
231
- # → Skips Phase 0, proceeds to Phase 1 or 2
81
+ System: "Found PRD.md (BMad Method track, 30 stories, 6 months old)"
82
+ System: "Is this work in progress or previous effort?"
83
+ You: "Previous effort - I'm just fixing a bug now"
84
+ System: "Tell me about your current work"
85
+ You: "Update payment method enums"
86
+ System: "Quick Flow track (tech-spec approach). Correct?"
87
+ You: "Yes"
88
+ Creates Quick Flow workflow
232
89
  ```
233
90
 
234
- ### Phase 1: Analysis (Optional)
235
-
236
- **Purpose:** Explore solutions and gather context before formal planning.
237
-
238
- **Available Workflows:**
239
-
240
- - `brainstorm-project` - Solution exploration for new features
241
- - `research` - Market/technical research for decision-making
242
- - `product-brief` - Strategic product planning document
243
-
244
- **When to Use:**
245
-
246
- - Complex features requiring multiple solution approaches
247
- - Technical decisions needing research (frameworks, patterns, tools)
248
- - Strategic additions requiring business context
249
-
250
- **When to Skip:**
251
-
252
- - Bug fixes or minor changes with obvious solutions
253
- - Well-understood features with clear requirements
254
- - Time-sensitive changes where planning overhead isn't justified
255
-
256
- ### Phase 2: Planning (Required)
257
-
258
- **Purpose:** Create formal requirements and break down work into epics and stories.
259
-
260
- The planning approach adapts to your brownfield project's complexity:
261
-
262
- #### Level 0: Single Atomic Change
263
-
264
- **Workflow:** `tech-spec` only
265
- **Outputs:** `tech-spec.md` + single story file
266
- **Next Phase:** → Implementation (Phase 4)
267
-
268
- **Use For:**
269
-
270
- - Bug fixes
271
- - Single file changes
272
- - Minor configuration updates
273
- - Small refactors
274
-
275
- **Key Considerations:**
276
-
277
- - Must understand existing pattern in affected file
278
- - Document integration points
279
- - Identify potential side effects
280
-
281
- **Example:** Fixing authentication token expiration bug in auth middleware
282
-
283
- #### Level 1: Small Feature
284
-
285
- **Workflow:** `tech-spec` only
286
- **Outputs:** `tech-spec.md` + epic breakdown + 2-10 story files
287
- **Next Phase:** → Implementation (Phase 4)
288
-
289
- **Use For:**
290
-
291
- - Single module additions
292
- - Small UI enhancements
293
- - Isolated feature additions
294
- - API endpoint additions
295
-
296
- **Key Considerations:**
297
-
298
- - Identify reusable existing components
299
- - Respect current architectural patterns
300
- - Plan integration with existing APIs/services
301
-
302
- **Example:** Adding "forgot password" feature to existing auth system
303
-
304
- #### Level 2: Medium Feature Set
305
-
306
- **Workflow:** `prd` → `tech-spec`
307
- **Outputs:** `PRD.md` + `epics.md` + `tech-spec.md`
308
- **Next Phase:** → Implementation (Phase 4)
309
-
310
- **Use For:**
311
-
312
- - Multiple related features
313
- - Cross-module enhancements
314
- - Moderate scope additions
315
- - Feature sets spanning 1-2 areas
316
-
317
- **Key Considerations:**
318
-
319
- - Document all integration points
320
- - Map dependencies to existing systems
321
- - Identify shared components for reuse
322
- - Plan migration strategy if changing patterns
323
-
324
- **Special Note:** Level 2 uses `tech-spec` instead of full architecture workflow to keep planning lightweight while still providing adequate technical guidance.
325
-
326
- **Example:** Adding user dashboard with analytics, preferences, and activity history
327
-
328
- #### Level 3: Complex Integration
91
+ ---
329
92
 
330
- **Workflow:** `prd` `create-architecture` implementation
331
- **Outputs:** `PRD.md` + `epics.md` + `architecture.md` (extension of existing)
332
- **Next Phase:** → Solutioning (Phase 3) → Implementation (Phase 4)
93
+ ## Phase 0: Documentation (Critical First Step)
333
94
 
334
- **Use For:**
95
+ 🚨 **For brownfield projects: Always ensure adequate AI-usable documentation before planning**
335
96
 
336
- - Major feature additions
337
- - Architectural integrations
338
- - Multi-system changes
339
- - Complex data migrations
97
+ ### Default Recommendation: Run document-project
340
98
 
341
- **Key Considerations:**
99
+ **Best practice:** Run `document-project` workflow unless you have **confirmed, trusted, AI-optimized documentation**.
342
100
 
343
- - Review existing architecture first
344
- - Plan integration strategy
345
- - Document architectural extensions
346
- - Identify migration paths
347
- - Plan backward compatibility
101
+ ### Why Document-Project is Almost Always the Right Choice
348
102
 
349
- **Phase 3 Workflows:**
103
+ Existing documentation often has quality issues that break AI workflows:
350
104
 
351
- - `architecture-review` - Review existing architecture first
352
- - `integration-planning` - Create integration strategy document
353
- - `create-architecture` - Extend existing architecture documentation
354
- - `solutioning-gate-check` - Validate architecture before implementation
105
+ **Common Problems:**
355
106
 
356
- **Example:** Adding real-time collaboration features to existing document editor
107
+ - **Too Much Information (TMI):** Massive markdown files with 10s or 100s of level 2 sections
108
+ - **Out of Date:** Documentation hasn't been updated with recent code changes
109
+ - **Wrong Format:** Written for humans, not AI agents (lacks structure, index, clear patterns)
110
+ - **Incomplete Coverage:** Missing critical architecture, patterns, or setup info
111
+ - **Inconsistent Quality:** Some areas documented well, others not at all
357
112
 
358
- #### Level 4: Enterprise Expansion
113
+ **Impact on AI Agents:**
359
114
 
360
- **Workflow:** Full methodology with strategic analysis
361
- **Outputs:** Product brief PRD comprehensive architecture phased implementation
362
- **Next Phase:** Solutioning (Phase 3) Implementation (Phase 4)
115
+ - AI agents hit token limits reading massive files
116
+ - Outdated docs cause hallucinations (agent thinks old patterns still apply)
117
+ - Missing structure means agents can't find relevant information
118
+ - Incomplete coverage leads to incorrect assumptions
363
119
 
364
- **Use For:**
120
+ ### Documentation Decision Tree
365
121
 
366
- - Platform expansions
367
- - Multi-team initiatives
368
- - System-wide modernization
369
- - Major architectural shifts
122
+ **Step 1: Assess Existing Documentation Quality**
370
123
 
371
- **Key Considerations:**
124
+ Ask yourself:
372
125
 
373
- - Comprehensive codebase documentation required (Phase 0)
374
- - Deep architectural review mandatory
375
- - Backward compatibility strategy
376
- - Phased rollout planning
377
- - Feature flag implementation
378
- - Migration strategy for existing data/users
379
- - Cross-team coordination
126
+ - Is it **current** (updated in last 30 days)?
127
+ - Is it **AI-optimized** (structured with index.md, clear sections, <500 lines per file)?
128
+ - Is it **comprehensive** (architecture, patterns, setup all documented)?
129
+ - Do you **trust** it completely for AI agent consumption?
380
130
 
381
- **Critical for Enterprise:**
131
+ **If ANY answer is NO → Run `document-project`**
382
132
 
383
- - Documentation phase is nearly mandatory
384
- - Analysis phase (research, product brief) recommended
385
- - Full architecture review before planning
386
- - Extensive integration testing strategy
387
- - Risk assessment and mitigation planning
133
+ **Step 2: Check for Massive Documents**
388
134
 
389
- **Example:** Adding multi-tenancy to existing single-tenant SaaS platform
135
+ If you have documentation but files are huge (>500 lines, 10+ level 2 sections):
390
136
 
391
- ### Phase 3: Solutioning (Levels 2-4)
137
+ 1. **First:** Run `shard-doc` tool to split large files:
392
138
 
393
- **Purpose:** Design architectural extensions and integration strategy.
139
+ ```bash
140
+ # Load BMad Master or any agent
141
+ bmad/core/tools/shard-doc.xml --input docs/massive-doc.md
142
+ ```
394
143
 
395
- **Workflows Available:**
144
+ - Splits on level 2 sections by default
145
+ - Creates organized, manageable files
146
+ - Preserves content integrity
396
147
 
397
- | Workflow | Level | Purpose | Output |
398
- | ------------------------ | ----- | ------------------------------------ | ------------------------- |
399
- | `architecture-review` | 3-4 | Review existing architecture | Analysis document |
400
- | `integration-planning` | 3-4 | Plan integration approach | Integration strategy |
401
- | `create-architecture` | 2-4 | Extend architecture documentation | architecture.md (updated) |
402
- | `validate-architecture` | 2-4 | Validate design decisions | Validation report |
403
- | `solutioning-gate-check` | 3-4 | Final approval before implementation | Gate check report |
148
+ 2. **Then:** Run `index-docs` task to create navigation:
404
149
 
405
- **Critical Differences from Greenfield:**
150
+ ```bash
151
+ bmad/core/tasks/index-docs.xml --directory ./docs
152
+ ```
406
153
 
407
- - You're **extending** existing architecture, not creating from scratch
408
- - Must document **integration points** explicitly
409
- - Need **migration strategy** for any pattern changes
410
- - Require **backward compatibility** considerations
411
- - Should plan **feature flags** for gradual rollout
154
+ 3. **Finally:** Validate quality - if sharded docs still seem incomplete/outdated Run `document-project`
412
155
 
413
- **Architecture Extensions Should Include:**
156
+ ### Four Real-World Scenarios
414
157
 
415
- - How new components integrate with existing systems
416
- - Data flow between new and existing modules
417
- - API contract changes (if any)
418
- - Database schema changes and migration strategy
419
- - Security implications and authentication integration
420
- - Performance impact on existing functionality
158
+ | Scenario | You Have | Action | Why |
159
+ | -------- | ------------------------------------------ | -------------------------- | --------------------------------------- |
160
+ | **A** | No documentation | `document-project` | Only option - generate from scratch |
161
+ | **B** | Docs exist but massive/outdated/incomplete | `document-project` | Safer to regenerate than trust bad docs |
162
+ | **C** | Good docs but no structure | `shard-doc` `index-docs` | Structure existing content for AI |
163
+ | **D** | Confirmed AI-optimized docs with index.md | Skip Phase 0 | Rare - only if you're 100% confident |
421
164
 
422
- ### Phase 4: Implementation (Iterative)
165
+ ### Scenario A: No Documentation (Most Common)
423
166
 
424
- **Purpose:** Transform plans into working code through sprint-based iteration.
167
+ **Action: Run document-project workflow**
425
168
 
426
- #### The Sprint Planning Entry Point
169
+ 1. Load Analyst or Technical Writer (Paige) agent
170
+ 2. Run `*document-project`
171
+ 3. Choose scan level:
172
+ - **Quick** (2-5min): Pattern analysis, no source reading
173
+ - **Deep** (10-30min): Reads critical paths - **Recommended**
174
+ - **Exhaustive** (30-120min): Reads all files
427
175
 
428
- Phase 4 begins with the `sprint-planning` workflow:
176
+ **Outputs:**
429
177
 
430
- **What It Does:**
178
+ - `docs/index.md` - Master AI entry point
179
+ - `docs/project-overview.md` - Executive summary
180
+ - `docs/architecture.md` - Architecture analysis
181
+ - `docs/source-tree-analysis.md` - Directory structure
182
+ - Additional files based on project type (API, web app, etc.)
431
183
 
432
- 1. Extracts all epics and stories from epic files
433
- 2. Creates `sprint-status.yaml` - single source of truth for tracking
434
- 3. Auto-detects existing story files and contexts
435
- 4. Maintains status through development lifecycle
184
+ ### Scenario B: Docs Exist But Quality Unknown/Poor (Very Common)
436
185
 
437
- **Run sprint-planning:**
186
+ **Action: Run document-project workflow (regenerate)**
438
187
 
439
- - Initially after Phase 2 or Phase 3 completion
440
- - After creating epic contexts
441
- - Periodically to sync with file system
442
- - To check overall progress
188
+ Even if `docs/` folder exists, if you're unsure about quality → **regenerate**.
443
189
 
444
- #### The Implementation Loop
190
+ **Why regenerate instead of index?**
445
191
 
446
- ```
447
- Phase Transitionsprint-planning
448
-
449
- epic-tech-context (per epic)
450
-
451
- ┌──────────────────┴──────────────────┐
452
- │ │
453
- ↓ ↓
454
- create-story → story-context → dev-story → code-review
455
- │ │ │ │
456
- ↓ ↓ ↓ ↓
457
- drafted ready-for-dev in-progress review
458
- │ │
459
- └────→───────┘
460
-
461
- done
462
-
463
- [epic complete?]
464
-
465
- retrospective
466
- ```
192
+ - Outdated docs → AI makes wrong assumptions
193
+ - Incomplete docs AI invents missing information
194
+ - TMI docs → AI hits token limits, misses key info
195
+ - Human-focused docs → Missing AI-critical structure
467
196
 
468
- #### Status State Machine
197
+ **document-project** will:
469
198
 
470
- **Epic Status:**
199
+ - Scan actual codebase (source of truth)
200
+ - Generate fresh, accurate documentation
201
+ - Structure properly for AI consumption
202
+ - Include only relevant, current information
471
203
 
472
- ```
473
- backlog → contexted
474
- ```
204
+ ### Scenario C: Good Docs But Needs Structure
475
205
 
476
- **Story Status:**
206
+ **Action: Shard massive files, then index**
477
207
 
478
- ```
479
- backlog → drafted → ready-for-dev → in-progress → review → done
480
- ```
208
+ If you have **good, current documentation** but it's in massive files:
481
209
 
482
- #### Phase 4 Workflows
483
-
484
- | Workflow | Agent | Purpose | Status Update |
485
- | ------------------- | ----- | ------------------------------- | ------------------------------------------- |
486
- | `sprint-planning` | SM | Initialize sprint tracking | Creates sprint-status.yaml |
487
- | `epic-tech-context` | SM | Create epic technical context | Epic: backlog → contexted |
488
- | `create-story` | SM | Draft individual story | Story: backlog → drafted |
489
- | `story-context` | SM | Generate implementation context | Story: drafted → ready-for-dev |
490
- | `dev-story` | DEV | Implement story | Story: ready-for-dev → in-progress → review |
491
- | `code-review` | SM/SR | Quality validation | Manual state management |
492
- | `retrospective` | SM | Capture epic learnings | Retrospective: optional → completed |
493
- | `correct-course` | SM | Handle issues/scope changes | Adaptive based on situation |
494
-
495
- #### Brownfield-Specific Implementation Considerations
496
-
497
- 1. **Respect Existing Patterns**
498
- - Use existing coding conventions
499
- - Follow established architectural approaches
500
- - Maintain consistency with current UI/UX patterns
501
- - Preserve team preferences and standards
502
-
503
- 2. **Integration Testing is Critical**
504
- - Test interactions with existing functionality
505
- - Validate API contracts remain unchanged (unless intentionally versioned)
506
- - Check for regression in existing features
507
- - Verify performance impact on legacy components
508
-
509
- 3. **Gradual Rollout Strategy**
510
- - Implement feature flags for new functionality
511
- - Plan rollback strategy
512
- - Support backward compatibility
513
- - Consider migration scripts for data/schema changes
514
-
515
- 4. **Context Injection**
516
- - `epic-tech-context`: Provides technical guidance specific to epic scope
517
- - `story-context`: Generates implementation context for each story
518
- - Both reference existing codebase patterns and integration points
519
- - Ensures developers have exact expertise needed for each task
520
-
521
- ## Workflow Routing by Level
522
-
523
- ### Visual Decision Tree
210
+ **Step 1: Shard large documents**
524
211
 
212
+ ```bash
213
+ # For each massive doc (>500 lines or 10+ level 2 sections)
214
+ bmad/core/tools/shard-doc.xml \
215
+ --input docs/api-documentation.md \
216
+ --output docs/api/ \
217
+ --level 2 # Split on ## headers (default)
525
218
  ```
526
- Start → workflow-status
527
-
528
- [Has documentation?]
529
-
530
- No ─→ document-project → [Choose scan level]
531
- Yes ↓
532
-
533
- [Complexity level?]
534
-
535
- ┌──────┴──────┬──────┬──────┬──────┐
536
- ↓ ↓ ↓ ↓ ↓
537
- Level 0 Level 1 Level 2 Level 3 Level 4
538
- ↓ ↓ ↓ ↓ ↓
539
- tech-spec tech-spec prd prd prd
540
- ↓ ↓ ↓ ↓ ↓
541
- └─────────────┴─────────┤ ├────────┘
542
- ↓ ↓
543
- tech-spec create-architecture
544
- ↓ ↓
545
- └───────┤
546
-
547
- sprint-planning
548
-
549
- Implementation Loop
550
- ```
551
-
552
- ### Path Files
553
-
554
- The v6 system uses modular path definitions for each brownfield level:
555
-
556
- **Location:** `/src/modules/bmm/workflows/workflow-status/paths/`
557
-
558
- - `brownfield-level-0.yaml` - Single atomic change path
559
- - `brownfield-level-1.yaml` - Small feature path
560
- - `brownfield-level-2.yaml` - Medium project path
561
- - `brownfield-level-3.yaml` - Complex integration path
562
- - `brownfield-level-4.yaml` - Enterprise expansion path
563
-
564
- Each path file clearly defines:
565
-
566
- - Required vs optional workflows for each phase
567
- - Agent assignments
568
- - Expected outputs
569
- - Integration notes
570
-
571
- ## Universal Entry Points
572
-
573
- ### `workflow-status` - Your Command Center
574
219
 
575
- **Always start here.** This workflow:
576
-
577
- - Checks for existing workflow status file
578
- - Displays current phase and progress
579
- - Shows next recommended action
580
- - Routes to appropriate workflows based on context
581
-
582
- **For New Projects:**
583
-
584
- - Detects missing status file
585
- - Directs to `workflow-init`
586
- - Guides through project setup
587
-
588
- **For Existing Projects:**
589
-
590
- - Displays current phase and progress
591
- - Shows Phase 4 implementation state
592
- - Recommends exact next action
593
- - Offers to change workflow if needed
594
-
595
- **Example Usage:**
220
+ **Step 2: Generate index**
596
221
 
597
222
  ```bash
598
- bmad analyst workflow-status
223
+ bmad/core/tasks/index-docs.xml --directory ./docs
599
224
  ```
600
225
 
601
- ### `workflow-init` - Smart Initialization
602
-
603
- If you don't have a status file, this workflow initializes your project workflow by asking about YOUR work first, then using artifacts as context:
226
+ **Step 3: Validate**
604
227
 
605
- **Step 1: Quick Scan (Context Only)**
228
+ - Review generated `docs/index.md`
229
+ - Check that sharded files are <500 lines each
230
+ - Verify content is current and accurate
231
+ - **If anything seems off → Run document-project instead**
606
232
 
607
- - Checks for existing code (`src/`, package files, `.git`)
608
- - Checks for planning artifacts (PRD, epics, stories, architecture docs)
609
- - Does NOT analyze in depth yet - just sees what's there
233
+ ### Scenario D: Confirmed AI-Optimized Documentation (Rare)
610
234
 
611
- **Step 2: Ask About YOUR Work**
235
+ **Action: Skip Phase 0**
612
236
 
613
- Asks: "What's your project called?"
237
+ Only skip if ALL conditions met:
614
238
 
615
- Then, if it found existing work, shows what it found and asks:
239
+ - `docs/index.md` exists and is comprehensive
240
+ - ✅ Documentation updated within last 30 days
241
+ - ✅ All doc files <500 lines with clear structure
242
+ - ✅ Covers architecture, patterns, setup, API surface
243
+ - ✅ You personally verified quality for AI consumption
244
+ - ✅ Previous AI agents used it successfully
616
245
 
617
- > **"Looking at what I found, are these:**
618
- >
619
- > a) Works in progress you're finishing
620
- > b) Documents from a previous effort (you're doing something NEW now)
621
- > c) The proposed work you're about to start
622
- > d) None of these - let me explain"
246
+ **If unsure → Run document-project** (costs 10-30 minutes, saves hours of confusion)
623
247
 
624
- **Your Paths:**
248
+ ### Why document-project is Critical
625
249
 
626
- - **Choose (a) or (c):** System analyzes the artifacts to determine level
627
- - **Choose (b) or (d):** System asks you to describe your NEW work
250
+ Without AI-optimized documentation, workflows fail:
628
251
 
629
- **Step 3: Determine Level**
252
+ - **tech-spec** (Quick Flow) can't auto-detect stack/patterns → Makes wrong assumptions
253
+ - **PRD** (BMad Method) can't reference existing code → Designs incompatible features
254
+ - **architecture** can't build on existing structure → Suggests conflicting patterns
255
+ - **story-context** can't inject existing patterns → Dev agent rewrites working code
256
+ - **dev-story** invents implementations → Breaks existing integrations
630
257
 
631
- If continuing old work: Counts stories from artifacts
632
- If new work: Asks "Tell me about what you're working on" and uses keyword detection
258
+ ### Key Principle
633
259
 
634
- Then confirms: "Level X brownfield project. Is that correct?"
260
+ **When in doubt, run document-project.**
635
261
 
636
- **Step 4: Create Workflow**
262
+ It's better to spend 10-30 minutes generating fresh, accurate docs than to waste hours debugging AI agents working from bad documentation.
637
263
 
638
- - Loads appropriate path file: `brownfield-level-{0-4}.yaml`
639
- - Generates workflow with all phases and workflows
640
- - Creates status file
641
-
642
- **Example: Old Level 3 PRD, New Level 0 Work**
643
-
644
- ```
645
- System: "What's your project called?"
646
- You: "PaymentApp"
264
+ ---
647
265
 
648
- System: "I found: PRD.md (Level 3, 30 stories, 6mo ago), src/ codebase"
649
- System: "Are these works in progress, previous effort, or proposed work?"
266
+ ## Workflow Phases by Track
650
267
 
651
- You: "b - Previous effort"
268
+ ### Phase 1: Analysis (Optional)
652
269
 
653
- System: "Tell me about what you're working on"
654
- You: "I need to update payment method enums"
270
+ **Workflows:**
655
271
 
656
- System: "Level 0 brownfield project. Is that correct?"
657
- You: "yes"
272
+ - `brainstorm-project` - Solution exploration
273
+ - `research` - Technical/market research
274
+ - `product-brief` - Strategic planning (BMad Method/Enterprise tracks only)
658
275
 
659
- Creates Level 0 workflow
660
- ```
276
+ **When to use:** Complex features, technical decisions, strategic additions
661
277
 
662
- **Smart Features:**
278
+ **When to skip:** Bug fixes, well-understood features, time-sensitive changes
663
279
 
664
- - Asks about YOUR work first
665
- - Uses artifacts as context, not primary source
666
- - Keyword detection: "fix", "update" → Level 0
667
- - Handles scaffolds: "Just a starter" → still greenfield
668
- - Flags missing documentation automatically
280
+ See [Workflows Guide](../workflows/README.md) for details.
669
281
 
670
- ## Key Artifacts in Brownfield Projects
671
-
672
- ### Tracking Documents
282
+ ### Phase 2: Planning (Required)
673
283
 
674
- **`bmm-workflow-status.md`** (Phases 0-3)
284
+ **Planning approach adapts by track:**
675
285
 
676
- - Current phase and progress
677
- - Workflow history
678
- - Next recommended actions
679
- - Project metadata
286
+ **Quick Flow:** Use `tech-spec` workflow
680
287
 
681
- **`sprint-status.yaml`** (Phase 4 only)
288
+ - Creates tech-spec.md
289
+ - Auto-detects existing stack (brownfield)
290
+ - Confirms conventions with you
291
+ - Generates implementation-ready stories
682
292
 
683
- - All epics, stories, retrospectives
684
- - Current status for each item
685
- - Single source of truth for implementation
686
- - Updated by agents as work progresses
293
+ **BMad Method/Enterprise:** Use `prd` workflow
687
294
 
688
- ### Planning Documents
295
+ - Creates PRD.md + epic breakdown
296
+ - References existing architecture
297
+ - Plans integration points
689
298
 
690
- **Level 0-1:**
299
+ **Brownfield-specific:** See [Scale Adaptive System](./scale-adaptive-system.md) for complete workflow paths by track.
691
300
 
692
- - `tech-spec.md` - Technical specification
693
- - `story-{key}.md` - Story files
301
+ ### Phase 3: Solutioning (BMad Method/Enterprise Only)
694
302
 
695
- **Level 2:**
303
+ **Critical for brownfield:**
696
304
 
697
- - `PRD.md` - Product requirements
698
- - `epics.md` - Epic breakdown
699
- - `tech-spec.md` - Technical specification
305
+ - Review existing architecture FIRST
306
+ - Document integration points explicitly
307
+ - Plan backward compatibility
308
+ - Consider migration strategy
309
+
310
+ **Workflows:**
311
+
312
+ - `create-architecture` - Extend architecture docs (BMad Method/Enterprise)
313
+ - `solutioning-gate-check` - Validate before implementation (BMad Method/Enterprise)
314
+
315
+ ### Phase 4: Implementation (All Tracks)
316
+
317
+ **Sprint-based development through story iteration:**
318
+
319
+ ```mermaid
320
+ flowchart TD
321
+ SPRINT[sprint-planning<br/>Initialize tracking]
322
+ EPIC[epic-tech-context<br/>Per epic]
323
+ CREATE[create-story]
324
+ CONTEXT[story-context]
325
+ DEV[dev-story]
326
+ REVIEW[code-review]
327
+ CHECK{More stories?}
328
+ RETRO[retrospective<br/>Per epic]
329
+
330
+ SPRINT --> EPIC
331
+ EPIC --> CREATE
332
+ CREATE --> CONTEXT
333
+ CONTEXT --> DEV
334
+ DEV --> REVIEW
335
+ REVIEW --> CHECK
336
+ CHECK -->|Yes| CREATE
337
+ CHECK -->|No| RETRO
338
+
339
+ style SPRINT fill:#bfb,stroke:#333,stroke-width:2px
340
+ style RETRO fill:#fbf,stroke:#333,stroke-width:2px
341
+ ```
700
342
 
701
- **Level 3-4:**
343
+ **Status Progression:**
702
344
 
703
- - `PRD.md` - Product requirements
704
- - `epics.md` - Epic breakdown
705
- - `architecture.md` - Architecture extensions
706
- - Integration and validation reports
345
+ - Epic: `backlog contexted`
346
+ - Story: `backlog → drafted → ready-for-dev in-progress → review → done`
707
347
 
708
- ### Implementation Documents
348
+ **Brownfield-Specific Implementation Tips:**
709
349
 
710
- **Phase 4 Artifacts:**
350
+ 1. **Respect existing patterns** - Follow established conventions
351
+ 2. **Test integration thoroughly** - Validate interactions with existing code
352
+ 3. **Use feature flags** - Enable gradual rollout
353
+ 4. **Context injection matters** - epic-tech-context and story-context reference existing patterns
711
354
 
712
- - `sprint-status.yaml` - Status tracking
713
- - `epic-{n}-context.md` - Epic technical contexts
714
- - `stories/` directory:
715
- - `{epic}-{story}-{title}.md` - Story definitions
716
- - `{epic}-{story}-{title}-context.md` - Implementation contexts
355
+ ---
717
356
 
718
- ## Best Practices for Brownfield Success
357
+ ## Best Practices
719
358
 
720
359
  ### 1. Always Document First
721
360
 
722
- Even if you know the codebase well, AI agents need comprehensive context. Run `document-project` with appropriate scan level before planning.
723
-
724
- **Why:** AI discovers undocumented patterns, integration points, and constraints that humans might overlook or take for granted.
725
-
726
- **Important:** Even if you have good documentation (README, ARCHITECTURE.md, etc.), you still need `docs/index.md` as the master AI retrieval source. If you have docs but no index:
727
-
728
- - **Quick fix:** Run the `index-docs` task (lightweight, just creates index)
729
- - **Comprehensive:** Use `document-project` with Deep scan to create index AND enhance docs
730
- - The index provides structured navigation for AI agents
731
-
732
- ### 2. Be Specific About Your Current Work
733
-
734
- When `workflow-init` asks about your work, be specific about what you're doing NOW:
735
-
736
- **Good descriptions:**
737
-
738
- - "I need to update payment method enums to include Apple Pay"
739
- - "Adding forgot password feature to existing auth system"
740
- - "Building admin dashboard with analytics and user management"
361
+ Even if you know the code, AI agents need `document-project` output for context. Run it before planning.
741
362
 
742
- **Why this matters:** The system uses your description to suggest the right complexity level. Clear, specific descriptions lead to accurate routing through appropriate workflows.
363
+ ### 2. Be Specific About Current Work
743
364
 
744
- ### 3. Choose the Right Documentation Approach
365
+ When workflow-init asks about your work:
745
366
 
746
- **For existing docs without index:**
367
+ - "Update payment method enums to include Apple Pay"
368
+ - ❌ "Fix stuff"
747
369
 
748
- - Use `index-docs` task - fast, lightweight, just generates index
749
- - Located at `bmad/core/tasks/index-docs.xml`
370
+ ### 3. Choose Right Documentation Approach
750
371
 
751
- **For comprehensive codebase documentation:**
752
-
753
- - Use `document-project` workflow with appropriate scan level:
754
- - **Quick:** Fast overview, planning next steps
755
- - **Deep:** Brownfield PRD preparation (most common)
756
- - **Exhaustive:** Migration planning, complete understanding
372
+ - **Has good docs, no index?** → Run `index-docs` task (fast)
373
+ - **No docs or need codebase analysis?** → Run `document-project` (Deep scan)
757
374
 
758
375
  ### 4. Respect Existing Patterns
759
376
 
760
- The brownfield templates identify:
761
-
762
- - Current coding conventions
763
- - Architectural approaches
764
- - Technology constraints
765
- - Team preferences
766
-
767
- **Always preserve these unless explicitly modernizing them.**
377
+ Tech-spec and story-context will detect conventions. Follow them unless explicitly modernizing.
768
378
 
769
379
  ### 5. Plan Integration Points Explicitly
770
380
 
771
- Document in your tech-spec or architecture:
381
+ Document in tech-spec/architecture:
772
382
 
773
383
  - Which existing modules you'll modify
774
384
  - What APIs/services you'll integrate with
775
385
  - How data flows between new and existing code
776
- - What shared components you'll reuse
777
386
 
778
387
  ### 6. Design for Gradual Rollout
779
388
 
780
- Brownfield changes should support:
781
-
782
- - Feature flags for new functionality
783
- - Rollback strategies
784
- - Backward compatibility
785
- - Migration scripts (if needed)
389
+ - Use feature flags for new functionality
390
+ - Plan rollback strategies
391
+ - Maintain backward compatibility
392
+ - Create migration scripts if needed
786
393
 
787
394
  ### 7. Test Integration Thoroughly
788
395
 
789
- Use the Test Architect (TEA) workflows:
790
-
791
- - `test-design` - Plan integration test strategy
792
- - `test-review` - Validate test coverage
793
- - `nfr-assess` - Check performance/security impact
794
-
795
- **Critical for Brownfield:**
796
-
797
396
  - Regression testing of existing features
798
397
  - Integration point validation
799
398
  - Performance impact assessment
@@ -804,457 +403,357 @@ Use the Test Architect (TEA) workflows:
804
403
  - Run `sprint-planning` at Phase 4 start
805
404
  - Context epics before drafting stories
806
405
  - Update `sprint-status.yaml` as work progresses
807
- - Re-run sprint-planning to sync with file system
808
406
 
809
407
  ### 9. Leverage Context Injection
810
408
 
811
409
  - Run `epic-tech-context` before story drafting
812
410
  - Always create `story-context` before implementation
813
- - These workflows reference existing patterns for consistency
411
+ - These reference existing patterns for consistency
814
412
 
815
413
  ### 10. Learn Continuously
816
414
 
817
415
  - Run `retrospective` after each epic
818
- - Incorporate learnings into next story drafts
819
- - Update patterns discovered during development
416
+ - Incorporate learnings into next stories
417
+ - Update discovered patterns
820
418
  - Share insights across team
821
419
 
822
- ## Common Brownfield Scenarios
420
+ ---
421
+
422
+ ## Common Scenarios
823
423
 
824
- ### Scenario 1: Bug Fix (Level 0)
424
+ ### Scenario 1: Bug Fix (Quick Flow)
825
425
 
826
426
  **Situation:** Authentication token expiration causing logout issues
827
427
 
428
+ **Track:** Quick Flow
429
+
828
430
  **Workflow:**
829
431
 
830
- 1. `workflow-status` detects brownfield, suggests Level 0
831
- 2. Skip Phase 0 if auth system is documented
832
- 3. `tech-spec` analyzes bug, plans fix, creates single story
833
- 4. `sprint-planning` creates sprint status
834
- 5. `dev-story` implement fix
835
- 6. `code-review` validate fix + test regression
432
+ 1. **Document:** Skip if auth system documented, else run `document-project` (Quick scan)
433
+ 2. **Plan:** Load PM run `tech-spec`
434
+ - Analyzes bug
435
+ - Detects stack (Express, Jest)
436
+ - Confirms conventions
437
+ - Creates tech-spec.md + story
438
+ 3. **Implement:** Load DEV → run `dev-story`
439
+ 4. **Review:** Load DEV → run `code-review`
440
+
441
+ **Time:** 2-4 hours
836
442
 
837
- **Time:** ~2-4 hours total
443
+ ---
838
444
 
839
- ### Scenario 2: Small Feature (Level 1)
445
+ ### Scenario 2: Small Feature (Quick Flow)
840
446
 
841
447
  **Situation:** Add "forgot password" to existing auth system
842
448
 
449
+ **Track:** Quick Flow
450
+
843
451
  **Workflow:**
844
452
 
845
- 1. `workflow-status` suggests Level 1
846
- 2. Phase 0: `document-project` (deep scan of auth module if not documented)
847
- 3. Phase 1: Optional - skip if requirements are clear
848
- 4. Phase 2: `tech-spec` creates epic with 3-5 stories
849
- 5. Phase 4: `sprint-planning` `create-story` → `dev-story` → repeat
453
+ 1. **Document:** Run `document-project` (Deep scan of auth module if not documented)
454
+ 2. **Plan:** Load PM → run `tech-spec`
455
+ - Detects Next.js 13.4, NextAuth.js
456
+ - Analyzes existing auth patterns
457
+ - Confirms conventions
458
+ - Creates tech-spec.md + epic + 3-5 stories
459
+ 3. **Implement:** Load SM → `sprint-planning` → `create-story` → `story-context`
460
+ Load DEV → `dev-story` for each story
461
+ 4. **Review:** Load DEV → `code-review`
850
462
 
851
463
  **Time:** 1-3 days
852
464
 
853
- ### Scenario 3: Feature Set (Level 2)
465
+ ---
466
+
467
+ ### Scenario 3: Feature Set (BMad Method)
854
468
 
855
469
  **Situation:** Add user dashboard with analytics, preferences, activity
856
470
 
471
+ **Track:** BMad Method
472
+
857
473
  **Workflow:**
858
474
 
859
- 1. `workflow-status` suggests Level 2
860
- 2. Phase 0: `document-project` (deep scan) - critical for understanding existing UI patterns
861
- 3. Phase 1: `research` (if evaluating analytics libraries)
862
- 4. Phase 2: `prd` → `tech-spec`
863
- 5. Phase 4: Sprint-based implementation (10-15 stories)
475
+ 1. **Document:** Run `document-project` (Deep scan) - Critical for understanding existing UI patterns
476
+ 2. **Analyze:** Load Analyst → `research` (if evaluating analytics libraries)
477
+ 3. **Plan:** Load PM → `prd`
478
+ 4. **Solution:** Load Architect → `create-architecture` → `solutioning-gate-check`
479
+ 5. **Implement:** Sprint-based (10-15 stories)
480
+ - Load SM → `sprint-planning`
481
+ - Per epic: `epic-tech-context` → stories
482
+ - Load DEV → `dev-story` per story
483
+ 6. **Review:** Per story completion
864
484
 
865
485
  **Time:** 1-2 weeks
866
486
 
867
- ### Scenario 4: Complex Integration (Level 3)
487
+ ---
488
+
489
+ ### Scenario 4: Complex Integration (BMad Method)
868
490
 
869
491
  **Situation:** Add real-time collaboration to document editor
870
492
 
493
+ **Track:** BMad Method
494
+
871
495
  **Workflow:**
872
496
 
873
- 1. `workflow-status` suggests Level 3
874
- 2. Phase 0: `document-project` (exhaustive if not documented)
875
- 3. Phase 1: `research` (WebSocket vs WebRTC vs CRDT)
876
- 4. Phase 2: `prd` → creates requirements + epics
877
- 5. Phase 3:
878
- - `architecture-review` → understand existing editor architecture
879
- - `integration-planning` → plan WebSocket integration strategy
880
- - `create-architecture` → extend architecture for real-time layer
881
- - `solutioning-gate-check` → validate before implementation
882
- 6. Phase 4: Sprint-based implementation (20-30 stories)
497
+ 1. **Document:** Run `document-project` (Exhaustive if not documented) - **Mandatory**
498
+ 2. **Analyze:** Load Analyst → `research` (WebSocket vs WebRTC vs CRDT)
499
+ 3. **Plan:** Load PM → `prd`
500
+ 4. **Solution:**
501
+ - Load Architect → `create-architecture` (extend for real-time layer)
502
+ - Load Architect → `solutioning-gate-check`
503
+ 5. **Implement:** Sprint-based (20-30 stories)
883
504
 
884
505
  **Time:** 3-6 weeks
885
506
 
886
- ### Scenario 5: Enterprise Expansion (Level 4)
507
+ ---
508
+
509
+ ### Scenario 5: Enterprise Expansion (Enterprise Method)
887
510
 
888
511
  **Situation:** Add multi-tenancy to single-tenant SaaS platform
889
512
 
513
+ **Track:** Enterprise Method
514
+
890
515
  **Workflow:**
891
516
 
892
- 1. `workflow-status` suggests Level 4
893
- 2. Phase 0: `document-project` (exhaustive) - **mandatory**
894
- 3. Phase 1: **Required**
895
- - `brainstorm-project` explore multi-tenancy approaches
896
- - `research` database sharding, tenant isolation, pricing models
897
- - `product-brief`strategic document
898
- 4. Phase 2: `prd` → comprehensive requirements
899
- 5. Phase 3:
900
- - `architecture-review` full existing system review
901
- - `integration-planning` phased migration strategy
902
- - `create-architecture` → multi-tenancy architecture
903
- - `validate-architecture` external review
904
- - `solutioning-gate-check` executive approval
905
- 6. Phase 4: Phased sprint-based implementation (50+ stories)
517
+ 1. **Document:** Run `document-project` (Exhaustive) - **Mandatory**
518
+ 2. **Analyze:** **Required**
519
+ - `brainstorm-project` - Explore multi-tenancy approaches
520
+ - `research` - Database sharding, tenant isolation, pricing
521
+ - `product-brief` - Strategic document
522
+ 3. **Plan:** Load PM `prd` (comprehensive)
523
+ 4. **Solution:**
524
+ - `create-architecture` - Full system architecture
525
+ - `integration-planning` - Phased migration strategy
526
+ - `create-architecture` - Multi-tenancy architecture
527
+ - `validate-architecture` - External review
528
+ - `solutioning-gate-check` - Executive approval
529
+ 5. **Implement:** Phased sprint-based (50+ stories)
906
530
 
907
531
  **Time:** 3-6 months
908
532
 
909
- ## Troubleshooting Common Issues
910
-
911
- ### Issue: AI Lacks Codebase Understanding
912
-
913
- **Symptoms:**
914
-
915
- - Generated plans don't align with existing patterns
916
- - Suggestions ignore available components
917
- - Integration approaches miss existing APIs
533
+ ---
918
534
 
919
- **Solution:**
535
+ ## Troubleshooting
920
536
 
921
- 1. Run `document-project` with deep or exhaustive scan
922
- 2. Review `index.md` - ensure it captures key systems
923
- 3. If specific area is unclear, run deep-dive mode on that area
924
- 4. Provide additional context in PRD about existing systems
537
+ For complete troubleshooting, see [Troubleshooting Guide](./troubleshooting.md).
925
538
 
926
- ### Issue: Have Documentation But Agents Can't Find It
539
+ ### AI Agents Lack Codebase Understanding
927
540
 
928
541
  **Symptoms:**
929
542
 
930
- - You have README, ARCHITECTURE.md, CONTRIBUTING.md, etc.
931
- - But AI agents aren't using the information effectively
932
- - Agents ask questions already answered in existing docs
933
- - No `docs/index.md` file exists
543
+ - Suggestions don't align with existing patterns
544
+ - Ignores available components
545
+ - Doesn't reference existing code
934
546
 
935
547
  **Solution:**
936
548
 
937
- 1. **Quick fix:** Run the `index-docs` task (from `bmad/core/tasks/index-docs.xml`)
938
- - Lightweight and fast (just indexes existing docs)
939
- - Scans your docs directory
940
- - Generates organized `index.md` with file descriptions
941
- - Provides AI agents with structured navigation
942
-
943
- 2. **Comprehensive approach:** Run `document-project` with Deep/Exhaustive scan
944
- - Discovers existing docs in Step 2 (shows you what it found)
945
- - Generates NEW AI-friendly documentation from codebase analysis
946
- - Creates index.md that links to BOTH existing docs AND new docs
947
- - Useful when existing docs are good but need technical codebase analysis too
948
-
949
- **Why This Happens:** AI agents need a structured entry point (`index.md`) to efficiently navigate documentation. Without it, they must search through multiple files, often missing relevant context.
549
+ 1. Run `document-project` with Deep scan
550
+ 2. Verify `docs/index.md` exists
551
+ 3. Check documentation completeness
552
+ 4. Run deep-dive on specific areas if needed
950
553
 
951
- ### Issue: Plans Feel Too Complex for Simple Changes
554
+ ### Have Documentation But Agents Can't Find It
952
555
 
953
556
  **Symptoms:**
954
557
 
955
- - Level 2+ workflow suggested for minor change
956
- - Too much documentation overhead
558
+ - README.md, ARCHITECTURE.md exist
559
+ - AI agents ask questions already answered
560
+ - No `docs/index.md` file
957
561
 
958
562
  **Solution:**
959
563
 
960
- 1. Re-run `workflow-status` or `workflow-init`
961
- 2. Correct the level when prompted (choose Level 0 or 1)
962
- 3. Trust your judgment - BMad Method adapts to your choice
963
- 4. Skip optional phases (Analysis)
564
+ - **Quick fix:** Run `index-docs` task (2-5min)
565
+ - **Comprehensive:** Run `document-project` workflow (10-30min)
964
566
 
965
- ### Issue: Integration Points Unclear
567
+ ### Integration Points Unclear
966
568
 
967
569
  **Symptoms:**
968
570
 
969
- - Stories lack detail on connecting to existing systems
970
- - Uncertainty about which existing code to modify
571
+ - Not sure how to connect new code to existing
572
+ - Unsure which files to modify
971
573
 
972
574
  **Solution:**
973
575
 
974
- 1. Ensure Phase 0 documentation is complete
975
- 2. Run deep-dive on integration areas in `document-project`
976
- 3. In Phase 2, explicitly document integration points
977
- 4. In Phase 3 (if Level 3+), use `integration-planning` workflow
978
- 5. Create detailed `epic-tech-context` and `story-context`
576
+ 1. Ensure `document-project` captured existing architecture
577
+ 2. Check `story-context` - should document integration points
578
+ 3. In tech-spec/architecture - explicitly document:
579
+ - Which existing modules to modify
580
+ - What APIs/services to integrate with
581
+ - Data flow between new and existing code
582
+ 4. Review architecture document for integration guidance
979
583
 
980
- ### Issue: Existing Tests Breaking
584
+ ### Existing Tests Breaking
981
585
 
982
586
  **Symptoms:**
983
587
 
984
588
  - Regression test failures
985
- - Existing functionality broken by changes
589
+ - Previously working functionality broken
986
590
 
987
591
  **Solution:**
988
592
 
989
- 1. Review existing test patterns in documentation
990
- 2. Use Test Architect workflows:
991
- - `test-design` - Plan test strategy upfront
992
- - `trace` - Map requirements to tests
993
- - `test-review` - Validate before merging
994
- 3. Add regression testing to Definition of Done
995
- 4. Consider feature flags for gradual rollout
593
+ 1. Review changes against existing patterns
594
+ 2. Verify API contracts unchanged (unless intentionally versioned)
595
+ 3. Run `test-review` workflow (TEA agent)
596
+ 4. Add regression testing to DoD
597
+ 5. Consider feature flags for gradual rollout
996
598
 
997
- ### Issue: Inconsistent Patterns Being Introduced
599
+ ### Inconsistent Patterns Being Introduced
998
600
 
999
601
  **Symptoms:**
1000
602
 
1001
- - New code doesn't match existing style
1002
- - Different architectural approach than existing modules
603
+ - New code style doesn't match existing
604
+ - Different architectural approach
1003
605
 
1004
606
  **Solution:**
1005
607
 
1006
- 1. Ensure `document-project` captured existing patterns
1007
- 2. Review architecture documentation before Phase 4
1008
- 3. Use `story-context` to inject pattern guidance
1009
- 4. Include pattern adherence in `code-review` checklist
1010
- 5. Run retrospectives to identify pattern deviations
1011
-
1012
- ## Test Architect Integration
1013
-
1014
- The Test Architect (TEA) plays a critical role in brownfield projects to prevent regression and validate integration.
1015
-
1016
- ### Four-Stage Approach
1017
-
1018
- **Stage 1 (Before Development):**
1019
-
1020
- - Risk assessment identifying legacy dependencies
1021
- - Test design planning for regression + new features
1022
- - Integration point identification
1023
-
1024
- **Stage 2 (During Development):**
608
+ 1. Check convention detection (Quick Spec Flow should detect patterns)
609
+ 2. Review documentation - ensure `document-project` captured patterns
610
+ 3. Use `story-context` - injects pattern guidance
611
+ 4. Add to code-review checklist: pattern adherence, convention consistency
612
+ 5. Run retrospective to identify deviations early
1025
613
 
1026
- - Requirements tracing validating existing functionality preservation
1027
- - NFR validation ensuring performance/security unchanged
1028
-
1029
- **Stage 3 (Code Review):**
1030
-
1031
- - Deep analysis of API contracts, data migrations
1032
- - Performance regression checks
1033
- - Integration point validation
1034
- - Dependency mapping
1035
-
1036
- **Stage 4 (Post-Review):**
1037
-
1038
- - Gate status updates
1039
- - Technical debt documentation
1040
-
1041
- ### TEA Workflows for Brownfield
1042
-
1043
- | Workflow | Purpose | When to Use |
1044
- | ------------- | -------------------------- | ------------------------------------ |
1045
- | `test-design` | Plan testing strategy | After Phase 2, before implementation |
1046
- | `test-review` | Validate test coverage | During story review |
1047
- | `trace` | Map requirements to tests | After test implementation |
1048
- | `nfr-assess` | Check performance/security | Before major releases |
1049
- | `atdd` | Acceptance test planning | For user-facing features |
1050
-
1051
- ### Risk Scoring for Brownfield
1052
-
1053
- TEA uses enhanced brownfield metrics:
1054
-
1055
- - **Regression Risk** = integration_points × code_age
1056
- - **Data Risk** = migration_complexity × data_volume
1057
- - **Performance Risk** = current_load × added_complexity
1058
- - **Compatibility Risk** = api_consumers × contract_changes
1059
-
1060
- **Automatic Thresholds:**
614
+ ---
1061
615
 
1062
- - Score ≥9: Automatic failure (must mitigate)
1063
- - Score ≥6: Concern (requires mitigation plan)
1064
- - Score <6: Acceptable (document only)
616
+ ## Quick Reference
1065
617
 
1066
- ## Quick Reference Commands
618
+ ### Commands by Phase
1067
619
 
1068
620
  ```bash
1069
- # Universal Entry Point (Always Start Here)
1070
- bmad analyst workflow-status
1071
-
1072
621
  # Phase 0: Documentation (If Needed)
1073
- bmad analyst document-project
1074
- # Choose: Quick / Deep / Exhaustive
622
+ # Analyst agent:
623
+ document-project # Create comprehensive docs (10-30min)
624
+ # OR load index-docs task for existing docs (2-5min)
1075
625
 
1076
626
  # Phase 1: Analysis (Optional)
1077
- bmad analyst brainstorm-project # Explore solutions
1078
- bmad analyst research # Gather technical/market data
1079
- bmad analyst product-brief # Strategic planning
627
+ # Analyst agent:
628
+ brainstorm-project # Explore solutions
629
+ research # Gather data
630
+ product-brief # Strategic planning (BMad Method/Enterprise only)
1080
631
 
1081
632
  # Phase 2: Planning (Required)
1082
- bmad pm tech-spec # Level 0-1 only
1083
- bmad pm prd # Level 2-4 only
1084
-
1085
- # Phase 3: Solutioning (Levels 2-4)
1086
- bmad architect architecture-review # Review existing (L3-4)
1087
- bmad architect integration-planning # Plan integration (L3-4)
1088
- bmad architect create-architecture # Extend architecture (L2-4)
1089
- bmad architect solutioning-gate-check # Final approval (L3-4)
1090
-
1091
- # Phase 4: Implementation (All Levels)
1092
- bmad sm sprint-planning # FIRST: Initialize tracking
1093
- bmad sm epic-tech-context # Create epic context
1094
- bmad sm create-story # Draft story
1095
- bmad sm story-context # Create story context
1096
- bmad dev dev-story # Implement story
1097
- bmad sm code-review # Review implementation
1098
- # (Manually update sprint-status.yaml to 'done')
1099
- bmad sm retrospective # After epic completion
1100
- bmad sm correct-course # If issues arise
1101
-
1102
- # Test Architect (Integration Throughout)
1103
- bmad tea test-design # Plan testing strategy
1104
- bmad tea test-review # Validate test coverage
1105
- bmad tea nfr-assess # Check performance/security
633
+ # PM agent:
634
+ tech-spec # Quick Flow track
635
+ prd # BMad Method/Enterprise tracks
636
+
637
+ # Phase 3: Solutioning (BMad Method/Enterprise)
638
+ # Architect agent:
639
+ create-architecture # Extend architecture
640
+ solutioning-gate-check # Final validation
641
+
642
+ # Phase 4: Implementation (All Tracks)
643
+ # SM agent:
644
+ sprint-planning # Initialize tracking
645
+ epic-tech-context # Epic context
646
+ create-story # Draft story
647
+ story-context # Story context
648
+
649
+ # DEV agent:
650
+ dev-story # Implement
651
+ code-review # Review
652
+
653
+ # SM agent:
654
+ retrospective # After epic
655
+ correct-course # If issues
1106
656
  ```
1107
657
 
1108
- ## Key Files Reference
1109
-
1110
- ### Documentation Phase
1111
-
1112
- - `docs/index.md` - **Master documentation index (REQUIRED for AI agents)** - Primary entry point
1113
- - `docs/project-overview.md` - Executive summary
1114
- - `docs/architecture.md` - Architecture analysis
1115
- - `docs/source-tree-analysis.md` - Annotated directory structure
1116
- - `docs/api-contracts.md` - API documentation (if applicable)
1117
- - `docs/data-models.md` - Database schemas (if applicable)
1118
- - `docs/deep-dive-{area}.md` - Area-specific deep dives
1119
- - Existing docs (README.md, ARCHITECTURE.md, etc.) - Incorporated and linked from index
1120
-
1121
- ### Planning Phase
658
+ ### Key Files
1122
659
 
1123
- - `bmm-workflow-status.md` - Phase 0-3 tracking
1124
- - `PRD.md` - Product requirements (L2-4)
1125
- - `epics.md` - Epic breakdown (L2-4)
1126
- - `tech-spec.md` - Technical specification (L0-2)
660
+ **Phase 0 Output:**
1127
661
 
1128
- ### Solutioning Phase
662
+ - `docs/index.md` - **Master AI entry point (REQUIRED)**
663
+ - `docs/project-overview.md`
664
+ - `docs/architecture.md`
665
+ - `docs/source-tree-analysis.md`
1129
666
 
1130
- - `architecture.md` - Architecture extensions (L2-4)
1131
- - `integration-strategy.md` - Integration planning (L3-4)
1132
- - Validation and gate check reports
667
+ **Phase 1-3 Tracking:**
1133
668
 
1134
- ### Implementation Phase
669
+ - `docs/bmm-workflow-status.yaml` - Progress tracker
1135
670
 
1136
- - `sprint-status.yaml` - **Single source of truth** for Phase 4
1137
- - `epic-{n}-context.md` - Epic technical contexts
1138
- - `stories/{epic}-{story}-{title}.md` - Story files
1139
- - `stories/{epic}-{story}-{title}-context.md` - Story contexts
671
+ **Phase 2 Planning:**
1140
672
 
1141
- ## Comparison: v4 vs v6 Brownfield
673
+ - `docs/tech-spec.md` (Quick Flow track)
674
+ - `docs/PRD.md` (BMad Method/Enterprise tracks)
675
+ - Epic breakdown
1142
676
 
1143
- ### What Changed
677
+ **Phase 3 Architecture:**
1144
678
 
1145
- **v4 Approach:**
679
+ - `docs/architecture.md` (BMad Method/Enterprise tracks)
1146
680
 
1147
- - Task-based system with fixed workflows
1148
- - Manual tracking across multiple documents
1149
- - Heavy upfront documentation requirements
1150
- - Rigid phase progression
681
+ **Phase 4 Implementation:**
1151
682
 
1152
- **v6 Improvements:**
683
+ - `docs/sprint-status.yaml` - **Single source of truth**
684
+ - `docs/epic-{n}-context.md`
685
+ - `docs/stories/{epic}-{story}-{title}.md`
686
+ - `docs/stories/{epic}-{story}-{title}-context.md`
1153
687
 
1154
- - Scale-adaptive workflows (0-4 levels)
1155
- - Unified status tracking (`workflow-status`, `sprint-status.yaml`)
1156
- - Three-level scanning (quick/deep/exhaustive)
1157
- - Just-in-time context injection
1158
- - Flexible resumability
1159
- - Modular workflow paths
1160
- - Intelligent routing system
688
+ ### Decision Flowchart
1161
689
 
1162
- ### Migration from v4
690
+ ```mermaid
691
+ flowchart TD
692
+ START([Brownfield Project])
693
+ CHECK{Has docs/<br/>index.md?}
1163
694
 
1164
- If you used BMad Method v4, here's how to transition:
695
+ START --> CHECK
696
+ CHECK -->|No| DOC[document-project<br/>Deep scan]
697
+ CHECK -->|Yes| TRACK{What Track?}
1165
698
 
1166
- **Old v4 Task → New v6 Workflow:**
699
+ DOC --> TRACK
1167
700
 
1168
- - `create-brownfield-prd` `prd` (with brownfield path)
1169
- - `document-project` `document-project` (enhanced with scan levels)
1170
- - Legacy task templates Replaced by workflow system
1171
- - Manual status tracking → `sprint-status.yaml` + agents
701
+ TRACK -->|Quick Flow| TS[tech-spec]
702
+ TRACK -->|BMad Method| PRD[prd architecture]
703
+ TRACK -->|Enterprise| PRD2[prdarch + security/devops]
1172
704
 
1173
- **Key Conceptual Shifts:**
705
+ TS --> IMPL[Phase 4<br/>Implementation]
706
+ PRD --> IMPL
707
+ PRD2 --> IMPL
1174
708
 
1175
- 1. **Scale-adaptive planning** - Choose level based on complexity
1176
- 2. **Phase 0 is conditional** - Only if documentation is lacking
1177
- 3. **Sprint status is centralized** - Single YAML file for Phase 4
1178
- 4. **Context injection** - Epic and story contexts provide JIT guidance
1179
- 5. **Workflow paths** - Clean separation by level and field type
1180
-
1181
- ## Tips for Success
709
+ style START fill:#f9f,stroke:#333,stroke-width:2px
710
+ style DOC fill:#ffb,stroke:#333,stroke-width:2px
711
+ style IMPL fill:#bfb,stroke:#333,stroke-width:2px
712
+ ```
1182
713
 
1183
- ### For Solo Developers
714
+ ---
1184
715
 
1185
- 1. Don't skip documentation phase - even if you know the code, AI agents need it
1186
- 2. Choose appropriate scan level - deep scan is usually best for brownfield PRDs
1187
- 3. Use Level 0-1 for small changes - don't over-engineer simple fixes
1188
- 4. Trust the sprint planning system - it tracks everything automatically
1189
- 5. Be specific when describing your work - helps system route to the right level
716
+ ## Prevention Tips
1190
717
 
1191
- ### For Teams
718
+ **Avoid issues before they happen:**
1192
719
 
1193
- 1. Document once, use everywhere - Phase 0 documentation serves entire team
1194
- 2. Use sprint-status.yaml as single source of truth - no multiple tracking systems
1195
- 3. Run retrospectives after epics - transfer learning to next stories
1196
- 4. Coordinate parallel work - multiple stories can be in-progress if capacity allows
1197
- 5. Establish clear communication about current iteration scope vs historical complexity
720
+ 1. **Always run document-project for brownfield** - Saves context issues later
721
+ 2. ✅ **Use fresh chats for complex workflows** - Prevents hallucinations
722
+ 3. **Verify files exist before workflows** - Check PRD, epics, stories present
723
+ 4. **Read agent menu first** - Confirm agent has the workflow
724
+ 5. **Start with simpler track if unsure** - Easy to upgrade (Quick Flow → BMad Method)
725
+ 6. ✅ **Keep status files updated** - Manual updates when needed
726
+ 7. ✅ **Run retrospectives after epics** - Catch issues early
727
+ 8. ✅ **Follow phase sequence** - Don't skip required phases
1198
728
 
1199
- ### For Enterprise
729
+ ---
1200
730
 
1201
- 1. Phase 0 is mandatory - comprehensive documentation prevents costly mistakes
1202
- 2. Include stakeholders early - Analysis phase (Phase 1) gathers business context
1203
- 3. Use gate checks - `solutioning-gate-check` provides approval checkpoint
1204
- 4. Plan phased rollout - feature flags and migration strategies are critical
1205
- 5. Document architectural extensions - maintain system documentation as you evolve
1206
- 6. Consider archiving completed planning artifacts to keep workspace clean
731
+ ## Related Documentation
1207
732
 
1208
- ## Support and Resources
733
+ - **[Scale Adaptive System](./scale-adaptive-system.md)** - Understanding tracks and complexity
734
+ - **[Quick Spec Flow](./quick-spec-flow.md)** - Fast-track for Quick Flow
735
+ - **[Quick Start Guide](./quick-start.md)** - Getting started with BMM
736
+ - **[Glossary](./glossary.md)** - Key terminology
737
+ - **[FAQ](./faq.md)** - Common questions
738
+ - **[Troubleshooting](./troubleshooting.md)** - Problem resolution
739
+ - **[Workflows Guide](../workflows/README.md)** - Complete workflow reference
1209
740
 
1210
- **Documentation:**
741
+ ---
1211
742
 
1212
- - [BMM Workflows Guide](../src/modules/bmm/workflows/README.md) - Complete v6 workflow reference
1213
- - [Test Architect Guide](../src/modules/bmm/testarch/README.md) - Quality and testing strategy
1214
- - [BMM Module README](../src/modules/bmm/README.md) - Module overview
743
+ ## Support & Resources
1215
744
 
1216
745
  **Community:**
1217
746
 
1218
- - Discord: [https://discord.gg/gk8jAdXWmj](https://discord.gg/gk8jAdXWmj) (#general-dev, #bugs-issues)
1219
- - GitHub Issues: [https://github.com/bmad-code-org/BMAD-METHOD/issues](https://github.com/bmad-code-org/BMAD-METHOD/issues)
1220
- - YouTube: [https://www.youtube.com/@BMadCode](https://www.youtube.com/@BMadCode)
747
+ - [Discord](https://discord.gg/gk8jAdXWmj) - #general-dev, #bugs-issues
748
+ - [GitHub Issues](https://github.com/bmad-code-org/BMAD-METHOD/issues)
749
+ - [YouTube Channel](https://www.youtube.com/@BMadCode)
1221
750
 
1222
- **Getting Started:**
1223
-
1224
- ```bash
1225
- # Install BMad Method
1226
- npx bmad-method install
751
+ **Documentation:**
1227
752
 
1228
- # Start your first brownfield project
1229
- cd your-project
1230
- bmad analyst workflow-status
1231
- ```
753
+ - [BMM Workflows Guide](../workflows/README.md)
754
+ - [Test Architect Guide](../testarch/README.md)
755
+ - [BMM Module README](../README.md)
1232
756
 
1233
757
  ---
1234
758
 
1235
- ## Remember
1236
-
1237
- **Brownfield development** is about understanding and respecting what exists while thoughtfully extending it. BMad Method v6's scale-adaptive approach ensures you get the right level of planning and documentation without unnecessary overhead.
1238
-
1239
- **Key Principles:**
1240
-
1241
- 1. **Ask First, Infer Second**: The system asks about YOUR work first, then uses artifacts as context
1242
- 2. **Scale Adapts**: From single fixes (Level 0) to enterprise expansions (Level 4)
1243
- 3. **Documentation Matters**: AI agents need comprehensive context to work effectively
1244
- 4. **Context Injection**: Epic and story contexts provide just-in-time guidance
1245
- 5. **Sprint-Based Tracking**: Single source of truth keeps everyone aligned
1246
-
1247
- **Quick Start:**
1248
-
1249
- ```bash
1250
- cd your-brownfield-project
1251
- bmad analyst workflow-status
1252
-
1253
- # System will guide you through:
1254
- # 1. What's your project called?
1255
- # 2. What are you working on? (if finds old work: "is this continuing old work or new work?")
1256
- # 3. Confirms detected level
1257
- # 4. Creates appropriate workflow
1258
- ```
1259
-
1260
- **The system is designed to understand YOUR current work and route you to the right workflows.**
759
+ _Brownfield development is about understanding and respecting what exists while thoughtfully extending it._