@rdmind/rdmind 0.0.9-alpha.1 → 0.0.9

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 (109) hide show
  1. package/.knowledge/.ext/.bmad-core/agent-teams/team-all.yaml +15 -0
  2. package/.knowledge/.ext/.bmad-core/agent-teams/team-fullstack.yaml +19 -0
  3. package/.knowledge/.ext/.bmad-core/agent-teams/team-ide-minimal.yaml +11 -0
  4. package/.knowledge/.ext/.bmad-core/agent-teams/team-no-ui.yaml +14 -0
  5. package/.knowledge/.ext/.bmad-core/agents/analyst.md +84 -0
  6. package/.knowledge/.ext/.bmad-core/agents/architect.md +85 -0
  7. package/.knowledge/.ext/.bmad-core/agents/bmad-master.md +110 -0
  8. package/.knowledge/.ext/.bmad-core/agents/bmad-orchestrator.md +147 -0
  9. package/.knowledge/.ext/.bmad-core/agents/dev.md +81 -0
  10. package/.knowledge/.ext/.bmad-core/agents/pm.md +84 -0
  11. package/.knowledge/.ext/.bmad-core/agents/po.md +79 -0
  12. package/.knowledge/.ext/.bmad-core/agents/qa.md +90 -0
  13. package/.knowledge/.ext/.bmad-core/agents/ra.md +74 -0
  14. package/.knowledge/.ext/.bmad-core/agents/sm.md +65 -0
  15. package/.knowledge/.ext/.bmad-core/agents/ux-expert.md +69 -0
  16. package/.knowledge/.ext/.bmad-core/checklists/architect-checklist.md +440 -0
  17. package/.knowledge/.ext/.bmad-core/checklists/change-checklist.md +184 -0
  18. package/.knowledge/.ext/.bmad-core/checklists/pm-checklist.md +372 -0
  19. package/.knowledge/.ext/.bmad-core/checklists/po-master-checklist.md +434 -0
  20. package/.knowledge/.ext/.bmad-core/checklists/story-dod-checklist.md +96 -0
  21. package/.knowledge/.ext/.bmad-core/checklists/story-draft-checklist.md +155 -0
  22. package/.knowledge/.ext/.bmad-core/checklists/trd-checklist.md +226 -0
  23. package/.knowledge/.ext/.bmad-core/core-config.yaml +22 -0
  24. package/.knowledge/.ext/.bmad-core/data/bmad-kb.md +809 -0
  25. package/.knowledge/.ext/.bmad-core/data/brainstorming-techniques.md +38 -0
  26. package/.knowledge/.ext/.bmad-core/data/elicitation-methods.md +156 -0
  27. package/.knowledge/.ext/.bmad-core/data/technical-preferences.md +5 -0
  28. package/.knowledge/.ext/.bmad-core/data/test-levels-framework.md +148 -0
  29. package/.knowledge/.ext/.bmad-core/data/test-priorities-matrix.md +174 -0
  30. package/.knowledge/.ext/.bmad-core/enhanced-ide-development-workflow.md +248 -0
  31. package/.knowledge/.ext/.bmad-core/install-manifest.yaml +512 -0
  32. package/.knowledge/.ext/.bmad-core/tasks/advanced-elicitation.md +119 -0
  33. package/.knowledge/.ext/.bmad-core/tasks/analyze-prd.md +123 -0
  34. package/.knowledge/.ext/.bmad-core/tasks/apply-qa-fixes.md +150 -0
  35. package/.knowledge/.ext/.bmad-core/tasks/brownfield-create-epic.md +162 -0
  36. package/.knowledge/.ext/.bmad-core/tasks/brownfield-create-story.md +149 -0
  37. package/.knowledge/.ext/.bmad-core/tasks/correct-course.md +72 -0
  38. package/.knowledge/.ext/.bmad-core/tasks/create-brownfield-story.md +314 -0
  39. package/.knowledge/.ext/.bmad-core/tasks/create-deep-research-prompt.md +280 -0
  40. package/.knowledge/.ext/.bmad-core/tasks/create-doc.md +103 -0
  41. package/.knowledge/.ext/.bmad-core/tasks/create-next-story.md +114 -0
  42. package/.knowledge/.ext/.bmad-core/tasks/document-project.md +345 -0
  43. package/.knowledge/.ext/.bmad-core/tasks/execute-checklist.md +88 -0
  44. package/.knowledge/.ext/.bmad-core/tasks/facilitate-brainstorming-session.md +138 -0
  45. package/.knowledge/.ext/.bmad-core/tasks/generate-ai-frontend-prompt.md +53 -0
  46. package/.knowledge/.ext/.bmad-core/tasks/index-docs.md +175 -0
  47. package/.knowledge/.ext/.bmad-core/tasks/kb-mode-interaction.md +77 -0
  48. package/.knowledge/.ext/.bmad-core/tasks/nfr-assess.md +345 -0
  49. package/.knowledge/.ext/.bmad-core/tasks/qa-gate.md +163 -0
  50. package/.knowledge/.ext/.bmad-core/tasks/review-story.md +316 -0
  51. package/.knowledge/.ext/.bmad-core/tasks/risk-profile.md +355 -0
  52. package/.knowledge/.ext/.bmad-core/tasks/shard-doc.md +187 -0
  53. package/.knowledge/.ext/.bmad-core/tasks/test-design.md +176 -0
  54. package/.knowledge/.ext/.bmad-core/tasks/trace-requirements.md +266 -0
  55. package/.knowledge/.ext/.bmad-core/tasks/validate-next-story.md +136 -0
  56. package/.knowledge/.ext/.bmad-core/tasks/validate-trd.md +158 -0
  57. package/.knowledge/.ext/.bmad-core/templates/architecture-tmpl.yaml +651 -0
  58. package/.knowledge/.ext/.bmad-core/templates/brainstorming-output-tmpl.yaml +156 -0
  59. package/.knowledge/.ext/.bmad-core/templates/brownfield-architecture-tmpl.yaml +478 -0
  60. package/.knowledge/.ext/.bmad-core/templates/brownfield-prd-tmpl.yaml +281 -0
  61. package/.knowledge/.ext/.bmad-core/templates/competitor-analysis-tmpl.yaml +349 -0
  62. package/.knowledge/.ext/.bmad-core/templates/front-end-architecture-tmpl.yaml +273 -0
  63. package/.knowledge/.ext/.bmad-core/templates/front-end-spec-tmpl.yaml +360 -0
  64. package/.knowledge/.ext/.bmad-core/templates/fullstack-architecture-tmpl.yaml +947 -0
  65. package/.knowledge/.ext/.bmad-core/templates/market-research-tmpl.yaml +253 -0
  66. package/.knowledge/.ext/.bmad-core/templates/prd-tmpl.yaml +203 -0
  67. package/.knowledge/.ext/.bmad-core/templates/project-brief-tmpl.yaml +222 -0
  68. package/.knowledge/.ext/.bmad-core/templates/qa-gate-tmpl.yaml +103 -0
  69. package/.knowledge/.ext/.bmad-core/templates/story-tmpl.yaml +138 -0
  70. package/.knowledge/.ext/.bmad-core/templates/trd-tmpl.yaml +198 -0
  71. package/.knowledge/.ext/.bmad-core/user-guide.md +530 -0
  72. package/.knowledge/.ext/.bmad-core/utils/bmad-doc-template.md +327 -0
  73. package/.knowledge/.ext/.bmad-core/utils/workflow-management.md +71 -0
  74. package/.knowledge/.ext/.bmad-core/workflows/brownfield-fullstack.yaml +298 -0
  75. package/.knowledge/.ext/.bmad-core/workflows/brownfield-service.yaml +188 -0
  76. package/.knowledge/.ext/.bmad-core/workflows/brownfield-ui.yaml +198 -0
  77. package/.knowledge/.ext/.bmad-core/workflows/greenfield-fullstack.yaml +241 -0
  78. package/.knowledge/.ext/.bmad-core/workflows/greenfield-service.yaml +207 -0
  79. package/.knowledge/.ext/.bmad-core/workflows/greenfield-ui.yaml +236 -0
  80. package/.knowledge/.ext/.bmad-core/working-in-the-brownfield.md +606 -0
  81. package/.knowledge/.ext/coding/ddd-architecture.md +223 -0
  82. package/.knowledge/.ext/coding/java-standards.md +308 -0
  83. package/.knowledge/.ext/coding/mybatis-standards.md +407 -0
  84. package/.knowledge/.ext/coding/sql-standards.md +263 -0
  85. package/.knowledge/.ext/coding/thrift-service.md +292 -0
  86. package/.knowledge/BMAD.md +255 -0
  87. package/.knowledge/coding.md +135 -0
  88. package/dist/package.json +4 -3
  89. package/dist/src/config/extension.js.map +1 -1
  90. package/dist/src/generated/git-commit.d.ts +2 -2
  91. package/dist/src/generated/git-commit.js +2 -2
  92. package/dist/src/generated/git-commit.js.map +1 -1
  93. package/dist/src/services/McpPromptLoader.js +1 -1
  94. package/dist/src/services/McpPromptLoader.js.map +1 -1
  95. package/dist/src/services/prompt-processors/atFileProcessor.js +1 -1
  96. package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -1
  97. package/dist/src/ui/commands/mcpCommand.js.map +1 -1
  98. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
  99. package/dist/src/ui/components/Tips.js +1 -1
  100. package/dist/src/ui/components/Tips.js.map +1 -1
  101. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
  102. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -1
  103. package/dist/src/ui/components/subagents/create/CreationSummary.js.map +1 -1
  104. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -1
  105. package/dist/src/ui/hooks/usePhraseCycler.js +2 -2
  106. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
  107. package/dist/src/utils/installationInfo.test.js.map +1 -1
  108. package/dist/tsconfig.tsbuildinfo +1 -1
  109. package/package.json +4 -3
