@@ -44,13 +44,13 @@ Run `/bmad:bmm:workflows:sprint-planning` to generate it, then rerun sprint-stat
4444 <action >Count story statuses: backlog, ready-for-dev, in-progress, review, done</action >
4545 <action >Map legacy epic status "contexted" → "in-progress"</action >
4646 <action >Count epic statuses: backlog, in-progress, done</action >
47- <action >Count retrospective statuses: optional, completed </action >
47+ <action >Count retrospective statuses: optional, done </action >
4848
4949<action >Validate all statuses against known values:</action >
5050
5151- Valid story statuses: backlog, ready-for-dev, in-progress, review, done, drafted (legacy)
5252- Valid epic statuses: backlog, in-progress, done, contexted (legacy)
53- - Valid retrospective statuses: optional, completed
53+ - Valid retrospective statuses: optional, done
5454
5555 <check if =" any status is unrecognized " >
5656 <output >
@@ -64,7 +64,7 @@ Run `/bmad:bmm:workflows:sprint-planning` to generate it, then rerun sprint-stat
6464
6565- Stories: backlog, ready-for-dev, in-progress, review, done
6666- Epics: backlog, in-progress, done
67- - Retrospectives: optional, completed
67+ - Retrospectives: optional, done
6868 </output >
6969 <ask >How should these be corrected?
7070 {{#each invalid_entries}}
@@ -83,15 +83,19 @@ Enter corrections (e.g., "1=in-progress, 2=backlog") or "skip" to continue witho
8383- IF any story has status "review": suggest ` /bmad:bmm:workflows:code-review `
8484- IF any story has status "in-progress" AND no stories have status "ready-for-dev": recommend staying focused on active story
8585- IF all epics have status "backlog" AND no stories have status "ready-for-dev": prompt ` /bmad:bmm:workflows:create-story `
86+ - IF ` generated ` timestamp is more than 7 days old: warn "sprint-status.yaml may be stale"
87+ - IF any story key doesn't match an epic pattern (e.g., story "5-1-..." but no "epic-5"): warn "orphaned story detected"
88+ - IF any epic has status in-progress but has no associated stories: warn "in-progress epic has no stories"
8689 </step >
8790
8891<step n =" 3 " goal =" Select next action recommendation " >
8992 <action >Pick the next recommended workflow using priority:</action >
93+ <note >When selecting "first" story: sort by epic number, then story number (e.g., 1-1 before 1-2 before 2-1)</note >
9094 1 . If any story status == in-progress → recommend ` dev-story ` for the first in-progress story
9195 2 . Else if any story status == review → recommend ` code-review ` for the first review story
9296 3 . Else if any story status == ready-for-dev → recommend ` dev-story `
9397 4 . Else if any story status == backlog → recommend ` create-story `
94- 5 . Else if retrospectives are optional → recommend ` retrospective `
98+ 5 . Else if any retrospective status == optional → recommend ` retrospective `
9599 6 . Else → All implementation items done; suggest ` workflow-status ` to plan next phase
96100 <action >Store selected recommendation as: next_story_id, next_workflow_id, next_agent (SM/DEV as appropriate)</action >
97101</step >
@@ -118,13 +122,6 @@ Enter corrections (e.g., "1=in-progress, 2=backlog") or "skip" to continue witho
118122 {{/each}}
119123 {{/if}}
120124
121- {{#if by_epic}}
122- ** Per Epic:**
123- {{#each by_epic}}
124-
125- - {{epic_id}}: context={{context_status}}, stories → backlog {{backlog}}, ready {{ready_for_dev}}, in-progress {{in_progress}}, review {{review}}, done {{done}}
126- {{/each}}
127- {{/if}}
128125 </output >
129126 </step >
130127
@@ -194,15 +191,39 @@ If the command targets a story, set `story_key={{next_story_id}}` when prompted.
194191 <template-output>suggestion = "Run sprint-planning to create it"</template-output>
195192 <action>Return</action>
196193 </check >
197- <action >Read file and verify it has a development_status section with at least one entry</action >
198- <check if =" validation fails " >
199- <template-output>is_valid = false</template-output>
200- <template-output>error = "development_status missing or empty"</template-output>
201- <template-output>suggestion = "Re-run sprint-planning or repair the file manually"</template-output>
202- <action>Return</action>
194+
195+ <action >Read and parse {sprint_status_file}</action >
196+
197+ <action >Validate required metadata fields exist: generated, project, project_key, tracking_system, story_location</action >
198+ <check if =" any required field missing " >
199+ <template-output >is_valid = false</template-output >
200+ <template-output >error = "Missing required field(s): {{missing_fields}}"</template-output >
201+ <template-output >suggestion = "Re-run sprint-planning or add missing fields manually"</template-output >
202+ <action >Return</action >
203+ </check >
204+
205+ <action >Verify development_status section exists with at least one entry</action >
206+ <check if =" development_status missing or empty " >
207+ <template-output >is_valid = false</template-output >
208+ <template-output >error = "development_status missing or empty"</template-output >
209+ <template-output >suggestion = "Re-run sprint-planning or repair the file manually"</template-output >
210+ <action >Return</action >
211+ </check >
212+
213+ <action >Validate all status values against known valid statuses:</action >
214+
215+ - Stories: backlog, ready-for-dev, in-progress, review, done (legacy: drafted)
216+ - Epics: backlog, in-progress, done (legacy: contexted)
217+ - Retrospectives: optional, done
218+ <check if =" any invalid status found " >
219+ <template-output >is_valid = false</template-output >
220+ <template-output >error = "Invalid status values: {{invalid_entries}}"</template-output >
221+ <template-output >suggestion = "Fix invalid statuses in sprint-status.yaml"</template-output >
222+ <action >Return</action >
203223 </check >
204- <template-output >is_valid = true</template-output >
205- <template-output >message = "sprint-status.yaml present and parsable"</template-output >
224+
225+ <template-output >is_valid = true</template-output >
226+ <template-output >message = "sprint-status.yaml valid: metadata complete, all statuses recognized"</template-output >
206227</step >
207228
208229</workflow >
0 commit comments