bmad-method 4.22.1 → 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 (42) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +3 -2
  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/data/bmad-kb.md +3 -1
  7. package/bmad-core/tasks/create-brownfield-story.md +355 -0
  8. package/bmad-core/tasks/create-next-story.md +25 -0
  9. package/bmad-core/tasks/create-workflow-plan.md +289 -0
  10. package/bmad-core/tasks/update-workflow-plan.md +248 -0
  11. package/bmad-core/templates/brownfield-prd-tmpl.md +52 -28
  12. package/bmad-core/utils/plan-management.md +223 -0
  13. package/bmad-core/workflows/brownfield-fullstack.yml +240 -55
  14. package/bmad-core/workflows/brownfield-service.yml +110 -36
  15. package/bmad-core/workflows/brownfield-ui.yml +110 -36
  16. package/bmad-core/workflows/greenfield-fullstack.yml +110 -36
  17. package/bmad-core/workflows/greenfield-service.yml +110 -36
  18. package/bmad-core/workflows/greenfield-ui.yml +110 -36
  19. package/common/tasks/create-doc.md +21 -1
  20. package/dist/agents/analyst.txt +24 -2
  21. package/dist/agents/architect.txt +21 -1
  22. package/dist/agents/bmad-master.txt +884 -31
  23. package/dist/agents/bmad-orchestrator.txt +807 -2
  24. package/dist/agents/pm.txt +73 -29
  25. package/dist/agents/sm.txt +25 -0
  26. package/dist/agents/ux-expert.txt +21 -1
  27. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +21 -1
  28. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +804 -1
  29. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +21 -1
  30. package/dist/teams/team-all.txt +1676 -267
  31. package/dist/teams/team-fullstack.txt +1651 -267
  32. package/dist/teams/team-ide-minimal.txt +832 -2
  33. package/dist/teams/team-no-ui.txt +1080 -103
  34. package/docs/bmad-workflow-guide.md +2 -1
  35. package/docs/core-architecture.md +2 -1
  36. package/package.json +1 -1
  37. package/tools/installer/bin/bmad.js +3 -2
  38. package/tools/installer/config/install.config.yml +13 -0
  39. package/tools/installer/lib/ide-setup.js +214 -1
  40. package/tools/installer/lib/installer.js +3 -13
  41. package/tools/installer/package.json +1 -1
  42. package/tools/lib/dependency-resolver.js +2 -2
