Skip to content

Commit 00a3af3

Browse files
alexeyvclaudebmadcode
authored
fix(bmm): sprint-status workflow improvements (#1141)
* fix(bmm): sprint-status workflow improvements - Remove dead by_epic template block and context_status variable (#1116, #1117) - Define "first" story ordering as epic number then story number (#1119) - Clarify retrospective check: "any retrospective status == optional" (#1120) - Strengthen validate mode: check required metadata fields and valid statuses (#1121) - Expand risk detection: stale file, orphaned stories, empty epics (#1122) - Fix retrospective valid status: use "done" instead of "completed" for consistency Fixes #1116, fixes #1117, fixes #1119, fixes #1120, fixes #1121, fixes #1122 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix(bmm): address CodeRabbit review feedback - Improve retrospective status descriptions for clarity - Fix empty epic detection to only warn on in-progress epics - Add 'generated' to required metadata field validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: Brian <[email protected]>
1 parent d0e0a09 commit 00a3af3

File tree

3 files changed

+46
-25
lines changed

3 files changed

+46
-25
lines changed

src/modules/bmm/workflows/4-implementation/sprint-planning/instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ development_status:
8484

8585
- Epic: `backlog` → `in-progress` → `done`
8686
- Story: `backlog` → `ready-for-dev` → `in-progress` → `review` → `done`
87-
- Retrospective: `optional` ↔ `completed`
87+
- Retrospective: `optional` ↔ `done`
8888
</step>
8989

9090
<step n="4" goal="Generate sprint status file">
@@ -119,7 +119,7 @@ development_status:
119119
#
120120
# Retrospective Status:
121121
# - optional: Can be completed but not required
122-
# - completed: Retrospective has been done
122+
# - done: Retrospective has been completed
123123
#
124124
# WORKFLOW NOTES:
125125
# ===============
@@ -210,11 +210,11 @@ backlog → ready-for-dev → in-progress → review → done
210210
**Retrospective Status:**
211211
212212
```
213-
optional ↔ completed
213+
optional ↔ done
214214
```
215215
216-
- **optional**: Can be done but not required
217-
- **completed**: Retrospective has been completed
216+
- **optional**: Ready to be conducted but not required
217+
- **done**: Finished
218218
219219
### Guidelines
220220

src/modules/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#
2525
# Retrospective Status:
2626
# - optional: Can be completed but not required
27-
# - completed: Retrospective has been done by *retrospective
27+
# - done: Retrospective has been completed
2828
#
2929
# WORKFLOW NOTES:
3030
# ===============

src/modules/bmm/workflows/4-implementation/sprint-status/instructions.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)