bmad-method 4.42.1 → 4.43.1

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 (105) hide show
  1. package/CONTRIBUTING.md +2 -9
  2. package/README.md +0 -98
  3. package/bmad-core/agents/bmad-master.md +6 -6
  4. package/bmad-core/data/bmad-kb.md +1 -0
  5. package/bmad-core/tasks/validate-next-story.md +1 -1
  6. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +5 -5
  7. package/dist/agents/analyst.txt +1 -0
  8. package/dist/agents/architect.txt +5 -5
  9. package/dist/agents/bmad-master.txt +12 -11
  10. package/dist/agents/bmad-orchestrator.txt +1 -0
  11. package/dist/agents/dev.txt +1 -1
  12. package/dist/agents/po.txt +1 -1
  13. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.txt +1 -1
  14. package/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +1 -1
  15. package/dist/expansion-packs/bmad-godot-game-dev/agents/bmad-orchestrator.txt +1513 -0
  16. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-analyst.txt +3190 -0
  17. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-architect.txt +4499 -0
  18. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-designer.txt +3925 -0
  19. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-developer.txt +666 -0
  20. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-pm.txt +2381 -0
  21. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-po.txt +1612 -0
  22. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-qa.txt +1745 -0
  23. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-sm.txt +1208 -0
  24. package/dist/expansion-packs/bmad-godot-game-dev/agents/game-ux-expert.txt +958 -0
  25. package/dist/expansion-packs/bmad-godot-game-dev/teams/godot-game-team.txt +27721 -0
  26. package/dist/teams/team-all.txt +7 -6
  27. package/dist/teams/team-fullstack.txt +7 -6
  28. package/dist/teams/team-ide-minimal.txt +2 -1
  29. package/dist/teams/team-no-ui.txt +7 -6
  30. package/docs/GUIDING-PRINCIPLES.md +3 -3
  31. package/docs/expansion-packs.md +3 -83
  32. package/docs/flattener.md +91 -0
  33. package/docs/versions.md +1 -1
  34. package/docs/working-in-the-brownfield.md +15 -6
  35. package/expansion-packs/bmad-godot-game-dev/README.md +244 -0
  36. package/expansion-packs/bmad-godot-game-dev/agent-teams/godot-game-team.yaml +18 -0
  37. package/expansion-packs/bmad-godot-game-dev/agents/bmad-orchestrator.md +147 -0
  38. package/expansion-packs/bmad-godot-game-dev/agents/game-analyst.md +84 -0
  39. package/expansion-packs/bmad-godot-game-dev/agents/game-architect.md +146 -0
  40. package/expansion-packs/bmad-godot-game-dev/agents/game-designer.md +78 -0
  41. package/expansion-packs/bmad-godot-game-dev/agents/game-developer.md +124 -0
  42. package/expansion-packs/bmad-godot-game-dev/agents/game-pm.md +82 -0
  43. package/expansion-packs/bmad-godot-game-dev/agents/game-po.md +115 -0
  44. package/expansion-packs/bmad-godot-game-dev/agents/game-qa.md +160 -0
  45. package/expansion-packs/bmad-godot-game-dev/agents/game-sm.md +66 -0
  46. package/expansion-packs/bmad-godot-game-dev/agents/game-ux-expert.md +75 -0
  47. package/expansion-packs/bmad-godot-game-dev/checklists/game-architect-checklist.md +377 -0
  48. package/expansion-packs/bmad-godot-game-dev/checklists/game-change-checklist.md +250 -0
  49. package/expansion-packs/bmad-godot-game-dev/checklists/game-design-checklist.md +225 -0
  50. package/expansion-packs/bmad-godot-game-dev/checklists/game-po-checklist.md +448 -0
  51. package/expansion-packs/bmad-godot-game-dev/checklists/game-story-dod-checklist.md +202 -0
  52. package/expansion-packs/bmad-godot-game-dev/config.yaml +30 -0
  53. package/expansion-packs/bmad-godot-game-dev/data/bmad-kb.md +811 -0
  54. package/expansion-packs/bmad-godot-game-dev/data/brainstorming-techniques.md +36 -0
  55. package/expansion-packs/bmad-godot-game-dev/data/development-guidelines.md +893 -0
  56. package/expansion-packs/bmad-godot-game-dev/data/elicitation-methods.md +156 -0
  57. package/expansion-packs/bmad-godot-game-dev/data/technical-preferences.md +3 -0
  58. package/expansion-packs/bmad-godot-game-dev/tasks/advanced-elicitation.md +110 -0
  59. package/expansion-packs/bmad-godot-game-dev/tasks/apply-qa-fixes.md +224 -0
  60. package/expansion-packs/bmad-godot-game-dev/tasks/brownfield-create-epic.md +162 -0
  61. package/expansion-packs/bmad-godot-game-dev/tasks/brownfield-create-story.md +149 -0
  62. package/expansion-packs/bmad-godot-game-dev/tasks/correct-course-game.md +159 -0
  63. package/expansion-packs/bmad-godot-game-dev/tasks/create-deep-research-prompt.md +278 -0
  64. package/expansion-packs/bmad-godot-game-dev/tasks/create-doc.md +103 -0
  65. package/expansion-packs/bmad-godot-game-dev/tasks/create-game-story.md +202 -0
  66. package/expansion-packs/bmad-godot-game-dev/tasks/document-project.md +343 -0
  67. package/expansion-packs/bmad-godot-game-dev/tasks/execute-checklist.md +88 -0
  68. package/expansion-packs/bmad-godot-game-dev/tasks/facilitate-brainstorming-session.md +136 -0
  69. package/expansion-packs/bmad-godot-game-dev/tasks/game-brownfield-create-epic.md +160 -0
  70. package/expansion-packs/bmad-godot-game-dev/tasks/game-brownfield-create-story.md +147 -0
  71. package/expansion-packs/bmad-godot-game-dev/tasks/game-design-brainstorming.md +290 -0
  72. package/expansion-packs/bmad-godot-game-dev/tasks/game-risk-profile.md +368 -0
  73. package/expansion-packs/bmad-godot-game-dev/tasks/game-test-design.md +219 -0
  74. package/expansion-packs/bmad-godot-game-dev/tasks/generate-ai-frontend-prompt.md +51 -0
  75. package/expansion-packs/bmad-godot-game-dev/tasks/kb-mode-interaction.md +77 -0
  76. package/expansion-packs/bmad-godot-game-dev/tasks/review-game-story.md +364 -0
  77. package/expansion-packs/bmad-godot-game-dev/tasks/shard-doc.md +187 -0
  78. package/expansion-packs/bmad-godot-game-dev/tasks/validate-game-story.md +208 -0
  79. package/expansion-packs/bmad-godot-game-dev/templates/brainstorming-output-tmpl.yaml +156 -0
  80. package/expansion-packs/bmad-godot-game-dev/templates/brownfield-prd-tmpl.yaml +281 -0
  81. package/expansion-packs/bmad-godot-game-dev/templates/competitor-analysis-tmpl.yaml +306 -0
  82. package/expansion-packs/bmad-godot-game-dev/templates/game-architecture-tmpl.yaml +1111 -0
  83. package/expansion-packs/bmad-godot-game-dev/templates/game-brief-tmpl.yaml +356 -0
  84. package/expansion-packs/bmad-godot-game-dev/templates/game-design-doc-tmpl.yaml +724 -0
  85. package/expansion-packs/bmad-godot-game-dev/templates/game-prd-tmpl.yaml +209 -0
  86. package/expansion-packs/bmad-godot-game-dev/templates/game-qa-gate-tmpl.yaml +186 -0
  87. package/expansion-packs/bmad-godot-game-dev/templates/game-story-tmpl.yaml +406 -0
  88. package/expansion-packs/bmad-godot-game-dev/templates/game-ui-spec-tmpl.yaml +601 -0
  89. package/expansion-packs/bmad-godot-game-dev/templates/level-design-doc-tmpl.yaml +620 -0
  90. package/expansion-packs/bmad-godot-game-dev/templates/market-research-tmpl.yaml +418 -0
  91. package/expansion-packs/bmad-godot-game-dev/utils/bmad-doc-template.md +327 -0
  92. package/expansion-packs/bmad-godot-game-dev/utils/workflow-management.md +71 -0
  93. package/expansion-packs/bmad-godot-game-dev/workflows/game-dev-greenfield.yaml +245 -0
  94. package/expansion-packs/bmad-godot-game-dev/workflows/game-prototype.yaml +213 -0
  95. package/package.json +1 -1
  96. package/release_notes.md +19 -2
  97. package/tools/flattener/ignoreRules.js +2 -0
  98. package/tools/installer/bin/bmad.js +37 -1
  99. package/tools/installer/config/install.config.yaml +35 -7
  100. package/tools/installer/lib/ide-setup.js +285 -80
  101. package/tools/installer/lib/installer.js +6 -1
  102. package/tools/installer/package.json +1 -1
  103. package/tools/upgraders/v3-to-v4-upgrader.js +1 -0
  104. package/test.md +0 -1
  105. /package/{implement-fork-friendly-ci.sh → tools/implement-fork-friendly-ci.sh} +0 -0
