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

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 (225) hide show
  1. package/.claude/agents/bmad-analysis/api-documenter.md +102 -0
  2. package/.claude/agents/bmad-analysis/codebase-analyzer.md +82 -0
  3. package/.claude/agents/bmad-analysis/data-analyst.md +101 -0
  4. package/.claude/agents/bmad-analysis/pattern-detector.md +84 -0
  5. package/.claude/agents/bmad-planning/dependency-mapper.md +83 -0
  6. package/.claude/agents/bmad-planning/epic-optimizer.md +81 -0
  7. package/.claude/agents/bmad-planning/requirements-analyst.md +61 -0
  8. package/.claude/agents/bmad-planning/technical-decisions-curator.md +168 -0
  9. package/.claude/agents/bmad-planning/trend-spotter.md +115 -0
  10. package/.claude/agents/bmad-planning/user-journey-mapper.md +123 -0
  11. package/.claude/agents/bmad-planning/user-researcher.md +72 -0
  12. package/.claude/agents/bmad-research/market-researcher.md +51 -0
  13. package/.claude/agents/bmad-research/tech-debt-auditor.md +106 -0
  14. package/.claude/agents/bmad-review/document-reviewer.md +102 -0
  15. package/.claude/agents/bmad-review/technical-evaluator.md +68 -0
  16. package/.claude/agents/bmad-review/test-coverage-analyzer.md +108 -0
  17. package/.claude/commands/bmad/bmm/agents/architect.md +0 -1
  18. package/.claude/commands/bmad/bmm/agents/sm.md +1 -1
  19. package/.claude/commands/bmad/bmm/agents/{paige.md → tech-writer.md} +3 -3
  20. package/.claude/commands/bmad/bmm/workflows/README.md +3 -3
  21. package/.claude/commands/bmad/bmm/workflows/epic-tech-context.md +15 -0
  22. package/.claude/commands/bmad/bmm/workflows/prd.md +1 -1
  23. package/.claude/commands/bmad/bmm/workflows/tech-spec.md +3 -3
  24. package/.claude/settings.local.json +3 -8
  25. package/CHANGELOG.md +305 -0
  26. package/CONTRIBUTING.md +1 -13
  27. package/README.md +88 -39
  28. package/bmad/_cfg/agent-manifest.csv +1 -6
  29. package/bmad/_cfg/files-manifest.csv +40 -114
  30. package/bmad/_cfg/ides/claude-code.yaml +4 -3
  31. package/bmad/_cfg/manifest.yaml +3 -4
  32. package/bmad/_cfg/task-manifest.csv +0 -1
  33. package/bmad/_cfg/workflow-manifest.csv +3 -7
  34. package/bmad/bmb/config.yaml +2 -2
  35. package/bmad/bmb/workflows/audit-workflow/instructions.md +1 -1
  36. package/bmad/bmm/README.md +79 -120
  37. package/bmad/bmm/agents/architect.md +0 -1
  38. package/bmad/bmm/agents/sm.md +1 -1
  39. package/bmad/bmm/agents/{paige.md → tech-writer.md} +3 -3
  40. package/bmad/bmm/config.yaml +4 -3
  41. package/bmad/bmm/tasks/daily-standup.xml +1 -1
  42. package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/instructions.md +1 -19
  43. package/bmad/bmm/workflows/2-plan-workflows/prd/checklist.md +10 -9
  44. package/bmad/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/epics-template.md +23 -34
  45. package/bmad/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/instructions.md +105 -331
  46. package/bmad/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories/workflow.yaml +23 -11
  47. package/bmad/bmm/workflows/2-plan-workflows/prd/instructions.md +23 -38
  48. package/bmad/bmm/workflows/2-plan-workflows/prd/workflow.yaml +1 -1
  49. package/bmad/bmm/workflows/2-plan-workflows/tech-spec/epics-template.md +38 -16
  50. package/bmad/bmm/workflows/2-plan-workflows/tech-spec/instructions.md +1 -19
  51. package/bmad/bmm/workflows/2-plan-workflows/tech-spec/user-story-template.md +35 -32
  52. package/bmad/bmm/workflows/2-plan-workflows/tech-spec/workflow.yaml +2 -2
  53. package/bmad/bmm/workflows/3-solutioning/architecture/instructions.md +7 -18
  54. package/bmad/bmm/workflows/3-solutioning/solutioning-gate-check/instructions.md +1 -18
  55. package/bmad/bmm/workflows/3-solutioning/solutioning-gate-check/workflow.yaml +6 -6
  56. package/bmad/bmm/workflows/4-implementation/epic-tech-context/workflow.yaml +1 -1
  57. package/bmad/bmm/workflows/techdoc/documentation-standards.md +26 -2
  58. package/bmad/bmm/workflows/testarch/atdd/atdd-checklist-template.md +2 -2
  59. package/bmad/bmm/workflows/workflow-status/init/instructions.md +623 -242
  60. package/bmad/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +120 -0
  61. package/bmad/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +108 -0
  62. package/bmad/bmm/workflows/workflow-status/paths/{brownfield-level-3.yaml → method-brownfield.yaml} +33 -31
  63. package/{src/modules/bmm/workflows/workflow-status/paths/greenfield-level-2.yaml → bmad/bmm/workflows/workflow-status/paths/method-greenfield.yaml} +31 -21
  64. package/bmad/bmm/workflows/workflow-status/paths/{brownfield-level-1.yaml → quick-flow-brownfield.yaml} +18 -18
  65. package/bmad/bmm/workflows/workflow-status/paths/{greenfield-level-1.yaml → quick-flow-greenfield.yaml} +16 -18
  66. package/bmad/bmm/workflows/workflow-status/workflow-status-template.yaml +4 -4
  67. package/bmad/core/config.yaml +2 -2
  68. package/bmad/core/tasks/workflow.xml +1 -11
  69. package/package.json +1 -1
  70. package/src/core/tasks/workflow.xml +1 -11
  71. package/src/modules/bmb/workflows/audit-workflow/instructions.md +1 -1
  72. package/src/modules/bmm/README.md +1 -1
  73. package/src/modules/bmm/_module-installer/install-config.yaml +5 -0
  74. package/src/modules/bmm/agents/architect.agent.yaml +0 -4
  75. package/src/modules/bmm/agents/game-dev.agent.yaml +8 -12
  76. package/src/modules/bmm/agents/sm.agent.yaml +1 -1
  77. package/src/modules/bmm/agents/{paige.agent.yaml → tech-writer.agent.yaml} +4 -4
  78. package/src/modules/bmm/docs/README.md +19 -18
  79. package/src/modules/bmm/docs/agents-guide.md +47 -99
  80. package/src/modules/bmm/docs/brownfield-guide.md +216 -96
  81. package/src/modules/bmm/docs/enterprise-agentic-development.md +380 -740
  82. package/src/modules/bmm/docs/faq.md +16 -16
  83. package/src/modules/bmm/docs/glossary.md +44 -50
  84. package/src/modules/bmm/docs/party-mode.md +110 -1122
  85. package/src/modules/bmm/docs/quick-spec-flow.md +36 -36
  86. package/src/modules/bmm/docs/quick-start.md +34 -34
  87. package/src/modules/bmm/docs/scale-adaptive-system.md +304 -454
  88. package/{bmad/bmm/testarch/README.md → src/modules/bmm/docs/test-architecture.md} +56 -38
  89. package/src/modules/bmm/docs/troubleshooting.md +7 -7
  90. package/src/modules/bmm/docs/workflows-analysis.md +64 -28
  91. package/src/modules/bmm/docs/workflows-implementation.md +196 -1671
  92. package/src/modules/bmm/docs/workflows-planning.md +74 -35
  93. package/src/modules/bmm/docs/workflows-solutioning.md +47 -17
  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 +25 -2
  111. package/src/modules/bmm/workflows/testarch/atdd/atdd-checklist-template.md +2 -2
  112. package/src/modules/bmm/workflows/workflow-status/init/instructions.md +623 -242
  113. package/src/modules/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +120 -0
  114. package/src/modules/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +108 -0
  115. package/src/modules/bmm/workflows/workflow-status/paths/{brownfield-level-3.yaml → method-brownfield.yaml} +33 -31
  116. package/{bmad/bmm/workflows/workflow-status/paths/greenfield-level-2.yaml → src/modules/bmm/workflows/workflow-status/paths/method-greenfield.yaml} +31 -21
  117. package/src/modules/bmm/workflows/workflow-status/paths/{brownfield-level-1.yaml → quick-flow-brownfield.yaml} +18 -18
  118. package/src/modules/bmm/workflows/workflow-status/paths/{greenfield-level-1.yaml → quick-flow-greenfield.yaml} +16 -18
  119. package/src/modules/bmm/workflows/workflow-status/workflow-status-template.yaml +4 -4
  120. package/tools/cli/installers/lib/core/config-collector.js +39 -11
  121. package/tools/cli/installers/lib/core/ide-config-manager.js +3 -1
  122. package/tools/cli/installers/lib/core/installer.js +20 -9
  123. package/tools/cli/installers/lib/core/manifest-generator.js +3 -1
  124. package/tools/cli/installers/lib/core/manifest.js +6 -2
  125. package/tools/cli/installers/lib/modules/manager.js +6 -0
  126. package/tools/cli/lib/config.js +3 -1
  127. package/tools/cli/lib/ui.js +5 -5
  128. package/tools/cli/lib/yaml-format.js +2 -1
  129. package/tools/schema/agent.js +2 -0
  130. package/.claude/commands/bmad/bmm/workflows/tech-spec-sm.md +0 -15
  131. package/bmad/_cfg/agents/cis-brainstorming-coach.customize.yaml +0 -42
  132. package/bmad/_cfg/agents/cis-creative-problem-solver.customize.yaml +0 -42
  133. package/bmad/_cfg/agents/cis-design-thinking-coach.customize.yaml +0 -42
  134. package/bmad/_cfg/agents/cis-innovation-strategist.customize.yaml +0 -42
  135. package/bmad/_cfg/agents/cis-storyteller.customize.yaml +0 -42
  136. package/bmad/bmb/agents/bmad-builder.md.bak +0 -70
  137. package/bmad/bmb/workflows/audit-workflow/workflow.yaml.bak +0 -23
  138. package/bmad/bmb/workflows/create-module/workflow.yaml.bak +0 -42
  139. package/bmad/bmb/workflows/create-workflow/workflow-template/workflow.yaml.bak +0 -39
  140. package/bmad/bmb/workflows/create-workflow/workflow.yaml.bak +0 -40
  141. package/bmad/bmb/workflows/edit-agent/workflow.yaml.bak +0 -33
  142. package/bmad/bmb/workflows/edit-module/workflow.yaml.bak +0 -34
  143. package/bmad/bmb/workflows/edit-workflow/workflow.yaml.bak +0 -27
  144. package/bmad/bmb/workflows/module-brief/workflow.yaml.bak +0 -29
  145. package/bmad/bmb/workflows/redoc/workflow.yaml.bak +0 -32
  146. package/bmad/bmm/docs/brownfield-guide.md +0 -1260
  147. package/bmad/bmm/docs/quick-spec-flow.md +0 -645
  148. package/bmad/bmm/docs/quick-start.md +0 -341
  149. package/bmad/bmm/docs/scale-adaptive-system.md +0 -1045
  150. package/bmad/bmm/tasks/retrospective.xml +0 -104
  151. package/bmad/bmm/workflows/1-analysis/brainstorm-project/README.md +0 -113
  152. package/bmad/bmm/workflows/1-analysis/product-brief/README.md +0 -180
  153. package/bmad/bmm/workflows/1-analysis/research/README.md +0 -454
  154. package/bmad/bmm/workflows/2-plan-workflows/README.md +0 -258
  155. package/bmad/bmm/workflows/3-solutioning/README.md +0 -1
  156. package/bmad/bmm/workflows/3-solutioning/architecture/README.md +0 -318
  157. package/bmad/bmm/workflows/3-solutioning/solutioning-gate-check/README.md +0 -177
  158. package/bmad/bmm/workflows/4-implementation/README.md +0 -221
  159. package/bmad/bmm/workflows/4-implementation/code-review/README.md +0 -69
  160. package/bmad/bmm/workflows/4-implementation/correct-course/README.md +0 -73
  161. package/bmad/bmm/workflows/4-implementation/create-story/README.md +0 -146
  162. package/bmad/bmm/workflows/4-implementation/dev-story/README.md +0 -206
  163. package/bmad/bmm/workflows/4-implementation/epic-tech-context/README.md +0 -195
  164. package/bmad/bmm/workflows/4-implementation/retrospective/README.md +0 -77
  165. package/bmad/bmm/workflows/4-implementation/sprint-planning/README.md +0 -156
  166. package/bmad/bmm/workflows/4-implementation/story-context/README.md +0 -234
  167. package/bmad/bmm/workflows/README.md +0 -256
  168. package/bmad/bmm/workflows/document-project/README.md +0 -444
  169. package/bmad/bmm/workflows/document-project/templates/README.md +0 -38
  170. package/bmad/bmm/workflows/testarch/README.md +0 -26
  171. package/bmad/bmm/workflows/testarch/atdd/README.md +0 -672
  172. package/bmad/bmm/workflows/testarch/automate/README.md +0 -869
  173. package/bmad/bmm/workflows/testarch/ci/README.md +0 -493
  174. package/bmad/bmm/workflows/testarch/framework/README.md +0 -340
  175. package/bmad/bmm/workflows/testarch/nfr-assess/README.md +0 -469
  176. package/bmad/bmm/workflows/testarch/test-design/README.md +0 -493
  177. package/bmad/bmm/workflows/testarch/test-review/README.md +0 -775
  178. package/bmad/bmm/workflows/testarch/trace/README.md +0 -802
  179. package/bmad/bmm/workflows/workflow-status/README.md +0 -260
  180. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-0.yaml +0 -54
  181. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-2.yaml +0 -76
  182. package/bmad/bmm/workflows/workflow-status/paths/brownfield-level-4.yaml +0 -88
  183. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-0.yaml +0 -45
  184. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-3.yaml +0 -73
  185. package/bmad/bmm/workflows/workflow-status/paths/greenfield-level-4.yaml +0 -75
  186. package/bmad/cis/README.md +0 -153
  187. package/bmad/cis/agents/README.md +0 -104
  188. package/bmad/cis/agents/brainstorming-coach.md +0 -62
  189. package/bmad/cis/agents/creative-problem-solver.md +0 -62
  190. package/bmad/cis/agents/design-thinking-coach.md +0 -62
  191. package/bmad/cis/agents/innovation-strategist.md +0 -62
  192. package/bmad/cis/agents/storyteller.md +0 -59
  193. package/bmad/cis/config.yaml +0 -10
  194. package/bmad/cis/teams/creative-squad.yaml +0 -6
  195. package/bmad/cis/workflows/README.md +0 -139
  196. package/bmad/cis/workflows/design-thinking/README.md +0 -56
  197. package/bmad/cis/workflows/design-thinking/design-methods.csv +0 -31
  198. package/bmad/cis/workflows/design-thinking/instructions.md +0 -200
  199. package/bmad/cis/workflows/design-thinking/template.md +0 -111
  200. package/bmad/cis/workflows/design-thinking/workflow.yaml +0 -32
  201. package/bmad/cis/workflows/innovation-strategy/README.md +0 -56
  202. package/bmad/cis/workflows/innovation-strategy/innovation-frameworks.csv +0 -31
  203. package/bmad/cis/workflows/innovation-strategy/instructions.md +0 -274
  204. package/bmad/cis/workflows/innovation-strategy/template.md +0 -189
  205. package/bmad/cis/workflows/innovation-strategy/workflow.yaml +0 -32
  206. package/bmad/cis/workflows/problem-solving/README.md +0 -56
  207. package/bmad/cis/workflows/problem-solving/instructions.md +0 -250
  208. package/bmad/cis/workflows/problem-solving/solving-methods.csv +0 -31
  209. package/bmad/cis/workflows/problem-solving/template.md +0 -165
  210. package/bmad/cis/workflows/problem-solving/workflow.yaml +0 -32
  211. package/bmad/cis/workflows/storytelling/README.md +0 -58
  212. package/bmad/cis/workflows/storytelling/instructions.md +0 -291
  213. package/bmad/cis/workflows/storytelling/story-types.csv +0 -26
  214. package/bmad/cis/workflows/storytelling/template.md +0 -113
  215. package/bmad/cis/workflows/storytelling/workflow.yaml +0 -32
  216. package/bmad/core/agents/bmad-master.md.bak +0 -69
  217. package/src/modules/bmm/docs/brownfield-guide.md.backup +0 -1324
  218. package/src/modules/bmm/docs/workflows-testing.md +0 -1572
  219. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-0.yaml +0 -54
  220. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-2.yaml +0 -76
  221. package/src/modules/bmm/workflows/workflow-status/paths/brownfield-level-4.yaml +0 -88
  222. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-0.yaml +0 -45
  223. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-3.yaml +0 -73
  224. package/src/modules/bmm/workflows/workflow-status/paths/greenfield-level-4.yaml +0 -75
  225. /package/bmad/_cfg/agents/{bmm-paige.customize.yaml → bmm-tech-writer.customize.yaml} +0 -0