@@ -0,0 +1,289 @@
1
+ # Create Workflow Plan Task
2
+
3
+ ## Purpose
4
+
5
+ Guide users through workflow selection and create a detailed plan document that outlines the selected workflow steps, decision points, and expected outputs. This task helps users understand what will happen before starting a complex workflow and provides a checklist to track progress.
6
+
7
+ ## Task Instructions
8
+
9
+ ### 1. Understand User's Goal
10
+
11
+ [[LLM: Start with discovery questions to understand what the user wants to accomplish]]
12
+
13
+ Ask the user:
14
+
15
+ 1. **Project Type**:
16
+ - Are you starting a new project (greenfield) or enhancing an existing one (brownfield)?
17
+ - What type of application? (web app, service/API, UI only, full-stack)
18
+
19
+ 2. **For Greenfield**:
20
+ - Do you need a quick prototype or production-ready application?
21
+ - Will this have a UI component?
22
+ - Single service or multiple services?
23
+
24
+ 3. **For Brownfield**:
25
+ - What's the scope of the enhancement?
26
+ - Single bug fix or small feature (few hours)
27
+ - Small enhancement (1-3 stories)
28
+ - Major feature requiring coordination
29
+ - Architectural changes or modernization
30
+ - Do you have existing documentation?
31
+ - Are you following existing patterns or introducing new ones?
32
+
33
+ ### 2. Recommend Appropriate Workflow
34
+
35
+ Based on the answers, recommend:
36
+
37
+ **Greenfield Options:**
38
+
39
+ - `greenfield-fullstack` - Complete web application
40
+ - `greenfield-service` - Backend API/service only
41
+ - `greenfield-ui` - Frontend only
42
+
43
+ **Brownfield Options:**
44
+
45
+ - `brownfield-create-story` - Single small change
46
+ - `brownfield-create-epic` - Small feature (1-3 stories)
47
+ - `brownfield-fullstack` - Major enhancement
48
+
49
+ **Simplified Option:**
50
+
51
+ - For users unsure or wanting flexibility, suggest starting with individual agent tasks
52
+
53
+ ### 3. Explain Selected Workflow
54
+
55
+ [[LLM: Once workflow is selected, provide clear explanation]]
56
+
57
+ For the selected workflow, explain:
58
+
59
+ 1. **Overview**: What this workflow accomplishes
60
+ 2. **Duration**: Estimated time for planning phase
61
+ 3. **Outputs**: What documents will be created
62
+ 4. **Decision Points**: Where user input will be needed
63
+ 5. **Requirements**: What information should be ready
64
+
65
+ ### 4. Create Workflow Plan Document
66
+
67
+ [[LLM: Generate a comprehensive plan document with the following structure]]
68
+
69
+ ```markdown
70
+ # Workflow Plan: {{Workflow Name}}
71
+
72
+ <!-- WORKFLOW-PLAN-META
73
+ workflow-id: {{workflow-id}}
74
+ status: active
75
+ created: {{ISO-8601 timestamp}}
76
+ updated: {{ISO-8601 timestamp}}
77
+ version: 1.0
78
+ -->
79
+
80
+ **Created Date**: {{current date}}
81
+ **Project**: {{project name}}
82
+ **Type**: {{greenfield/brownfield}}
83
+ **Status**: Active
84
+ **Estimated Planning Duration**: {{time estimate}}
85
+
86
+ ## Objective
87
+
88
+ {{Clear description of what will be accomplished}}
89
+
90
+ ## Selected Workflow
91
+
92
+ **Workflow**: `{{workflow-id}}`
93
+ **Reason**: {{Why this workflow fits the user's needs}}
94
+
95
+ ## Workflow Steps
96
+
97
+ ### Planning Phase
98
+
99
+ - [ ] Step 1: {{step name}} <!-- step-id: 1.1, agent: {{agent}}, task: {{task}} -->
100
+ - **Agent**: {{agent name}}
101
+ - **Action**: {{what happens}}
102
+ - **Output**: {{what's created}}
103
+ - **User Input**: {{if any}}
104
+
105
+ - [ ] Step 2: {{step name}} <!-- step-id: 1.2, agent: {{agent}}, task: {{task}} -->
106
+ - **Agent**: {{agent name}}
107
+ - **Action**: {{what happens}}
108
+ - **Output**: {{what's created}}
109
+ - **Decision Point**: {{if any}} <!-- decision-id: D1 -->
110
+
111
+ {{Continue for all planning steps}}
112
+
113
+ ### Development Phase (IDE)
114
+
115
+ - [ ] Document Sharding <!-- step-id: 2.1, agent: po, task: shard-doc -->
116
+ - Prepare documents for story creation
117
+
118
+ - [ ] Story Development Cycle <!-- step-id: 2.2, repeats: true -->
119
+ - [ ] Create story (SM agent) <!-- step-id: 2.2.1, agent: sm, task: create-next-story -->
120
+ - [ ] Review story (optional) <!-- step-id: 2.2.2, agent: analyst, optional: true -->
121
+ - [ ] Implement story (Dev agent) <!-- step-id: 2.2.3, agent: dev -->
122
+ - [ ] QA review (optional) <!-- step-id: 2.2.4, agent: qa, optional: true -->
123
+ - [ ] Repeat for all stories
124
+
125
+ - [ ] Epic Retrospective (optional) <!-- step-id: 2.3, agent: po, optional: true -->
126
+
127
+ ## Key Decision Points
128
+
129
+ 1. **{{Decision Name}}** (Step {{n}}): <!-- decision-id: D1, status: pending -->
130
+ - Trigger: {{what causes this decision}}
131
+ - Options: {{available choices}}
132
+ - Impact: {{how it affects the workflow}}
133
+ - Decision Made: _Pending_
134
+
135
+ {{List all decision points}}
136
+
137
+ ## Expected Outputs
138
+
139
+ ### Planning Documents
140
+ - [ ] {{document 1}} - {{description}}
141
+ - [ ] {{document 2}} - {{description}}
142
+ {{etc...}}
143
+
144
+ ### Development Artifacts
145
+ - [ ] Stories in `docs/stories/`
146
+ - [ ] Implementation code
147
+ - [ ] Tests
148
+ - [ ] Updated documentation
149
+
150
+ ## Prerequisites Checklist
151
+
152
+ Before starting this workflow, ensure you have:
153
+
154
+ - [ ] {{prerequisite 1}}
155
+ - [ ] {{prerequisite 2}}
156
+ - [ ] {{prerequisite 3}}
157
+ {{etc...}}
158
+
159
+ ## Customization Options
160
+
161
+ Based on your project needs, you may:
162
+ - Skip {{optional step}} if {{condition}}
163
+ - Add {{additional step}} if {{condition}}
164
+ - Choose {{alternative}} instead of {{default}}
165
+
166
+ ## Risk Considerations
167
+
168
+ {{For brownfield only}}
169
+ - Integration complexity: {{assessment}}
170
+ - Rollback strategy: {{approach}}
171
+ - Testing requirements: {{special needs}}
172
+
173
+ ## Next Steps
174
+
175
+ 1. Review this plan and confirm it matches your expectations
176
+ 2. Gather any missing prerequisites
177
+ 3. Start workflow with: `*task workflow {{workflow-id}}`
178
+ 4. Or begin with first agent: `@{{first-agent}}`
179
+
180
+ ## Notes
181
+
182
+ {{Any additional context or warnings}}
183
+
184
+ ---
185
+ *This plan can be updated as you progress through the workflow. Check off completed items to track progress.*
186
+ ```
187
+
188
+ ### 5. Save and Present Plan
189
+
190
+ 1. Save the plan as `docs/workflow-plan.md`
191
+ 2. Inform user: "Workflow plan created at docs/workflow-plan.md"
192
+ 3. Offer options:
193
+ - Review the plan together
194
+ - Start the workflow now
195
+ - Gather prerequisites first
196
+ - Modify the plan
197
+
198
+ ### 6. Plan Variations
199
+
200
+ [[LLM: Adjust plan detail based on workflow complexity]]
201
+
202
+ **For Simple Workflows** (create-story, create-epic):
203
+
204
+ - Simpler checklist format
205
+ - Focus on immediate next steps
206
+ - Less detailed explanations
207
+
208
+ **For Complex Workflows** (full greenfield/brownfield):
209
+
210
+ - Detailed step breakdowns
211
+ - All decision points documented
212
+ - Comprehensive output descriptions
213
+ - Risk mitigation sections
214
+
215
+ **For Brownfield Workflows**:
216
+
217
+ - Include existing system impact analysis
218
+ - Document integration checkpoints
219
+ - Add rollback considerations
220
+ - Note documentation dependencies
221
+
222
+ ### 7. Interactive Planning Mode
223
+
224
+ [[LLM: If user wants to customize the workflow]]
225
+
226
+ If user wants to modify the standard workflow:
227
+
228
+ 1. Present workflow steps as options
229
+ 2. Allow skipping optional steps
230
+ 3. Let user reorder certain steps
231
+ 4. Document customizations in plan
232
+ 5. Warn about dependencies if steps are skipped
233
+
234
+ ### 8. Execution Guidance
235
+
236
+ After plan is created, provide clear guidance:
237
+
238
+ ```text
239
+ Your workflow plan is ready! Here's how to proceed:
240
+
241
+ 1. **Review the plan**: Check that all steps align with your goals
242
+ 2. **Gather prerequisites**: Use the checklist to ensure you're ready
243
+ 3. **Start execution**:
244
+ - Full workflow: `*task workflow {{workflow-id}}`
245
+ - Step by step: Start with `@{{first-agent}}`
246
+ 4. **Track progress**: Check off steps in the plan as completed
247
+
248
+ Would you like to:
249
+ a) Review the plan together
250
+ b) Start the workflow now
251
+ c) Gather prerequisites first
252
+ d) Modify the plan
253
+ ```
254
+
255
+ ## Success Criteria
256
+
257
+ The workflow plan is successful when:
258
+
259
+ 1. User clearly understands what will happen
260
+ 2. All decision points are documented
261
+ 3. Prerequisites are identified
262
+ 4. Expected outputs are clear
263
+ 5. User feels confident to proceed
264
+ 6. Plan serves as useful progress tracker
265
+
266
+ ## Integration with BMad Master and Orchestrator
267
+
268
+ When used by BMad Master or BMad Orchestrator, this task should:
269
+
270
+ 1. Be offered when user asks about workflows
271
+ 2. Be suggested before starting complex workflows
272
+ 3. Create a plan that the agent can reference during execution
273
+ 4. Allow the agent to track progress against the plan
274
+
275
+ ## Example Usage
276
+
277
+ ```text
278
+ User: "I need to add a payment system to my existing app"
279
+
280
+ BMad Orchestrator: "Let me help you create a workflow plan for that enhancement. I'll ask a few questions to recommend the best approach..."
281
+
282
+ [Runs through discovery questions]
283
+
284
+ BMad Orchestrator: "Based on your answers, I recommend the brownfield-fullstack workflow. Let me create a detailed plan for you..."
285
+
286
+ [Creates and saves plan]
287
+
288
+ BMad Orchestrator: "I've created a workflow plan at docs/workflow-plan.md. This shows all the steps we'll go through, what documents will be created, and where you'll need to make decisions. Would you like to review it together?"
289
+ ```
@@ -0,0 +1,248 @@
1
+ # Update Workflow Plan Task
2
+
3
+ ## Purpose
4
+
5
+ Update the status of steps in an active workflow plan, mark completions, add notes about deviations, and maintain an accurate record of workflow progress. This task can be called directly by users or automatically by other tasks upon completion.
6
+
7
+ ## Task Instructions
8
+
9
+ ### 0. Load Plan Configuration
10
+
11
+ [[LLM: First load core-config.yml to get plan settings]]
12
+
13
+ Check workflow configuration:
14
+
15
+ - `workflow.planFile` - Location of the plan (default: docs/workflow-plan.md)
16
+ - `workflow.trackProgress` - Whether tracking is enabled
17
+ - `workflow.updateOnCompletion` - Whether to auto-update on task completion
18
+
19
+ If tracking is disabled, inform user and exit.
20
+
21
+ ### 1. Verify Plan Exists
22
+
23
+ [[LLM: Check if workflow plan exists at configured location]]
24
+
25
+ If no plan exists:
26
+
27
+ ```
28
+ No active workflow plan found at {location}.
29
+ Would you like to create one? Use *plan command.
30
+ ```
31
+
32
+ ### 2. Determine Update Type
33
+
34
+ [[LLM: Ask user what type of update they want to make]]
35
+
36
+ Present options:
37
+
38
+ ```
39
+ What would you like to update in the workflow plan?
40
+
41
+ 1. Mark step as complete
42
+ 2. Update current step
43
+ 3. Add deviation note
44
+ 4. Mark decision point resolution
45
+ 5. Update overall status
46
+ 6. View current plan status only
47
+
48
+ Please select an option (1-6):
49
+ ```
50
+
51
+ ### 3. Parse Current Plan
52
+
53
+ [[LLM: Read and parse the plan to understand current state]]
54
+
55
+ Extract:
56
+
57
+ - All steps with their checkbox status
58
+ - Step IDs from comments (if present)
59
+ - Current completion percentage
60
+ - Any existing deviation notes
61
+ - Decision points and their status
62
+
63
+ ### 4. Execute Updates
64
+
65
+ #### 4.1 Mark Step Complete
66
+
67
+ If user selected option 1:
68
+
69
+ 1. Show numbered list of incomplete steps
70
+ 2. Ask which step to mark complete
71
+ 3. Update the checkbox from `[ ]` to `[x]`
72
+ 4. Add completion timestamp: `<!-- completed: YYYY-MM-DD HH:MM -->`
73
+ 5. If this was the current step, identify next step
74
+
75
+ #### 4.2 Update Current Step
76
+
77
+ If user selected option 2:
78
+
79
+ 1. Show all steps with current status
80
+ 2. Ask which step is now current
81
+ 3. Add/move `<!-- current-step -->` marker
82
+ 4. Optionally add note about why sequence changed
83
+
84
+ #### 4.3 Add Deviation Note
85
+
86
+ If user selected option 3:
87
+
88
+ 1. Ask for deviation description
89
+ 2. Ask which step this relates to (or general)
90
+ 3. Insert note in appropriate location:
91
+
92
+ ```markdown
93
+ > **Deviation Note** (YYYY-MM-DD): {user_note}
94
+ > Related to: Step X.Y or General workflow
95
+ ```
96
+
97
+ #### 4.4 Mark Decision Resolution
98
+
99
+ If user selected option 4:
100
+
101
+ 1. Show pending decision points
102
+ 2. Ask which decision was made
103
+ 3. Record the decision and chosen path
104
+ 4. Update related steps based on decision
105
+
106
+ #### 4.5 Update Overall Status
107
+
108
+ If user selected option 5:
109
+
110
+ 1. Show current overall status
111
+ 2. Provide options:
112
+ - Active (continuing with plan)
113
+ - Paused (temporarily stopped)
114
+ - Abandoned (no longer following)
115
+ - Complete (all steps done)
116
+ 3. Update plan header with new status
117
+
118
+ ### 5. Automatic Updates (When Called by Tasks)
119
+
120
+ [[LLM: When called automatically by another task]]
121
+
122
+ If called with parameters:
123
+
124
+ ```
125
+ task: {task_name}
126
+ step_id: {step_identifier}
127
+ status: complete|skipped|failed
128
+ note: {optional_note}
129
+ ```
130
+
131
+ Automatically:
132
+
133
+ 1. Find the corresponding step
134
+ 2. Update its status
135
+ 3. Add completion metadata
136
+ 4. Add note if provided
137
+ 5. Calculate new progress percentage
138
+
139
+ ### 6. Generate Update Summary
140
+
141
+ After updates, show summary:
142
+
143
+ ```
144
+ ✅ Workflow Plan Updated
145
+
146
+ Changes made:
147
+ - {change_1}
148
+ - {change_2}
149
+
150
+ New Status:
151
+ - Progress: {X}% complete ({completed}/{total} steps)
152
+ - Current Step: {current_step}
153
+ - Next Recommended: {next_step}
154
+
155
+ Plan location: {file_path}
156
+ ```
157
+
158
+ ### 7. Integration with Other Tasks
159
+
160
+ [[LLM: How other tasks should call this]]
161
+
162
+ Other tasks can integrate by:
163
+
164
+ 1. **After Task Completion**:
165
+
166
+ ```
167
+ At end of task execution:
168
+ - Check if task corresponds to a plan step
169
+ - If yes, call update-workflow-plan with:
170
+ - task: {current_task_name}
171
+ - step_id: {matching_step}
172
+ - status: complete
173
+ ```
174
+
175
+ 2. **On Task Failure**:
176
+
177
+ ```
178
+ If task fails:
179
+ - Call update-workflow-plan with:
180
+ - task: {current_task_name}
181
+ - status: failed
182
+ - note: {failure_reason}
183
+ ```
184
+
185
+ ### 8. Plan Status Display
186
+
187
+ [[LLM: When user selects view status only]]
188
+
189
+ Display comprehensive status:
190
+
191
+ ```markdown
192
+ 📋 Workflow Plan Status
193
+ ━━━━━━━━━━━━━━━━━━━━
194
+ Workflow: {workflow_name}
195
+ Status: {Active|Paused|Complete}
196
+ Progress: {X}% complete ({completed}/{total} steps)
197
+ Last Updated: {timestamp}
198
+
199
+ ✅ Completed Steps:
200
+ - [x] Step 1.1: {description} (completed: {date})
201
+ - [x] Step 1.2: {description} (completed: {date})
202
+
203
+ 🔄 Current Step:
204
+ - [ ] Step 2.1: {description} <!-- current-step -->
205
+ Agent: {agent_name}
206
+ Task: {task_name}
207
+
208
+ 📌 Upcoming Steps:
209
+ - [ ] Step 2.2: {description}
210
+ - [ ] Step 3.1: {description}
211
+
212
+ ⚠️ Deviations/Notes:
213
+ {any_deviation_notes}
214
+
215
+ 📊 Decision Points:
216
+ - Decision 1: {status} - {choice_made}
217
+ - Decision 2: Pending
218
+
219
+ 💡 Next Action:
220
+ Based on the plan, you should {recommended_action}
221
+ ```
222
+
223
+ ## Success Criteria
224
+
225
+ The update is successful when:
226
+
227
+ 1. Plan accurately reflects current workflow state
228
+ 2. All updates are clearly timestamped
229
+ 3. Deviations are documented with reasons
230
+ 4. Progress calculation is correct
231
+ 5. Next steps are clear to user
232
+ 6. Plan remains readable and well-formatted
233
+
234
+ ## Error Handling
235
+
236
+ - **Plan file not found**: Offer to create new plan
237
+ - **Malformed plan**: Attempt basic updates, warn user
238
+ - **Write permission error**: Show changes that would be made
239
+ - **Step not found**: Show available steps, ask for clarification
240
+ - **Concurrent updates**: Implement simple locking or warn about conflicts
241
+
242
+ ## Notes
243
+
244
+ - Always preserve plan history (don't delete old information)
245
+ - Keep updates atomic to prevent corruption
246
+ - Consider creating backup before major updates
247
+ - Updates should enhance, not complicate, the workflow experience
248
+ - If plan becomes too cluttered, suggest creating fresh plan for next phase
@@ -22,34 +22,45 @@ Do not proceed with any recommendations until the user has validated your unders
22
22
 
23
23
  ### Existing Project Overview
24
24
 
25
- [[LLM: If working in IDE with project loaded, analyze the project structure and existing documentation. If working in web interface, request project upload or detailed project information from user.]]
25
+ [[LLM: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.]]
26
26
 
27
- **Project Location**: [[LLM: Note if this is IDE-based analysis or user-provided information]]
27
+ **Analysis Source**: [[LLM: Indicate one of the following:
28
+ - Document-project output available at: {{path}}
29
+ - IDE-based fresh analysis
30
+ - User-provided information
31
+ ]]
28
32
 
29
- **Current Project State**: [[LLM: Brief description of what the project currently does and its primary purpose]]
33
+ **Current Project State**: [[LLM:
34
+ - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections
35
+ - Otherwise: Brief description of what the project currently does and its primary purpose
36
+ ]]
30
37
 
31
38
  ### Available Documentation Analysis
32
39
 
33
- [[LLM: Check for existing documentation in docs folder or provided by user. List what documentation is available and assess its completeness. Required documents include:
40
+ [[LLM:
41
+ If document-project was run:
42
+ - Note: "Document-project analysis available - using existing technical documentation"
43
+ - List key documents created by document-project
44
+ - Skip the missing documentation check below
34
45
 
35
- - Tech stack documentation
36
- - Source tree/architecture overview
37
- - Coding standards
38
- - API documentation or OpenAPI specs
39
- - External API integrations
40
- - UX/UI guidelines or existing patterns]]
46
+ Otherwise, check for existing documentation:
47
+ ]]
41
48
 
42
49
  **Available Documentation**:
43
50
 
44
- - [ ] Tech Stack Documentation
45
- - [ ] Source Tree/Architecture
46
- - [ ] Coding Standards
47
- - [ ] API Documentation
48
- - [ ] External API Documentation
49
- - [ ] UX/UI Guidelines
51
+ - [ ] Tech Stack Documentation [[LLM: If from document-project, check ✓]]
52
+ - [ ] Source Tree/Architecture [[LLM: If from document-project, check ✓]]
53
+ - [ ] Coding Standards [[LLM: If from document-project, may be partial]]
54
+ - [ ] API Documentation [[LLM: If from document-project, check ✓]]
55
+ - [ ] External API Documentation [[LLM: If from document-project, check ✓]]
56
+ - [ ] UX/UI Guidelines [[LLM: May not be in document-project]]
57
+ - [ ] Technical Debt Documentation [[LLM: If from document-project, check ✓]]
50
58
  - [ ] Other: \***\*\_\_\_\*\***
51
59
 
52
- [[LLM: If critical documentation is missing, STOP and recommend: "I recommend running the document-project task first to generate baseline documentation including tech-stack, source-tree, coding-standards, APIs, external-APIs, and UX/UI information. This will provide the foundation needed for a comprehensive brownfield PRD."]]
60
+ [[LLM:
61
+ - If document-project was already run: "Using existing project analysis from document-project output."
62
+ - If critical documentation is missing and no document-project: "I recommend running the document-project task first..."
63
+ ]]
53
64
 
54
65
  ### Enhancement Scope Definition
55
66
 
@@ -139,13 +150,19 @@ Do not proceed with any recommendations until the user has validated your unders
139
150
 
140
151
  ### Existing Technology Stack
141
152
 
142
- [[LLM: Document the current technology stack that must be maintained or integrated with]]
153
+ [[LLM:
154
+ If document-project output available:
155
+ - Extract from "Actual Tech Stack" table in High Level Architecture section
156
+ - Include version numbers and any noted constraints
143
157
 
144
- **Languages**: [[LLM: Current programming languages in use]]
145
- **Frameworks**: [[LLM: Current frameworks and their versions]]
146
- **Database**: [[LLM: Current database technology and schema considerations]]
147
- **Infrastructure**: [[LLM: Current deployment and hosting infrastructure]]
148
- **External Dependencies**: [[LLM: Current third-party services and APIs]]
158
+ Otherwise, document the current technology stack:
159
+ ]]
160
+
161
+ **Languages**: [[LLM: From document-project or fresh analysis]]
162
+ **Frameworks**: [[LLM: From document-project or fresh analysis]]
163
+ **Database**: [[LLM: From document-project or fresh analysis]]
164
+ **Infrastructure**: [[LLM: From document-project or fresh analysis]]
165
+ **External Dependencies**: [[LLM: From document-project "External Services" section or fresh analysis]]
149
166
 
150
167
  ### Integration Approach
151
168
 
@@ -176,12 +193,19 @@ Do not proceed with any recommendations until the user has validated your unders
176
193
 
177
194
  ### Risk Assessment and Mitigation
178
195
 
179
- [[LLM: Identify risks specific to working with existing codebase]]
196
+ [[LLM:
197
+ If document-project output available:
198
+ - Reference "Technical Debt and Known Issues" section
199
+ - Include "Workarounds and Gotchas" that might impact enhancement
200
+ - Note any identified constraints from "Critical Technical Debt"
201
+
202
+ Build risk assessment incorporating existing known issues:
203
+ ]]
180
204
 
181
- **Technical Risks**: [[LLM: Risks related to modifying existing code]]
182
- **Integration Risks**: [[LLM: Risks in integrating with existing systems]]
183
- **Deployment Risks**: [[LLM: Risks in deploying alongside existing features]]
184
- **Mitigation Strategies**: [[LLM: Specific strategies to address identified risks]]
205
+ **Technical Risks**: [[LLM: Include risks from document-project + new enhancement risks]]
206
+ **Integration Risks**: [[LLM: Reference integration constraints from document-project]]
207
+ **Deployment Risks**: [[LLM: Include deployment gotchas from document-project]]
208
+ **Mitigation Strategies**: [[LLM: Address both existing and new risks]]
185
209
 
186
210
  ## Epic and Story Structure
187
211