better status loading and updating for phase 4

This commit is contained in:
Brian Madison
2025-10-25 14:26:30 -05:00
parent 994f251687
commit 5762941321
14 changed files with 288 additions and 1068 deletions

View File

@@ -28,15 +28,19 @@
<action>READ COMPLETE FILES for all items found in the prioritized set. Store content and paths for citation.</action>
</step>
<step n="3" goal="Determine target story from sprint status">
<action>Query sprint-status for next backlog story:</action>
<step n="3" goal="Find next backlog story to draft" tag="sprint-status">
<critical>MUST read COMPLETE sprint-status.yaml file from start to end to preserve order</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL lines from beginning to end - do not skip any content</action>
<action>Parse the development_status section completely to understand story order</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: get_next_story</param>
<param>filter_status: backlog</param>
</invoke-workflow>
<action>Find the FIRST story (by reading in order from top to bottom) where:
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
- Status value equals "backlog"
</action>
<check if="{{result_found}} == false">
<check if="no backlog story found">
<output>📋 No backlog stories found in sprint-status.yaml
All stories are either already drafted or completed.
@@ -49,13 +53,16 @@ All stories are either already drafted or completed.
<action>HALT</action>
</check>
<action>Parse {{result_story_key}} to extract epic_num, story_num, and story_title
Example: "1-2-user-authentication" → epic_num=1, story_num=2, title="user-authentication"
<action>Extract from found story key (e.g., "1-2-user-authentication"):
- epic_num: first number before dash (e.g., "1")
- story_num: second number after first dash (e.g., "2")
- story_title: remainder after second dash (e.g., "user-authentication")
</action>
<action>Set {{story_id}} = "{{epic_num}}.{{story_num}}"</action>
<action>Store story_key for later use (e.g., "1-2-user-authentication")</action>
<action>Verify story is enumerated in {{epics_file}}. If not found, HALT with message:</action>
<action>"Story {{result_story_key}} not found in epics.md. Please load PM agent and run correct-course to sync epics, then rerun create-story."</action>
<action>"Story {{story_key}} not found in epics.md. Please load PM agent and run correct-course to sync epics, then rerun create-story."</action>
<action>Check if story file already exists at expected path in {{story_dir}}</action>
<check if="story file exists">
@@ -97,19 +104,20 @@ Will update existing story file rather than creating new one.
<template-output file="{default_output_file}">change_log</template-output>
</step>
<step n="8" goal="Validate, save, and optionally generate context">
<step n="8" goal="Validate, save, and mark story drafted" tag="sprint-status">
<invoke-task>Validate against checklist at {installed_path}/checklist.md using bmad/core/tasks/validate-workflow.xml</invoke-task>
<action>Save document unconditionally (non-interactive default). In interactive mode, allow user confirmation.</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_story_status</param>
<param>story_key: {{result_story_key}}</param>
<param>new_status: drafted</param>
<param>validate: true</param>
</invoke-workflow>
<!-- Mark story as drafted in sprint status -->
<action>Update {{output_folder}}/sprint-status.yaml</action>
<action>Load the FULL file and read all development_status entries</action>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "backlog" (expected previous state)</action>
<action>Update development_status[{{story_key}}] = "drafted"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == false">
<output>⚠️ Could not update story status: {{result_error}}
<check if="story key not found in file">
<output>⚠️ Could not update story status: {{story_key}} not found in sprint-status.yaml
Story file was created successfully, but sprint-status.yaml was not updated.
You may need to run sprint-planning to refresh tracking.
@@ -122,9 +130,9 @@ You may need to run sprint-planning to refresh tracking.
**Story Details:**
- Story ID: {{story_id}}
- Story Key: {{result_story_key}}
- Story Key: {{story_key}}
- File: {{story_file}}
- Status: {{result_new_status}} (was {{result_old_status}})
- Status: drafted (was backlog)
**Next Steps:**
1. Review the drafted story in {{story_file}}

View File

