bmad-method 4.24.5 → 4.25.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 (37) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/bmad-core/agents/analyst.md +8 -5
  3. package/bmad-core/agents/architect.md +7 -5
  4. package/bmad-core/agents/bmad-master.md +19 -24
  5. package/bmad-core/agents/dev.md +20 -28
  6. package/bmad-core/agents/pm.md +6 -4
  7. package/bmad-core/agents/po.md +11 -7
  8. package/bmad-core/agents/qa.md +9 -3
  9. package/bmad-core/agents/sm.md +6 -6
  10. package/bmad-core/agents/ux-expert.md +6 -11
  11. package/bmad-core/checklists/story-draft-checklist.md +1 -1
  12. package/bmad-core/core-config.yaml +1 -1
  13. package/bmad-core/tasks/create-next-story.md +61 -224
  14. package/bmad-core/tasks/review-story.md +18 -8
  15. package/bmad-core/tasks/validate-next-story.md +134 -0
  16. package/bmad-core/templates/project-brief-tmpl.md +4 -2
  17. package/bmad-core/templates/story-tmpl.md +22 -33
  18. package/dist/agents/analyst.txt +10 -6
  19. package/dist/agents/architect.txt +5 -4
  20. package/dist/agents/bmad-master.txt +105 -283
  21. package/dist/agents/dev.txt +155 -26
  22. package/dist/agents/pm.txt +4 -3
  23. package/dist/agents/po.txt +168 -39
  24. package/dist/agents/qa.txt +25 -10
  25. package/dist/agents/sm.txt +164 -263
  26. package/dist/agents/ux-expert.txt +4 -10
  27. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +10 -6
  28. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +1 -1
  29. package/dist/teams/team-all.txt +300 -328
  30. package/dist/teams/team-fullstack.txt +191 -62
  31. package/dist/teams/team-ide-minimal.txt +277 -305
  32. package/dist/teams/team-no-ui.txt +187 -52
  33. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +1 -1
  34. package/expansion-packs/bmad-creator-tools/config.yaml +1 -1
  35. package/expansion-packs/bmad-infrastructure-devops/config.yaml +1 -1
  36. package/package.json +1 -1
  37. package/tools/installer/package.json +1 -1
@@ -2,187 +2,62 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- To identify the next logical story based on project progress and epic definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the `Story Template`. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research.
5
+ To identify the next logical story based on project progress and epic definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the `Story Template`. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research or finding its own context.
6
6
 
7
- ## Task Execution Instructions
7
+ ## SEQUENTIAL Task Execution (Do not proceed until current Task is complete)
8
8
 
9
- ### 0. Load Core Configuration
10
-
11
- [[LLM: CRITICAL - This MUST be your first step]]
9
+ ### 0. Load Core Configuration and Check Workflow
12
10
 
13
11
  - Load `.bmad-core/core-config.yaml` from the project root
14
- - If the file does not exist:
15
- - HALT and inform the user: "core-config.yaml not found. This file is required for story creation. You can:
16
- 1. Copy it from GITHUB BMad-Method/bmad-core/core-config.yaml and configure it for your project
17
- 2. Run the BMad installer against your project to upgrade and add the file automatically
18
- Please add and configure core-config.yaml before proceeding."
19
- - Extract the following key configurations:
20
- - `devStoryLocation`: Where to save story files
21
- - `prd.prdSharded`: Whether PRD is sharded or monolithic
22
- - `prd.prdFile`: Location of monolithic PRD (if not sharded)
23
- - `prd.prdShardedLocation`: Location of sharded epic files
24
- - `prd.epicFilePattern`: Pattern for epic files (e.g., `epic-{n}*.md`)
25
- - `architecture.architectureVersion`: Architecture document version
26
- - `architecture.architectureSharded`: Whether architecture is sharded
27
- - `architecture.architectureFile`: Location of monolithic architecture
28
- - `architecture.architectureShardedLocation`: Location of sharded architecture files
29
- - `workflow.trackProgress`: Whether workflow plan tracking is enabled
30
- - `workflow.planFile`: Location of workflow plan (if tracking enabled)
31
-
32
- ### 0.5 Check Workflow Plan (if configured)
33
-
34
- [[LLM: Check if workflow plan tracking is enabled]]
35
-
36
- - If `workflow.trackProgress: true`, check for active plan at `workflow.planFile`
37
- - If plan exists:
38
- - Parse plan to check if story creation is the expected next step
39
- - If out of sequence and `workflow.enforceSequence: true`:
40
- - Show warning: "The workflow plan indicates you should complete {expected_step} before creating stories."
41
- - Block execution unless user explicitly overrides
42
- - If out of sequence and `workflow.enforceSequence: false`:
43
- - Show warning but allow continuation with confirmation
44
- - Continue with story identification after plan check
12
+ - If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story creation. You can either: 1) Copy it from GITHUB bmad-core/core-config.yaml and configure it for your project OR 2) Run the BMad installer against your project to upgrade and add the file automatically. Please add and configure core-config.yaml before proceeding."
13
+ - Extract key configurations: `devStoryLocation`, `prd.*`, `architecture.*`, `workflow.*`
14
+ - If `workflow.trackProgress: true`, use `utils/plan-management.md` to check plan sequence and warn if out of order
45
15
 