@@ -1,1324 +0,0 @@
1
- # BMad Method Brownfield Development Guide
2
-
3
- ## Overview
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.
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?
10
-
11
- Brownfield projects involve working within existing codebases rather than starting fresh. This includes:
12
-
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
18
-
19
- The key difference from greenfield development: you must understand and respect existing patterns, architecture, and constraints.
20
-
21
- ## Scale-Adaptive Workflow System
22
-
23
- BMad Method v6 uses a **scale-adaptive** approach that automatically routes brownfield projects through appropriate workflows based on complexity:
24
-
25
- ### Brownfield Complexity Levels
26
-
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 |
34
-
35
- ### How Scale Determination Works
36
-
37
- When you run `workflow-init`, it asks about YOUR work first, then uses existing artifacts as context:
38
-
39
- #### Step 1: Understand What You're Working On
40
-
41
- The workflow asks you first:
42
-
43
- 1. **Project name**: "What's your project called?"
44
-
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:
48
-
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"
55
-
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
58
-
59
- 3. **Asks about your work**: "Tell me about what you're working on. What's the goal?"
60
-
61
- 4. **Analyzes your description** using keyword detection:
62
-
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"
68
-
69
- **Examples:**
70
-
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**
76
-
77
- 5. **Suggests and confirms**: "Based on your description: Level X brownfield project. Is that correct?"
78
-
79
- #### How It Handles Old Artifacts
80
-
81
- **Scenario: Old Level 3 PRD, New Level 0 Work**
82
-
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?"
86
-
87
- You: "b - Documents from a previous effort"
88
-
89
- System: "Tell me about what you're working on"
90
- You: "I need to update payment method enums"
91
-
92
- System: "Level 0 brownfield project. Is that correct?"
93
- You: "yes"
94
-
95
- ✅ Result: Level 0 workflow
96
- ```
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
232
- ```
233
-
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
329
-
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)
333
-
334
- **Use For:**
335
-
336
- - Major feature additions
337
- - Architectural integrations
338
- - Multi-system changes
339
- - Complex data migrations
340
-
341
- **Key Considerations:**
342
-
343
- - Review existing architecture first
344
- - Plan integration strategy
345
- - Document architectural extensions
346
- - Identify migration paths
347
- - Plan backward compatibility
348
-
349
- **Phase 3 Workflows:**
350
-
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
355
-
356
- **Example:** Adding real-time collaboration features to existing document editor
357
-
358
- #### Level 4: Enterprise Expansion
359
-
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)
363
-
364
- **Use For:**
365
-
366
- - Platform expansions
367
- - Multi-team initiatives
368
- - System-wide modernization
369
- - Major architectural shifts
370
-
371
- **Key Considerations:**
372
-
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
380
-
381
- **Critical for Enterprise:**
382
-
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
388
-
389
- **Example:** Adding multi-tenancy to existing single-tenant SaaS platform
390
-
391
- ### Phase 3: Solutioning (Levels 2-4)
392
-
393
- **Purpose:** Design architectural extensions and integration strategy.
394
-
395
- **Workflows Available:**
396
-
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 |
404
-
405
- **Critical Differences from Greenfield:**
406
-
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
412
-
413
- **Architecture Extensions Should Include:**
414
-
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
421
-
422
- ### Phase 4: Implementation (Iterative)
423
-
424
- **Purpose:** Transform plans into working code through sprint-based iteration.
425
-
426
- #### The Sprint Planning Entry Point
427
-
428
- Phase 4 begins with the `sprint-planning` workflow:
429
-
430
- **What It Does:**
431
-
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
436
-
437
- **Run sprint-planning:**
438
-
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
443
-
444
- #### The Implementation Loop
445
-
446
- ```mermaid
447
- flowchart TD
448
- TRANS[Phase Transition]
449
- SPRINT[sprint-planning]
450
- EPIC[epic-tech-context<br/>per epic]
451
- CREATE[create-story]
452
- CONTEXT[story-context]
453
- DEV[dev-story]
454
- REVIEW[code-review]
455
-
456
- DRAFTED[Status: drafted]
457
- READY[Status: ready-for-dev]
458
- INPROG[Status: in-progress]
459
- REV[Status: review]
460
- DONE[Status: done]
461
-
462
- CHECK{Epic complete?}
463
- RETRO[retrospective]
464
- MORE{More epics?}
465
-
466
- TRANS --> SPRINT
467
- SPRINT --> EPIC
468
- EPIC --> CREATE
469
- CREATE --> DRAFTED
470
- DRAFTED --> CONTEXT
471
- CONTEXT --> READY
472
- READY --> DEV
473
- DEV --> INPROG
474
- INPROG --> REVIEW
475
- REVIEW --> REV
476
- REV --> DONE
477
- DONE --> CHECK
478
- CHECK -->|No, more stories| CREATE
479
- CHECK -->|Yes| RETRO
480
- RETRO --> MORE
481
- MORE -->|Yes| EPIC
482
- MORE -->|No| COMPLETE([Project Complete])
483
-
484
- style SPRINT fill:#bfb,stroke:#333,stroke-width:2px
485
- style EPIC fill:#bbf,stroke:#333,stroke-width:2px
486
- style RETRO fill:#fbf,stroke:#333,stroke-width:2px
487
- style COMPLETE fill:#f9f,stroke:#333,stroke-width:3px
488
- ```
489
-
490
- #### Status State Machine
491
-
492
- **Epic Status:**
493
-
494
- ```mermaid
495
- stateDiagram-v2
496
- [*] --> backlog
497
- backlog --> contexted: epic-tech-context
498
- contexted --> [*]
499
- ```
500
-
501
- **Story Status:**
502
-
503
- ```mermaid
504
- stateDiagram-v2
505
- [*] --> backlog
506
- backlog --> drafted: create-story
507
- drafted --> ready_for_dev: story-context
508
- ready_for_dev --> in_progress: dev-story starts
509
- in_progress --> review: dev-story completes
510
- review --> done: code-review passes
511
- done --> [*]
512
- ```
513
-
514
- #### Phase 4 Workflows
515
-
516
- | Workflow | Agent | Purpose | Status Update |
517
- | ------------------- | ----- | ------------------------------- | ------------------------------------------- |
518
- | `sprint-planning` | SM | Initialize sprint tracking | Creates sprint-status.yaml |
519
- | `epic-tech-context` | SM | Create epic technical context | Epic: backlog → contexted |
520
- | `create-story` | SM | Draft individual story | Story: backlog → drafted |
521
- | `story-context` | SM | Generate implementation context | Story: drafted → ready-for-dev |
522
- | `dev-story` | DEV | Implement story | Story: ready-for-dev → in-progress → review |
523
- | `code-review` | SM/SR | Quality validation | Manual state management |
524
- | `retrospective` | SM | Capture epic learnings | Retrospective: optional → completed |
525
- | `correct-course` | SM | Handle issues/scope changes | Adaptive based on situation |
526
-
527
- #### Brownfield-Specific Implementation Considerations
528
-
529
- 1. **Respect Existing Patterns**
530
- - Use existing coding conventions
531
- - Follow established architectural approaches
532
- - Maintain consistency with current UI/UX patterns
533
- - Preserve team preferences and standards
534
-
535
- 2. **Integration Testing is Critical**
536
- - Test interactions with existing functionality
537
- - Validate API contracts remain unchanged (unless intentionally versioned)
538
- - Check for regression in existing features
539
- - Verify performance impact on legacy components
540
-
541
- 3. **Gradual Rollout Strategy**
542
- - Implement feature flags for new functionality
543
- - Plan rollback strategy
544
- - Support backward compatibility
545
- - Consider migration scripts for data/schema changes
546
-
547
- 4. **Context Injection**
548
- - `epic-tech-context`: Provides technical guidance specific to epic scope
549
- - `story-context`: Generates implementation context for each story
550
- - Both reference existing codebase patterns and integration points
551
- - Ensures developers have exact expertise needed for each task
552
-
553
- ## Workflow Routing by Level
554
-
555
- ### Visual Decision Tree
556
-
557
- ```mermaid
558
- flowchart TD
559
- START([workflow-status])
560
- HASDOCS{Has documentation?}
561
- DOC[document-project<br/>Choose scan level]
562
- LEVEL{Complexity level?}
563
-
564
- L0[Level 0]
565
- L1[Level 1]
566
- L2[Level 2]
567
- L3[Level 3]
568
- L4[Level 4]
569
-
570
- TS0[tech-spec]
571
- TS1[tech-spec]
572
- PRD2[prd]
573
- PRD3[prd]
574
- PRD4[prd]
575
-
576
- TS2[tech-spec]
577
- ARCH[create-architecture]
578
-
579
- SPRINT[sprint-planning]
580
- IMPL[Implementation Loop]
581
-
582
- START --> HASDOCS
583
- HASDOCS -->|No| DOC
584
- HASDOCS -->|Yes| LEVEL
585
- DOC --> LEVEL
586
-
587
- LEVEL --> L0
588
- LEVEL --> L1
589
- LEVEL --> L2
590
- LEVEL --> L3
591
- LEVEL --> L4
592
-
593
- L0 --> TS0
594
- L1 --> TS1
595
- L2 --> PRD2
596
- L3 --> PRD3
597
- L4 --> PRD4
598
-
599
- TS0 --> SPRINT
600
- TS1 --> SPRINT
601
- PRD2 --> TS2
602
- PRD3 --> ARCH
603
- PRD4 --> ARCH
604
-
605
- TS2 --> SPRINT
606
- ARCH --> SPRINT
607
- SPRINT --> IMPL
608
-
609
- style START fill:#bfb,stroke:#333,stroke-width:2px
610
- style HASDOCS fill:#ffb,stroke:#333,stroke-width:2px
611
- style LEVEL fill:#ffb,stroke:#333,stroke-width:2px
612
- style SPRINT fill:#bbf,stroke:#333,stroke-width:2px
613
- style IMPL fill:#f9f,stroke:#333,stroke-width:3px
614
- ```
615
-
616
- ### Path Files
617
-
618
- The v6 system uses modular path definitions for each brownfield level:
619
-
620
- **Location:** `/src/modules/bmm/workflows/workflow-status/paths/`
621
-
622
- - `brownfield-level-0.yaml` - Single atomic change path
623
- - `brownfield-level-1.yaml` - Small feature path
624
- - `brownfield-level-2.yaml` - Medium project path
625
- - `brownfield-level-3.yaml` - Complex integration path
626
- - `brownfield-level-4.yaml` - Enterprise expansion path
627
-
628
- Each path file clearly defines:
629
-
630
- - Required vs optional workflows for each phase
631
- - Agent assignments
632
- - Expected outputs
633
- - Integration notes
634
-
635
- ## Universal Entry Points
636
-
637
- ### `workflow-status` - Your Command Center
638
-
639
- **Always start here.** This workflow:
640
-
641
- - Checks for existing workflow status file
642
- - Displays current phase and progress
643
- - Shows next recommended action
644
- - Routes to appropriate workflows based on context
645
-
646
- **For New Projects:**
647
-
648
- - Detects missing status file
649
- - Directs to `workflow-init`
650
- - Guides through project setup
651
-
652
- **For Existing Projects:**
653
-
654
- - Displays current phase and progress
655
- - Shows Phase 4 implementation state
656
- - Recommends exact next action
657
- - Offers to change workflow if needed
658
-
659
- **Example Usage:**
660
-
661
- ```bash
662
- bmad analyst workflow-status
663
- ```
664
-
665
- ### `workflow-init` - Smart Initialization
666
-
667
- 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:
668
-
669
- **Step 1: Quick Scan (Context Only)**
670
-
671
- - Checks for existing code (`src/`, package files, `.git`)
672
- - Checks for planning artifacts (PRD, epics, stories, architecture docs)
673
- - Does NOT analyze in depth yet - just sees what's there
674
-
675
- **Step 2: Ask About YOUR Work**
676
-
677
- Asks: "What's your project called?"
678
-
679
- Then, if it found existing work, shows what it found and asks:
680
-
681
- > **"Looking at what I found, are these:**
682
- >
683
- > a) Works in progress you're finishing
684
- > b) Documents from a previous effort (you're doing something NEW now)
685
- > c) The proposed work you're about to start
686
- > d) None of these - let me explain"
687
-
688
- **Your Paths:**
689
-
690
- - **Choose (a) or (c):** System analyzes the artifacts to determine level
691
- - **Choose (b) or (d):** System asks you to describe your NEW work
692
-
693
- **Step 3: Determine Level**
694
-
695
- If continuing old work: Counts stories from artifacts
696
- If new work: Asks "Tell me about what you're working on" and uses keyword detection
697
-
698
- Then confirms: "Level X brownfield project. Is that correct?"
699
-
700
- **Step 4: Create Workflow**
701
-
702
- - Loads appropriate path file: `brownfield-level-{0-4}.yaml`
703
- - Generates workflow with all phases and workflows
704
- - Creates status file
705
-
706
- **Example: Old Level 3 PRD, New Level 0 Work**
707
-
708
- ```
709
- System: "What's your project called?"
710
- You: "PaymentApp"
711
-
712
- System: "I found: PRD.md (Level 3, 30 stories, 6mo ago), src/ codebase"
713
- System: "Are these works in progress, previous effort, or proposed work?"
714
-
715
- You: "b - Previous effort"
716
-
717
- System: "Tell me about what you're working on"
718
- You: "I need to update payment method enums"
719
-
720
- System: "Level 0 brownfield project. Is that correct?"
721
- You: "yes"
722
-
723
- ✅ Creates Level 0 workflow
724
- ```
725
-
726
- **Smart Features:**
727
-
728
- - Asks about YOUR work first
729
- - Uses artifacts as context, not primary source
730
- - Keyword detection: "fix", "update" → Level 0
731
- - Handles scaffolds: "Just a starter" → still greenfield
732
- - Flags missing documentation automatically
733
-
734
- ## Key Artifacts in Brownfield Projects
735
-
736
- ### Tracking Documents
737
-
738
- **`bmm-workflow-status.md`** (Phases 0-3)
739
-
740
- - Current phase and progress
741
- - Workflow history
742
- - Next recommended actions
743
- - Project metadata
744
-
745
- **`sprint-status.yaml`** (Phase 4 only)
746
-
747
- - All epics, stories, retrospectives
748
- - Current status for each item
749
- - Single source of truth for implementation
750
- - Updated by agents as work progresses
751
-
752
- ### Planning Documents
753
-
754
- **Level 0-1:**
755
-
756
- - `tech-spec.md` - Technical specification
757
- - `story-{key}.md` - Story files
758
-
759
- **Level 2:**
760
-
761
- - `PRD.md` - Product requirements
762
- - `epics.md` - Epic breakdown
763
- - `tech-spec.md` - Technical specification
764
-
765
- **Level 3-4:**
766
-
767
- - `PRD.md` - Product requirements
768
- - `epics.md` - Epic breakdown
769
- - `architecture.md` - Architecture extensions
770
- - Integration and validation reports
771
-
772
- ### Implementation Documents
773
-
774
- **Phase 4 Artifacts:**
775
-
776
- - `sprint-status.yaml` - Status tracking
777
- - `epic-{n}-context.md` - Epic technical contexts
778
- - `stories/` directory:
779
- - `{epic}-{story}-{title}.md` - Story definitions
780
- - `{epic}-{story}-{title}-context.md` - Implementation contexts
781
-
782
- ## Best Practices for Brownfield Success
783
-
784
- ### 1. Always Document First
785
-
786
- Even if you know the codebase well, AI agents need comprehensive context. Run `document-project` with appropriate scan level before planning.
787
-
788
- **Why:** AI discovers undocumented patterns, integration points, and constraints that humans might overlook or take for granted.
789
-
790
- **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:
791
-
792
- - **Quick fix:** Run the `index-docs` task (lightweight, just creates index)
793
- - **Comprehensive:** Use `document-project` with Deep scan to create index AND enhance docs
794
- - The index provides structured navigation for AI agents
795
-
796
- ### 2. Be Specific About Your Current Work
797
-
798
- When `workflow-init` asks about your work, be specific about what you're doing NOW:
799
-
800
- **Good descriptions:**
801
-
802
- - "I need to update payment method enums to include Apple Pay"
803
- - "Adding forgot password feature to existing auth system"
804
- - "Building admin dashboard with analytics and user management"
805
-
806
- **Why this matters:** The system uses your description to suggest the right complexity level. Clear, specific descriptions lead to accurate routing through appropriate workflows.
807
-
808
- ### 3. Choose the Right Documentation Approach
809
-
810
- **For existing docs without index:**
811
-
812
- - Use `index-docs` task - fast, lightweight, just generates index
813
- - Located at `bmad/core/tasks/index-docs.xml`
814
-
815
- **For comprehensive codebase documentation:**
816
-
817
- - Use `document-project` workflow with appropriate scan level:
818
- - **Quick:** Fast overview, planning next steps
819
- - **Deep:** Brownfield PRD preparation (most common)
820
- - **Exhaustive:** Migration planning, complete understanding
821
-
822
- ### 4. Respect Existing Patterns
823
-
824
- The brownfield templates identify:
825
-
826
- - Current coding conventions
827
- - Architectural approaches
828
- - Technology constraints
829
- - Team preferences
830
-
831
- **Always preserve these unless explicitly modernizing them.**
832
-
833
- ### 5. Plan Integration Points Explicitly
834
-
835
- Document in your tech-spec or architecture:
836
-
837
- - Which existing modules you'll modify
838
- - What APIs/services you'll integrate with
839
- - How data flows between new and existing code
840
- - What shared components you'll reuse
841
-
842
- ### 6. Design for Gradual Rollout
843
-
844
- Brownfield changes should support:
845
-
846
- - Feature flags for new functionality
847
- - Rollback strategies
848
- - Backward compatibility
849
- - Migration scripts (if needed)
850
-
851
- ### 7. Test Integration Thoroughly
852
-
853
- Use the Test Architect (TEA) workflows:
854
-
855
- - `test-design` - Plan integration test strategy
856
- - `test-review` - Validate test coverage
857
- - `nfr-assess` - Check performance/security impact
858
-
859
- **Critical for Brownfield:**
860
-
861
- - Regression testing of existing features
862
- - Integration point validation
863
- - Performance impact assessment
864
- - API contract verification
865
-
866
- ### 8. Use Sprint Planning Effectively
867
-
868
- - Run `sprint-planning` at Phase 4 start
869
- - Context epics before drafting stories
870
- - Update `sprint-status.yaml` as work progresses
871
- - Re-run sprint-planning to sync with file system
872
-
873
- ### 9. Leverage Context Injection
874
-
875
- - Run `epic-tech-context` before story drafting
876
- - Always create `story-context` before implementation
877
- - These workflows reference existing patterns for consistency
878
-
879
- ### 10. Learn Continuously
880
-
881
- - Run `retrospective` after each epic
882
- - Incorporate learnings into next story drafts
883
- - Update patterns discovered during development
884
- - Share insights across team
885
-
886
- ## Common Brownfield Scenarios
887
-
888
- ### Scenario 1: Bug Fix (Level 0)
889
-
890
- **Situation:** Authentication token expiration causing logout issues
891
-
892
- **Workflow:**
893
-
894
- 1. `workflow-status` → detects brownfield, suggests Level 0
895
- 2. Skip Phase 0 if auth system is documented
896
- 3. `tech-spec` → analyzes bug, plans fix, creates single story
897
- 4. `sprint-planning` → creates sprint status
898
- 5. `dev-story` → implement fix
899
- 6. `code-review` → validate fix + test regression
900
-
901
- **Time:** ~2-4 hours total
902
-
903
- ### Scenario 2: Small Feature (Level 1)
904
-
905
- **Situation:** Add "forgot password" to existing auth system
906
-
907
- **Workflow:**
908
-
909
- 1. `workflow-status` → suggests Level 1
910
- 2. Phase 0: `document-project` (deep scan of auth module if not documented)
911
- 3. Phase 1: Optional - skip if requirements are clear
912
- 4. Phase 2: `tech-spec` → creates epic with 3-5 stories
913
- 5. Phase 4: `sprint-planning` → `create-story` → `dev-story` → repeat
914
-
915
- **Time:** 1-3 days
916
-
917
- ### Scenario 3: Feature Set (Level 2)
918
-
919
- **Situation:** Add user dashboard with analytics, preferences, activity
920
-
921
- **Workflow:**
922
-
923
- 1. `workflow-status` → suggests Level 2
924
- 2. Phase 0: `document-project` (deep scan) - critical for understanding existing UI patterns
925
- 3. Phase 1: `research` (if evaluating analytics libraries)
926
- 4. Phase 2: `prd` → `tech-spec`
927
- 5. Phase 4: Sprint-based implementation (10-15 stories)
928
-
929
- **Time:** 1-2 weeks
930
-
931
- ### Scenario 4: Complex Integration (Level 3)
932
-
933
- **Situation:** Add real-time collaboration to document editor
934
-
935
- **Workflow:**
936
-
937
- 1. `workflow-status` → suggests Level 3
938
- 2. Phase 0: `document-project` (exhaustive if not documented)
939
- 3. Phase 1: `research` (WebSocket vs WebRTC vs CRDT)
940
- 4. Phase 2: `prd` → creates requirements + epics
941
- 5. Phase 3:
942
- - `architecture-review` → understand existing editor architecture
943
- - `integration-planning` → plan WebSocket integration strategy
944
- - `create-architecture` → extend architecture for real-time layer
945
- - `solutioning-gate-check` → validate before implementation
946
- 6. Phase 4: Sprint-based implementation (20-30 stories)
947
-
948
- **Time:** 3-6 weeks
949
-
950
- ### Scenario 5: Enterprise Expansion (Level 4)
951
-
952
- **Situation:** Add multi-tenancy to single-tenant SaaS platform
953
-
954
- **Workflow:**
955
-
956
- 1. `workflow-status` → suggests Level 4
957
- 2. Phase 0: `document-project` (exhaustive) - **mandatory**
958
- 3. Phase 1: **Required**
959
- - `brainstorm-project` → explore multi-tenancy approaches
960
- - `research` → database sharding, tenant isolation, pricing models
961
- - `product-brief` → strategic document
962
- 4. Phase 2: `prd` → comprehensive requirements
963
- 5. Phase 3:
964
- - `architecture-review` → full existing system review
965
- - `integration-planning` → phased migration strategy
966
- - `create-architecture` → multi-tenancy architecture
967
- - `validate-architecture` → external review
968
- - `solutioning-gate-check` → executive approval
969
- 6. Phase 4: Phased sprint-based implementation (50+ stories)
970
-
971
- **Time:** 3-6 months
972
-
973
- ## Troubleshooting Common Issues
974
-
975
- ### Issue: AI Lacks Codebase Understanding
976
-
977
- **Symptoms:**
978
-
979
- - Generated plans don't align with existing patterns
980
- - Suggestions ignore available components
981
- - Integration approaches miss existing APIs
982
-
983
- **Solution:**
984
-
985
- 1. Run `document-project` with deep or exhaustive scan
986
- 2. Review `index.md` - ensure it captures key systems
987
- 3. If specific area is unclear, run deep-dive mode on that area
988
- 4. Provide additional context in PRD about existing systems
989
-
990
- ### Issue: Have Documentation But Agents Can't Find It
991
-
992
- **Symptoms:**
993
-
994
- - You have README, ARCHITECTURE.md, CONTRIBUTING.md, etc.
995
- - But AI agents aren't using the information effectively
996
- - Agents ask questions already answered in existing docs
997
- - No `docs/index.md` file exists
998
-
999
- **Solution:**
1000
-
1001
- 1. **Quick fix:** Run the `index-docs` task (from `bmad/core/tasks/index-docs.xml`)
1002
- - Lightweight and fast (just indexes existing docs)
1003
- - Scans your docs directory
1004
- - Generates organized `index.md` with file descriptions
1005
- - Provides AI agents with structured navigation
1006
-
1007
- 2. **Comprehensive approach:** Run `document-project` with Deep/Exhaustive scan
1008
- - Discovers existing docs in Step 2 (shows you what it found)
1009
- - Generates NEW AI-friendly documentation from codebase analysis
1010
- - Creates index.md that links to BOTH existing docs AND new docs
1011
- - Useful when existing docs are good but need technical codebase analysis too
1012
-
1013
- **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.
1014
-
1015
- ### Issue: Plans Feel Too Complex for Simple Changes
1016
-
1017
- **Symptoms:**
1018
-
1019
- - Level 2+ workflow suggested for minor change
1020
- - Too much documentation overhead
1021
-
1022
- **Solution:**
1023
-
1024
- 1. Re-run `workflow-status` or `workflow-init`
1025
- 2. Correct the level when prompted (choose Level 0 or 1)
1026
- 3. Trust your judgment - BMad Method adapts to your choice
1027
- 4. Skip optional phases (Analysis)
1028
-
1029
- ### Issue: Integration Points Unclear
1030
-
1031
- **Symptoms:**
1032
-
1033
- - Stories lack detail on connecting to existing systems
1034
- - Uncertainty about which existing code to modify
1035
-
1036
- **Solution:**
1037
-
1038
- 1. Ensure Phase 0 documentation is complete
1039
- 2. Run deep-dive on integration areas in `document-project`
1040
- 3. In Phase 2, explicitly document integration points
1041
- 4. In Phase 3 (if Level 3+), use `integration-planning` workflow
1042
- 5. Create detailed `epic-tech-context` and `story-context`
1043
-
1044
- ### Issue: Existing Tests Breaking
1045
-
1046
- **Symptoms:**
1047
-
1048
- - Regression test failures
1049
- - Existing functionality broken by changes
1050
-
1051
- **Solution:**
1052
-
1053
- 1. Review existing test patterns in documentation
1054
- 2. Use Test Architect workflows:
1055
- - `test-design` - Plan test strategy upfront
1056
- - `trace` - Map requirements to tests
1057
- - `test-review` - Validate before merging
1058
- 3. Add regression testing to Definition of Done
1059
- 4. Consider feature flags for gradual rollout
1060
-
1061
- ### Issue: Inconsistent Patterns Being Introduced
1062
-
1063
- **Symptoms:**
1064
-
1065
- - New code doesn't match existing style
1066
- - Different architectural approach than existing modules
1067
-
1068
- **Solution:**
1069
-
1070
- 1. Ensure `document-project` captured existing patterns
1071
- 2. Review architecture documentation before Phase 4
1072
- 3. Use `story-context` to inject pattern guidance
1073
- 4. Include pattern adherence in `code-review` checklist
1074
- 5. Run retrospectives to identify pattern deviations
1075
-
1076
- ## Test Architect Integration
1077
-
1078
- The Test Architect (TEA) plays a critical role in brownfield projects to prevent regression and validate integration.
1079
-
1080
- ### Four-Stage Approach
1081
-
1082
- **Stage 1 (Before Development):**
1083
-
1084
- - Risk assessment identifying legacy dependencies
1085
- - Test design planning for regression + new features
1086
- - Integration point identification
1087
-
1088
- **Stage 2 (During Development):**
1089
-
1090
- - Requirements tracing validating existing functionality preservation
1091
- - NFR validation ensuring performance/security unchanged
1092
-
1093
- **Stage 3 (Code Review):**
1094
-
1095
- - Deep analysis of API contracts, data migrations
1096
- - Performance regression checks
1097
- - Integration point validation
1098
- - Dependency mapping
1099
-
1100
- **Stage 4 (Post-Review):**
1101
-
1102
- - Gate status updates
1103
- - Technical debt documentation
1104
-
1105
- ### TEA Workflows for Brownfield
1106
-
1107
- | Workflow | Purpose | When to Use |
1108
- | ------------- | -------------------------- | ------------------------------------ |
1109
- | `test-design` | Plan testing strategy | After Phase 2, before implementation |
1110
- | `test-review` | Validate test coverage | During story review |
1111
- | `trace` | Map requirements to tests | After test implementation |
1112
- | `nfr-assess` | Check performance/security | Before major releases |
1113
- | `atdd` | Acceptance test planning | For user-facing features |
1114
-
1115
- ### Risk Scoring for Brownfield
1116
-
1117
- TEA uses enhanced brownfield metrics:
1118
-
1119
- - **Regression Risk** = integration_points × code_age
1120
- - **Data Risk** = migration_complexity × data_volume
1121
- - **Performance Risk** = current_load × added_complexity
1122
- - **Compatibility Risk** = api_consumers × contract_changes
1123
-
1124
- **Automatic Thresholds:**
1125
-
1126
- - Score ≥9: Automatic failure (must mitigate)
1127
- - Score ≥6: Concern (requires mitigation plan)
1128
- - Score <6: Acceptable (document only)
1129
-
1130
- ## Quick Reference Commands
1131
-
1132
- ```bash
1133
- # Universal Entry Point (Always Start Here)
1134
- bmad analyst workflow-status
1135
-
1136
- # Phase 0: Documentation (If Needed)
1137
- bmad analyst document-project
1138
- # → Choose: Quick / Deep / Exhaustive
1139
-
1140
- # Phase 1: Analysis (Optional)
1141
- bmad analyst brainstorm-project # Explore solutions
1142
- bmad analyst research # Gather technical/market data
1143
- bmad analyst product-brief # Strategic planning
1144
-
1145
- # Phase 2: Planning (Required)
1146
- bmad pm tech-spec # Level 0-1 only
1147
- bmad pm prd # Level 2-4 only
1148
-
1149
- # Phase 3: Solutioning (Levels 2-4)
1150
- bmad architect architecture-review # Review existing (L3-4)
1151
- bmad architect integration-planning # Plan integration (L3-4)
1152
- bmad architect create-architecture # Extend architecture (L2-4)
1153
- bmad architect solutioning-gate-check # Final approval (L3-4)
1154
-
1155
- # Phase 4: Implementation (All Levels)
1156
- bmad sm sprint-planning # FIRST: Initialize tracking
1157
- bmad sm epic-tech-context # Create epic context
1158
- bmad sm create-story # Draft story
1159
- bmad sm story-context # Create story context
1160
- bmad dev dev-story # Implement story
1161
- bmad sm code-review # Review implementation
1162
- # (Manually update sprint-status.yaml to 'done')
1163
- bmad sm retrospective # After epic completion
1164
- bmad sm correct-course # If issues arise
1165
-
1166
- # Test Architect (Integration Throughout)
1167
- bmad tea test-design # Plan testing strategy
1168
- bmad tea test-review # Validate test coverage
1169
- bmad tea nfr-assess # Check performance/security
1170
- ```
1171
-
1172
- ## Key Files Reference
1173
-
1174
- ### Documentation Phase
1175
-
1176
- - `docs/index.md` - **Master documentation index (REQUIRED for AI agents)** - Primary entry point
1177
- - `docs/project-overview.md` - Executive summary
1178
- - `docs/architecture.md` - Architecture analysis
1179
- - `docs/source-tree-analysis.md` - Annotated directory structure
1180
- - `docs/api-contracts.md` - API documentation (if applicable)
1181
- - `docs/data-models.md` - Database schemas (if applicable)
1182
- - `docs/deep-dive-{area}.md` - Area-specific deep dives
1183
- - Existing docs (README.md, ARCHITECTURE.md, etc.) - Incorporated and linked from index
1184
-
1185
- ### Planning Phase
1186
-
1187
- - `bmm-workflow-status.md` - Phase 0-3 tracking
1188
- - `PRD.md` - Product requirements (L2-4)
1189
- - `epics.md` - Epic breakdown (L2-4)
1190
- - `tech-spec.md` - Technical specification (L0-2)
1191
-
1192
- ### Solutioning Phase
1193
-
1194
- - `architecture.md` - Architecture extensions (L2-4)
1195
- - `integration-strategy.md` - Integration planning (L3-4)
1196
- - Validation and gate check reports
1197
-
1198
- ### Implementation Phase
1199
-
1200
- - `sprint-status.yaml` - **Single source of truth** for Phase 4
1201
- - `epic-{n}-context.md` - Epic technical contexts
1202
- - `stories/{epic}-{story}-{title}.md` - Story files
1203
- - `stories/{epic}-{story}-{title}-context.md` - Story contexts
1204
-
1205
- ## Comparison: v4 vs v6 Brownfield
1206
-
1207
- ### What Changed
1208
-
1209
- **v4 Approach:**
1210
-
1211
- - Task-based system with fixed workflows
1212
- - Manual tracking across multiple documents
1213
- - Heavy upfront documentation requirements
1214
- - Rigid phase progression
1215
-
1216
- **v6 Improvements:**
1217
-
1218
- - Scale-adaptive workflows (0-4 levels)
1219
- - Unified status tracking (`workflow-status`, `sprint-status.yaml`)
1220
- - Three-level scanning (quick/deep/exhaustive)
1221
- - Just-in-time context injection
1222
- - Flexible resumability
1223
- - Modular workflow paths
1224
- - Intelligent routing system
1225
-
1226
- ### Migration from v4
1227
-
1228
- If you used BMad Method v4, here's how to transition:
1229
-
1230
- **Old v4 Task → New v6 Workflow:**
1231
-
1232
- - `create-brownfield-prd` → `prd` (with brownfield path)
1233
- - `document-project` → `document-project` (enhanced with scan levels)
1234
- - Legacy task templates → Replaced by workflow system
1235
- - Manual status tracking → `sprint-status.yaml` + agents
1236
-
1237
- **Key Conceptual Shifts:**
1238
-
1239
- 1. **Scale-adaptive planning** - Choose level based on complexity
1240
- 2. **Phase 0 is conditional** - Only if documentation is lacking
1241
- 3. **Sprint status is centralized** - Single YAML file for Phase 4
1242
- 4. **Context injection** - Epic and story contexts provide JIT guidance
1243
- 5. **Workflow paths** - Clean separation by level and field type
1244
-
1245
- ## Tips for Success
1246
-
1247
- ### For Solo Developers
1248
-
1249
- 1. Don't skip documentation phase - even if you know the code, AI agents need it
1250
- 2. Choose appropriate scan level - deep scan is usually best for brownfield PRDs
1251
- 3. Use Level 0-1 for small changes - don't over-engineer simple fixes
1252
- 4. Trust the sprint planning system - it tracks everything automatically
1253
- 5. Be specific when describing your work - helps system route to the right level
1254
-
1255
- ### For Teams
1256
-
1257
- 1. Document once, use everywhere - Phase 0 documentation serves entire team
1258
- 2. Use sprint-status.yaml as single source of truth - no multiple tracking systems
1259
- 3. Run retrospectives after epics - transfer learning to next stories
1260
- 4. Coordinate parallel work - multiple stories can be in-progress if capacity allows
1261
- 5. Establish clear communication about current iteration scope vs historical complexity
1262
-
1263
- ### For Enterprise
1264
-
1265
- 1. Phase 0 is mandatory - comprehensive documentation prevents costly mistakes
1266
- 2. Include stakeholders early - Analysis phase (Phase 1) gathers business context
1267
- 3. Use gate checks - `solutioning-gate-check` provides approval checkpoint
1268
- 4. Plan phased rollout - feature flags and migration strategies are critical
1269
- 5. Document architectural extensions - maintain system documentation as you evolve
1270
- 6. Consider archiving completed planning artifacts to keep workspace clean
1271
-
1272
- ## Support and Resources
1273
-
1274
- **Documentation:**
1275
-
1276
- - [BMM Workflows Guide](../src/modules/bmm/workflows/README.md) - Complete v6 workflow reference
1277
- - [Test Architect Guide](../src/modules/bmm/testarch/README.md) - Quality and testing strategy
1278
- - [BMM Module README](../src/modules/bmm/README.md) - Module overview
1279
-
1280
- **Community:**
1281
-
1282
- - Discord: [https://discord.gg/gk8jAdXWmj](https://discord.gg/gk8jAdXWmj) (#general-dev, #bugs-issues)
1283
- - GitHub Issues: [https://github.com/bmad-code-org/BMAD-METHOD/issues](https://github.com/bmad-code-org/BMAD-METHOD/issues)
1284
- - YouTube: [https://www.youtube.com/@BMadCode](https://www.youtube.com/@BMadCode)
1285
-
1286
- **Getting Started:**
1287
-
1288
- ```bash
1289
- # Install BMad Method
1290
- npx bmad-method install
1291
-
1292
- # Start your first brownfield project
1293
- cd your-project
1294
- bmad analyst workflow-status
1295
- ```
1296
-
1297
- ---
1298
-
1299
- ## Remember
1300
-
1301
- **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.
1302
-
1303
- **Key Principles:**
1304
-
1305
- 1. **Ask First, Infer Second**: The system asks about YOUR work first, then uses artifacts as context
1306
- 2. **Scale Adapts**: From single fixes (Level 0) to enterprise expansions (Level 4)
1307
- 3. **Documentation Matters**: AI agents need comprehensive context to work effectively
1308
- 4. **Context Injection**: Epic and story contexts provide just-in-time guidance
1309
- 5. **Sprint-Based Tracking**: Single source of truth keeps everyone aligned
1310
-
1311
- **Quick Start:**
1312
-
1313
- ```bash
1314
- cd your-brownfield-project
1315
- bmad analyst workflow-status
1316
-
1317
- # System will guide you through:
1318
- # 1. What's your project called?
1319
- # 2. What are you working on? (if finds old work: "is this continuing old work or new work?")
1320
- # 3. Confirms detected level
1321
- # 4. Creates appropriate workflow
1322
- ```
1323
-
1324
- **The system is designed to understand YOUR current work and route you to the right workflows.**