@@ -15,7 +15,7 @@
<workflow>
<step n="1" goal="Locate and load story from sprint status">
<step n="1" goal="Find next ready story and load it" tag="sprint-status">
<check if="{{story_path}} is provided">
<action>Use {{story_path}} directly</action>
<action>Read COMPLETE story file</action>
@@ -23,14 +23,18 @@
<goto>task_check</goto>
</check>
<action>Query sprint-status for ready stories:</action>
<critical>MUST read COMPLETE sprint-status.yaml file from start to end to preserve order</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL lines from beginning to end - do not skip any content</action>
<action>Parse the development_status section completely to understand story order</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: get_next_story</param>
<param>filter_status: ready-for-dev</param>
</invoke-workflow>
<action>Find the FIRST story (by reading in order from top to bottom) where:
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
- Status value equals "ready-for-dev"
</action>
<check if="{{result_found}} == false">
<check if="no ready-for-dev story found">
<output>📋 No ready-for-dev stories found in sprint-status.yaml
**Options:**
@@ -41,9 +45,9 @@
<action>HALT</action>
</check>
<action>Use {{result_story_key}} to find story file in {{story_dir}}</action>
<action>Store the found story_key (e.g., "1-2-user-authentication") for later status updates</action>
<action>Find matching story file in {{story_dir}} using story_key pattern</action>
<action>Read COMPLETE story file from discovered path</action>
<action>Store {{result_story_key}} for later status updates</action>
<anchor id="task_check" />
@@ -55,32 +59,30 @@
<action if="task requirements ambiguous">ASK user to clarify or HALT</action>
</step>
<step n="1.5" goal="Mark story in-progress in sprint status">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: get_story_status</param>
<param>story_key: {{result_story_key}}</param>
</invoke-workflow>
<step n="1.5" goal="Mark story in-progress" tag="sprint-status">
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read all development_status entries to find {{story_key}}</action>
<action>Get current status value for development_status[{{story_key}}]</action>
<check if="{{result_status}} == 'ready-for-dev'">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_story_status</param>
<param>story_key: {{result_story_key}}</param>
<param>new_status: in-progress</param>
<param>validate: true</param>
</invoke-workflow>
<check if="{{result_success}} == true">
<output>🚀 Starting work on story {{result_story_key}}
Status updated: {{result_old_status}} → {{result_new_status}}
</output>
</check>
<check if="current status == 'ready-for-dev'">
<action>Update development_status[{{story_key}}] = "in-progress"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<output>🚀 Starting work on story {{story_key}}
Status updated: ready-for-dev → in-progress
</output>
</check>
<check if="{{result_status}} == 'in-progress'">
<output>⏯️ Resuming work on story {{result_story_key}}
<check if="current status == 'in-progress'">
<output>⏯️ Resuming work on story {{story_key}}
Story is already marked in-progress
</output>
</check>
<check if="current status is neither ready-for-dev nor in-progress">
<output>⚠️ Unexpected story status: {{current_status}}
Expected ready-for-dev or in-progress. Continuing anyway...
</output>
</check>
</step>
<step n="2" goal="Plan and implement task">
@@ -123,22 +125,22 @@ Story is already marked in-progress
<action if="no tasks remain"><goto step="6">Completion</goto></action>
</step>
<step n="6" goal="Story completion sequence">
<step n="6" goal="Story completion and mark for review" tag="sprint-status">
<action>Verify ALL tasks and subtasks are marked [x] (re-scan the story document now)</action>
<action>Run the full regression suite (do not skip)</action>
<action>Confirm File List includes every changed file</action>
<action>Execute story definition-of-done checklist, if the story includes one</action>
<action>Update the story Status to: Ready for Review</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_story_status</param>
<param>story_key: {{result_story_key}}</param>
<param>new_status: review</param>
<param>validate: true</param>
</invoke-workflow>
<!-- Mark story ready for review -->
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "in-progress" (expected previous state)</action>
<action>Update development_status[{{story_key}}] = "review"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == false">
<output>⚠️ Story file updated, but sprint-status update failed: {{result_error}}
<check if="story key not found in file">
<output>⚠️ Story file updated, but sprint-status update failed: {{story_key}} not found
Story is marked Ready for Review in file, but sprint-status.yaml may be out of sync.
</output>
@@ -157,10 +159,10 @@ Story is marked Ready for Review in file, but sprint-status.yaml may be out of s
**Story Details:**
- Story ID: {{current_story_id}}
- Story Key: {{result_story_key}}
- Story Key: {{story_key}}
- Title: {{current_story_title}}
- File: {{story_path}}
- Status: {{result_new_status}} (was {{result_old_status}})
- Status: review (was in-progress)
**Next Steps:**
1. Review the implemented story and test the changes

