all phase 4 workflows use status check workflow update

This commit is contained in:
Brian Madison
2025-10-17 20:33:38 -05:00
parent e92f138f3d
commit af8e296e6f
17 changed files with 436 additions and 194 deletions

View File

@@ -2,10 +2,22 @@
<critical>The workflow execution engine is governed by: {project-root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {project-root}/bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>DOCUMENT OUTPUT: Updated epics, stories, or PRD sections. Clear, actionable changes. User skill level ({user_skill_level}) affects conversation style ONLY, not document updates.</critical>
<workflow>
<step n="0" goal="Check project status" optional="true">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: init-check</param>
</invoke-workflow>
<output>Running correct-course workflow for sprint change management.
{{#if status_exists}}Status tracking enabled.{{else}}Note: No status file - running standalone.{{/if}}</output>
</step>
<step n="1" goal="Initialize Change Navigation">
<action>Confirm change trigger and gather user description of the issue</action>
<action>Ask: "What specific issue or change has been identified that requires navigation?"</action>

View File

@@ -8,6 +8,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
installed_path: "{project-root}/bmad/bmm/workflows/4-implementation/correct-course"

View File

@@ -3,10 +3,13 @@
````xml
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>This workflow creates or updates the next user story from epics/PRD and architecture context, saving to the configured stories directory and optionally invoking Story Context.</critical>
<critical>Default execution mode: #yolo (minimal prompts). Only elicit if absolutely required and {{non_interactive}} == false.</critical>
<critical>DOCUMENT OUTPUT: Concise, technical, actionable story specifications. Use tables/lists for acceptance criteria and tasks. User skill level ({user_skill_level}) affects conversation style ONLY, not document content.</critical>
<workflow>
<step n="1" goal="Load config and initialize">
@@ -28,46 +31,26 @@
<action>READ COMPLETE FILES for all items found in the prioritized set. Store content and paths for citation.</action>
</step>
<step n="2.5" goal="Check status file TODO section for story to draft">
<action>Read {output_folder}/bmm-workflow-status.md (if exists)</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### TODO (Needs Drafting)" section</action>
<step n="2.5" goal="Get story to draft from status file">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: data</param>
<param>data_request: next_story</param>
</invoke-workflow>
<check if="TODO section has a story">
<action>Extract story information from TODO section:</action>
- todo_story_id: The story ID to draft (e.g., "1.1", "auth-feature-1", "login-fix")
- todo_story_title: The story title (for validation)
- todo_story_file: The exact story file path to create
<check if="status_exists == true AND todo_story_id != ''">
<action>Use extracted story information:</action>
- {{todo_story_id}}: The story ID to draft
- {{todo_story_title}}: The story title
- {{todo_story_file}}: The exact story file path to create
<critical>This is the PRIMARY source for determining which story to draft</critical>
<critical>DO NOT search or guess - the status file tells you exactly which story to create</critical>
<critical>This is the PRIMARY source - DO NOT search or guess</critical>
<action>Parse story numbering from todo_story_id:</action>
<check if='todo_story_id matches "N.M" format (e.g., "1.1", "2.3")'>
<action>Set {{epic_num}} = N, {{story_num}} = M</action>
<action>Set {{story_file}} = "story-{{epic_num}}.{{story_num}}.md"</action>
<action>Set {{story_path}} = {story_dir}/{{todo_story_file}}</action>
<action>Skip legacy discovery in Step 3</action>
</check>
<check if='todo_story_id matches "slug-N" format (e.g., "auth-feature-1", "icon-reliability-2")'>
<action>Set {{epic_slug}} = slug part, {{story_num}} = N</action>
<action>Set {{story_file}} = "story-{{epic_slug}}-{{story_num}}.md"</action>
</check>
<check if='todo_story_id matches "slug" format (e.g., "login-fix", "icon-migration")'>
<action>Set {{story_slug}} = full slug</action>
<action>Set {{story_file}} = "story-{{story_slug}}.md"</action>
</check>
<action>Validate that {{story_file}} matches {{todo_story_file}} from status file</action>
<action>If mismatch, HALT with error: "Story file mismatch. Status file says: {{todo_story_file}}, derived: {{story_file}}"</action>
<action>Skip old story discovery logic in Step 3 - we know exactly what to draft</action>
</check>
<check if="TODO section is empty OR status file not found">
<action>Fall back to old story discovery logic in Step 3</action>
<action>Note: This is the legacy behavior for projects not using the new status file system</action>
<check if="status_exists == false OR todo_story_id == ''">
<action>Fall back to legacy story discovery in Step 3</action>
</check>
</step>

View File

@@ -8,6 +8,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components

View File

@@ -3,53 +3,50 @@
````xml
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>Only modify the story file in these areas: Tasks/Subtasks checkboxes, Dev Agent Record (Debug Log, Completion Notes), File List, Change Log, and Status</critical>
<critical>Execute ALL steps in exact order; do NOT skip steps</critical>
<critical>If {{run_until_complete}} == true, run non-interactively: do not pause between steps unless a HALT condition is reached or explicit user approval is required for unapproved dependencies.</critical>
<critical>Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution until the story is COMPLETE (all ACs satisfied and all tasks/subtasks checked) or a HALT condition is triggered.</critical>
<critical>Do NOT schedule a "next session" or request review pauses unless a HALT condition applies. Only Step 6 decides completion.</critical>
<critical>User skill level ({user_skill_level}) affects conversation style ONLY, not code updates.</critical>
<workflow>
<step n="1" goal="Load story from status file IN PROGRESS section">
<action>Read {output_folder}/bmm-workflow-status.md (if exists)</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### IN PROGRESS (Approved for Development)" section</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: data</param>
<param>data_request: next_story</param>
</invoke-workflow>
<check if="IN PROGRESS section has a story">
<action>Extract story information:</action>
- current_story_id: The story ID (e.g., "1.1", "auth-feature-1", "login-fix")
- current_story_title: The story title
- current_story_file: The exact story file path
- current_story_context_file: The context file path (if exists)
<check if="status_exists == true AND in_progress_story != ''">
<action>Use IN PROGRESS story from status:</action>
- {{in_progress_story}}: Current story ID
- Story file path derived from ID format
<critical>DO NOT SEARCH for stories - the status file tells you exactly which story is IN PROGRESS</critical>
<critical>DO NOT SEARCH - status file provides exact story</critical>
<action>Set {{story_path}} = {story_dir}/{current_story_file}</action>
<action>Read the COMPLETE story file from {{story_path}}</action>
<action>Parse sections: Story, Acceptance Criteria, Tasks/Subtasks (including subtasks), Dev Notes, Dev Agent Record, File List, Change Log, Status</action>
<action>Identify the first incomplete task (unchecked [ ]) in Tasks/Subtasks; if subtasks exist, treat all subtasks as part of the selected task scope</action>
<check>If no incomplete tasks found → "All tasks completed - proceed to completion sequence" and <goto step="6">Continue</goto></check>
<check>If story file inaccessible → HALT: "Cannot develop story without access to story file"</check>
<check>If task requirements ambiguous → ASK user to clarify; if unresolved, HALT: "Task requirements must be clear before implementation"</check>
<action>Determine story file path from in_progress_story ID</action>
<action>Set {{story_path}} = {story_dir}/{{derived_story_file}}</action>
</check>
<check if="IN PROGRESS section is empty OR status file not found">
<check if="status_exists == false OR in_progress_story == ''">
<action>Fall back to legacy auto-discovery:</action>
<action>If {{story_path}} was explicitly provided and is valid → use it. Otherwise, attempt auto-discovery.</action>
<action>Auto-discovery: Read {{story_dir}} from config (dev_story_location). If invalid/missing or contains no .md files, ASK user to provide either: (a) a story file path, or (b) a directory to scan.</action>
<action>If a directory is provided, list story markdown files recursively under that directory matching pattern: "story-*.md".</action>
<action>Sort candidates by last modified time (newest first) and take the top {{story_selection_limit}} items.</action>
<ask>Present the list with index, filename, and modified time. Ask: "Select a story (1-{{story_selection_limit}}) or enter a path:"</ask>
<action>Resolve the selected item into {{story_path}}</action>
<action>Read the COMPLETE story file from {{story_path}}</action>
<action>Parse sections: Story, Acceptance Criteria, Tasks/Subtasks (including subtasks), Dev Notes, Dev Agent Record, File List, Change Log, Status</action>
<action>Identify the first incomplete task (unchecked [ ]) in Tasks/Subtasks; if subtasks exist, treat all subtasks as part of the selected task scope</action>
<check>If no incomplete tasks found → "All tasks completed - proceed to completion sequence" and <goto step="6">Continue</goto></check>
<check>If story file inaccessible → HALT: "Cannot develop story without access to story file"</check>
<check>If task requirements ambiguous → ASK user to clarify; if unresolved, HALT: "Task requirements must be clear before implementation"</check>
<action>If {{story_path}} explicitly provided → use it</action>
<action>Otherwise list story-*.md files from {{story_dir}}, sort by modified time</action>
<ask optional="true" if="{{non_interactive}} == false">Select story or enter path</ask>
<action if="{{non_interactive}} == true">Auto-select most recent</action>
</check>
<action>Read COMPLETE story file from {{story_path}}</action>
<action>Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status</action>
<action>Identify first incomplete task (unchecked [ ]) in Tasks/Subtasks</action>
<check>If no incomplete tasks → <goto step="6">Completion sequence</goto></check>
<check>If story file inaccessible → HALT: "Cannot develop story without access to story file"</check>
<check>If task requirements ambiguous → ASK user to clarify or HALT</check>
</step>
<step n="2" goal="Plan and implement task">

View File

@@ -8,6 +8,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components

View File

@@ -2,46 +2,37 @@
<critical>The workflow execution engine is governed by: {project-root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {project-root}/bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>
<critical>DOCUMENT OUTPUT: Retrospective analysis. Concise insights, lessons learned, action items. User skill level ({user_skill_level}) affects conversation style ONLY, not retrospective content.</critical>
FACILITATION NOTES:
- Scrum Master facilitates this retrospective
- Psychological safety is paramount - NO BLAME
- Focus on systems, processes, and learning
- Everyone contributes with specific examples preferred
- Action items must be achievable with clear ownership
- Two-part format: (1) Epic Review + (2) Next Epic Preparation
</critical>
</critical>
<workflow>
<step n="1" goal="Check and load workflow status file">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename: bmm-workflow-status.md)</action>
<step n="1" goal="Check workflow status">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: init-check</param>
</invoke-workflow>
<check if="exists">
<action>Load the status file</action>
<action>Set status_file_found = true</action>
<action>Store status_file_path for later updates</action>
<check if="status_exists == false">
<output>⚠️ {{suggestion}}
Running in standalone mode - no progress tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
This workflow conducts epic retrospective (optional Phase 4 workflow).
Options:
1. Run workflow-status first to create the status file (recommended for progress tracking)
2. Continue in standalone mode (no progress tracking)
3. Exit
What would you like to do?</ask>
<action>If user chooses option 1 → HALT with message: "Please run workflow-status first, then return to retrospective"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
</check>
<action>Store {{status_file_path}} for later updates (if exists)</action>
</step>
<step n="2" goal="Epic Context Discovery">

View File

@@ -8,6 +8,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
installed_path: "{project-root}/bmad/bmm/workflows/4-implementation/retrospective"

View File

@@ -3,39 +3,30 @@
````xml
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>This workflow performs a Senior Developer Review on a story flagged Ready for Review, appends structured review notes, and can update the story status based on the outcome.</critical>
<critical>Default execution mode: #yolo (non-interactive). Only ask if {{non_interactive}} == false. If auto-discovery of the target story fails, HALT with a clear message to provide 'story_path' or 'story_dir'.</critical>
<critical>Only modify the story file in these areas: Status (optional per settings), Dev Agent Record (Completion Notes), File List (if corrections are needed), Change Log, and the appended "Senior Developer Review (AI)" section at the end of the document.</critical>
<critical>Execute ALL steps in exact order; do NOT skip steps</critical>
<critical>DOCUMENT OUTPUT: Technical review reports. Structured findings with severity levels and action items. User skill level ({user_skill_level}) affects conversation style ONLY, not review content.</critical>
<workflow>
<step n="1" goal="Check and load workflow status file">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename: bmm-workflow-status.md)</action>
<step n="1" goal="Check workflow status">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: init-check</param>
</invoke-workflow>
<check if="exists">
<action>Load the status file</action>
<action>Set status_file_found = true</action>
<action>Store status_file_path for later updates</action>
<check if="status_exists == false">
<output>⚠️ {{suggestion}}
Running in standalone mode - no progress tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
This workflow performs Senior Developer Review on a story (optional Phase 4 workflow).
Options:
1. Run workflow-status first to create the status file (recommended for progress tracking)
2. Continue in standalone mode (no progress tracking)
3. Exit
What would you like to do?</ask>
<action>If user chooses option 1 → HALT with message: "Please run workflow-status first, then return to review-story"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
</check>
<action>Store {{status_file_path}} for later updates (if exists)</action>
</step>
<step n="2" goal="Locate story and verify review status">

View File

@@ -9,6 +9,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components

View File

@@ -2,7 +2,8 @@
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<workflow>
@@ -10,32 +11,29 @@
<critical>NO SEARCHING - DEV agent reads status file IN PROGRESS section to know which story was being worked on</critical>
<critical>Workflow: Update story file status, move story IN PROGRESS → DONE, move TODO → IN PROGRESS, move BACKLOG → TODO</critical>
<step n="1" goal="Read status file and identify the IN PROGRESS story">
<step n="1" goal="Get story queue from status file">
<action>Read {output_folder}/bmm-workflow-status.md</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### IN PROGRESS (Approved for Development)" section</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: data</param>
<param>data_request: all</param>
</invoke-workflow>
<action>Extract current story information:</action>
<check if="status_exists == false OR in_progress_story == ''">
<output>❌ No status file or no IN PROGRESS story found.
- current_story_id: The story ID (e.g., "1.1", "auth-feature-1", "login-fix")
- current_story_title: The story title
- current_story_file: The exact story file path
- current_story_points: Story points (if tracked)
This workflow requires an active status file with an IN PROGRESS story.
<action>Read the TODO section to know what's next:</action>
Run `workflow-status` to check your project state.</output>
<action>Exit workflow</action>
</check>
- todo_story_id: Next story to move to IN PROGRESS (if exists)
- todo_story_title: Next story title
- todo_story_file: Next story file path
<action>Use extracted story queue:</action>
<action>Read the BACKLOG section to know what comes after:</action>
- next_backlog_story_id: Story to move to TODO (if exists)
- next_backlog_story_title
- next_backlog_story_file
<critical>DO NOT SEARCH for stories - the status file tells you exactly which story is in each state</critical>
- {{in_progress_story}}: Current story to mark done
- {{todo_story_id}}: Next story (move to IN PROGRESS)
- {{stories_sequence}}: All stories
- {{stories_done}}: Completed stories
- {{status_file_path}}: Status file to update
</step>

View File

@@ -0,0 +1,283 @@
# Story Approved Workflow Instructions (DEV Agent)
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<workflow>
<critical>This workflow is run by DEV agent AFTER user confirms a story is approved (Definition of Done is complete)</critical>
<critical>NO SEARCHING - DEV agent reads status file IN PROGRESS section to know which story was being worked on</critical>
<critical>Workflow: Update story file status, move story IN PROGRESS → DONE, move TODO → IN PROGRESS, move BACKLOG → TODO</critical>
<step n="1" goal="Read status file and identify the IN PROGRESS story">
<action>Read {output_folder}/bmm-workflow-status.md</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### IN PROGRESS (Approved for Development)" section</action>
<action>Extract current story information:</action>
- current_story_id: The story ID (e.g., "1.1", "auth-feature-1", "login-fix")
- current_story_title: The story title
- current_story_file: The exact story file path
- current_story_points: Story points (if tracked)
<action>Read the TODO section to know what's next:</action>
- todo_story_id: Next story to move to IN PROGRESS (if exists)
- todo_story_title: Next story title
- todo_story_file: Next story file path
<action>Read the BACKLOG section to know what comes after:</action>
- next_backlog_story_id: Story to move to TODO (if exists)
- next_backlog_story_title
- next_backlog_story_file
<critical>DO NOT SEARCH for stories - the status file tells you exactly which story is in each state</critical>
</step>
<step n="2" goal="Update the current story file status to Done">
<action>Read the story file: {story_dir}/{current_story_file}</action>
<action>Find the "Status:" line (usually at the top)</action>
<action>Update story file:</action>
- Change: `Status: Ready` or `Status: In Review`
- To: `Status: Done`
<action>Add completion notes if Dev Agent Record section exists:</action>
Find "## Dev Agent Record" section and add:
```
### Completion Notes
**Completed:** {{date}}
**Definition of Done:** All acceptance criteria met, code reviewed, tests passing, deployed
```
<action>Save the story file</action>
</step>
<step n="3" goal="Move story IN PROGRESS → DONE, advance the queue">
<action>Open {output_folder}/bmm-workflow-status.md</action>
<action>Update "#### DONE (Completed Stories)" section:</action>
Add the completed story to the table:
| Story ID | File | Completed Date | Points |
| -------------------- | ---------------------- | -------------- | ------------------------ |
| {{current_story_id}} | {{current_story_file}} | {{date}} | {{current_story_points}} |
... (existing done stories)
**Total completed:** {{done_count + 1}} stories
**Total points completed:** {{done_points + current_story_points}} points
<action>Update "#### IN PROGRESS (Approved for Development)" section:</action>
<check if="todo_story exists">
Move the TODO story to IN PROGRESS:
#### IN PROGRESS (Approved for Development)
- **Story ID:** {{todo_story_id}}
- **Story Title:** {{todo_story_title}}
- **Story File:** `{{todo_story_file}}`
- **Story Status:** Ready (OR Draft if not yet reviewed)
- **Context File:** `{{context_file_path}}` (if exists, otherwise note "Context not yet generated")
- **Action:** DEV should run `dev-story` workflow to implement this story
</check>
<check if="todo_story does NOT exist">
Mark IN PROGRESS as empty:
#### IN PROGRESS (Approved for Development)
(No story currently in progress - all stories complete!)
</check>
<action>Update "#### TODO (Needs Drafting)" section:</action>
<check if="next_backlog_story exists">
Move the first BACKLOG story to TODO:
#### TODO (Needs Drafting)
- **Story ID:** {{next_backlog_story_id}}
- **Story Title:** {{next_backlog_story_title}}
- **Story File:** `{{next_backlog_story_file}}`
- **Status:** Not created OR Draft (needs review)
- **Action:** SM should run `create-story` workflow to draft this story
</check>
<check if="next_backlog_story does NOT exist">
Mark TODO as empty:
#### TODO (Needs Drafting)
(No more stories to draft - all stories are drafted or complete)
</check>
<action>Update "#### BACKLOG (Not Yet Drafted)" section:</action>
Remove the first story from the BACKLOG table (the one we just moved to TODO).
If BACKLOG had 1 story and is now empty:
| Epic | Story | ID | Title | File |
| ----------------------------- | ----- | --- | ----- | ---- |
| (empty - all stories drafted) | | | | |
**Total in backlog:** 0 stories
<action>Update story counts in "#### Epic/Story Summary" section:</action>
- Increment done_count by 1
- Increment done_points by {{current_story_points}}
- Decrement backlog_count by 1 (if story was moved from BACKLOG → TODO)
- Update epic breakdown:
- Increment epic_done_stories for the current story's epic
<check if="all stories complete">
<action>Check "4-Implementation" checkbox in "### Phase Completion Status"</action>
<action>Set progress_percentage = 100%</action>
</check>
</step>
<step n="4" goal="Update Decision Log, Progress, and Next Action">
<action>Add to "## Decision Log" section:</action>
```
- **{{date}}**: Story {{current_story_id}} ({{current_story_title}}) approved and marked done by DEV agent. Moved from IN PROGRESS → DONE. {{#if todo_story}}Story {{todo_story_id}} moved from TODO → IN PROGRESS.{{/if}} {{#if next_backlog_story}}Story {{next_backlog_story_id}} moved from BACKLOG → TODO.{{/if}}
```
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "story-approved (Story {{current_story_id}})"</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "story-approved (Story {{current_story_id}}) - Complete"</action>
<template-output file="{{status_file_path}}">progress_percentage</template-output>
<action>Calculate per-story weight: remaining_40_percent / total_stories / 5</action>
<action>Increment by: {{per_story_weight}} \* 1 (story-approved weight is ~1% per story)</action>
<check if="all stories complete">
<action>Set progress_percentage = 100%</action>
</check>
<action>Update "### Next Action Required" section:</action>
<check if="todo_story exists">
```
**What to do next:** {{#if todo_story_status == 'Draft'}}Review drafted story {{todo_story_id}}, then mark it ready{{else}}Implement story {{todo_story_id}}{{/if}}
**Command to run:** {{#if todo_story_status == 'Draft'}}Load SM agent and run 'story-ready' workflow{{else}}Run 'dev-story' workflow to implement{{/if}}
**Agent to load:** {{#if todo_story_status == 'Draft'}}bmad/bmm/agents/sm.md{{else}}bmad/bmm/agents/dev.md{{/if}}
```
</check>
<check if="todo_story does NOT exist AND backlog not empty">
```
**What to do next:** Draft the next story ({{next_backlog_story_id}})
**Command to run:** Load SM agent and run 'create-story' workflow
**Agent to load:** bmad/bmm/agents/sm.md
```
</check>
<check if="all stories complete">
```
**What to do next:** All stories complete! Run retrospective workflow or close project.
**Command to run:** Load PM agent and run 'retrospective' workflow
**Agent to load:** bmad/bmm/agents/pm.md
```
</check>
<action>Save bmm-workflow-status.md</action>
</step>
<step n="5" goal="Confirm completion to user">
<action>Display summary</action>
**Story Approved and Marked Done, {user_name}!**
✅ Story file updated: `{{current_story_file}}` → Status: Done
✅ Status file updated: Story moved IN PROGRESS → DONE
{{#if todo_story}}✅ Next story moved: TODO → IN PROGRESS ({{todo_story_id}}: {{todo_story_title}}){{/if}}
{{#if next_backlog_story}}✅ Next story moved: BACKLOG → TODO ({{next_backlog_story_id}}: {{next_backlog_story_title}}){{/if}}
**Completed Story:**
- **ID:** {{current_story_id}}
- **Title:** {{current_story_title}}
- **File:** `{{current_story_file}}`
- **Points:** {{current_story_points}}
- **Completed:** {{date}}
**Progress Summary:**
- **Stories Completed:** {{done_count}} / {{total_stories}}
- **Points Completed:** {{done_points}} / {{total_points}}
- **Progress:** {{progress_percentage}}%
{{#if all_stories_complete}}
**🎉 ALL STORIES COMPLETE!**
Congratulations! You have completed all stories for this project.
**Next Steps:**
1. Run `retrospective` workflow with PM agent to review the project
2. Close out the project
3. Celebrate! 🎊
{{/if}}
{{#if todo_story}}
**Next Story (IN PROGRESS):**
- **ID:** {{todo_story_id}}
- **Title:** {{todo_story_title}}
- **File:** `{{todo_story_file}}`
- **Status:** {{todo_story_status}}
**Next Steps:**
{{#if todo_story_status == 'Draft'}}
1. Review the drafted story {{todo_story_file}}
2. Load SM agent and run `story-ready` workflow to approve it
3. Then return to DEV agent to implement
{{else}}
1. Stay with DEV agent and run `dev-story` workflow
2. Implement story {{todo_story_id}}
{{/if}}
{{/if}}
{{#if backlog_not_empty AND todo_empty}}
**Next Story (TODO):**
- **ID:** {{next_backlog_story_id}}
- **Title:** {{next_backlog_story_title}}
**Next Steps:**
1. Load SM agent
2. Run `create-story` workflow to draft story {{next_backlog_story_id}}
{{/if}}
</step>
</workflow>
```

View File

@@ -9,6 +9,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components

View File

@@ -3,61 +3,30 @@
````xml
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>This workflow assembles a Story Context XML for a single user story by extracting ACs, tasks, relevant docs/code, interfaces, constraints, and testing guidance to support implementation.</critical>
<critical>Default execution mode: #yolo (non-interactive). Only ask if {{non_interactive}} == false. If auto-discovery fails, HALT and request 'story_path' or 'story_dir'.</critical>
<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="Check and load workflow status file">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename: bmm-workflow-status.md)</action>
<step n="1" goal="Validate workflow sequence">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: story-context</param>
</invoke-workflow>
<check if="exists">
<action>Load the status file</action>
<action>Extract key information:</action>
- current_step: What workflow was last run
- next_step: What workflow should run next
- planned_workflow: The complete workflow journey table
- progress_percentage: Current progress
- IN PROGRESS story: The story being worked on (from Implementation Progress section)
<action>Set status_file_found = true</action>
<action>Store status_file_path for later updates</action>
<check if='next_step != "story-context" AND current_step != "story-ready"'>
<ask>**⚠️ Workflow Sequence Note**
Status file shows:
- Current step: {{current_step}}
- Expected next: {{next_step}}
This workflow (story-context) is typically run after story-ready.
Options:
1. Continue anyway (story-context is optional)
2. Exit and run the expected workflow: {{next_step}}
3. Check status with workflow-status
What would you like to do?</ask>
<action>If user chooses exit → HALT with message: "Run workflow-status to see current state"</action>
<check if="warning != ''">
<output>{{warning}}</output>
<ask>Continue with story-context anyway? (y/n)</ask>
<check if="n">
<output>{{suggestion}}</output>
<action>Exit workflow</action>
</check>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
The status file tracks progress across all workflows and provides context about which story to work on.
Options:
1. Run workflow-status first to create the status file (recommended)
2. Continue in standalone mode (no progress tracking)
3. Exit
What would you like to do?</ask>
<action>If user chooses option 1 → HALT with message: "Please run workflow-status first, then return to story-context"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
</check>
<action>Store {{status_file_path}} for later updates</action>
</step>
<step n="2" goal="Locate story and initialize output">

View File

@@ -9,6 +9,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components

View File

@@ -2,7 +2,8 @@
<critical>The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>Communicate all responses in {communication_language}</critical>
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<workflow>
@@ -10,19 +11,28 @@
<critical>NO SEARCHING - SM agent reads status file TODO section to know which story was drafted</critical>
<critical>Simple workflow: Update story file status, move story TODO → IN PROGRESS, move next story BACKLOG → TODO</critical>
<step n="1" goal="Read status file and identify the TODO story">
<step n="1" goal="Get TODO story from status file">
<action>Read {output_folder}/bmm-workflow-status.md</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### TODO (Needs Drafting)" section</action>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: data</param>
<param>data_request: next_story</param>
</invoke-workflow>
<action>Extract story information:</action>
<check if="status_exists == false OR todo_story_id == ''">
<output>❌ No status file or no TODO story found.
- todo_story_id: The story ID (e.g., "1.1", "auth-feature-1", "login-fix")
- todo_story_title: The story title
- todo_story_file: The exact story file path
This workflow requires an active status file with a TODO story.
<critical>DO NOT SEARCH for stories - the status file tells you exactly which story is in TODO</critical>
Run `workflow-status` to check your project state.</output>
<action>Exit workflow</action>
</check>
<action>Use extracted story information:</action>
- {{todo_story_id}}: Story to mark ready
- {{todo_story_title}}: Story title
- {{todo_story_file}}: Story file path
- {{status_file_path}}: Status file to update
</step>

View File

@@ -9,6 +9,7 @@ output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated
# Workflow components