46
16
  ### 1. Identify Next Story for Preparation
47
17
 
48
- #### 1.1 Locate Epic Files
49
-
50
- - Based on `prdSharded` from config:
51
- - **If `prdSharded: true`**: Look for epic files in `prdShardedLocation` using `epicFilePattern`
52
- - **If `prdSharded: false`**: Load the full PRD from `prdFile` and extract epics from section headings (## Epic N or ### Epic N)
53
-
54
- #### 1.2 Review Existing Stories
55
-
56
- - Check `devStoryLocation` from config (e.g., `docs/stories/`) for existing story files
57
- - If the directory exists and has at least 1 file, find the highest-numbered story file.
58
- - **If a highest story file exists (`{lastEpicNum}.{lastStoryNum}.story.md`):**
59
- - Verify its `Status` is 'Done' (or equivalent).
60
- - If not 'Done', present an alert to the user:
61
-
62
- ```plaintext
63
- ALERT: Found incomplete story:
64
- File: {lastEpicNum}.{lastStoryNum}.story.md
65
- Status: [current status]
66
-
67
- Would you like to:
68
- 1. View the incomplete story details (instructs user to do so, agent does not display)
69
- 2. Cancel new story creation at this time
70
- 3. Accept risk & Override to create the next story in draft
71
-
72
- Please choose an option (1/2/3):
73
- ```
74
-
75
- - Proceed only if user selects option 3 (Override) or if the last story was 'Done'.
76
- - If proceeding: Look for the Epic File for `{lastEpicNum}` (e.g., `epic-{lastEpicNum}*.md`) and parse it to find ALL stories in that epic. **ALWAYS select the next sequential story** (e.g., if last was 2.2, next MUST be 2.3).
77
- - If the next sequential story has unmet prerequisites, present this to the user:
78
-
79
- ```plaintext
80
- ALERT: Next story has unmet prerequisites:
81
- Story: {epicNum}.{storyNum} - {Story Title}
82
- Prerequisites not met: [list specific prerequisites]
83
-
84
- Would you like to:
85
- 1. Create the story anyway (mark prerequisites as pending)
86
- 2. Skip to a different story (requires your specific instruction)
87
- 3. Cancel story creation
88
-
89
- Please choose an option (1/2/3):
90
- ```
91
-
92
- - If there are no more stories in the current epic (e.g., 2.9 was done and there is no 2.10):
93
-
94
- ```plaintext
95
- Epic {epicNum} Complete: All stories in Epic {epicNum} have been completed.
96
-
97
- Would you like to:
98
- 1. Begin Epic {epicNum + 1} with story {epicNum + 1}.1
99
- 2. Select a specific story to work on
100
- 3. Cancel story creation
101
-
102
- Please choose an option (1/2/3):
103
- ```
104
-
105
- - **CRITICAL**: NEVER automatically skip to another epic or non-sequential story. The user MUST explicitly instruct which story to create if skipping the sequential order.
106
-
107
- - **If no story files exist in `docs/stories/`:**
108
- - The next story is ALWAYS 1.1 (the first story of the first epic).
109
- - If story 1.1 has unmet prerequisites, follow the same alert process as above.
110
- - Announce the identified story to the user: "Identified next story for preparation: {epicNum}.{storyNum} - {Story Title}".
111
-
112
- ### 2. Gather Core Story Requirements (from Epic)
113
-
114
- - For the identified story, review its parent Epic (e.g., `epic-{epicNum}*.md` from the location identified in step 1.1).
115
- - Extract: Exact Title, full Goal/User Story statement, initial list of Requirements, all Acceptance Criteria (ACs), and any predefined high-level Tasks.
116
- - Keep a record of this original epic-defined scope for later deviation analysis.
117
-
118
- ### 3. Review Previous Story and Extract Dev Notes
18
+ #### 1.1 Locate Epic Files and Review Existing Stories
119
19
 
120
- [[LLM: This step is CRITICAL for continuity and learning from implementation experience]]
20
+ - Based on `prdSharded` from config, locate epic files (sharded location/pattern or monolithic PRD sections)
21
+ - If `devStoryLocation` has story files, load the highest `{epicNum}.{storyNum}.story.md` file
22
+ - **If highest story exists:**
23
+ - Verify status is 'Done'. If not, alert user: "ALERT: Found incomplete story! File: {lastEpicNum}.{lastStoryNum}.story.md Status: [current status] You should fix this story first, but would you like to accept risk & override to create the next story in draft?"
24
+ - If proceeding, select next sequential story in the current epic
25
+ - If epic is complete, prompt user: "Epic {epicNum} Complete: All stories in Epic {epicNum} have been completed. Would you like to: 1) Begin Epic {epicNum + 1} with story 1 2) Select a specific story to work on 3) Cancel story creation"
26
+ - **CRITICAL**: NEVER automatically skip to another epic. User MUST explicitly instruct which story to create.
27
+ - **If no story files exist:** The next story is ALWAYS 1.1 (first story of first epic)
28
+ - Announce the identified story to the user: "Identified next story for preparation: {epicNum}.{storyNum} - {Story Title}"
121
29
 
122
- - If this is not the first story (i.e., previous story exists):
123
- - Read the previous sequential story from `docs/stories`
124
- - Pay special attention to:
125
- - Dev Agent Record sections (especially Completion Notes and Debug Log References)
126
- - Any deviations from planned implementation
127
- - Technical decisions made during implementation
128
- - Challenges encountered and solutions applied
129
- - Any "lessons learned" or notes for future stories
130
- - Extract relevant insights that might inform the current story's preparation
30
+ ### 2. Gather Story Requirements and Previous Story Context
131
31
 
132
- ### 4. Gather & Synthesize Architecture Context
32
+ - Extract story requirements from the identified epic file
33
+ - If previous story exists, review Dev Agent Record sections for:
34
+ - Completion Notes and Debug Log References
35
+ - Implementation deviations and technical decisions
36
+ - Challenges encountered and lessons learned
37
+ - Extract relevant insights that inform the current story's preparation
133
38
 
134
- [[LLM: CRITICAL - You MUST gather technical details from the architecture documents. NEVER make up technical details not found in these documents.]]
39
+ ### 3. Gather Architecture Context
135
40
 
136
- #### 4.1 Determine Architecture Document Strategy
41
+ #### 3.1 Determine Architecture Reading Strategy
137
42
 
138
- Based on configuration loaded in Step 0:
43
+ - **If `architectureVersion: >= v4` and `architectureSharded: true`**: Read `{architectureShardedLocation}/index.md` then follow structured reading order below
44
+ - **Else**: Use monolithic `architectureFile` for similar sections
139
45
 
140
- - **If `architectureVersion: v4` and `architectureSharded: true`**:
141
- - Read `{architectureShardedLocation}/index.md` to understand available documentation
142
- - Follow the structured reading order in section 4.2 below
143
-
144
- - **If `architectureVersion: v4` and `architectureSharded: false`**:
145
- - Load the monolithic architecture from `architectureFile`
146
- - Extract relevant sections based on v4 structure (tech stack, project structure, etc.)
147
-
148
- - **If `architectureVersion` is NOT v4**:
149
- - Inform user: "Architecture document is not v4 format. Will use best judgment to find relevant information."
150
- - If `architectureSharded: true`: Search sharded files by filename relevance
151
- - If `architectureSharded: false`: Search within monolithic `architectureFile` for relevant sections
46
+ #### 3.2 Read Architecture Documents Based on Story Type
152
47
 
153
- #### 4.2 Recommended Reading Order Based on Story Type (v4 Sharded Only)
48
+ **For ALL Stories:** tech-stack.md, unified-project-structure.md, coding-standards.md, testing-strategy.md
154
49
 
155
- [[LLM: Use this structured approach ONLY for v4 sharded architecture. For other versions, use best judgment based on file names and content.]]
50
+ **For Backend/API Stories, additionally:** data-models.md, database-schema.md, backend-architecture.md, rest-api-spec.md, external-apis.md
156
51
 
157
- **For ALL Stories:**
52
+ **For Frontend/UI Stories, additionally:** frontend-architecture.md, components.md, core-workflows.md, data-models.md
158
53
 
159
- 1. `docs/architecture/tech-stack.md` - Understand technology constraints and versions
160
- 2. `docs/architecture/unified-project-structure.md` - Know where code should be placed
161
- 3. `docs/architecture/coding-standards.md` - Ensure dev follows project conventions
162
- 4. `docs/architecture/testing-strategy.md` - Include testing requirements in tasks
54
+ **For Full-Stack Stories:** Read both Backend and Frontend sections above
163
55
 
164
- **For Backend/API Stories, additionally read:**
165
- 5. `docs/architecture/data-models.md` - Data structures and validation rules
166
- 6. `docs/architecture/database-schema.md` - Database design and relationships
167
- 7. `docs/architecture/backend-architecture.md` - Service patterns and structure
168
- 8. `docs/architecture/rest-api-spec.md` - API endpoint specifications
169
- 9. `docs/architecture/external-apis.md` - Third-party integrations (if relevant)
56
+ #### 3.3 Extract Story-Specific Technical Details
170
57
 
171
- **For Frontend/UI Stories, additionally read:**
172
- 5. `docs/architecture/frontend-architecture.md` - Component structure and patterns
173
- 6. `docs/architecture/components.md` - Specific component designs
174
- 7. `docs/architecture/core-workflows.md` - User interaction flows
175
- 8. `docs/architecture/data-models.md` - Frontend data handling
58
+ Extract ONLY information directly relevant to implementing the current story. Do NOT invent new libraries, patterns, or standards not in the source documents.
176
59
 
177
- **For Full-Stack Stories:**
178
-
179
- - Read both Backend and Frontend sections above
180
-
181
- #### 4.3 Extract Story-Specific Technical Details
182
-
183
- [[LLM: As you read each document, extract ONLY the information directly relevant to implementing the current story. Do NOT include general information unless it directly impacts the story implementation.]]
184
-
185
- For each relevant document, extract:
60
+ Extract:
186
61
 
187
62
  - Specific data models, schemas, or structures the story will use
188
63
  - API endpoints the story must implement or consume
@@ -191,33 +66,22 @@ For each relevant document, extract:
191
66
  - Testing requirements specific to the story's features
192
67
  - Security or performance considerations affecting the story
193
68
 
194
- #### 4.4 Document Source References
195
-
196
- [[LLM: ALWAYS cite the source document and section for each technical detail you include. This helps the dev agent verify information if needed.]]
69
+ ALWAYS cite source documents: `[Source: architecture/{filename}.md#{section}]`
197
70
 
198
- Format references as: `[Source: architecture/{filename}.md#{section}]`
71
+ ### 4. Verify Project Structure Alignment
199
72
 
200
- ### 5. Verify Project Structure Alignment
73
+ - Cross-reference story requirements with Project Structure Guide from `docs/architecture/unified-project-structure.md`
74
+ - Ensure file paths, component locations, or module names align with defined structures
75
+ - Document any structural conflicts in "Project Structure Notes" section within the story draft
201
76
 
202
- - Cross-reference the story's requirements and anticipated file manipulations with the Project Structure Guide from `docs/architecture/unified-project-structure.md`.
203
- - Ensure any file paths, component locations, or module names implied by the story align with defined structures.
204
- - Document any structural conflicts, necessary clarifications, or undefined components/paths in a "Project Structure Notes" section within the story draft.
77
+ ### 5. Populate Story Template with Full Context
205
78
 
206
- ### 6. Populate Story Template with Full Context
207
-
208
- - Create a new story file: `{devStoryLocation}/{epicNum}.{storyNum}.story.md` (using location from config).
209
- - Use the Story Template to structure the file.
210
- - Fill in:
211
- - Story `{EpicNum}.{StoryNum}: {Short Title Copied from Epic File}`
212
- - `Status: Draft`
213
- - `Story` (User Story statement from Epic)
214
- - `Acceptance Criteria (ACs)` (from Epic, to be refined if needed based on context)
215
- - **`Dev Technical Guidance` section (CRITICAL):**
216
-
217
- [[LLM: This section MUST contain ONLY information extracted from the architecture shards. NEVER invent or assume technical details.]]
218
-
219
- - Include ALL relevant technical details gathered from Steps 3 and 4, organized by category:
220
- - **Previous Story Insights**: Key learnings or considerations from the previous story
79
+ - Create new story file: `{devStoryLocation}/{epicNum}.{storyNum}.story.md` using Story Template
80
+ - Fill in basic story information: Title, Status (Draft), Story statement, Acceptance Criteria from Epic
81
+ - **`Dev Notes` section (CRITICAL):**
82
+ - CRITICAL: This section MUST contain ONLY information extracted from architecture documents. NEVER invent or assume technical details.
83
+ - Include ALL relevant technical details from Steps 2-3, organized by category:
84
+ - **Previous Story Insights**: Key learnings from previous story
221
85
  - **Data Models**: Specific schemas, validation rules, relationships [with source references]
222
86
  - **API Specifications**: Endpoint details, request/response formats, auth requirements [with source references]
223
87
  - **Component Specifications**: UI component details, props, state management [with source references]
@@ -226,52 +90,25 @@ Format references as: `[Source: architecture/{filename}.md#{section}]`
226
90
  - **Technical Constraints**: Version requirements, performance considerations, security rules
227
91
  - Every technical detail MUST include its source reference: `[Source: architecture/{filename}.md#{section}]`
228
92
  - If information for a category is not found in the architecture docs, explicitly state: "No specific guidance found in architecture docs"
229
-
230
93
  - **`Tasks / Subtasks` section:**
231
- - Generate a detailed, sequential list of technical tasks based ONLY on:
232
- - Requirements from the Epic
233
- - Technical constraints from architecture shards
234
- - Project structure from unified-project-structure.md
235
- - Testing requirements from testing-strategy.md
94
+ - Generate detailed, sequential list of technical tasks based ONLY on: Epic Requirements, Story AC, Reviewed Architecture Information
236
95
  - Each task must reference relevant architecture documentation
237
- - Include unit testing as explicit subtasks based on testing-strategy.md
96
+ - Include unit testing as explicit subtasks based on the Testing Strategy
238
97
  - Link tasks to ACs where applicable (e.g., `Task 1 (AC: 1, 3)`)
239
- - Add notes on project structure alignment or discrepancies found in Step 5.
240
- - Prepare content for the "Deviation Analysis" based on any conflicts between epic requirements and architecture constraints.
98
+ - Add notes on project structure alignment or discrepancies found in Step 4
241
99
 
242
- ### 7. Run Story Draft Checklist
243
-
244
- - Execute the Story Draft Checklist against the prepared story
245
- - Document any issues or gaps identified
246
- - Make necessary adjustments to meet quality standards
247
- - Ensure all technical guidance is properly sourced from architecture docs
248
-
249
- ### 8. Finalize Story File
100
+ ### 6. Story Draft Completion and Review
250
101
 
251
102
  - Review all sections for completeness and accuracy
252
103
  - Verify all source references are included for technical details
253
104
  - Ensure tasks align with both epic requirements and architecture constraints
254
- - Update status to "Draft"
255
- - Save the story file to `{devStoryLocation}/{epicNum}.{storyNum}.story.md` (using location from config)
256
-
257
- ### 9. Report Completion
258
-
259
- Provide a summary to the user including:
260
-
261
- - Story created: `{epicNum}.{storyNum} - {Story Title}`
262
- - Status: Draft
263
- - Key technical components included from architecture docs
264
- - Any deviations or conflicts noted between epic and architecture
265
- - Recommendations for story review before approval
266
- - Next steps: Story should be reviewed by PO for approval before dev work begins
267
-
268
- ### 10. Update Workflow Plan (if applicable)
269
-
270
- [[LLM: After successful story creation]]
271
-
272
- - If `workflow.trackProgress: true` and `workflow.updateOnCompletion: true`:
273
- - Call update-workflow-plan task to mark story creation step complete
274
- - Parameters: task: create-next-story, step_id: {from plan}, status: complete
275
- - If plan shows next step, mention it in completion message
276
-
277
- [[LLM: Remember - The success of this task depends on extracting real, specific technical details from the architecture shards. The dev agent should have everything they need in the story file without having to search through multiple documents.]]
105
+ - Update status to "Draft" and save the story file
106
+ - If `workflow.trackProgress: true` and `workflow.updateOnCompletion: true`, call update-workflow-plan task to mark story creation step complete
107
+ - Execute `tasks/execute-checklist` `checklists/story-draft-checklist`
108
+ - Provide summary to user including:
109
+ - Story created: `{devStoryLocation}/{epicNum}.{storyNum}.story.md`
110
+ - Status: Draft
111
+ - Key technical components included from architecture docs
112
+ - Any deviations or conflicts noted between epic and architecture
113
+ - Checklist Results
114
+ - Next steps: For Complex stories, suggest the user carefully review the story draft and also optionally have the PO run the task `validate-next-story`
@@ -17,11 +17,19 @@ When a developer marks a story as "Ready for Review", perform a comprehensive se
17
17
  - Understand the dev notes and requirements
18
18
  - Note any completion notes from the developer
19
19
 
20
- 2. **Focus on the File List**
20
+ 2. **Verify Implementation Against Dev Notes Guidance**
21
+ - Review the "Dev Notes" section for specific technical guidance provided to the developer
22
+ - Verify the developer's implementation follows the architectural patterns specified in Dev Notes
23
+ - Check that file locations match the project structure guidance in Dev Notes
24
+ - Confirm any specified libraries, frameworks, or technical approaches were used correctly
25
+ - Validate that security considerations mentioned in Dev Notes were implemented
26
+
27
+ 3. **Focus on the File List**
21
28
  - Verify all files listed were actually created/modified
22
29
  - Check for any missing files that should have been updated
30
+ - Ensure file locations align with the project structure guidance from Dev Notes
23
31
 
24
- 3. **Senior Developer Code Review**
32
+ 4. **Senior Developer Code Review**
25
33
  - Review code with the eye of a senior developer
26
34
  - If changes form a cohesive whole, review them together
27
35
  - If changes are independent, review incrementally file by file
@@ -33,7 +41,7 @@ When a developer marks a story as "Ready for Review", perform a comprehensive se
33
41
  - Security concerns
34
42
  - Best practices and patterns
35
43
 
36
- 4. **Active Refactoring**
44
+ 5. **Active Refactoring**
37
45
  - As a senior developer, you CAN and SHOULD refactor code where improvements are needed
38
46
  - When refactoring:
39
47
  - Make the changes directly in the files
@@ -42,30 +50,32 @@ When a developer marks a story as "Ready for Review", perform a comprehensive se
42
50
  - Ensure all tests still pass after refactoring
43
51
  - Update the File List if you modify additional files
44
52
 
45
- 5. **Standards Compliance Check**
53
+ 6. **Standards Compliance Check**
46
54
  - Verify adherence to `docs/coding-standards.md`
47
55
  - Check compliance with `docs/unified-project-structure.md`
48
56
  - Validate testing approach against `docs/testing-strategy.md`
49
57
  - Ensure all guidelines mentioned in the story are followed
50
58
 
51
- 6. **Acceptance Criteria Validation**
59
+ 7. **Acceptance Criteria Validation**
52
60
  - Verify each AC is fully implemented
53
61
  - Check for any missing functionality
54
62
  - Validate edge cases are handled
55
63
 
56
- 7. **Test Coverage Review**
64
+ 8. **Test Coverage Review**
57
65
  - Ensure unit tests cover edge cases
58
66
  - Add missing tests if critical coverage is lacking
59
67
  - Verify integration tests (if required) are comprehensive
60
68
  - Check that test assertions are meaningful
61
69
  - Look for missing test scenarios
62
70
 
63
- 8. **Documentation and Comments**
71
+ 9. **Documentation and Comments**
64
72
  - Verify code is self-documenting where possible
65
73
  - Add comments for complex logic if missing
66
74
  - Ensure any API changes are documented
67
75
 
68
- ## Append Results to Story File
76
+ ## Update Story File - QA Results Section ONLY
77
+
78
+ **CRITICAL**: You are ONLY authorized to update the "QA Results" section of the story file. DO NOT modify any other sections.
69
79
 
70
80
  After review and any refactoring, append your results to the story file in the QA Results section:
71
81
 
@@ -0,0 +1,134 @@
1
+ # Validate Next Story Task
2
+
3
+ ## Purpose
4
+
5
+ To comprehensively validate a story draft before implementation begins, ensuring it is complete, accurate, and provides sufficient context for successful development. This task identifies issues and gaps that need to be addressed, preventing hallucinations and ensuring implementation readiness.
6
+
7
+ ## SEQUENTIAL Task Execution (Do not proceed until current Task is complete)
8
+
9
+ ### 0. Load Core Configuration and Inputs
10
+
11
+ - Load `.bmad-core/core-config.yaml` from the project root
12
+ - If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story validation."
13
+ - Extract key configurations: `devStoryLocation`, `prd.*`, `architecture.*`
14
+ - Identify and load the following inputs:
15
+ - **Story file**: The drafted story to validate (provided by user or discovered in `devStoryLocation`)
16
+ - **Parent epic**: The epic containing this story's requirements
17
+ - **Architecture documents**: Based on configuration (sharded or monolithic)
18
+ - **Story template**: `bmad-core/templates/story-tmpl.md` for completeness validation
19
+
20
+ ### 1. Template Completeness Validation
21
+
22
+ - Load `bmad-core/templates/story-tmpl.md` and extract all section headings from the template
23
+ - **Missing sections check**: Compare story sections against template sections to verify all required sections are present
24
+ - **Placeholder validation**: Ensure no template placeholders remain unfilled (e.g., `{{EpicNum}}`, `{{role}}`, `_TBD_`)
25
+ - **Agent section verification**: Confirm all sections from template exist for future agent use
26
+ - **Structure compliance**: Verify story follows template structure and formatting
27
+
28
+ ### 2. File Structure and Source Tree Validation
29
+
30
+ - **File paths clarity**: Are new/existing files to be created/modified clearly specified?
31
+ - **Source tree relevance**: Is relevant project structure included in Dev Notes?
32
+ - **Directory structure**: Are new directories/components properly located according to project structure?
33
+ - **File creation sequence**: Do tasks specify where files should be created in logical order?
34
+ - **Path accuracy**: Are file paths consistent with project structure from architecture docs?
35
+
36
+ ### 3. UI/Frontend Completeness Validation (if applicable)
37
+
38
+ - **Component specifications**: Are UI components sufficiently detailed for implementation?
39
+ - **Styling/design guidance**: Is visual implementation guidance clear?
40
+ - **User interaction flows**: Are UX patterns and behaviors specified?
41
+ - **Responsive/accessibility**: Are these considerations addressed if required?
42
+ - **Integration points**: Are frontend-backend integration points clear?
43
+
44
+ ### 4. Acceptance Criteria Satisfaction Assessment
45
+
46
+ - **AC coverage**: Will all acceptance criteria be satisfied by the listed tasks?
47
+ - **AC testability**: Are acceptance criteria measurable and verifiable?
48
+ - **Missing scenarios**: Are edge cases or error conditions covered?
49
+ - **Success definition**: Is "done" clearly defined for each AC?
50
+ - **Task-AC mapping**: Are tasks properly linked to specific acceptance criteria?
51
+
52
+ ### 5. Validation and Testing Instructions Review
53
+
54
+ - **Test approach clarity**: Are testing methods clearly specified?
55
+ - **Test scenarios**: Are key test cases identified?
56
+ - **Validation steps**: Are acceptance criteria validation steps clear?
57
+ - **Testing tools/frameworks**: Are required testing tools specified?
58
+ - **Test data requirements**: Are test data needs identified?
59
+
60
+ ### 6. Security Considerations Assessment (if applicable)
61
+
62
+ - **Security requirements**: Are security needs identified and addressed?
63
+ - **Authentication/authorization**: Are access controls specified?
64
+ - **Data protection**: Are sensitive data handling requirements clear?
65
+ - **Vulnerability prevention**: Are common security issues addressed?
66
+ - **Compliance requirements**: Are regulatory/compliance needs addressed?
67
+
68
+ ### 7. Tasks/Subtasks Sequence Validation
69
+
70
+ - **Logical order**: Do tasks follow proper implementation sequence?
71
+ - **Dependencies**: Are task dependencies clear and correct?
72
+ - **Granularity**: Are tasks appropriately sized and actionable?
73
+ - **Completeness**: Do tasks cover all requirements and acceptance criteria?
74
+ - **Blocking issues**: Are there any tasks that would block others?
75
+
76
+ ### 8. Anti-Hallucination Verification
77
+
78
+ - **Source verification**: Every technical claim must be traceable to source documents
79
+ - **Architecture alignment**: Dev Notes content matches architecture specifications
80
+ - **No invented details**: Flag any technical decisions not supported by source documents
81
+ - **Reference accuracy**: Verify all source references are correct and accessible
82
+ - **Fact checking**: Cross-reference claims against epic and architecture documents
83
+
84
+ ### 9. Dev Agent Implementation Readiness
85
+
86
+ - **Self-contained context**: Can the story be implemented without reading external docs?
87
+ - **Clear instructions**: Are implementation steps unambiguous?
88
+ - **Complete technical context**: Are all required technical details present in Dev Notes?
89
+ - **Missing information**: Identify any critical information gaps
90
+ - **Actionability**: Are all tasks actionable by a development agent?
91
+
92
+ ### 10. Generate Validation Report
93
+
94
+ Provide a structured validation report including:
95
+
96
+ #### Template Compliance Issues
97
+
98
+ - Missing sections from story template
99
+ - Unfilled placeholders or template variables
100
+ - Structural formatting issues
101
+
102
+ #### Critical Issues (Must Fix - Story Blocked)
103
+
104
+ - Missing essential information for implementation
105
+ - Inaccurate or unverifiable technical claims
106
+ - Incomplete acceptance criteria coverage
107
+ - Missing required sections
108
+
109
+ #### Should-Fix Issues (Important Quality Improvements)
110
+
111
+ - Unclear implementation guidance
112
+ - Missing security considerations
113
+ - Task sequencing problems
114
+ - Incomplete testing instructions
115
+
116
+ #### Nice-to-Have Improvements (Optional Enhancements)
117
+
118
+ - Additional context that would help implementation
119
+ - Clarifications that would improve efficiency
120
+ - Documentation improvements
121
+
122
+ #### Anti-Hallucination Findings
123
+
124
+ - Unverifiable technical claims
125
+ - Missing source references
126
+ - Inconsistencies with architecture documents
127
+ - Invented libraries, patterns, or standards
128
+
129
+ #### Final Assessment
130
+
131
+ - **GO**: Story is ready for implementation
132
+ - **NO-GO**: Story requires fixes before implementation
133
+ - **Implementation Readiness Score**: 1-10 scale
134
+ - **Confidence Level**: High/Medium/Low for successful implementation
@@ -1,6 +1,8 @@
1
- # Project Brief: {{Project Name}}
1
+ ---
2
+ defaultOutput: docs/brief.md
3
+ ---
2
4
 
3
- [[LLM: The default path and filename unless specified is docs/brief.md]]
5
+ # Project Brief: {{Project Name}}
4
6
 
5
7
  [[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development.
6
8
 
@@ -1,14 +1,29 @@
1
+ ---
2
+ defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md
3
+ smAgent:
4
+ editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log
5
+ sectionSpecificInstructions:
6
+ "Dev Notes":
7
+ - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story
8
+ - Do not invent information.
9
+ - If known add Relevant Source Tree info that relates to this story.
10
+ - If there were important notes from previous story that are relevant to this one, include them here.
11
+ - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks.
12
+ Testing:
13
+ - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc)
14
+ ---
15
+
1
16
  # Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}}
2
17
 
3
18
  ## Status: {{ Draft | Approved | InProgress | Review | Done }}
4
19
 
5
20
  ## Story
6
21
 
7
- - As a {{role}}
8
- - I want {{action}}
9
- - so that {{benefit}}
22
+ **As a** {{role}},\
23
+ **I want** {{action}},\
24
+ **so that** {{benefit}}
10
25
 
11
- ## Acceptance Criteria (ACs)
26
+ ## Acceptance Criteria
12
27
 
13
28
  {{ Copy of Acceptance Criteria numbered list }}
14
29
 
@@ -23,20 +38,12 @@
23
38
 
24
39
  ## Dev Notes
25
40
 
26
- [[LLM: populates relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story. Do not invent information. Critical: If known add Relevant Source Tree info that relates to this story. If there were important notes from previous story that are relevant to this one, also include them here if it will help the dev agent. You do NOT need to repeat anything from coding standards or test standards as the dev agent is already aware of those. The dev agent should NEVER need to read the PRD or architecture documents or child documents though to complete this self contained story, because your critical mission is to share the specific items needed here extremely concisely for the Dev Agent LLM to comprehend with the least about of context overhead token usage needed.]]
27
-
28
41
  ### Testing
29
42
 
30
- [[LLM: Scrum Master use `test-strategy-and-standards.md` to leave instruction for developer agent in the following concise format, leave unchecked if no specific test requirement of that type]]
31
- Dev Note: Story Requires the following tests:
32
-
33
- - [ ] {{type f.e. Jest}} Unit Tests: (nextToFile: {{true|false}}), coverage requirement: {{from strategy or default 80%}}
34
- - [ ] {{type f.e. Jest with in memory db}} Integration Test (Test Location): location: {{Integration test location f.e. `/tests/story-name/foo.spec.cs` or `next to handler`}}
35
- - [ ] {{type f.e. Cypress}} E2E: location: {{f.e. `/e2e/{epic-name/bar.test.ts`}}
36
-
37
- Manual Test Steps: [[LLM: Include how if possible the user can manually test the functionality when story is Ready for Review, if any]]
43
+ ## Change Log
38
44
 
39
- {{ f.e. `- dev will create a script with task 3 above that you can run with "npm run test-initiate-launch-sequence" and validate Armageddon is initiated`}}
45
+ | Date | Version | Description | Author |
46
+ | :--- | :------ | :---------- | :----- |
40
47
 
41
48
  ## Dev Agent Record
42
49
 
@@ -44,26 +51,8 @@ Manual Test Steps: [[LLM: Include how if possible the user can manually test the
44
51
 
45
52
  ### Debug Log References
46
53
 
47
- [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update]]
48
- [[LLM: (Dev Agent) If the debug is logged to during the current story progress, create a table with the debug log and the specific task section in the debug log - do not repeat all the details in the story]]
49
-
50
54
  ### Completion Notes List
51
55
 
52
- [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update - remove this line to the SM]]
53
- [[LLM: (Dev Agent) Anything the SM needs to know that deviated from the story that might impact drafting the next story.]]
54
-
55
56
  ### File List
56
57
 
57
- [[LLM: (Dev Agent) List every new file created, or existing file modified in a bullet list.]]
58
-
59
- ### Change Log
60
-
61
- [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update- remove this line to the SM]]
62
- [[LLM: (Dev Agent) Track document versions and changes during development that deviate from story dev start]]
63
-
64
- | Date | Version | Description | Author |
65
- | :--- | :------ | :---------- | :----- |
66
-
67
58
  ## QA Results
68
-
69
- [[LLM: QA Agent Results]]