@@ -0,0 +1,606 @@
1
+ # Working in the Brownfield: A Complete Guide
2
+
3
+ ## Critical Tip
4
+
5
+ Regardless of what you plan for your existing project you want to start agentic coding with, producing contextual artifacts for agents is of the highest importance.
6
+
7
+ If using Claude Code - it is recommended to use the document-project task with the architect to systematically produce important key artifacts for your codebase.
8
+
9
+ Optionally you can product context information and understanding for your repo utilizing web agents like Gemini. If its already in github, you can provide the project URL in gemini and use the agents to help analyze or document the project with the team fullstack or the architect specific gem.
10
+
11
+ If your project is too large, you can also flatten your codebase - which can make it easier to upload or use with some tools. You can read more about the optional tool in the [Flattener Guide](./flattener.md)
12
+
13
+ ## What is Brownfield Development?
14
+
15
+ Brownfield development refers to adding features, fixing bugs, or modernizing existing software projects. Unlike greenfield (new) projects, brownfield work requires understanding existing code, respecting constraints, and ensuring new changes integrate seamlessly without breaking existing functionality.
16
+
17
+ ## When to Use BMad for Brownfield
18
+
19
+ - Add significant new features to existing applications
20
+ - Modernize legacy codebases
21
+ - Integrate new technologies or services
22
+ - Refactor complex systems
23
+ - Fix bugs that require architectural understanding
24
+ - Document undocumented systems
25
+
26
+ ## When NOT to use a Brownfield Flow
27
+
28
+ If you have just completed an MVP with BMad, and you want to continue with post-MVP, its easier to just talk to the PM and ask it to work with you to create a new epic to add into the PRD, shard out the epic, update any architecture documents with the architect, and just go from there.
29
+
30
+ ## The Complete Brownfield Workflow
31
+
32
+ Starting in the Web Option (potentially save some cost but a potentially more frustrating experience):
33
+
34
+ 1. **Follow the [<ins>User Guide - Installation</ins>](user-guide.md#installation) steps to setup your agent in the web.**
35
+ 2. **Generate a 'flattened' single file of your entire codebase** run: `npx bmad-method flatten`
36
+
37
+ Starting in an IDE with large context and good models (Its important to use quality models for this process for the best results)
38
+
39
+ 1. In Claude Code or a similar IDE, select the architect agent and then use the \*document-project task. You will want to ensure you are validating and directing the agent to produce the best possible documents for LLMs to understand your code base, and not include any misleading or unnecessary info.
40
+
41
+ ### Choose Your Approach
42
+
43
+ #### Approach A: PRD-First (Recommended if adding very large and complex new features, single or multiple epics or massive changes)
44
+
45
+ **Best for**: Large codebases, monorepos, or when you know exactly what you want to build
46
+
47
+ 1. **Create PRD First** to define requirements
48
+ 2. **Document only relevant areas** based on PRD needs
49
+ 3. **More efficient** - avoids documenting unused code
50
+
51
+ #### Approach B: Document-First (Good for Smaller Projects)
52
+
53
+ **Best for**: Smaller codebases, unknown systems, or exploratory changes
54
+
55
+ 1. **Document entire system** first
56
+ 2. **Create PRD** with full context
57
+ 3. **More thorough** - captures everything
58
+
59
+ ### Approach A: PRD-First Workflow (Recommended)
60
+
61
+ #### Phase 1: Define Requirements First
62
+
63
+ **In Gemini Web (with your flattened-codebase.xml uploaded):**
64
+
65
+ ```bash
66
+ @pm
67
+ *create-brownfield-prd
68
+ ```
69
+
70
+ The PM will:
71
+
72
+ - **Ask about your enhancement** requirements
73
+ - **Explore the codebase** to understand current state
74
+ - **Identify affected areas** that need documentation
75
+ - **Create focused PRD** with clear scope
76
+
77
+ **Key Advantage**: The PRD identifies which parts of your monorepo/large codebase actually need documentation!
78
+
79
+ #### Phase 2: Focused Documentation
80
+
81
+ **Still in Gemini Web, now with PRD context:**
82
+
83
+ ```bash
84
+ @architect
85
+ *document-project
86
+ ```
87
+
88
+ The architect will:
89
+
90
+ - **Ask about your focus** if no PRD was provided
91
+ - **Offer options**: Create PRD, provide requirements, or describe the enhancement
92
+ - **Reference the PRD/description** to understand scope
93
+ - **Focus on relevant modules** identified in PRD or your description
94
+ - **Skip unrelated areas** to keep docs lean
95
+ - **Generate ONE architecture document** for all environments
96
+
97
+ The architect creates:
98
+
99
+ - **One comprehensive architecture document** following fullstack-architecture template
100
+ - **Covers all system aspects** in a single file
101
+ - **Easy to copy and save** as `docs/architecture.md`
102
+ - **Can be sharded later** in IDE if desired
103
+
104
+ For example, if you say "Add payment processing to user service":
105
+
106
+ - Documents only: user service, API endpoints, database schemas, payment integrations
107
+ - Creates focused source tree showing only payment-related code paths
108
+ - Skips: admin panels, reporting modules, unrelated microservices
109
+
110
+ ### Approach B: Document-First Workflow
111
+
112
+ #### Phase 1: Document the Existing System
113
+
114
+ **Best Approach - Gemini Web with 1M+ Context**:
115
+
116
+ 1. **Go to Gemini Web** (gemini.google.com)
117
+ 2. **Upload your project**:
118
+ - **Option A**: Paste your GitHub repository URL directly
119
+ - **Option B**: Upload your flattened-codebase.xml file
120
+ 3. **Load the architect agent**: Upload `dist/agents/architect.txt`
121
+ 4. **Run documentation**: Type `*document-project`
122
+
123
+ The architect will generate comprehensive documentation of everything.
124
+
125
+ #### Phase 2: Plan Your Enhancement
126
+
127
+ ##### Option A: Full Brownfield Workflow (Recommended for Major Changes)
128
+
129
+ **1. Create Brownfield PRD**:
130
+
131
+ ```bash
132
+ @pm
133
+ *create-brownfield-prd
134
+ ```
135
+
136
+ The PM agent will:
137
+
138
+ - **Analyze existing documentation** from Phase 1
139
+ - **Request specific enhancement details** from you
140
+ - **Assess complexity** and recommend approach
141
+ - **Create epic/story structure** for the enhancement
142
+ - **Identify risks and integration points**
143
+
144
+ **How PM Agent Gets Project Context**:
145
+
146
+ - In Gemini Web: Already has full project context from Phase 1 documentation
147
+ - In IDE: Will ask "Please provide the path to your existing project documentation"
148
+
149
+ **Key Prompts You'll Encounter**:
150
+
151
+ - "What specific enhancement or feature do you want to add?"
152
+ - "Are there any existing systems or APIs this needs to integrate with?"
153
+ - "What are the critical constraints we must respect?"
154
+ - "What is your timeline and team size?"
155
+
156
+ **2. Create Brownfield Architecture**:
157
+
158
+ ```bash
159
+ @architect
160
+ *create-brownfield-architecture
161
+ ```
162
+
163
+ The architect will:
164
+
165
+ - **Review the brownfield PRD**
166
+ - **Design integration strategy**
167
+ - **Plan migration approach** if needed
168
+ - **Identify technical risks**
169
+ - **Define compatibility requirements**
170
+
171
+ ##### Option B: Quick Enhancement (For Focused Changes)
172
+
173
+ **For Single Epic Without Full PRD**:
174
+
175
+ ```bash
176
+ @pm
177
+ *create-brownfield-epic
178
+ ```
179
+
180
+ Use when:
181
+
182
+ - Enhancement is well-defined and isolated
183
+ - Existing documentation is comprehensive
184
+ - Changes don't impact multiple systems
185
+ - You need quick turnaround
186
+
187
+ **For Single Story**:
188
+
189
+ ```bash
190
+ @pm
191
+ *create-brownfield-story
192
+ ```
193
+
194
+ Use when:
195
+
196
+ - Bug fix or tiny feature
197
+ - Very isolated change
198
+ - No architectural impact
199
+ - Clear implementation path
200
+
201
+ ### Phase 3: Validate Planning Artifacts
202
+
203
+ ```bash
204
+ @po
205
+ *execute-checklist-po
206
+ ```
207
+
208
+ The PO ensures:
209
+
210
+ - Compatibility with existing system
211
+ - No breaking changes planned
212
+ - Risk mitigation strategies in place
213
+ - Clear integration approach
214
+
215
+ ### Phase 4: Save and Shard Documents
216
+
217
+ 1. Save your PRD and Architecture as:
218
+ docs/prd.md
219
+ docs/architecture.md
220
+ (Note: You can optionally prefix with 'brownfield-' if managing multiple versions)
221
+ 2. Shard your docs:
222
+ In your IDE
223
+
224
+ ```bash
225
+ @po
226
+ shard docs/prd.md
227
+ ```
228
+
229
+ ```bash
230
+ @po
231
+ shard docs/architecture.md
232
+ ```
233
+
234
+ ### Phase 5: Transition to Development
235
+
236
+ **Follow the [<ins>Enhanced IDE Development Workflow</ins>](enhanced-ide-development-workflow.md)**
237
+
238
+ ## Brownfield Best Practices
239
+
240
+ ### 1. Always Document First
241
+
242
+ Even if you think you know the codebase:
243
+
244
+ - Run `document-project` to capture current state
245
+ - AI agents need this context
246
+ - Discovers undocumented patterns
247
+
248
+ ### 2. Respect Existing Patterns
249
+
250
+ The brownfield templates specifically look for:
251
+
252
+ - Current coding conventions
253
+ - Existing architectural patterns
254
+ - Technology constraints
255
+ - Team preferences
256
+
257
+ ### 3. Plan for Gradual Rollout
258
+
259
+ Brownfield changes should:
260
+
261
+ - Support feature flags
262
+ - Plan rollback strategies
263
+ - Include migration scripts
264
+ - Maintain backwards compatibility
265
+
266
+ ### 4. Test Integration Thoroughly
267
+
268
+ #### Why the Test Architect is Critical for Brownfield
269
+
270
+ In brownfield projects, the Test Architect (Quinn) becomes your safety net against breaking existing functionality. Unlike greenfield where you're building fresh, brownfield requires careful validation that new changes don't destabilize what already works.
271
+
272
+ #### Brownfield-Specific Testing Challenges
273
+
274
+ The Test Architect addresses unique brownfield complexities:
275
+
276
+ | **Challenge** | **How Test Architect Helps** | **Command** |
277
+ | --------------------------- | ------------------------------------------------- | ------------------- |
278
+ | **Regression Risks** | Identifies which existing features might break | `*risk` |
279
+ | **Legacy Dependencies** | Maps integration points and hidden dependencies | `*trace` |
280
+ | **Performance Degradation** | Validates no slowdown in existing flows | `*nfr` |
281
+ | **Coverage Gaps** | Finds untested legacy code that new changes touch | `*design` |
282
+ | **Breaking Changes** | Detects API/contract violations | `*review` |
283
+ | **Migration Safety** | Validates data transformations and rollback plans | `*risk` + `*review` |
284
+
285
+ #### Complete Test Architect Workflow for Brownfield
286
+
287
+ ##### Stage 1: Before Development (Risk & Strategy)
288
+
289
+ **CRITICAL FOR BROWNFIELD - Run These First:**
290
+
291
+ ```bash
292
+ # 1. RISK ASSESSMENT (Run IMMEDIATELY after story creation)
293
+ @qa *risk {brownfield-story}
294
+ # Identifies: Legacy dependencies, breaking changes, integration points
295
+ # Output: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
296
+ # Brownfield Focus:
297
+ # - Regression probability scoring
298
+ # - Affected downstream systems
299
+ # - Data migration risks
300
+ # - Rollback complexity
301
+
302
+ # 2. TEST DESIGN (After risk assessment)
303
+ @qa *design {brownfield-story}
304
+ # Creates: Regression test strategy + new feature tests
305
+ # Output: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md
306
+ # Brownfield Focus:
307
+ # - Existing functionality that needs regression tests
308
+ # - Integration test requirements
309
+ # - Performance benchmarks to maintain
310
+ # - Feature flag test scenarios
311
+ ```
312
+
313
+ ##### Stage 2: During Development (Continuous Validation)
314
+
315
+ **Monitor Integration Health While Coding:**
316
+
317
+ ```bash
318
+ # 3. REQUIREMENTS TRACING (Mid-development checkpoint)
319
+ @qa *trace {brownfield-story}
320
+ # Maps: New requirements + existing functionality preservation
321
+ # Output: docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md
322
+ # Brownfield Focus:
323
+ # - Existing features that must still work
324
+ # - New/old feature interactions
325
+ # - API contract preservation
326
+ # - Missing regression test coverage
327
+
328
+ # 4. NFR VALIDATION (Before considering "done")
329
+ @qa *nfr {brownfield-story}
330
+ # Validates: Performance, security, reliability unchanged
331
+ # Output: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
332
+ # Brownfield Focus:
333
+ # - Performance regression detection
334
+ # - Security implications of integrations
335
+ # - Backward compatibility validation
336
+ # - Load/stress on legacy components
337
+ ```
338
+
339
+ ##### Stage 3: Code Review (Deep Integration Analysis)
340
+
341
+ **Comprehensive Brownfield Review:**
342
+
343
+ ```bash
344
+ # 5. FULL REVIEW (When development complete)
345
+ @qa *review {brownfield-story}
346
+ # Performs: Deep analysis + active refactoring
347
+ # Outputs:
348
+ # - QA Results in story file
349
+ # - Gate file: docs/qa/gates/{epic}.{story}-{slug}.yml
350
+ ```
351
+
352
+ The review specifically analyzes:
353
+
354
+ - **API Breaking Changes**: Validates all existing contracts maintained
355
+ - **Data Migration Safety**: Checks transformation logic and rollback procedures
356
+ - **Performance Regression**: Compares against baseline metrics
357
+ - **Integration Points**: Validates all touchpoints with legacy code
358
+ - **Feature Flag Logic**: Ensures proper toggle behavior
359
+ - **Dependency Impacts**: Maps affected downstream systems
360
+
361
+ ##### Stage 4: Post-Review (Gate Updates)
362
+
363
+ ```bash
364
+ # 6. GATE STATUS UPDATE (After addressing issues)
365
+ @qa *gate {brownfield-story}
366
+ # Updates: Quality gate decision after fixes
367
+ # Output: docs/qa/gates/{epic}.{story}-{slug}.yml
368
+ # Brownfield Considerations:
369
+ # - May WAIVE certain legacy code issues
370
+ # - Documents technical debt acceptance
371
+ # - Tracks migration progress
372
+ ```
373
+
374
+ #### Brownfield-Specific Risk Scoring
375
+
376
+ The Test Architect uses enhanced risk scoring for brownfield:
377
+
378
+ | **Risk Category** | **Brownfield Factors** | **Impact on Gate** |
379
+ | ---------------------- | ------------------------------------------ | ------------------- |
380
+ | **Regression Risk** | Number of integration points × Age of code | Score ≥9 = FAIL |
381
+ | **Data Risk** | Migration complexity × Data volume | Score ≥6 = CONCERNS |
382
+ | **Performance Risk** | Current load × Added complexity | Score ≥6 = CONCERNS |
383
+ | **Compatibility Risk** | API consumers × Contract changes | Score ≥9 = FAIL |
384
+
385
+ #### Brownfield Testing Standards
386
+
387
+ Quinn enforces additional standards for brownfield:
388
+
389
+ - **Regression Test Coverage**: Every touched legacy module needs tests
390
+ - **Performance Baselines**: Must maintain or improve current metrics
391
+ - **Rollback Procedures**: Every change needs a rollback plan
392
+ - **Feature Flags**: All risky changes behind toggles
393
+ - **Integration Tests**: Cover all legacy touchpoints
394
+ - **Contract Tests**: Validate API compatibility
395
+ - **Data Validation**: Migration correctness checks
396
+
397
+ #### Quick Reference: Brownfield Test Commands
398
+
399
+ | **Scenario** | **Commands to Run** | **Order** | **Why Critical** |
400
+ | --------------------------------- | ---------------------------------------------------- | ---------- | ----------------------------- |
401
+ | **Adding Feature to Legacy Code** | `*risk` → `*design` → `*trace` → `*review` | Sequential | Map all dependencies first |
402
+ | **API Modification** | `*risk` → `*design` → `*nfr` → `*review` | Sequential | Prevent breaking consumers |
403
+ | **Performance-Critical Change** | `*nfr` early and often → `*review` | Continuous | Catch degradation immediately |
404
+ | **Data Migration** | `*risk` → `*design` → `*trace` → `*review` → `*gate` | Full cycle | Ensure data integrity |
405
+ | **Bug Fix in Complex System** | `*risk` → `*trace` → `*review` | Focused | Prevent side effects |
406
+
407
+ #### Integration with Brownfield Scenarios
408
+
409
+ **Scenario-Specific Guidance:**
410
+
411
+ 1. **Legacy Code Modernization**
412
+ - Start with `*risk` to map all dependencies
413
+ - Use `*design` to plan strangler fig approach
414
+ - Run `*trace` frequently to ensure nothing breaks
415
+ - `*review` with focus on gradual migration
416
+
417
+ 2. **Adding Features to Monolith**
418
+ - `*risk` identifies integration complexity
419
+ - `*design` plans isolation strategies
420
+ - `*nfr` monitors performance impact
421
+ - `*review` validates no monolith degradation
422
+
423
+ 3. **Microservice Extraction**
424
+ - `*risk` maps service boundaries
425
+ - `*trace` ensures functionality preservation
426
+ - `*nfr` validates network overhead acceptable
427
+ - `*gate` documents accepted trade-offs
428
+
429
+ 4. **Database Schema Changes**
430
+ - `*risk` assesses migration complexity
431
+ - `*design` plans backward-compatible approach
432
+ - `*trace` maps all affected queries
433
+ - `*review` validates migration safety
434
+
435
+ ### 5. Communicate Changes
436
+
437
+ Document:
438
+
439
+ - What changed and why
440
+ - Migration instructions
441
+ - New patterns introduced
442
+ - Deprecation notices
443
+
444
+ ## Common Brownfield Scenarios
445
+
446
+ ### Scenario 1: Adding a New Feature
447
+
448
+ 1. Document existing system
449
+ 2. Create brownfield PRD focusing on integration
450
+ 3. **Test Architect Early Involvement**:
451
+ - Run `@qa *risk` on draft stories to identify integration risks
452
+ - Use `@qa *design` to plan regression test strategy
453
+ 4. Architecture emphasizes compatibility
454
+ 5. Stories include integration tasks with test requirements
455
+ 6. **During Development**:
456
+ - Developer runs `@qa *trace` to verify coverage
457
+ - Use `@qa *nfr` to monitor performance impact
458
+ 7. **Review Stage**: `@qa *review` validates integration safety
459
+
460
+ ### Scenario 2: Modernizing Legacy Code
461
+
462
+ 1. Extensive documentation phase
463
+ 2. PRD includes migration strategy
464
+ 3. **Test Architect Strategy Planning**:
465
+ - `@qa *risk` assesses modernization complexity
466
+ - `@qa *design` plans parallel testing approach
467
+ 4. Architecture plans gradual transition (strangler fig pattern)
468
+ 5. Stories follow incremental modernization with:
469
+ - Regression tests for untouched legacy code
470
+ - Integration tests for new/old boundaries
471
+ - Performance benchmarks at each stage
472
+ 6. **Continuous Validation**: Run `@qa *trace` after each increment
473
+ 7. **Gate Management**: Use `@qa *gate` to track technical debt acceptance
474
+
475
+ ### Scenario 3: Bug Fix in Complex System
476
+
477
+ 1. Document relevant subsystems
478
+ 2. Use `create-brownfield-story` for focused fix
479
+ 3. **Test Architect Risk Assessment**: Run `@qa *risk` to identify side effect potential
480
+ 4. Include regression test requirements from `@qa *design` output
481
+ 5. **During Fix**: Use `@qa *trace` to map affected functionality
482
+ 6. **Before Commit**: Run `@qa *review` for comprehensive validation
483
+ 7. Test Architect validates no side effects using:
484
+ - Risk profiling for side effect analysis (probability × impact scoring)
485
+ - Trace matrix to ensure fix doesn't break related features
486
+ - NFR assessment to verify performance/security unchanged
487
+ - Gate decision documents fix safety
488
+
489
+ ### Scenario 4: API Integration
490
+
491
+ 1. Document existing API patterns
492
+ 2. PRD defines integration requirements
493
+ 3. **Test Architect Contract Analysis**:
494
+ - `@qa *risk` identifies breaking change potential
495
+ - `@qa *design` creates contract test strategy
496
+ 4. Architecture ensures consistent patterns
497
+ 5. **API Testing Focus**:
498
+ - Contract tests for backward compatibility
499
+ - Integration tests for new endpoints
500
+ - Performance tests for added load
501
+ 6. Stories include API documentation updates
502
+ 7. **Validation Checkpoints**:
503
+ - `@qa *trace` maps all API consumers
504
+ - `@qa *nfr` validates response times
505
+ - `@qa *review` ensures no breaking changes
506
+ 8. **Gate Decision**: Document any accepted breaking changes with migration path
507
+
508
+ ## Troubleshooting
509
+
510
+ ### "The AI doesn't understand my codebase"
511
+
512
+ **Solution**: Re-run `document-project` with more specific paths to critical files
513
+
514
+ ### "Generated plans don't fit our patterns"
515
+
516
+ **Solution**: Update generated documentation with your specific conventions before planning phase
517
+
518
+ ### "Too much boilerplate for small changes"
519
+
520
+ **Solution**: Use `create-brownfield-story` instead of full workflow
521
+
522
+ ### "Integration points unclear"
523
+
524
+ **Solution**: Provide more context during PRD creation, specifically highlighting integration systems
525
+
526
+ ## Quick Reference
527
+
528
+ ### Brownfield-Specific Commands
529
+
530
+ ```bash
531
+ # Document existing project
532
+ @architect *document-project
533
+
534
+ # Create enhancement PRD
535
+ @pm *create-brownfield-prd
536
+
537
+ # Create architecture with integration focus
538
+ @architect *create-brownfield-architecture
539
+
540
+ # Quick epic creation
541
+ @pm *create-brownfield-epic
542
+
543
+ # Single story creation
544
+ @pm *create-brownfield-story
545
+ ```
546
+
547
+ ### Test Architect Commands for Brownfield
548
+
549
+ Note: Short forms shown below. Full commands: `*risk-profile`, `*test-design`, `*nfr-assess`, `*trace-requirements`
550
+
551
+ ```bash
552
+ # BEFORE DEVELOPMENT (Planning)
553
+ @qa *risk {story} # Assess regression & integration risks
554
+ @qa *design {story} # Plan regression + new feature tests
555
+
556
+ # DURING DEVELOPMENT (Validation)
557
+ @qa *trace {story} # Verify coverage of old + new
558
+ @qa *nfr {story} # Check performance degradation
559
+
560
+ # AFTER DEVELOPMENT (Review)
561
+ @qa *review {story} # Deep integration analysis
562
+ @qa *gate {story} # Update quality decision
563
+ ```
564
+
565
+ ### Decision Tree
566
+
567
+ ```text
568
+ Do you have a large codebase or monorepo?
569
+ ├─ Yes → PRD-First Approach
570
+ │ └─ Create PRD → Document only affected areas
571
+ └─ No → Is the codebase well-known to you?
572
+ ├─ Yes → PRD-First Approach
573
+ └─ No → Document-First Approach
574
+
575
+ Is this a major enhancement affecting multiple systems?
576
+ ├─ Yes → Full Brownfield Workflow
577
+ │ └─ ALWAYS run Test Architect *risk + *design first
578
+ └─ No → Is this more than a simple bug fix?
579
+ ├─ Yes → *create-brownfield-epic
580
+ │ └─ Run Test Architect *risk for integration points
581
+ └─ No → *create-brownfield-story
582
+ └─ Still run *risk if touching critical paths
583
+
584
+ Does the change touch legacy code?
585
+ ├─ Yes → Test Architect is MANDATORY
586
+ │ ├─ *risk → Identify regression potential
587
+ │ ├─ *design → Plan test coverage
588
+ │ └─ *review → Validate no breakage
589
+ └─ No → Test Architect is RECOMMENDED
590
+ └─ *review → Ensure quality standards
591
+ ```
592
+
593
+ ## Conclusion
594
+
595
+ Brownfield development with BMad Method provides structure and safety when modifying existing systems. The Test Architect becomes your critical safety net, using risk assessment, regression testing, and continuous validation to ensure new changes don't destabilize existing functionality.
596
+
597
+ **The Brownfield Success Formula:**
598
+
599
+ 1. **Document First** - Understand what exists
600
+ 2. **Assess Risk Early** - Use Test Architect `*risk` before coding
601
+ 3. **Plan Test Strategy** - Design regression + new feature tests
602
+ 4. **Validate Continuously** - Check integration health during development
603
+ 5. **Review Comprehensively** - Deep analysis before committing
604
+ 6. **Gate Decisively** - Document quality decisions
605
+
606
+ Remember: **In brownfield, the Test Architect isn't optional - it's your insurance policy against breaking production.**