# Workflow Status Check - Multi-Mode Service The workflow execution engine is governed by: {project-root}/bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {project-root}/bmad/bmm/workflows/workflow-status/workflow.yaml This workflow operates in multiple modes: interactive (default), validate, data, init-check, update Other workflows can call this as a service to avoid duplicating status logic Check for {{mode}} parameter passed by calling workflow Default mode = "interactive" if not specified Continue to Step 1 for normal status check flow Jump to Step 10 for workflow validation service Jump to Step 20 for data extraction service Jump to Step 30 for simple init check Jump to Step 40 for status update service Search {output_folder}/ for file: bmm-workflow-status.md No workflow status found. To get started: Load analyst agent and run: `workflow-init` This will guide you through project setup and create your workflow path. Exit workflow Continue to step 2 Read bmm-workflow-status.md Extract key-value pairs from status file: Parse these fields: - PROJECT_NAME - PROJECT_TYPE - PROJECT_LEVEL - FIELD_TYPE - CURRENT_PHASE - CURRENT_WORKFLOW - TODO_STORY - IN_PROGRESS_STORY - NEXT_ACTION - NEXT_COMMAND - NEXT_AGENT Load workflow path file to check for optional steps Check if current workflow is in progress or complete ## 📊 Current Status **Project:** {{PROJECT_NAME}} (Level {{PROJECT_LEVEL}} {{PROJECT_TYPE}}) **Phase:** {{CURRENT_PHASE}} **Current Workflow:** {{CURRENT_WORKFLOW}} {{#if CURRENT_PHASE == "4-Implementation"}} **Development Queue:** - TODO: {{TODO_STORY}} - {{TODO_TITLE}} - IN PROGRESS: {{IN_PROGRESS_STORY}} - {{IN_PROGRESS_TITLE}} {{/if}} ## 🎯 Your Options {{#if CURRENT_WORKFLOW != "complete"}} **Continue in progress:** - {{CURRENT_WORKFLOW}} ({{CURRENT_AGENT}} agent) {{/if}} **Next required step:** - Command: `{{NEXT_COMMAND}}` - Agent: {{NEXT_AGENT}} {{#if optional_workflows_available}} **Optional workflows available:** {{#each optional_workflows}} - {{workflow_name}} ({{agent}}) {{/each}} {{/if}} What would you like to do? {{#if CURRENT_WORKFLOW != "complete"}} 1. **Continue current** - Resume {{CURRENT_WORKFLOW}} {{/if}} 2. **Next required** - {{NEXT_COMMAND}} {{#if optional_workflows_available}} 3. **Optional workflow** - Choose from available options {{/if}} 4. **View full status** - See complete status file 5. **Exit** - Return to agent Your choice: Handle user selection based on available options Read {output_folder}/bmm-workflow-status.md if exists status_exists = false should_proceed = true warning = "No status file found. Running without progress tracking." suggestion = "Consider running workflow-init first for progress tracking" Return to calling workflow Parse status file fields Load workflow path file from WORKFLOW_PATH field Check if {{calling_workflow}} matches CURRENT_WORKFLOW or NEXT_COMMAND status_exists = true current_phase = {{CURRENT_PHASE}} current_workflow = {{CURRENT_WORKFLOW}} next_workflow = {{NEXT_COMMAND}} project_level = {{PROJECT_LEVEL}} project_type = {{PROJECT_TYPE}} field_type = {{FIELD_TYPE}} should_proceed = true warning = "" suggestion = "Resuming {{current_workflow}}" should_proceed = true warning = "" suggestion = "Proceeding with planned next step" Check if calling_workflow is in optional workflows list should_proceed = true warning = "Running optional workflow {{calling_workflow}}" suggestion = "This is optional. Expected next: {{next_workflow}}" should_proceed = true warning = "⚠️ Out of sequence: Expected {{next_workflow}}, running {{calling_workflow}}" suggestion = "Consider running {{next_workflow}} instead, or continue if intentional" status_file_path = {{path to bmm-workflow-status.md}} Return control to calling workflow with all template outputs Read {output_folder}/bmm-workflow-status.md if exists status_exists = false error = "No status file to extract data from" Return to calling workflow Parse status file completely status_exists = true Extract from Development Queue section todo_story_id = {{TODO_STORY}} todo_story_title = {{TODO_TITLE}} in_progress_story = {{IN_PROGRESS_STORY}} stories_sequence = {{STORIES_SEQUENCE}} stories_done = {{STORIES_DONE}} Determine story file path based on ID format todo_story_file = "story-{{N}}.{{M}}.md" todo_story_file = "story-{{slug}}-{{N}}.md" todo_story_file = "story-{{slug}}.md" project_name = {{PROJECT_NAME}} project_type = {{PROJECT_TYPE}} project_level = {{PROJECT_LEVEL}} field_type = {{FIELD_TYPE}} workflow_path = {{WORKFLOW_PATH}} current_phase = {{CURRENT_PHASE}} phase_1_complete = {{PHASE_1_COMPLETE}} phase_2_complete = {{PHASE_2_COMPLETE}} phase_3_complete = {{PHASE_3_COMPLETE}} phase_4_complete = {{PHASE_4_COMPLETE}} Return all parsed fields as template outputs status_file_path = {{path to bmm-workflow-status.md}} Return control to calling workflow with requested data Check if {output_folder}/bmm-workflow-status.md exists status_exists = true suggestion = "Status file found. Ready to proceed." status_exists = false suggestion = "No status file. Run workflow-init to create one (optional for progress tracking)" Return immediately to calling workflow Read {output_folder}/bmm-workflow-status.md success = false error = "No status file found. Cannot update." Return to calling workflow Parse all current values from status file Load workflow path file from WORKFLOW_PATH field Check {{action}} parameter to determine update type Get {{workflow_name}} parameter (required) Mark workflow complete: - Update CURRENT_WORKFLOW to "{{workflow_name}} - Complete" Find {{workflow_name}} in loaded path YAML Determine next workflow from path sequence Update Next Action fields: - NEXT_ACTION: Description from next workflow in path - NEXT_COMMAND: Command for next workflow - NEXT_AGENT: Agent for next workflow - CURRENT_WORKFLOW: Set to next workflow name (or "Complete" if no more) - CURRENT_AGENT: Set to next agent Check if phase complete: - If {{workflow_name}} is last required workflow in current phase - Update PHASE_X_COMPLETE to true - Update CURRENT_PHASE to next phase (if applicable) Trigger story population (see populate_stories action below) Update LAST_UPDATED to {{date}} Save status file success = true next_workflow = {{determined next workflow}} next_agent = {{determined next agent}} phase_complete = {{true/false}} Get {{epics_file}} parameter (required - path to epics.md) Read {{epics_file}} completely Parse all story definitions from epic sections Extract story IDs in sequential order (e.g., story-1.1, story-1.2, story-2.1...) Extract story titles for each ID Build ordered story list: - Format: JSON array or comma-separated - Example: ["story-1.1", "story-1.2", "story-1.3", "story-2.1"] Update status file: - STORIES_SEQUENCE: {{ordered_story_list}} - TODO_STORY: {{first_story_id}} - TODO_TITLE: {{first_story_title}} - IN_PROGRESS_STORY: (empty) - IN_PROGRESS_TITLE: (empty) - STORIES_DONE: [] Update LAST_UPDATED to {{date}} Save status file success = true total_stories = {{count}} first_story = {{first_story_id}} Get current TODO_STORY from status file success = false error = "No TODO story to start" Return to calling workflow Move TODO → IN PROGRESS: - IN_PROGRESS_STORY: {{current TODO_STORY}} - IN_PROGRESS_TITLE: {{current TODO_TITLE}} Find next story in STORIES_SEQUENCE after current TODO_STORY Move next story to TODO: - TODO_STORY: {{next_story_id}} - TODO_TITLE: {{next_story_title}} Clear TODO: - TODO_STORY: (empty) - TODO_TITLE: (empty) Update NEXT_ACTION and NEXT_COMMAND: - NEXT_ACTION: "Implement story {{IN_PROGRESS_STORY}}" - NEXT_COMMAND: "dev-story" - NEXT_AGENT: "dev" Update LAST_UPDATED to {{date}} Save status file success = true in_progress_story = {{IN_PROGRESS_STORY}} next_todo = {{TODO_STORY or empty}} Get current IN_PROGRESS_STORY from status file success = false error = "No IN PROGRESS story to complete" Return to calling workflow Move IN PROGRESS → DONE: - Add {{IN_PROGRESS_STORY}} to STORIES_DONE list Move TODO → IN PROGRESS: - IN_PROGRESS_STORY: {{current TODO_STORY}} - IN_PROGRESS_TITLE: {{current TODO_TITLE}} Find next story in STORIES_SEQUENCE after current TODO_STORY Move next story to TODO: - TODO_STORY: {{next_story_id}} - TODO_TITLE: {{next_story_title}} Clear TODO: - TODO_STORY: (empty) - TODO_TITLE: (empty) Mark Phase 4 complete: - PHASE_4_COMPLETE: true - CURRENT_WORKFLOW: "Complete" - NEXT_ACTION: "All stories complete!" - NEXT_COMMAND: (empty) Update NEXT_ACTION: - If IN_PROGRESS_STORY exists: "Implement story {{IN_PROGRESS_STORY}}" - If only TODO_STORY exists: "Draft story {{TODO_STORY}}" - NEXT_COMMAND: "dev-story" or "create-story" Update LAST_UPDATED to {{date}} Save status file success = true completed_story = {{completed_story_id}} stories_remaining = {{count}} all_complete = {{true/false}} Get {{workflow_name}} parameter (required) Get {{agent_name}} parameter (optional) Update current workflow: - CURRENT_WORKFLOW: {{workflow_name}} - CURRENT_AGENT: {{agent_name or infer from path}} Find {{workflow_name}} in path to determine next: - NEXT_ACTION: Next workflow description - NEXT_COMMAND: Next workflow command - NEXT_AGENT: Next workflow agent Update LAST_UPDATED to {{date}} Save status file success = true success = false error = "Unknown action: {{action}}. Valid actions: complete_workflow, populate_stories, start_story, complete_story, set_current_workflow" Return control to calling workflow with template outputs