View File

@@ -16,13 +16,15 @@
<action>Resolve output file path using workflow variables and initialize by writing the template.</action>
</step>
<step n="1.5" goal="Validate epic in sprint status">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: get_epic_status</param>
<param>epic_id: {{epic_id}}</param>
</invoke-workflow>
<step n="1.5" goal="Validate epic exists in sprint status" tag="sprint-status">
<critical>MUST read COMPLETE sprint-status.yaml file to find epic status</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL development_status entries</action>
<check if="{{result_found}} == false">
<action>Look for epic key "epic-{{epic_id}}" in development_status</action>
<action>Get current status value if epic exists</action>
<check if="epic not found">
<output>⚠️ Epic {{epic_id}} not found in sprint-status.yaml
This epic hasn't been registered in the sprint plan yet.
@@ -31,7 +33,7 @@ Run sprint-planning workflow to initialize epic tracking.
<action>HALT</action>
</check>
<check if="{{result_status}} == 'contexted'">
<check if="epic status == 'contexted'">
<output> Epic {{epic_id}} already marked as contexted
Continuing to regenerate tech spec...
@@ -89,17 +91,18 @@ Continuing to regenerate tech spec...
</template-output>
</step>
<step n="8" goal="Validate and complete">
<step n="8" goal="Validate and mark epic contexted" tag="sprint-status">
<invoke-task>Validate against checklist at {installed_path}/checklist.md using bmad/core/tasks/validate-workflow.xml</invoke-task>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_epic_status</param>
<param>epic_id: {{epic_id}}</param>
<param>new_status: contexted</param>
</invoke-workflow>
<!-- Mark epic as contexted -->
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Find development_status key "epic-{{epic_id}}"</action>
<action>Verify current status is "backlog" (expected previous state)</action>
<action>Update development_status["epic-{{epic_id}}"] = "contexted"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == false">
<output>⚠️ Could not update epic status: {{result_error}}</output>
<check if="epic key not found in file">
<output>⚠️ Could not update epic status: epic-{{epic_id}} not found</output>
</check>
<output>**✅ Tech Spec Generated Successfully, {user_name}!**
@@ -108,7 +111,7 @@ Continuing to regenerate tech spec...
- Epic ID: {{epic_id}}
- Epic Title: {{epic_title}}
- Tech Spec File: {{default_output_file}}
- Epic Status: {{result_new_status}} (was {{result_old_status}})
- Epic Status: contexted (was backlog)
**Note:** This is a JIT (Just-In-Time) workflow - run again for other epics as needed.

View File

