12 KiB
Sprint Status Workflow
Goal: Summarize sprint status, surface risks, and recommend the next workflow action.
Your Role: You are a Scrum Master providing clear, actionable sprint visibility. No time estimates — focus on status, risks, and next steps.
INITIALIZATION
Configuration Loading
Load config from {project-root}/_bmad/bmm/config.yaml and resolve:
project_name,user_namecommunication_language,document_output_languageimplementation_artifactsdateas system-generated current datetime- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config
{communication_language}
Paths
sprint_status_file={implementation_artifacts}/sprint-status.yamldeferred_work_file={implementation_artifacts}/deferred-work.md
Input Files
| Input | Path | Load Strategy |
|---|---|---|
| Sprint status | {sprint_status_file} |
FULL_LOAD |
| Deferred work | {deferred_work_file} |
FULL_LOAD (optional) |
Context
project_context=**/project-context.md(load if exists)
EXECUTION
Set mode = {{mode}} if provided by caller; otherwise mode = "interactive" Jump to Step 20 Jump to Step 30 Continue to Step 1 Load {project_context} for project-wide patterns and conventions (if exists) Try {sprint_status_file} ❌ sprint-status.yaml not found. Run `/bmad:bmm:workflows:sprint-planning` to generate it, then rerun sprint-status. Exit workflow Continue to Step 2 Read the FULL file: {sprint_status_file} Parse fields: generated, last_updated, project, project_key, tracking_system, story_location Parse development_status map. Classify keys: - Epics: keys starting with "epic-" (and not ending with "-retrospective") - Retrospectives: keys ending with "-retrospective" - Stories: everything else (e.g., 1-2-login-form) Map legacy story status "drafted" → "ready-for-dev" Count story statuses: backlog, ready-for-dev, in-progress, review, done Map legacy epic status "contexted" → "in-progress" Count epic statuses: backlog, in-progress, done Count retrospective statuses: optional, doneValidate all statuses against known values:
-
Valid story statuses: backlog, ready-for-dev, in-progress, review, done, drafted (legacy)
-
Valid epic statuses: backlog, in-progress, done, contexted (legacy)
-
Valid retrospective statuses: optional, done
⚠️ Unknown status detected: {{#each invalid_entries}}
{{key}}: "{{status}}" (not recognized) {{/each}}
Valid statuses:
- Stories: backlog, ready-for-dev, in-progress, review, done
- Epics: backlog, in-progress, done
- Retrospectives: optional, done How should these be corrected? {{#each invalid_entries}} {{@index}}. {{key}}: "{{status}}" → [select valid status] {{/each}}
Enter corrections (e.g., "1=in-progress, 2=backlog") or "skip" to continue without fixing: Update sprint-status.yaml with corrected values Re-parse the file with corrected statuses
Detect risks:
- IF any story has status "review": suggest
/bmad:bmm:workflows:code-review - IF any story has status "in-progress" AND no stories have status "ready-for-dev": recommend staying focused on active story
- IF all epics have status "backlog" AND no stories have status "ready-for-dev": prompt
/bmad:bmm:workflows:create-story - IF
last_updatedtimestamp is more than 7 days old (orlast_updatedis missing, fall back togenerated): warn "sprint-status.yaml may be stale" - IF any story key doesn't match an epic pattern (e.g., story "5-1-..." but no "epic-5"): warn "orphaned story detected"
- IF any epic has status in-progress but has no associated stories: warn "in-progress epic has no stories"
Analyze deferred work backlog (if {deferred_work_file} exists):
Parse all deferred items from {deferred_work_file}. The file uses level-2 headings produced by bmad-code-review: `## Deferred from: code review of story-X.Y (YYYY-MM-DD)` Each heading is followed by bullet items (one per deferred finding). Count total deferred items (bullet items, not headings) Group items by originating review/story (derived from the heading above each group) Classify items by severity: if the item includes an explicit category use it; otherwise derive heuristically from description keywords (security/auth/injection → security; bug/crash/error/null → bug; performance/slow/cache → performance; style/lint/naming → style; default → tech-debt) Store counts: {{deferred_total}}, {{deferred_high}} (security/bug), {{deferred_medium}} (tech-debt/performance), {{deferred_low}} (style/minor) IF {{deferred_total}} > 20: add risk "Deferred work backlog is large ({{deferred_total}} items) — consider triaging with SM agent" IF {{deferred_high}} > 0: add risk "{{deferred_high}} high-priority deferred items (security/bugs) need attention" Set {{deferred_total}} = 0, {{deferred_high}} = 0, {{deferred_medium}} = 0, {{deferred_low}} = 0 Pick the next recommended workflow using priority: When selecting "first" story: sort by epic number, then story number (e.g., 1-1 before 1-2 before 2-1) 1. If any story status == in-progress → recommend `dev-story` for the first in-progress story 2. Else if any story status == review → recommend `code-review` for the first review story 3. Else if any story status == ready-for-dev → recommend `dev-story` 4. Else if any story status == backlog → recommend `create-story` 5. Else if any retrospective status == optional → recommend `retrospective` 6. Else → All implementation items done; congratulate the user - you both did amazing work together! Store selected recommendation as: next_story_id, next_workflow_id, next_agent (SM/DEV as appropriate) ## 📊 Sprint Status- Project: {{project}} ({{project_key}})
- Tracking: {{tracking_system}}
- Status file: {sprint_status_file}
Stories: backlog {{count_backlog}}, ready-for-dev {{count_ready}}, in-progress {{count_in_progress}}, review {{count_review}}, done {{count_done}}
Epics: backlog {{epic_backlog}}, in-progress {{epic_in_progress}}, done {{epic_done}}
{{#if deferred_total}} Deferred Work: {{deferred_total}} items ({{deferred_high}} high, {{deferred_medium}} medium, {{deferred_low}} low) {{/if}}
Next Recommendation: /bmad:bmm:workflows:{{next_workflow_id}} ({{next_story_id}})
{{#if risks}} Risks: {{#each risks}}
-
{{this}} {{/each}} {{/if}}
Read and parse {sprint_status_file}
Validate required metadata fields exist: generated, project, project_key, tracking_system, story_location (last_updated is optional for backward compatibility) is_valid = false error = "Missing required field(s): {{missing_fields}}" suggestion = "Re-run sprint-planning or add missing fields manually" Return
Verify development_status section exists with at least one entry is_valid = false error = "development_status missing or empty" suggestion = "Re-run sprint-planning or repair the file manually" Return
Validate all status values against known valid statuses:
- Stories: backlog, ready-for-dev, in-progress, review, done (legacy: drafted)
- Epics: backlog, in-progress, done (legacy: contexted)
- Retrospectives: optional, done is_valid = false error = "Invalid status values: {{invalid_entries}}" suggestion = "Fix invalid statuses in sprint-status.yaml" Return
is_valid = true message = "sprint-status.yaml valid: metadata complete, all statuses recognized"