From ddaefa32843c5b71a14aa712c1fd02a05063dc36 Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Tue, 21 Oct 2025 23:03:46 -0500 Subject: [PATCH] use sprint plan for al workflow level 4 implementations --- .../create-story/instructions.md | 67 ++++++++++++--- .../dev-story/instructions.md | 86 +++++++++++++++++-- .../epic-tech-context/instructions.md | 36 ++++++++ .../retrospective/instructions.md | 70 ++++++++++++++- .../review-story/instructions.md | 81 +++++++++++++++-- .../story-done/instructions.md | 84 ++++++++++++++---- .../story-ready/instructions.md | 70 ++++++++++++--- 7 files changed, 437 insertions(+), 57 deletions(-) diff --git a/src/modules/bmm/workflows/4-implementation/create-story/instructions.md b/src/modules/bmm/workflows/4-implementation/create-story/instructions.md index 8220f879..34a2e0b2 100644 --- a/src/modules/bmm/workflows/4-implementation/create-story/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/create-story/instructions.md @@ -28,17 +28,43 @@ READ COMPLETE FILES for all items found in the prioritized set. Store content and paths for citation. - - List existing story markdown files in {{story_dir}} matching pattern: "story-..md" - If none found → Set {{epic_num}}=1 and {{story_num}}=1 - If files found → Parse epic_num and story_num; pick the highest pair - Open the latest story (if exists) and read Status - If Status != Done/Approved and {{non_interactive}} == true → TARGET the latest story for update (do not create a new one) - If Status == Done/Approved → Candidate next story is {{epic_num}}.{{story_num+1}} - If creating a new story candidate: VERIFY planning in {{epics_file}}. Confirm that epic {{epic_num}} explicitly enumerates a next story matching {{story_num+1}} (or an equivalent next planned story entry). If epics.md is missing or does not enumerate another story for this epic, HALT with message: - "No planned next story found in epics.md for epic {{epic_num}}. Please load either PM (Product Manager) agent at {project-root}/bmad/bmm/agents/pm.md or SM (Scrum Master) agent at {project-root}/bmad/bmm/agents/sm.md and run `*correct-course` to add/modify epic stories, then rerun create-story." - If verification passes → Set {{story_num}} = {{story_num}} + 1 - If starting a new epic and {{non_interactive}} == false, ASK for {{epic_num}} and reset {{story_num}} to 1. In {{non_interactive}} == true, do NOT auto-advance epic; stay within current epic and continue incrementing story_num. + + Query sprint-status for next backlog story: + + + action: get_next_story + filter_status: backlog + + + + 📋 No backlog stories found in sprint-status.yaml + +All stories are either already drafted or completed. + +**Options:** +1. Run sprint-planning to refresh story tracking +2. Load PM agent and run correct-course to add more stories +3. Check if current sprint is complete + + HALT + + + 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" + + Set {{story_id}} = "{{epic_num}}.{{story_num}}" + + Verify story is enumerated in {{epics_file}}. If not found, HALT with message: + "Story {{result_story_key}} not found in epics.md. Please load PM agent and run correct-course to sync epics, then rerun create-story." + + Check if story file already exists at expected path in {{story_dir}} + + ℹ️ Story file already exists: {{story_file_path}} + +Will update existing story file rather than creating new one. + + Set update_mode = true + @@ -74,14 +100,31 @@ Validate against checklist at {installed_path}/checklist.md using bmad/core/tasks/validate-workflow.xml Save document unconditionally (non-interactive default). In interactive mode, allow user confirmation. + + + action: update_story_status + story_key: {{result_story_key}} + new_status: drafted + validate: true + + + + ⚠️ Could not update story status: {{result_error}} + +Story file was created successfully, but sprint-status.yaml was not updated. +You may need to run sprint-planning to refresh tracking. + + + If {{auto_run_context}} == true → Pass {{story_path}} = {default_output_file} Report created/updated story path **✅ Story Created Successfully, {user_name}!** **Story Details:** - Story ID: {{story_id}} +- Story Key: {{result_story_key}} - File: {{story_file}} -- Status: Draft (needs review) +- Status: {{result_new_status}} (was {{result_old_status}}) **Next Steps:** 1. Review the drafted story in {{story_file}} diff --git a/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md b/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md index dfeb1258..a1780648 100644 --- a/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/dev-story/instructions.md @@ -15,13 +15,38 @@ - - If {{story_path}} explicitly provided → use it - Otherwise list story-*.md files from {{story_dir}}, sort by modified time - Select story or enter path - Auto-select most recent + + + Use {{story_path}} directly + Read COMPLETE story file + Extract story_key from filename or metadata + task_check + + + Query sprint-status for ready stories: + + + action: get_next_story + filter_status: ready-for-dev + + + + 📋 No ready-for-dev stories found in sprint-status.yaml + +**Options:** +1. Run `story-ready` to mark drafted stories as ready +2. Run `create-story` if no stories are drafted yet +3. Check sprint-status.yaml to see current story states + + HALT + + + Use {{result_story_key}} to find story file in {{story_dir}} + Read COMPLETE story file from discovered path + Store {{result_story_key}} for later status updates + + - Read COMPLETE story file from {{story_path}} Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status Identify first incomplete task (unchecked [ ]) in Tasks/Subtasks @@ -30,6 +55,34 @@ If task requirements ambiguous → ASK user to clarify or HALT + + + action: get_story_status + story_key: {{result_story_key}} + + + + + action: update_story_status + story_key: {{result_story_key}} + new_status: in-progress + validate: true + + + + 🚀 Starting work on story {{result_story_key}} +Status updated: {{result_old_status}} → {{result_new_status}} + + + + + + ⏯️ Resuming work on story {{result_story_key}} +Story is already marked in-progress + + + + Review acceptance criteria and dev notes for the selected task Plan implementation steps and edge cases; write down a brief plan in Dev Agent Record → Debug Log @@ -76,6 +129,21 @@ Confirm File List includes every changed file Execute story definition-of-done checklist, if the story includes one Update the story Status to: Ready for Review + + + action: update_story_status + story_key: {{result_story_key}} + new_status: review + validate: true + + + + ⚠️ Story file updated, but sprint-status update failed: {{result_error}} + +Story is marked Ready for Review in file, but sprint-status.yaml may be out of sync. + + + If any task is incomplete → Return to step 1 to complete remaining work (Do NOT finish with partial progress) If regression failures exist → STOP and resolve before completing If File List is incomplete → Update it before completing @@ -89,14 +157,16 @@ **Story Details:** - Story ID: {{current_story_id}} +- Story Key: {{result_story_key}} - Title: {{current_story_title}} - File: {{story_path}} -- Status: Ready for Review +- Status: {{result_new_status}} (was {{result_old_status}}) **Next Steps:** 1. Review the implemented story and test the changes 2. Verify all acceptance criteria are met -3. When satisfied, mark story complete and continue with next story +3. Run `review-story` workflow for senior developer review +4. When review passes, run `story-done` to mark complete diff --git a/src/modules/bmm/workflows/4-implementation/epic-tech-context/instructions.md b/src/modules/bmm/workflows/4-implementation/epic-tech-context/instructions.md index f7d94101..901dd7bd 100644 --- a/src/modules/bmm/workflows/4-implementation/epic-tech-context/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/epic-tech-context/instructions.md @@ -16,6 +16,29 @@ Resolve output file path using workflow variables and initialize by writing the template. + + + action: get_epic_status + epic_id: {{epic_id}} + + + + ⚠️ Epic {{epic_id}} not found in sprint-status.yaml + +This epic hasn't been registered in the sprint plan yet. +Run sprint-planning workflow to initialize epic tracking. + + HALT + + + + ℹ️ Epic {{epic_id}} already marked as contexted + +Continuing to regenerate tech spec... + + + + Read COMPLETE PRD and Architecture files. @@ -68,18 +91,31 @@ Validate against checklist at {installed_path}/checklist.md using bmad/core/tasks/validate-workflow.xml + + + action: update_epic_status + epic_id: {{epic_id}} + new_status: contexted + + + + ⚠️ Could not update epic status: {{result_error}} + + **✅ Tech Spec Generated Successfully, {user_name}!** **Epic Details:** - Epic ID: {{epic_id}} - Epic Title: {{epic_title}} - Tech Spec File: {{default_output_file}} +- Epic Status: {{result_new_status}} (was {{result_old_status}}) **Note:** This is a JIT (Just-In-Time) workflow - run again for other epics as needed. **Next Steps:** 1. If more epics need tech specs: Run tech-spec again with different epic_id 2. If all tech specs complete: Proceed to Phase 4 implementation + - Load SM agent and run `create-story` to begin implementing stories diff --git a/src/modules/bmm/workflows/4-implementation/retrospective/instructions.md b/src/modules/bmm/workflows/4-implementation/retrospective/instructions.md index b35680f5..b14c4cf0 100644 --- a/src/modules/bmm/workflows/4-implementation/retrospective/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/retrospective/instructions.md @@ -26,6 +26,48 @@ FACILITATION NOTES: If auto-detection succeeds, confirm with user: "It looks like Epic {{epic_number}} was just completed - is that correct?" If auto-detection fails or user indicates different epic, ask them to share which epic they just completed +Verify epic completion status in sprint-status: + + + action: check_epic_complete + epic_id: {{epic_number}} + + + + ⚠️ 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}} + +**Pending Stories:** +{{result_pending_stories}} + +**Options:** + +1. Complete remaining stories before running retrospective +2. Continue with partial retrospective (not recommended) +3. Run sprint-planning to refresh story tracking + + +Epic is incomplete. Continue anyway? (yes/no) + + + HALT + + +Set {{partial_retrospective}} = true + + + + ✅ Epic {{epic_number}} is complete - all {{result_done_stories}} stories done! + +Ready to proceed with retrospective. + + + Load the completed epic from: {output_folder}/prd/epic-{{epic_number}}.md Extract epic details: @@ -361,6 +403,27 @@ See you at sprint planning once prep work is done!" ``` Save retrospective summary to: {output_folder}/retrospectives/epic-{{completed_number}}-retro-{{date}}.md + + + action: complete_retrospective + epic_id: {{completed_number}} + + + + ✅ Retrospective marked as completed in sprint-status.yaml + +Retrospective key: {{result_retro_key}} +Status: {{result_old_status}} → {{result_new_status}} + + + + + ⚠️ Could not update retrospective status: {{result_error}} + +Retrospective document was saved, but sprint-status.yaml may need manual update. + + + Confirm all action items have been captured Remind user to schedule prep sprint if needed **✅ Retrospective Complete, {user_name}!** @@ -368,6 +431,7 @@ See you at sprint planning once prep work is done!" **Epic Review:** - Epic {{completed_number}}: {{epic_title}} reviewed +- Retrospective Status: {{result_new_status}} - Retrospective saved: {output_folder}/retrospectives/epic-{{completed_number}}-retro-{{date}}.md - Action Items: {{action_count}} - Preparation Tasks: {{prep_task_count}} @@ -379,8 +443,10 @@ See you at sprint planning once prep work is done!" 2. Execute preparation sprint (Est: {{prep_days}} days) 3. Complete critical path items before Epic {{next_number}} 4. Begin Epic {{next_number}} planning when preparation complete - - + - Load PM agent and run `epic-tech-context` for next epic + - Or continue with existing contexted epics + + diff --git a/src/modules/bmm/workflows/4-implementation/review-story/instructions.md b/src/modules/bmm/workflows/4-implementation/review-story/instructions.md index 55a97cd5..cc71a128 100644 --- a/src/modules/bmm/workflows/4-implementation/review-story/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/review-story/instructions.md @@ -15,11 +15,49 @@ - If {{story_path}} was provided → use it. Else auto-discover from {{story_dir}} by listing files matching pattern: "story-*.md" (recursive), sort by last modified (newest first), present top {{story_selection_limit}}. - Select a story (1-{{story_selection_limit}}) or enter a path: - Resolve {{story_path}} and read the COMPLETE file. - Extract {{epic_num}} and {{story_num}} from filename (e.g., story-2.3.*.md) and story metadata if available. - Parse sections: Status, Story, Acceptance Criteria, Tasks/Subtasks (and completion states), Dev Notes, Dev Agent Record (Context Reference, Completion Notes, File List), Change Log. + + Use {{story_path}} directly + Read COMPLETE file and parse sections + Extract story_key from filename or story metadata + verify_status + + + Query sprint-status for review stories: + + + action: list_stories + filter_status: review + limit: 10 + + + + 📋 No stories in review status found + +**Options:** +1. Run `dev-story` to implement and mark stories ready for review +2. Check sprint-status.yaml for current story states + + HALT + + + Display available review stories: + +**Stories Ready for Review ({{result_count}} found):** + +{{result_story_list}} + + + + Select story to review (enter story key or number): + Auto-select first story from result_stories + + Resolve selected story_key and find file path in {{story_dir}} + Resolve {{story_path}} and read the COMPLETE file + + + + Extract {{epic_num}} and {{story_num}} from filename (e.g., story-2.3.*.md) and story metadata if available + Parse sections: Status, Story, Acceptance Criteria, Tasks/Subtasks (and completion states), Dev Notes, Dev Agent Record (Context Reference, Completion Notes, File List), Change Log HALT with message: "Story status must be 'Ready for Review' to proceed" (accept 'Review' as equivalent). HALT. @@ -80,6 +118,32 @@ Save the story file. + + 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: update_story_status + story_key: {{story_key}} + new_status: {{target_status}} + validate: true + + + + ✅ Sprint status updated: {{result_old_status}} → {{result_new_status}} + + + + ⚠️ Could not update sprint-status: {{result_error}} + +Review was saved to story file, but sprint-status.yaml may be out of sync. + + + + Normalize Action Items into a structured list: description, severity (High/Med/Low), type (Bug/TechDebt/Enhancement), suggested owner (if known), related AC/file references. @@ -104,13 +168,16 @@ **Story Details:** - Story: {{epic_num}}.{{story_num}} +- Story Key: {{story_key}} - Review Outcome: {{outcome}} +- Sprint Status: {{result_new_status}} - Action Items: {{action_item_count}} **Next Steps:** 1. Review the Senior Developer Review notes appended to story -2. Address any action items or changes requested -3. When ready, continue with implementation or mark story complete +2. If approved: Story is marked done, continue with next story +3. If changes requested: Address action items and re-run `dev-story` +4. If blocked: Resolve blockers before proceeding diff --git a/src/modules/bmm/workflows/4-implementation/story-done/instructions.md b/src/modules/bmm/workflows/4-implementation/story-done/instructions.md index 48ad46ec..d63276e7 100644 --- a/src/modules/bmm/workflows/4-implementation/story-done/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/story-done/instructions.md @@ -10,25 +10,55 @@ This workflow is run by DEV agent AFTER user confirms a story is approved (Definition of Done is complete) Workflow: Update story file status to Done - + -If {{story_path}} explicitly provided → use it -Otherwise list story-\*.md files from {{story_dir}}, sort by modified time -Select the story to mark as Done, or enter path: +If {{story_path}} is provided → use it directly; extract story_key from filename or metadata; GOTO mark_done -Read the story file: {{story_path}} -Extract story ID and title from the file +Otherwise query sprint-status for reviewed stories: + + + action: list_stories + filter_status: review + limit: 10 + + + + 📋 No stories in review status found + +All stories are either still in development or already done. + +**Options:** + +1. Run `dev-story` to implement stories +2. Run `review-story` if stories need review first +3. Check sprint-status.yaml for current story states + + HALT + + +Display available reviewed stories: + +**Stories Ready to Mark Done ({{result_count}} found):** + +{{result_story_list}} + + + +Select the story to mark as Done (enter story key or number): + +Resolve selected story_key from user input +Find matching story file in {{story_dir}} using story_key pattern + + + +Read the story file from resolved path +Extract story_id and story_title from the file Find the "Status:" line (usually at the top) +Update story file: Change Status to "Done" -Update story file: - -- Change: `Status: Ready for Review` or `Status: In Review` or similar -- To: `Status: Done` - -Add completion notes if Dev Agent Record section exists: - -Find "## Dev Agent Record" section and add: +Add completion notes to Dev Agent Record section: +Find "## Dev Agent Record" section and add: ``` ### Completion Notes @@ -36,8 +66,24 @@ Find "## Dev Agent Record" section and add: **Definition of Done:** All acceptance criteria met, code reviewed, tests passing ``` + + Save the story file + + action: update_story_status + story_key: {{story_key}} + new_status: done + validate: true + + + + ⚠️ Story file updated, but could not update sprint-status: {{result_error}} + +Story is marked Done in file, but sprint-status.yaml may be out of sync. + + + @@ -45,10 +91,12 @@ Find "## Dev Agent Record" section and add: **Story Approved and Marked Done, {user_name}!** ✅ Story file updated: `{{story_file}}` → Status: Done +✅ Sprint status updated: {{result_old_status}} → {{result_new_status}} **Completed Story:** - **ID:** {{story_id}} +- **Key:** {{story_key}} - **Title:** {{story_title}} - **File:** `{{story_file}}` - **Completed:** {{date}} @@ -56,8 +104,12 @@ Find "## Dev Agent Record" section and add: **Next Steps:** 1. Continue with next story in your backlog -2. Or run `retrospective` workflow if all stories are complete - + - Run `create-story` for next backlog story + - Or run `dev-story` if ready stories exist +2. Check epic completion status + - Run `retrospective` workflow to check if epic is complete + - Epic retrospective will verify all stories are done + diff --git a/src/modules/bmm/workflows/4-implementation/story-ready/instructions.md b/src/modules/bmm/workflows/4-implementation/story-ready/instructions.md index 934810d2..c897aad7 100644 --- a/src/modules/bmm/workflows/4-implementation/story-ready/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/story-ready/instructions.md @@ -10,24 +10,68 @@ This workflow is run by SM agent AFTER user reviews a drafted story and confirms it's ready for development Simple workflow: Update story file status to Ready - + -If {{story_path}} explicitly provided → use it -Otherwise list story-\*.md files from {{story_dir}}, sort by modified time -Select the drafted story to mark as Ready, or enter path: +If {{story_path}} is provided → use it directly; extract story_key from filename or metadata; GOTO mark_ready -Read the story file: {{story_path}} -Extract story ID and title from the file +Otherwise query sprint-status for drafted stories: + + + action: list_stories + filter_status: drafted + limit: 10 + + + + 📋 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 + + HALT + + +Display available drafted stories: + +**Drafted Stories Available ({{result_count}} found):** + +{{result_story_list}} + + + +Select the drafted story to mark as Ready (enter story key or number): +Auto-select first story from result_stories + +Resolve selected story_key from user input or auto-selection +Find matching story file in {{story_dir}} using story_key pattern + + + +Read the story file from resolved path +Extract story_id and story_title from the file Find the "Status:" line (usually at the top) - -Update story file: - -- Change: `Status: Draft` or similar -- To: `Status: Ready` - +Update story file: Change Status to "Ready" Save the story file + + action: update_story_status + story_key: {{story_key}} + new_status: ready-for-dev + validate: true + + + + ⚠️ Story file updated, but could not update sprint-status: {{result_error}} + +You may need to run sprint-planning to refresh tracking. + + + @@ -35,10 +79,12 @@ **Story Marked Ready for Development, {user_name}!** ✅ Story file updated: `{{story_file}}` → Status: Ready +✅ Sprint status updated: {{result_old_status}} → {{result_new_status}} **Story Details:** - **ID:** {{story_id}} +- **Key:** {{story_key}} - **Title:** {{story_title}} - **File:** `{{story_file}}` - **Status:** Ready for development