@@ -20,30 +20,40 @@ FACILITATION NOTES:
<workflow>
<step n="1" goal="Epic Context Discovery">
<step n="1" goal="Epic Context Discovery and verify completion" tag="sprint-status">
<action>Help the user identify which epic was just completed through natural conversation</action>
<action>Attempt to auto-detect by checking {output_folder}/stories/ for the highest numbered completed story and extracting the epic number</action>
<action>If auto-detection succeeds, confirm with user: "It looks like Epic {{epic_number}} was just completed - is that correct?"</action>
<action>If auto-detection fails or user indicates different epic, ask them to share which epic they just completed</action>
<action>Verify epic completion status in sprint-status:</action>
<action>Verify epic completion status:</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: check_epic_complete</param>
<param>epic_id: {{epic_number}}</param>
</invoke-workflow>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL development_status entries</action>
<check if="{{result_complete}} == false">
<action>Find all stories for epic {{epic_number}}:
- Look for keys starting with "{{epic_number}}-" (e.g., "1-1-", "1-2-", etc.)
- Exclude epic key itself ("epic-{{epic_number}}")
- Exclude retrospective key ("epic-{{epic_number}}-retrospective")
</action>
<action>Count total stories found for this epic</action>
<action>Count stories with status = "done"</action>
<action>Collect list of pending story keys (status != "done")</action>
<action>Determine if complete: true if all stories are done, false otherwise</action>
<check if="epic is not complete">
<output>⚠️ Epic {{epic_number}} is not yet complete for retrospective
**Epic Status:**
- Total Stories: {{result_total_stories}}
- Completed (Done): {{result_done_stories}}
- Pending: {{result_total_stories - result_done_stories}}
- Total Stories: {{total_stories}}
- Completed (Done): {{done_stories}}
- Pending: {{pending_count}}
**Pending Stories:**
{{result_pending_stories}}
{{pending_story_list}}
**Options:**
@@ -61,8 +71,8 @@ FACILITATION NOTES:
<action if="user says yes">Set {{partial_retrospective}} = true</action>
</check>
<check if="{{result_complete}} == true">
<output>✅ Epic {{epic_number}} is complete - all {{result_done_stories}} stories done!
<check if="epic is complete">
<output>✅ Epic {{epic_number}} is complete - all {{done_stories}} stories done!
Ready to proceed with retrospective.
</output>
@@ -403,27 +413,32 @@ See you at sprint planning once prep work is done!"
```
<action>Save retrospective summary to: {output_folder}/retrospectives/epic-{{completed_number}}-retro-{{date}}.md</action>
</step>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: complete_retrospective</param>
<param>epic_id: {{completed_number}}</param>
</invoke-workflow>
<step n="9" goal="Mark retrospective completed in sprint status" tag="sprint-status">
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Find development_status key "epic-{{completed_number}}-retrospective"</action>
<action>Verify current status is "optional" (expected previous state)</action>
<action>Update development_status["epic-{{completed_number}}-retrospective"] = "completed"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == true">
<check if="update successful">
<output>✅ Retrospective marked as completed in sprint-status.yaml
Retrospective key: {{result_retro_key}}
Status: {{result_old_status}} → {{result_new_status}}
Retrospective key: epic-{{completed_number}}-retrospective
Status: optional → completed
</output>
</check>
<check if="{{result_success}} == false">
<output>⚠️ Could not update retrospective status: {{result_error}}
<check if="retrospective key not found">
<output>⚠️ Could not update retrospective status: epic-{{completed_number}}-retrospective not found
Retrospective document was saved, but sprint-status.yaml may need manual update.
</output>
</check>
</step>
<step n="10" goal="Final summary">
<action>Confirm all action items have been captured</action>
<action>Remind user to schedule prep sprint if needed</action>
<output>**✅ Retrospective Complete, {user_name}!**
@@ -431,7 +446,7 @@ Retrospective document was saved, but sprint-status.yaml may need manual update.
**Epic Review:**
- Epic {{completed_number}}: {{epic_title}} reviewed
- Retrospective Status: {{result_new_status}}
- Retrospective Status: completed
- Retrospective saved: {output_folder}/retrospectives/epic-{{completed_number}}-retro-{{date}}.md
- Action Items: {{action_count}}
- Preparation Tasks: {{prep_task_count}}

View File

@@ -14,7 +14,7 @@
<workflow>
<step n="1" goal="Locate story and verify review status">
<step n="1" goal="Find story ready for review" tag="sprint-status">
<check if="{{story_path}} is provided">
<action>Use {{story_path}} directly</action>
<action>Read COMPLETE file and parse sections</action>
@@ -22,15 +22,21 @@
<goto>verify_status</goto>
</check>
<action>Query sprint-status for review stories:</action>
<critical>MUST read COMPLETE sprint-status.yaml file from start to end to preserve order</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL lines from beginning to end - do not skip any content</action>
<action>Parse the development_status section completely</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: list_stories</param>
<param>filter_status: review</param>
<param>limit: 10</param>
</invoke-workflow>
<action>Find ALL stories (reading in order from top to bottom) where:
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
- Status value equals "review"
</action>
<check if="{{result_count}} == 0">
<action>Collect up to 10 review story keys in order (limit for display purposes)</action>
<action>Count total review stories found</action>
<check if="no review stories found">
<output>📋 No stories in review status found
**Options:**
@@ -42,14 +48,14 @@
<action>Display available review stories:
**Stories Ready for Review ({{result_count}} found):**
**Stories Ready for Review ({{review_count}} found):**
{{result_story_list}}
{{list_of_review_story_keys}}
</action>
<ask if="{{non_interactive}} == false">Select story to review (enter story key or number):</ask>
<action if="{{non_interactive}} == true">Auto-select first story from result_stories</action>
<action if="{{non_interactive}} == true">Auto-select first story from the list</action>
<action>Resolve selected story_key and find file path in {{story_dir}}</action>
<action>Resolve {{story_path}} and read the COMPLETE file</action>
@@ -118,26 +124,25 @@
<action>Save the story file.</action>
</step>
<step n="7.5" goal="Update sprint-status based on review outcome">
<step n="7.5" goal="Update sprint status based on review outcome" tag="sprint-status">
<action>Determine target status based on review outcome:
- If {{outcome}} == "Approve" → target_status = "done"
- If {{outcome}} == "Changes Requested" → target_status = "in-progress"
- If {{outcome}} == "Blocked" → target_status = "review" (stay in review)
</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_story_status</param>
<param>story_key: {{story_key}}</param>
<param>new_status: {{target_status}}</param>
<param>validate: true</param>
</invoke-workflow>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read all development_status entries to find {{story_key}}</action>
<action>Verify current status is "review" (expected previous state)</action>
<action>Update development_status[{{story_key}}] = {{target_status}}</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == true">
<output>✅ Sprint status updated: {{result_old_status}} → {{result_new_status}}</output>
<check if="update successful">
<output>✅ Sprint status updated: review → {{target_status}}</output>
</check>
<check if="{{result_success}} == false">
<output>⚠️ Could not update sprint-status: {{result_error}}
<check if="story key not found">
<output>⚠️ Could not update sprint-status: {{story_key}} not found
Review was saved to story file, but sprint-status.yaml may be out of sync.
</output>
@@ -170,7 +175,7 @@ Review was saved to story file, but sprint-status.yaml may be out of sync.
- Story: {{epic_num}}.{{story_num}}
- Story Key: {{story_key}}
- Review Outcome: {{outcome}}
- Sprint Status: {{result_new_status}}
- Sprint Status: {{target_status}}
- Action Items: {{action_item_count}}
**Next Steps:**

View File

@@ -11,12 +11,52 @@
<critical>DOCUMENT OUTPUT: Technical XML context file. Concise, structured, project-relative paths only. User skill level ({user_skill_level}) affects conversation style ONLY, not context content.</critical>
<workflow>
<step n="1" goal="Locate story and initialize output">
<action>If {{story_path}} provided and valid → use it; else auto-discover from {{story_dir}}.</action>
<action>Auto-discovery: read {{story_dir}} (dev_story_location). If invalid/missing or contains no .md files, ASK for a story file path or directory to scan.</action>
<action>If a directory is provided, list markdown files named "story-*.md" recursively; sort by last modified time; display top {{story_selection_limit}} with index, filename, path, modified time.</action>
<ask optional="true" if="{{non_interactive}} == false">"Select a story (1-{{story_selection_limit}}) or enter a path:"</ask>
<action>If {{non_interactive}} == true: choose the most recently modified story automatically. If none found, HALT with a clear message to provide 'story_path' or 'story_dir'. Else resolve selection into {{story_path}} and READ COMPLETE file.</action>
<step n="1" goal="Find drafted story from sprint status" tag="sprint-status">
<action>If {{story_path}} provided and valid → use it; extract story_key from filename/metadata; GOTO initialize_context</action>
<critical>MUST read COMPLETE sprint-status.yaml file from start to end to preserve order</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL lines from beginning to end - do not skip any content</action>
<action>Parse the development_status section completely</action>
<action>Find ALL stories (reading in order from top to bottom) where:
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
- Status value equals "drafted"
</action>
<action>Collect up to 10 drafted story keys in order (limit for display purposes)</action>
<action>Count total drafted stories found</action>
<check if="no drafted stories found">
<output>📋 No drafted stories found in sprint-status.yaml
All stories are either still in backlog or already marked ready/in-progress/done.
**Options:**
1. Run `create-story` to draft more stories
2. Run `sprint-planning` to refresh story tracking
</output>
<action>HALT</action>
</check>
<action>Display available drafted stories:
**Drafted Stories Available ({{drafted_count}} found):**
{{list_of_drafted_story_keys}}
</action>
<ask if="{{non_interactive}} == false">Select the drafted story to generate context for (enter story key or number):</ask>
<action if="{{non_interactive}} == true">Auto-select first story from the list</action>
<action>Resolve selected story_key from user input or auto-selection</action>
<action>Find matching story file in {{story_dir}} using story_key pattern</action>
<action>Resolve {{story_path}} and READ COMPLETE file</action>
<anchor id="initialize_context" />
<action>Extract {{epic_id}}, {{story_id}}, {{story_title}}, {{story_status}} from filename/content; parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes.</action>
<action>Extract user story fields (asA, iWant, soThat).</action>
<action>Store project root path for relative path conversion: extract from {project-root} variable.</action>
@@ -91,16 +131,36 @@
<invoke-task>Validate against checklist at {installed_path}/checklist.md using bmad/core/tasks/validate-workflow.xml</invoke-task>
</step>
<step n="7" goal="Update story status and context reference">
<action>Open {{story_path}}; if Status == 'Draft' then set to 'ContextReadyDraft'; otherwise leave unchanged.</action>
<step n="7" goal="Update story file and mark ready for dev" tag="sprint-status">
<action>Open {{story_path}}</action>
<action>Find the "Status:" line (usually at the top)</action>
<action>Update story file: Change Status to "Ready"</action>
<action>Under 'Dev Agent Record' → 'Context Reference' (create if missing), add or update a list item for {default_output_file}.</action>
<action>Save the story file.</action>
<!-- Update sprint status to mark ready-for-dev -->
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "drafted" (expected previous state)</action>
<action>Update development_status[{{story_key}}] = "ready-for-dev"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="story key not found in file">
<output>⚠️ Story file updated, but could not update sprint-status: {{story_key}} not found
You may need to run sprint-planning to refresh tracking.
</output>
</check>
<output>**✅ Story Context Generated Successfully, {user_name}!**
**Story Details:**
- Story ID: {{story_id}}
- Story Key: {{story_key}}
- Title: {{story_title}}
- Context File: {{default_output_file}}
- Story Status: Ready (was Draft)
- Sprint Status: ready-for-dev (was drafted)
**Next Steps:**
1. Load DEV agent (bmad/bmm/agents/dev.md)

View File

@@ -10,19 +10,26 @@
<critical>This workflow is run by DEV agent AFTER user confirms a story is approved (Definition of Done is complete)</critical>
<critical>Workflow: Update story file status to Done</critical>
<step n="1" goal="Find reviewed story and mark done">
<step n="1" goal="Find reviewed story to mark done" tag="sprint-status">
<action>If {{story_path}} is provided → use it directly; extract story_key from filename or metadata; GOTO mark_done</action>
<action>Otherwise query sprint-status for reviewed stories:</action>
<critical>MUST read COMPLETE sprint-status.yaml file from start to end to preserve order</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL lines from beginning to end - do not skip any content</action>
<action>Parse the development_status section completely</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: list_stories</param>
<param>filter_status: review</param>
<param>limit: 10</param>
</invoke-workflow>
<action>Find ALL stories (reading in order from top to bottom) where:
<check if="{{result_count}} == 0">
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
- Status value equals "review"
</action>
<action>Collect up to 10 review story keys in order (limit for display purposes)</action>
<action>Count total review stories found</action>
<check if="no review stories found">
<output>📋 No stories in review status found
All stories are either still in development or already done.
@@ -38,9 +45,9 @@ All stories are either still in development or already done.
<action>Display available reviewed stories:
**Stories Ready to Mark Done ({{result_count}} found):**
**Stories Ready to Mark Done ({{review_count}} found):**
{{result_story_list}}
{{list_of_review_story_keys}}
</action>
@@ -69,16 +76,17 @@ All stories are either still in development or already done.
</action>
<action>Save the story file</action>
</step>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_story_status</param>
<param>story_key: {{story_key}}</param>
<param>new_status: done</param>
<param>validate: true</param>
</invoke-workflow>
<step n="2" goal="Update sprint status to done" tag="sprint-status">
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "review" (expected previous state)</action>
<action>Update development_status[{{story_key}}] = "done"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == false">
<output>⚠️ Story file updated, but could not update sprint-status: {{result_error}}
<check if="story key not found in file">
<output>⚠️ Story file updated, but could not update sprint-status: {{story_key}} not found
Story is marked Done in file, but sprint-status.yaml may be out of sync.
</output>
@@ -86,12 +94,12 @@ Story is marked Done in file, but sprint-status.yaml may be out of sync.
</step>
<step n="2" goal="Confirm completion to user">
<step n="3" goal="Confirm completion to user">
<output>**Story Approved and Marked Done, {user_name}!**
✅ Story file updated: `{{story_file}}` → Status: Done
✅ Sprint status updated: {{result_old_status}} → {{result_new_status}}
✅ Sprint status updated: review → done
**Completed Story:**

View File

@@ -10,19 +10,26 @@
<critical>This workflow is run by SM agent AFTER user reviews a drafted story and confirms it's ready for development</critical>
<critical>Simple workflow: Update story file status to Ready</critical>
<step n="1" goal="Find drafted story and mark as ready">
<step n="1" goal="Find drafted story to mark ready" tag="sprint-status">
<action>If {{story_path}} is provided → use it directly; extract story_key from filename or metadata; GOTO mark_ready</action>
<action>Otherwise query sprint-status for drafted stories:</action>
<critical>MUST read COMPLETE sprint-status.yaml file from start to end to preserve order</critical>
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Read ALL lines from beginning to end - do not skip any content</action>
<action>Parse the development_status section completely</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: list_stories</param>
<param>filter_status: drafted</param>
<param>limit: 10</param>
</invoke-workflow>
<action>Find ALL stories (reading in order from top to bottom) where:
<check if="{{result_count}} == 0">
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
- Status value equals "drafted"
</action>
<action>Collect up to 10 drafted story keys in order (limit for display purposes)</action>
<action>Count total drafted stories found</action>
<check if="no drafted stories found">
<output>📋 No drafted stories found in sprint-status.yaml
All stories are either still in backlog or already marked ready/in-progress/done.
@@ -37,14 +44,14 @@ All stories are either still in backlog or already marked ready/in-progress/done
<action>Display available drafted stories:
**Drafted Stories Available ({{result_count}} found):**
**Drafted Stories Available ({{drafted_count}} found):**
{{result_story_list}}
{{list_of_drafted_story_keys}}
</action>
<ask if="{{non_interactive}} == false">Select the drafted story to mark as Ready (enter story key or number):</ask>
<action if="{{non_interactive}} == true">Auto-select first story from result_stories</action>
<action if="{{non_interactive}} == true">Auto-select first story from the list</action>
<action>Resolve selected story_key from user input or auto-selection</action>
<action>Find matching story file in {{story_dir}} using story_key pattern</action>
@@ -57,16 +64,17 @@ All stories are either still in backlog or already marked ready/in-progress/done
<action>Find the "Status:" line (usually at the top)</action>
<action>Update story file: Change Status to "Ready"</action>
<action>Save the story file</action>
</step>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/helpers/sprint-status">
<param>action: update_story_status</param>
<param>story_key: {{story_key}}</param>
<param>new_status: ready-for-dev</param>
<param>validate: true</param>
</invoke-workflow>
<step n="2" goal="Update sprint status to ready-for-dev" tag="sprint-status">
<action>Load the FULL file: {{output_folder}}/sprint-status.yaml</action>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "drafted" (expected previous state)</action>
<action>Update development_status[{{story_key}}] = "ready-for-dev"</action>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<check if="{{result_success}} == false">
<output>⚠️ Story file updated, but could not update sprint-status: {{result_error}}
<check if="story key not found in file">
<output>⚠️ Story file updated, but could not update sprint-status: {{story_key}} not found
You may need to run sprint-planning to refresh tracking.
</output>
@@ -74,12 +82,12 @@ You may need to run sprint-planning to refresh tracking.
</step>
<step n="2" goal="Confirm completion to user">
<step n="3" goal="Confirm completion to user">
<output>**Story Marked Ready for Development, {user_name}!**
✅ Story file updated: `{{story_file}}` → Status: Ready
✅ Sprint status updated: {{result_old_status}} → {{result_new_status}}
✅ Sprint status updated: drafted → ready-for-dev
**Story Details:**