bmad-method 4.23.0 → 4.24.0

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 (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/bmad-core/agents/bmad-master.md +14 -1
  4. package/bmad-core/agents/bmad-orchestrator.md +14 -0
  5. package/bmad-core/core-config.yml +5 -0
  6. package/bmad-core/tasks/create-brownfield-story.md +355 -0
  7. package/bmad-core/tasks/create-next-story.md +25 -0
  8. package/bmad-core/tasks/create-workflow-plan.md +289 -0
  9. package/bmad-core/tasks/update-workflow-plan.md +248 -0
  10. package/bmad-core/templates/brownfield-prd-tmpl.md +52 -28
  11. package/bmad-core/utils/plan-management.md +223 -0
  12. package/bmad-core/workflows/brownfield-fullstack.yml +240 -55
  13. package/bmad-core/workflows/brownfield-service.yml +110 -36
  14. package/bmad-core/workflows/brownfield-ui.yml +110 -36
  15. package/bmad-core/workflows/greenfield-fullstack.yml +110 -36
  16. package/bmad-core/workflows/greenfield-service.yml +110 -36
  17. package/bmad-core/workflows/greenfield-ui.yml +110 -36
  18. package/common/tasks/create-doc.md +21 -1
  19. package/dist/agents/analyst.txt +23 -1
  20. package/dist/agents/architect.txt +21 -1
  21. package/dist/agents/bmad-master.txt +883 -30
  22. package/dist/agents/bmad-orchestrator.txt +806 -1
  23. package/dist/agents/pm.txt +73 -29
  24. package/dist/agents/sm.txt +25 -0
  25. package/dist/agents/ux-expert.txt +21 -1
  26. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +21 -1
  27. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +804 -1
  28. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +21 -1
  29. package/dist/teams/team-all.txt +1675 -266
  30. package/dist/teams/team-fullstack.txt +1650 -266
  31. package/dist/teams/team-ide-minimal.txt +831 -1
  32. package/dist/teams/team-no-ui.txt +1079 -102
  33. package/package.json +1 -1
  34. package/tools/installer/lib/installer.js +2 -12
  35. package/tools/installer/package.json +1 -1
  36. package/tools/lib/dependency-resolver.js +2 -2
@@ -0,0 +1,223 @@
1
+ # Plan Management Utility
2
+
3
+ ## Purpose
4
+
5
+ Provides utilities for agents and tasks to interact with workflow plans, check progress, update status, and ensure workflow steps are executed in the appropriate sequence.
6
+
7
+ ## Core Functions
8
+
9
+ ### 1. Check Plan Existence
10
+
11
+ [[LLM: When any agent starts or task begins, check if a workflow plan exists]]
12
+
13
+ ```
14
+ Check for workflow plan:
15
+ 1. Look for docs/workflow-plan.md (default location)
16
+ 2. Check core-config.yml for custom plan location
17
+ 3. Return plan status (exists/not exists)
18
+ ```
19
+
20
+ ### 2. Parse Plan Status
21
+
22
+ [[LLM: Extract current progress from the plan document]]
23
+
24
+ **Plan Parsing Logic:**
25
+
26
+ 1. **Identify Step Structure**:
27
+ - Look for checkbox lines: `- [ ]` or `- [x]`
28
+ - Extract step IDs from comments: `<!-- step-id: X.Y -->`
29
+ - Identify agent assignments: `<!-- agent: pm -->`
30
+
31
+ 2. **Determine Current State**:
32
+ - Last completed step (highest numbered `[x]`)
33
+ - Next expected step (first `[ ]` after completed steps)
34
+ - Overall progress percentage
35
+
36
+ 3. **Extract Metadata**:
37
+ - Workflow type from plan header
38
+ - Decision points and their status
39
+ - Any deviation notes
40
+
41
+ ### 3. Sequence Validation
42
+
43
+ [[LLM: Check if requested action aligns with plan sequence]]
44
+
45
+ **Validation Rules:**
46
+
47
+ 1. **Strict Mode** (enforceSequence: true):
48
+ - Must complete steps in exact order
49
+ - Warn and block if out of sequence
50
+ - Require explicit override justification
51
+
52
+ 2. **Flexible Mode** (enforceSequence: false):
53
+ - Warn about sequence deviation
54
+ - Allow with confirmation
55
+ - Log deviation reason
56
+
57
+ **Warning Templates:**
58
+
59
+ ```
60
+ SEQUENCE WARNING:
61
+ The workflow plan shows you should complete "{expected_step}" next.
62
+ You're attempting to: "{requested_action}"
63
+
64
+ In strict mode: Block and require plan update
65
+ In flexible mode: Allow with confirmation
66
+ ```
67
+
68
+ ### 4. Plan Update Operations
69
+
70
+ [[LLM: Provide consistent way to update plan progress]]
71
+
72
+ **Update Actions:**
73
+
74
+ 1. **Mark Step Complete**:
75
+ - Change `- [ ]` to `- [x]`
76
+ - Add completion timestamp comment
77
+ - Update any status metadata
78
+
79
+ 2. **Add Deviation Note**:
80
+ - Insert note explaining why sequence changed
81
+ - Reference the deviation in plan
82
+
83
+ 3. **Update Current Step Pointer**:
84
+ - Add/move `<!-- current-step -->` marker
85
+ - Update last-modified timestamp
86
+
87
+ ### 5. Integration Instructions
88
+
89
+ [[LLM: How agents and tasks should use this utility]]
90
+
91
+ **For Agents (startup sequence)**:
92
+
93
+ ```
94
+ 1. Check if plan exists using this utility
95
+ 2. If exists:
96
+ - Parse current status
97
+ - Show user: "Active workflow plan detected. Current step: {X}"
98
+ - Suggest: "Next recommended action: {next_step}"
99
+ 3. Continue with normal startup
100
+ ```
101
+
102
+ **For Tasks (pre-execution)**:
103
+
104
+ ```
105
+ 1. Check if plan exists
106
+ 2. If exists:
107
+ - Verify this task aligns with plan
108
+ - If not aligned:
109
+ - In strict mode: Show warning and stop
110
+ - In flexible mode: Show warning and ask for confirmation
111
+ 3. After task completion:
112
+ - Update plan if task was a planned step
113
+ - Add note if task was unplanned
114
+ ```
115
+
116
+ ### 6. Plan Status Report Format
117
+
118
+ [[LLM: Standard format for showing plan status]]
119
+
120
+ ```
121
+ 📋 Workflow Plan Status
122
+ ━━━━━━━━━━━━━━━━━━━━
123
+ Workflow: {workflow_name}
124
+ Progress: {X}% complete ({completed}/{total} steps)
125
+
126
+ ✅ Completed:
127
+ - {completed_step_1}
128
+ - {completed_step_2}
129
+
130
+ 🔄 Current Step:
131
+ - {current_step_description}
132
+
133
+ 📌 Upcoming:
134
+ - {next_step_1}
135
+ - {next_step_2}
136
+
137
+ ⚠️ Notes:
138
+ - {any_deviations_or_notes}
139
+ ```
140
+
141
+ ### 7. Decision Point Handling
142
+
143
+ [[LLM: Special handling for workflow decision points]]
144
+
145
+ When encountering a decision point in the plan:
146
+
147
+ 1. **Identify Decision Marker**: `<!-- decision: {decision_id} -->`
148
+ 2. **Check Decision Status**: Made/Pending
149
+ 3. **If Pending**:
150
+ - Block progress until decision made
151
+ - Show options to user
152
+ - Record decision when made
153
+ 4. **If Made**:
154
+ - Verify current path aligns with decision
155
+ - Warn if attempting alternate path
156
+
157
+ ### 8. Plan Abandonment
158
+
159
+ [[LLM: Graceful handling when user wants to stop following plan]]
160
+
161
+ If user wants to abandon plan:
162
+
163
+ 1. Confirm abandonment intent
164
+ 2. Add abandonment note to plan
165
+ 3. Mark plan as "Abandoned" in header
166
+ 4. Stop plan checking for remainder of session
167
+ 5. Suggest creating new plan if needed
168
+
169
+ ## Usage Examples
170
+
171
+ ### Example 1: Agent Startup Check
172
+
173
+ ```
174
+ BMad Master starting...
175
+
176
+ [Check for plan]
177
+ Found active workflow plan: brownfield-fullstack
178
+ Progress: 40% complete (4/10 steps)
179
+ Current step: Create PRD (pm agent)
180
+
181
+ Suggestion: Based on your plan, you should work with the PM agent next.
182
+ Use *agent pm to switch, or *plan-status to see full progress.
183
+ ```
184
+
185
+ ### Example 2: Task Sequence Warning
186
+
187
+ ```
188
+ User: *task create-next-story
189
+
190
+ [Plan check triggered]
191
+ ⚠️ SEQUENCE WARNING:
192
+ Your workflow plan indicates the PRD hasn't been created yet.
193
+ Creating stories before the PRD may lead to incomplete requirements.
194
+
195
+ Would you like to:
196
+ 1. Continue anyway (will note deviation in plan)
197
+ 2. Switch to creating PRD first (*agent pm)
198
+ 3. View plan status (*plan-status)
199
+ ```
200
+
201
+ ### Example 3: Automatic Plan Update
202
+
203
+ ```
204
+ [After completing create-doc task for PRD]
205
+
206
+ ✅ Plan Updated: Marked "Create PRD" as complete
207
+ 📍 Next step: Create Architecture Document (architect agent)
208
+ ```
209
+
210
+ ## Implementation Notes
211
+
212
+ - This utility should be lightweight and fast
213
+ - Plan parsing should be resilient to format variations
214
+ - Always preserve user agency - warnings not blocks (unless strict mode)
215
+ - Plan updates should be atomic to prevent corruption
216
+ - Consider plan versioning for rollback capability
217
+
218
+ ## Error Handling
219
+
220
+ - Missing plan: Return null, don't error
221
+ - Malformed plan: Warn but continue, treat as no plan
222
+ - Update failures: Log but don't block task completion
223
+ - Parse errors: Fallback to basic text search
@@ -12,23 +12,76 @@ workflow:
12
12
  - integration-enhancement
13
13
 
14
14
  sequence:
15
+ - step: enhancement_classification
16
+ agent: analyst
17
+ action: classify enhancement scope
18
+ notes: |
19
+ Determine enhancement complexity to route to appropriate path:
20
+ - Single story (< 4 hours) → Use brownfield-create-story task
21
+ - Small feature (1-3 stories) → Use brownfield-create-epic task
22
+ - Major enhancement (multiple epics) → Continue with full workflow
23
+
24
+ Ask user: "Can you describe the enhancement scope? Is this a small fix, a feature addition, or a major enhancement requiring architectural changes?"
25
+
26
+ - step: routing_decision
27
+ condition: based_on_classification
28
+ routes:
29
+ single_story:
30
+ agent: pm
31
+ uses: brownfield-create-story
32
+ notes: "Create single story for immediate implementation. Exit workflow after story creation."
33
+ small_feature:
34
+ agent: pm
35
+ uses: brownfield-create-epic
36
+ notes: "Create focused epic with 1-3 stories. Exit workflow after epic creation."
37
+ major_enhancement:
38
+ continue: to_next_step
39
+ notes: "Continue with comprehensive planning workflow below."
40
+
41
+ - step: documentation_check
42
+ agent: analyst
43
+ action: check existing documentation
44
+ condition: major_enhancement_path
45
+ notes: |
46
+ Check if adequate project documentation exists:
47
+ - Look for existing architecture docs, API specs, coding standards
48
+ - Assess if documentation is current and comprehensive
49
+ - If adequate: Skip document-project, proceed to PRD
50
+ - If inadequate: Run document-project first
51
+
15
52
  - step: project_analysis
16
53
  agent: architect
17
54
  action: analyze existing project and use task document-project
18
- creates: multiple documents per the document-project template
19
- notes: "Review existing documentation, codebase structure, and identify integration points. Document current system understanding before proceeding."
55
+ creates: brownfield-architecture.md (or multiple documents)
56
+ condition: documentation_inadequate
57
+ notes: "Run document-project to capture current system state, technical debt, and constraints. Pass findings to PRD creation."
20
58
 
21
59
  - agent: pm
22
60
  creates: prd.md
23
61
  uses: brownfield-prd-tmpl
24
- requires: existing_project_analysis
25
- notes: "Creates comprehensive PRD with existing system analysis and enhancement planning. SAVE OUTPUT: Copy final prd.md to your project's docs/ folder."
62
+ requires: existing_documentation_or_analysis
63
+ notes: |
64
+ Creates PRD for major enhancement. If document-project was run, reference its output to avoid re-analysis.
65
+ If skipped, use existing project documentation.
66
+ SAVE OUTPUT: Copy final prd.md to your project's docs/ folder.
67
+
68
+ - step: architecture_decision
69
+ agent: pm/architect
70
+ action: determine if architecture document needed
71
+ condition: after_prd_creation
72
+ notes: |
73
+ Review PRD to determine if architectural planning is needed:
74
+ - New architectural patterns → Create architecture doc
75
+ - New libraries/frameworks → Create architecture doc
76
+ - Platform/infrastructure changes → Create architecture doc
77
+ - Following existing patterns → Skip to story creation
26
78
 
27
79
  - agent: architect
28
80
  creates: architecture.md
29
81
  uses: brownfield-architecture-tmpl
30
82
  requires: prd.md
31
- notes: "Creates architecture with integration strategy and existing system constraints. SAVE OUTPUT: Copy final architecture.md to your project's docs/ folder."
83
+ condition: architecture_changes_needed
84
+ notes: "Creates architecture ONLY for significant architectural changes. SAVE OUTPUT: Copy final architecture.md to your project's docs/ folder."
32
85
 
33
86
  - agent: po
34
87
  validates: all_artifacts
@@ -40,60 +93,162 @@ workflow:
40
93
  condition: po_checklist_issues
41
94
  notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder."
42
95
 
96
+ - agent: po
97
+ action: shard_documents
98
+ creates: sharded_docs
99
+ requires: all_artifacts_in_project
100
+ notes: |
101
+ Shard documents for IDE development:
102
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
103
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
104
+ - Creates docs/prd/ and docs/architecture/ folders with sharded content
105
+
106
+ - agent: sm
107
+ action: create_story
108
+ creates: story.md
109
+ requires: sharded_docs_or_brownfield_docs
110
+ repeats: for_each_epic_or_enhancement
111
+ notes: |
112
+ Story creation cycle:
113
+ - For sharded PRD: @sm → *create (uses create-next-story)
114
+ - For brownfield docs: @sm → use create-brownfield-story task
115
+ - Creates story from available documentation
116
+ - Story starts in "Draft" status
117
+ - May require additional context gathering for brownfield
118
+
119
+ - agent: analyst/pm
120
+ action: review_draft_story
121
+ updates: story.md
122
+ requires: story.md
123
+ optional: true
124
+ condition: user_wants_story_review
125
+ notes: |
126
+ OPTIONAL: Review and approve draft story
127
+ - NOTE: story-review task coming soon
128
+ - Review story completeness and alignment
129
+ - Update story status: Draft → Approved
130
+
131
+ - agent: dev
132
+ action: implement_story
133
+ creates: implementation_files
134
+ requires: story.md
135
+ notes: |
136
+ Dev Agent (New Chat): @dev
137
+ - Implements approved story
138
+ - Updates File List with all changes
139
+ - Marks story as "Review" when complete
140
+
141
+ - agent: qa
142
+ action: review_implementation
143
+ updates: implementation_files
144
+ requires: implementation_files
145
+ optional: true
146
+ notes: |
147
+ OPTIONAL: QA Agent (New Chat): @qa → review-story
148
+ - Senior dev review with refactoring ability
149
+ - Fixes small issues directly
150
+ - Leaves checklist for remaining items
151
+ - Updates story status (Review → Done or stays Review)
152
+
153
+ - agent: dev
154
+ action: address_qa_feedback
155
+ updates: implementation_files
156
+ condition: qa_left_unchecked_items
157
+ notes: |
158
+ If QA left unchecked items:
159
+ - Dev Agent (New Chat): Address remaining items
160
+ - Return to QA for final approval
161
+
162
+ - repeat_development_cycle:
163
+ action: continue_for_all_stories
164
+ notes: |
165
+ Repeat story cycle (SM → Dev → QA) for all epic stories
166
+ Continue until all stories in PRD are complete
167
+
168
+ - agent: po
169
+ action: epic_retrospective
170
+ creates: epic-retrospective.md
171
+ condition: epic_complete
172
+ optional: true
173
+ notes: |
174
+ OPTIONAL: After epic completion
175
+ - NOTE: epic-retrospective task coming soon
176
+ - Validate epic was completed correctly
177
+ - Document learnings and improvements
178
+
43
179
  - workflow_end:
44
- action: move_to_ide
180
+ action: project_complete
45
181
  notes: |
46
- Planning phase complete! Now transition to IDE Development:
47
-
48
- 1. ENSURE DOCUMENTS ARE IN PROJECT:
49
- - Copy final prd.md to project's docs/prd.md
50
- - Copy final architecture.md to project's docs/architecture.md
51
- - All documents must be in the project before proceeding
52
-
53
- 2. SHARD DOCUMENTS (in IDE):
54
- - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
55
- - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
56
- - This creates docs/prd/ and docs/architecture/ folders with sharded content
57
-
58
- 3. START DEVELOPMENT CYCLE:
59
- a. SM Agent (New Chat): @sm → *create
60
- - Creates next story from sharded docs
61
- - Review and approve story (Draft → Approved)
62
-
63
- b. Dev Agent (New Chat): @dev
64
- - Implements approved story
65
- - Updates File List with all changes
66
- - Marks story as "Review" when complete
67
-
68
- c. QA Agent (New Chat): @qa → review-story
69
- - Senior dev review with refactoring ability
70
- - Fixes small issues directly
71
- - Leaves checklist for remaining items
72
- - Updates story status (Review → Done or stays Review)
73
-
74
- d. If QA left unchecked items:
75
- - Dev Agent (New Chat): Address remaining items
76
- - Return to QA for final approval
77
-
78
- 4. REPEAT: Continue cycle for all epic stories
182
+ All stories implemented and reviewed!
183
+ Project development phase complete.
79
184
 
80
185
  Reference: data#bmad-kb:IDE Development Workflow
81
186
 
82
187
  flow_diagram: |
83
188
  ```mermaid
84
189
  graph TD
85
- A[Start: Brownfield Enhancement] --> B[analyst: analyze existing project]
86
- B --> C[pm: prd.md]
87
- C --> D[architect: architecture.md]
88
- D --> E[po: validate with po-master-checklist]
89
- E --> F{PO finds issues?}
90
- F -->|Yes| G[Return to relevant agent for fixes]
91
- F -->|No| H[Move to IDE Environment]
92
- G --> E
93
-
94
- style H fill:#90EE90
95
- style C fill:#FFE4B5
96
- style D fill:#FFE4B5
190
+ A[Start: Brownfield Enhancement] --> B[analyst: classify enhancement scope]
191
+ B --> C{Enhancement Size?}
192
+
193
+ C -->|Single Story| D[pm: brownfield-create-story]
194
+ C -->|1-3 Stories| E[pm: brownfield-create-epic]
195
+ C -->|Major Enhancement| F[analyst: check documentation]
196
+
197
+ D --> END1[To Dev Implementation]
198
+ E --> END2[To Story Creation]
199
+
200
+ F --> G{Docs Adequate?}
201
+ G -->|No| H[architect: document-project]
202
+ G -->|Yes| I[pm: brownfield PRD]
203
+ H --> I
204
+
205
+ I --> J{Architecture Needed?}
206
+ J -->|Yes| K[architect: architecture.md]
207
+ J -->|No| L[po: validate artifacts]
208
+ K --> L
209
+
210
+ L --> M{PO finds issues?}
211
+ M -->|Yes| N[Fix issues]
212
+ M -->|No| O[po: shard documents]
213
+ N --> L
214
+
215
+ O --> P[sm: create story]
216
+ P --> Q{Story Type?}
217
+ Q -->|Sharded PRD| R[create-next-story]
218
+ Q -->|Brownfield Docs| S[create-brownfield-story]
219
+
220
+ R --> T{Review draft?}
221
+ S --> T
222
+ T -->|Yes| U[review & approve]
223
+ T -->|No| V[dev: implement]
224
+ U --> V
225
+
226
+ V --> W{QA review?}
227
+ W -->|Yes| X[qa: review]
228
+ W -->|No| Y{More stories?}
229
+ X --> Z{Issues?}
230
+ Z -->|Yes| AA[dev: fix]
231
+ Z -->|No| Y
232
+ AA --> X
233
+ Y -->|Yes| P
234
+ Y -->|No| AB{Retrospective?}
235
+ AB -->|Yes| AC[po: retrospective]
236
+ AB -->|No| AD[Complete]
237
+ AC --> AD
238
+
239
+ style AD fill:#90EE90
240
+ style END1 fill:#90EE90
241
+ style END2 fill:#90EE90
242
+ style D fill:#87CEEB
243
+ style E fill:#87CEEB
244
+ style I fill:#FFE4B5
245
+ style K fill:#FFE4B5
246
+ style O fill:#ADD8E6
247
+ style P fill:#ADD8E6
248
+ style V fill:#ADD8E6
249
+ style U fill:#F0E68C
250
+ style X fill:#F0E68C
251
+ style AC fill:#F0E68C
97
252
  ```
98
253
 
99
254
  decision_guidance:
@@ -105,8 +260,38 @@ workflow:
105
260
  - Multiple team members will work on related changes
106
261
 
107
262
  handoff_prompts:
108
- analyst_to_pm: "Existing project analysis complete. Create comprehensive PRD with integration strategy."
109
- pm_to_architect: "PRD ready. Save it as docs/prd.md, then create the integration architecture."
263
+ classification_complete: |
264
+ Enhancement classified as: {{enhancement_type}}
265
+ {{if single_story}}: Proceeding with brownfield-create-story task for immediate implementation.
266
+ {{if small_feature}}: Creating focused epic with brownfield-create-epic task.
267
+ {{if major_enhancement}}: Continuing with comprehensive planning workflow.
268
+
269
+ documentation_assessment: |
270
+ Documentation assessment complete:
271
+ {{if adequate}}: Existing documentation is sufficient. Proceeding directly to PRD creation.
272
+ {{if inadequate}}: Running document-project to capture current system state before PRD.
273
+
274
+ document_project_to_pm: |
275
+ Project analysis complete. Key findings documented in:
276
+ - {{document_list}}
277
+ Use these findings to inform PRD creation and avoid re-analyzing the same aspects.
278
+
279
+ pm_to_architect_decision: |
280
+ PRD complete and saved as docs/prd.md.
281
+ Architectural changes identified: {{yes/no}}
282
+ {{if yes}}: Proceeding to create architecture document for: {{specific_changes}}
283
+ {{if no}}: No architectural changes needed. Proceeding to validation.
284
+
110
285
  architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety."
111
- po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document."
112
- complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development."
286
+
287
+ po_to_sm: |
288
+ All artifacts validated.
289
+ Documentation type available: {{sharded_prd / brownfield_docs}}
290
+ {{if sharded}}: Use standard create-next-story task.
291
+ {{if brownfield}}: Use create-brownfield-story task to handle varied documentation formats.
292
+
293
+ sm_story_creation: |
294
+ Creating story from {{documentation_type}}.
295
+ {{if missing_context}}: May need to gather additional context from user during story creation.
296
+
297
+ complete: "All planning artifacts validated and development can begin. Stories will be created based on available documentation format."