@@ -0,0 +1,364 @@
1
+ # review-game-story
2
+
3
+ Perform a comprehensive Godot game story review with quality gate decision, focusing on TDD compliance, 60+ FPS performance validation, and GDScript/C# language strategy. This adaptive, risk-aware review creates both a story update and a detailed gate file.
4
+
5
+ ## Inputs
6
+
7
+ ```yaml
8
+ required:
9
+ - story_id: '{epic}.{story}' # e.g., "1.3"
10
+ - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml
11
+ - story_title: '{title}' # If missing, derive from story file H1
12
+ - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated)
13
+ ```
14
+
15
+ ## Prerequisites
16
+
17
+ - Story status must be "Review"
18
+ - Developer has completed all tasks and updated the File List
19
+ - All GUT (GDScript) and GoDotTest (C#) tests are passing
20
+ - Performance profiler shows 60+ FPS maintained
21
+ - TDD cycle (Red-Green-Refactor) was followed
22
+
23
+ ## Review Process - Adaptive Test Architecture
24
+
25
+ ### 1. Risk Assessment (Determines Review Depth)
26
+
27
+ **Auto-escalate to deep review when:**
28
+
29
+ - Performance drops below 60 FPS
30
+ - No TDD tests written (GUT/GoDotTest)
31
+ - Language strategy violated (wrong GDScript/C# choice)
32
+ - Object pooling missing for spawned entities
33
+ - Diff > 500 lines
34
+ - Previous gate was FAIL/CONCERNS
35
+ - Story has > 5 acceptance criteria
36
+ - Signal connections not properly cleaned up
37
+
38
+ ### 2. Comprehensive Analysis
39
+
40
+ **A. Requirements Traceability**
41
+
42
+ - Map each acceptance criteria to GUT/GoDotTest tests
43
+ - Verify TDD was followed (tests written first)
44
+ - Identify coverage gaps (target 80% minimum)
45
+ - Verify all Godot nodes have corresponding test cases
46
+ - Check signal emission tests exist
47
+
48
+ **B. Code Quality Review**
49
+
50
+ - Node architecture and scene composition
51
+ - GDScript static typing enforcement (10-20% perf gain)
52
+ - C# optimization patterns (no LINQ, no allocations)
53
+ - Signal connection patterns
54
+ - Object pooling implementation
55
+ - Resource preloading vs lazy loading
56
+ - Godot best practices adherence
57
+ - Performance profiler validation (60+ FPS)
58
+
59
+ **C. Test Architecture Assessment**
60
+
61
+ - GUT test coverage for GDScript components
62
+ - GoDotTest coverage for C# components
63
+ - TDD compliance (Red-Green-Refactor cycle)
64
+ - Scene testing with test doubles
65
+ - Signal testing patterns
66
+ - Node mocking appropriateness
67
+ - Edge case and error scenario coverage
68
+ - Test execution performance impact
69
+
70
+ **D. Non-Functional Requirements (NFRs)**
71
+
72
+ - Performance: 60+ FPS maintained, frame time <16.67ms
73
+ - Memory: Scene memory usage, object pooling
74
+ - Draw Calls: Within platform budgets
75
+ - Platform Compatibility: Export template validation
76
+ - Input Latency: <50ms for player controls
77
+ - Load Times: Scene transitions <3 seconds
78
+ - Reliability: Signal cleanup, node lifecycle
79
+
80
+ **E. Godot Testability Evaluation**
81
+
82
+ - Node Testability: Can nodes be tested in isolation?
83
+ - Signal Observability: Can signal emissions be verified?
84
+ - Scene Testing: Can scenes be tested without full game?
85
+ - Performance Testing: Can FPS be validated in tests?
86
+ - Platform Testing: Export templates testable?
87
+
88
+ **F. Technical Debt Identification**
89
+
90
+ - Missing TDD tests (GUT/GoDotTest)
91
+ - Dynamic typing in GDScript (performance debt)
92
+ - Missing object pools for spawned entities
93
+ - Unoptimized node trees
94
+ - Signal connection leaks
95
+ - Wrong language choice (GDScript vs C#)
96
+ - Performance bottlenecks below 60 FPS
97
+
98
+ ### 3. Active Refactoring
99
+
100
+ - Add static typing to GDScript where missing
101
+ - Optimize C# code (remove LINQ, allocations)
102
+ - Implement object pooling for spawned entities
103
+ - Run GUT/GoDotTest to ensure changes don't break
104
+ - Profile to verify 60+ FPS maintained
105
+ - Document all changes in QA Results section
106
+ - Do NOT alter story content beyond QA Results section
107
+ - Do NOT change story Status or File List
108
+
109
+ ### 4. Standards Compliance Check
110
+
111
+ - Verify adherence to Godot coding standards
112
+ - Check static typing in all GDScript
113
+ - Validate C# optimization patterns (no LINQ)
114
+ - Verify TDD approach (tests written first)
115
+ - Check node naming conventions
116
+ - Validate signal naming patterns
117
+ - Ensure 60+ FPS performance targets met
118
+ - Verify language strategy decisions
119
+
120
+ ### 5. Acceptance Criteria Validation
121
+
122
+ - Verify each AC is fully implemented
123
+ - Check TDD tests exist for each AC
124
+ - Validate performance within 60+ FPS
125
+ - Verify object pooling where needed
126
+ - Check platform export compatibility
127
+ - Validate input handling across devices
128
+
129
+ ### 6. Documentation and Comments
130
+
131
+ - Verify GDScript documentation comments
132
+ - Check C# XML documentation
133
+ - Ensure export variables have tooltips
134
+ - Document performance optimizations
135
+ - Note language choice rationale
136
+ - Document signal flow and connections
137
+
138
+ ## Output 1: Update Story File - QA Results Section ONLY
139
+
140
+ **CRITICAL**: You are ONLY authorized to update the "QA Results" section of the story file. DO NOT modify any other sections.
141
+
142
+ **QA Results Anchor Rule:**
143
+
144
+ - If `## QA Results` doesn't exist, append it at end of file
145
+ - If it exists, append a new dated entry below existing entries
146
+ - Never edit other sections
147
+
148
+ After review and any refactoring, append your results to the story file in the QA Results section:
149
+
150
+ ```markdown
151
+ ## QA Results
152
+
153
+ ### Review Date: [Date]
154
+
155
+ ### Reviewed By: Linus (Godot Game Test Architect)
156
+
157
+ ### Code Quality Assessment
158
+
159
+ [Overall assessment of implementation quality]
160
+
161
+ ### Refactoring Performed
162
+
163
+ [List any refactoring you performed with explanations]
164
+
165
+ - **File**: [filename]
166
+ - **Change**: [what was changed]
167
+ - **Why**: [reason for change]
168
+ - **How**: [how it improves the code]
169
+
170
+ ### Compliance Check
171
+
172
+ - Godot Standards: [✓/✗] [notes if any]
173
+ - TDD Compliance: [✓/✗] [GUT/GoDotTest coverage]
174
+ - Performance (60+ FPS): [✓/✗] [profiler results]
175
+ - Language Strategy: [✓/✗] [GDScript/C# choices]
176
+ - Object Pooling: [✓/✗] [for spawned entities]
177
+ - All ACs Met: [✓/✗] [notes if any]
178
+
179
+ ### Improvements Checklist
180
+
181
+ [Check off items you handled yourself, leave unchecked for dev to address]
182
+
183
+ - [x] Added static typing to player controller (scripts/player_controller.gd)
184
+ - [x] Implemented object pool for bullets (scripts/systems/bullet_pool.gd)
185
+ - [x] Added missing GUT tests for signal emissions
186
+ - [ ] Consider moving physics logic to C# for performance
187
+ - [ ] Add performance benchmarks to test suite
188
+ - [ ] Optimize draw calls in particle system
189
+
190
+ ### Performance Review
191
+
192
+ - Frame Rate: [Current FPS] (Target: 60+)
193
+ - Frame Time: [ms] (Target: <16.67ms)
194
+ - Draw Calls: [count] (Budget: [platform specific])
195
+ - Memory Usage: [MB] (Limit: [platform specific])
196
+ - Object Pools: [Implemented/Missing]
197
+
198
+ ### Language Strategy Review
199
+
200
+ - GDScript Components: [Appropriate/Should be C#]
201
+ - C# Components: [Appropriate/Should be GDScript]
202
+ - Static Typing: [Complete/Missing]
203
+ - Interop Boundaries: [Minimized/Excessive]
204
+
205
+ ### Files Modified During Review
206
+
207
+ [If you modified files, list them here - ask Dev to update File List]
208
+
209
+ ### Gate Status
210
+
211
+ Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml
212
+ Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
213
+ NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
214
+
215
+ # Note: Paths should reference core-config.yaml for custom configurations
216
+
217
+ ### Recommended Status
218
+
219
+ [✓ Ready for Done] / [✗ Changes Required - See unchecked items above]
220
+ (Story owner decides final status)
221
+ ```
222
+
223
+ ## Output 2: Create Quality Gate File
224
+
225
+ **Template and Directory:**
226
+
227
+ - Render from `templates/qa-gate-tmpl.yaml`
228
+ - Create `docs/qa/gates/` directory if missing (or configure in core-config.yaml)
229
+ - Save to: `docs/qa/gates/{epic}.{story}-{slug}.yml`
230
+
231
+ Gate file structure:
232
+
233
+ ```yaml
234
+ schema: 1
235
+ story: '{epic}.{story}'
236
+ story_title: '{story title}'
237
+ gate: PASS|CONCERNS|FAIL|WAIVED
238
+ status_reason: '1-2 sentence explanation of gate decision'
239
+ reviewer: 'Linus (Godot Game Test Architect)'
240
+ updated: '{ISO-8601 timestamp}'
241
+
242
+ top_issues: [] # Empty if no issues
243
+ waiver: { active: false } # Set active: true only if WAIVED
244
+
245
+ # Extended fields (optional but recommended):
246
+ quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights
247
+ expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review
248
+
249
+ evidence:
250
+ tests_reviewed: { count }
251
+ risks_identified: { count }
252
+ trace:
253
+ ac_covered: [1, 2, 3] # AC numbers with test coverage
254
+ ac_gaps: [4] # AC numbers lacking coverage
255
+
256
+ nfr_validation:
257
+ performance:
258
+ status: PASS|CONCERNS|FAIL
259
+ fps: '60+|<60'
260
+ frame_time: 'ms value'
261
+ notes: 'Profiler findings'
262
+ tdd_compliance:
263
+ status: PASS|CONCERNS|FAIL
264
+ gut_coverage: 'percentage'
265
+ godottest_coverage: 'percentage'
266
+ notes: 'Test-first validation'
267
+ language_strategy:
268
+ status: PASS|CONCERNS|FAIL
269
+ notes: 'GDScript/C# appropriateness'
270
+ reliability:
271
+ status: PASS|CONCERNS|FAIL
272
+ notes: 'Signal cleanup, node lifecycle'
273
+
274
+ recommendations:
275
+ immediate: # Must fix before production
276
+ - action: 'Fix FPS drops below 60'
277
+ refs: ['scenes/game.tscn']
278
+ - action: 'Add object pooling for particles'
279
+ refs: ['scripts/particle_spawner.gd']
280
+ future: # Can be addressed later
281
+ - action: 'Consider C# for physics system'
282
+ refs: ['scripts/physics_manager.gd']
283
+ ```
284
+
285
+ ### Gate Decision Criteria
286
+
287
+ **Deterministic rule (apply in order):**
288
+
289
+ If risk_summary exists, apply its thresholds first (≥9 → FAIL, ≥6 → CONCERNS), then NFR statuses, then top_issues severity.
290
+
291
+ 1. **Risk thresholds (if risk_summary present):**
292
+ - If any risk score ≥ 9 → Gate = FAIL (unless waived)
293
+ - Else if any score ≥ 6 → Gate = CONCERNS
294
+
295
+ 2. **Test coverage gaps (if trace available):**
296
+ - If any P0 test from test-design is missing → Gate = CONCERNS
297
+ - If security/data-loss P0 test missing → Gate = FAIL
298
+
299
+ 3. **Issue severity:**
300
+ - If any `top_issues.severity == high` → Gate = FAIL (unless waived)
301
+ - Else if any `severity == medium` → Gate = CONCERNS
302
+
303
+ 4. **NFR statuses:**
304
+ - If any NFR status is FAIL → Gate = FAIL
305
+ - Else if any NFR status is CONCERNS → Gate = CONCERNS
306
+ - Else → Gate = PASS
307
+
308
+ - WAIVED only when waiver.active: true with reason/approver
309
+
310
+ Detailed criteria:
311
+
312
+ - **PASS**: All critical requirements met, no blocking issues
313
+ - **CONCERNS**: Non-critical issues found, team should review
314
+ - **FAIL**: Critical issues that should be addressed
315
+ - **WAIVED**: Issues acknowledged but explicitly waived by team
316
+
317
+ ### Quality Score Calculation
318
+
319
+ ```text
320
+ quality_score = 100 - (20 × number of FAILs) - (10 × number of CONCERNS)
321
+ Bounded between 0 and 100
322
+ ```
323
+
324
+ If `technical-preferences.md` defines custom weights, use those instead.
325
+
326
+ ### Suggested Owner Convention
327
+
328
+ For each issue in `top_issues`, include a `suggested_owner`:
329
+
330
+ - `dev`: Code changes needed
331
+ - `sm`: Requirements clarification needed
332
+ - `po`: Business decision needed
333
+
334
+ ## Key Principles
335
+
336
+ - You are a Godot Game Test Architect ensuring 60+ FPS and TDD compliance
337
+ - You enforce static typing in GDScript and optimization in C#
338
+ - You have authority to add object pooling and optimize performance
339
+ - Always validate with Godot profiler data
340
+ - Focus on performance-based prioritization
341
+ - Ensure GUT/GoDotTest coverage meets 80% target
342
+ - Provide actionable Godot-specific recommendations
343
+
344
+ ## Blocking Conditions
345
+
346
+ Stop the review and request clarification if:
347
+
348
+ - Performance drops below 60 FPS
349
+ - No TDD tests (GUT/GoDotTest) exist
350
+ - Story file is incomplete or missing critical sections
351
+ - File List is empty or clearly incomplete
352
+ - Language strategy violated without justification
353
+ - Object pooling missing for frequently spawned entities
354
+ - Critical node architecture issues that require discussion
355
+
356
+ ## Completion
357
+
358
+ After review:
359
+
360
+ 1. Update the QA Results section in the story file
361
+ 2. Create the gate file in `docs/qa/gates/`
362
+ 3. Recommend status: "Ready for Done" or "Changes Required" (owner decides)
363
+ 4. If files were modified, list them in QA Results and ask Dev to update File List
364
+ 5. Always provide constructive feedback and actionable recommendations
@@ -0,0 +1,187 @@
1
+ <!-- Powered by BMAD™ Core -->
2
+
3
+ # Document Sharding Task
4
+
5
+ ## Purpose
6
+
7
+ - Split a large document into multiple smaller documents based on level 2 sections
8
+ - Create a folder structure to organize the sharded documents
9
+ - Maintain all content integrity including code blocks, diagrams, and markdown formatting
10
+
11
+ ## Primary Method: Automatic with markdown-tree
12
+
13
+ [[LLM: First, check if markdownExploder is set to true in .bmad-godot-game-dev/config.yaml. If it is, attempt to run the command: `md-tree explode {input file} {output path}`.
14
+
15
+ If the command succeeds, inform the user that the document has been sharded successfully and STOP - do not proceed further.
16
+
17
+ If the command fails (especially with an error indicating the command is not found or not available), inform the user: "The markdownExploder setting is enabled but the md-tree command is not available. Please either:
18
+
19
+ 1. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
20
+ 2. Or set markdownExploder to false in .bmad-godot-game-dev/config.yaml
21
+
22
+ **IMPORTANT: STOP HERE - do not proceed with manual sharding until one of the above actions is taken.**"
23
+
24
+ If markdownExploder is set to false, inform the user: "The markdownExploder setting is currently false. For better performance and reliability, you should:
25
+
26
+ 1. Set markdownExploder to true in .bmad-godot-game-dev/config.yaml
27
+ 2. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
28
+
29
+ I will now proceed with the manual sharding process."
30
+
31
+ Then proceed with the manual method below ONLY if markdownExploder is false.]]
32
+
33
+ ### Installation and Usage
34
+
35
+ 1. **Install globally**:
36
+
37
+ ```bash
38
+ npm install -g @kayvan/markdown-tree-parser
39
+ ```
40
+
41
+ 2. **Use the explode command**:
42
+
43
+ ```bash
44
+ # For PRD
45
+ md-tree explode docs/prd.md docs/prd
46
+
47
+ # For Architecture
48
+ md-tree explode docs/architecture.md docs/architecture
49
+
50
+ # For any document
51
+ md-tree explode [source-document] [destination-folder]
52
+ ```
53
+
54
+ 3. **What it does**:
55
+ - Automatically splits the document by level 2 sections
56
+ - Creates properly named files
57
+ - Adjusts heading levels appropriately
58
+ - Handles all edge cases with code blocks and special markdown
59
+
60
+ If the user has @kayvan/markdown-tree-parser installed, use it and skip the manual process below.
61
+
62
+ ---
63
+
64
+ ## Manual Method (if @kayvan/markdown-tree-parser is not available or user indicated manual method)
65
+
66
+ ### Task Instructions
67
+
68
+ 1. Identify Document and Target Location
69
+
70
+ - Determine which document to shard (user-provided path)
71
+ - Create a new folder under `docs/` with the same name as the document (without extension)
72
+ - Example: `docs/prd.md` → create folder `docs/prd/`
73
+
74
+ 2. Parse and Extract Sections
75
+
76
+ CRITICAL AEGNT SHARDING RULES:
77
+
78
+ 1. Read the entire document content
79
+ 2. Identify all level 2 sections (## headings)
80
+ 3. For each level 2 section:
81
+ - Extract the section heading and ALL content until the next level 2 section
82
+ - Include all subsections, code blocks, diagrams, lists, tables, etc.
83
+ - Be extremely careful with:
84
+ - Fenced code blocks (```) - ensure you capture the full block including closing backticks and account for potential misleading level 2's that are actually part of a fenced section example
85
+ - Mermaid diagrams - preserve the complete diagram syntax
86
+ - Nested markdown elements
87
+ - Multi-line content that might contain ## inside code blocks
88
+
89
+ CRITICAL: Use proper parsing that understands markdown context. A ## inside a code block is NOT a section header.]]
90
+
91
+ ### 3. Create Individual Files
92
+
93
+ For each extracted section:
94
+
95
+ 1. **Generate filename**: Convert the section heading to lowercase-dash-case
96
+ - Remove special characters
97
+ - Replace spaces with dashes
98
+ - Example: "## Tech Stack" → `tech-stack.md`
99
+
100
+ 2. **Adjust heading levels**:
101
+ - The level 2 heading becomes level 1 (# instead of ##) in the sharded new document
102
+ - All subsection levels decrease by 1:
103
+
104
+ ```txt
105
+ - ### → ##
106
+ - #### → ###
107
+ - ##### → ####
108
+ - etc.
109
+ ```
110
+
111
+ 3. **Write content**: Save the adjusted content to the new file
112
+
113
+ ### 4. Create Index File
114
+
115
+ Create an `index.md` file in the sharded folder that:
116
+
117
+ 1. Contains the original level 1 heading and any content before the first level 2 section
118
+ 2. Lists all the sharded files with links:
119
+
120
+ ```markdown
121
+ # Original Document Title
122
+
123
+ [Original introduction content if any]
124
+
125
+ ## Sections
126
+
127
+ - [Section Name 1](./section-name-1.md)
128
+ - [Section Name 2](./section-name-2.md)
129
+ - [Section Name 3](./section-name-3.md)
130
+ ...
131
+ ```
132
+
133
+ ### 5. Preserve Special Content
134
+
135
+ 1. **Code blocks**: Must capture complete blocks including:
136
+
137
+ ```language
138
+ content
139
+ ```
140
+
141
+ 2. **Mermaid diagrams**: Preserve complete syntax:
142
+
143
+ ```mermaid
144
+ graph TD
145
+ ...
146
+ ```
147
+
148
+ 3. **Tables**: Maintain proper markdown table formatting
149
+
150
+ 4. **Lists**: Preserve indentation and nesting
151
+
152
+ 5. **Inline code**: Preserve backticks
153
+
154
+ 6. **Links and references**: Keep all markdown links intact
155
+
156
+ 7. **Template markup**: If documents contain {{placeholders}} ,preserve exactly
157
+
158
+ ### 6. Validation
159
+
160
+ After sharding:
161
+
162
+ 1. Verify all sections were extracted
163
+ 2. Check that no content was lost
164
+ 3. Ensure heading levels were properly adjusted
165
+ 4. Confirm all files were created successfully
166
+
167
+ ### 7. Report Results
168
+
169
+ Provide a summary:
170
+
171
+ ```text
172
+ Document sharded successfully:
173
+ - Source: [original document path]
174
+ - Destination: docs/[folder-name]/
175
+ - Files created: [count]
176
+ - Sections:
177
+ - section-name-1.md: "Section Title 1"
178
+ - section-name-2.md: "Section Title 2"
179
+ ...
180
+ ```
181
+
182
+ ## Important Notes
183
+
184
+ - Never modify the actual content, only adjust heading levels
185
+ - Preserve ALL formatting, including whitespace where significant
186
+ - Handle edge cases like sections with code blocks containing ## symbols
187
+ - Ensure the sharding is reversible (could reconstruct the original from shards)