arch alignment with workflows

This commit is contained in:
Brian Madison
2025-10-17 16:44:06 -05:00
parent 9519eae666
commit ffd354b605
20 changed files with 2111 additions and 1247 deletions

View File

@@ -5,33 +5,36 @@
<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 readiness">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: brainstorm-game</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}}</output>
<output>Note: Game brainstorming is optional. Continuing without progress tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
<check if="status_exists == true">
<action>Store {{status_file_path}} for later updates</action>
This workflow generates brainstorming ideas for game ideation (optional Phase 1 workflow).
<check if="project_type != 'game'">
<output>Note: This is a {{project_type}} project. Game brainstorming is designed for game projects.</output>
<ask>Continue with game brainstorming anyway? (y/n)</ask>
<check if="n">
<action>Exit workflow</action>
</check>
</check>
Options:
<check if="warning != ''">
<output>{{warning}}</output>
<output>Note: Game brainstorming can be valuable at any project stage.</output>
</check>
</check>
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 brainstorm-game"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
</check>
</step>
</step>
<step n="2" goal="Load game brainstorming context and techniques">
<action>Read the game context document from: {game_context}</action>
@@ -63,15 +66,9 @@ What would you like to do?</ask>
</invoke-workflow>
</step>
<step n="4" goal="Update status file on completion">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename)</action>
<check if="status file exists">
<action>Load the status file</action>
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "brainstorm-game"</action>
<step n="4" goal="Update status and complete">
<check if="standalone_mode != true">
<action>Load {{status_file_path}}</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "brainstorm-game - Complete"</action>
@@ -80,21 +77,25 @@ What would you like to do?</ask>
<action>Increment by: 5% (optional Phase 1 workflow)</action>
<template-output file="{{status_file_path}}">decisions_log</template-output>
<action>Add entry:</action>
```
- **{{date}}**: Completed brainstorm-game workflow. Generated game brainstorming session results saved to {output_folder}/brainstorming-session-results-{{date}}.md. Next: Review game ideas and consider running research or game-brief workflows.
```
<action>Add entry: "- **{{date}}**: Completed brainstorm-game workflow. Generated game brainstorming session results. Next: Review game ideas and consider research or game-brief workflows."</action>
<output>**✅ Game Brainstorming Session Complete, {user_name}!**
<action>Save {{status_file_path}}</action>
</check>
<output>**✅ Game Brainstorming Session Complete, {user_name}!**
**Session Results:**
- Game brainstorming results saved to: {output_folder}/brainstorming-session-results-{{date}}.md
- Game brainstorming results saved to: {output_folder}/bmm-brainstorming-session-{{date}}.md
**Status file updated:**
{{#if standalone_mode != true}}
**Status Updated:**
- Current step: brainstorm-game ✓
- Progress: {{new_progress_percentage}}%
- Progress tracking updated
{{else}}
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-init` first.
{{/if}}
**Next Steps:**
@@ -104,27 +105,10 @@ What would you like to do?</ask>
- `game-brief` workflow to formalize game vision
- Or proceed directly to `plan-project` if ready
{{#if standalone_mode != true}}
Check status anytime with: `workflow-status`
{{/if}}
</output>
</check>
<check if="status file not found">
<output>**✅ Game Brainstorming Session Complete, {user_name}!**
**Session Results:**
- Game brainstorming results saved to: {output_folder}/brainstorming-session-results-{{date}}.md
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-status` first.
**Next Steps:**
1. Review game brainstorming results
2. Run research or game-brief workflows
</output>
</check>
</step>
</step>
</workflow>

View File

@@ -1,6 +1,6 @@
# Brainstorm Project - Workflow Instructions
````xml
```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>
@@ -8,30 +8,25 @@
<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 readiness">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: brainstorm-project</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}}</output>
<output>Note: Brainstorming is optional. Continuing without progress tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
<check if="status_exists == true">
<action>Store {{status_file_path}} for later updates</action>
This workflow generates brainstorming ideas for project ideation (optional Phase 1 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 brainstorm-project"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
<check if="warning != ''">
<output>{{warning}}</output>
<output>Note: Brainstorming can be valuable at any project stage.</output>
</check>
</check>
</step>
@@ -56,15 +51,9 @@ What would you like to do?</ask>
</invoke-workflow>
</step>
<step n="4" goal="Update status file on completion">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename)</action>
<check if="status file exists">
<action>Load the status file</action>
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "brainstorm-project"</action>
<step n="4" goal="Update status and complete">
<check if="standalone_mode != true">
<action>Load {{status_file_path}}</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "brainstorm-project - Complete"</action>
@@ -73,19 +62,20 @@ What would you like to do?</ask>
<action>Increment by: 5% (optional Phase 1 workflow)</action>
<template-output file="{{status_file_path}}">decisions_log</template-output>
<action>Add entry:</action>
```
- **{{date}}**: Completed brainstorm-project workflow. Generated brainstorming session results saved to {output_folder}/brainstorming-session-results-{{date}}.md. Next: Review ideas and consider running research or product-brief workflows.
```
<action>Add entry: "- **{{date}}**: Completed brainstorm-project workflow. Generated brainstorming session results. Next: Review ideas and consider research or product-brief workflows."</action>
<output>**✅ Brainstorming Session Complete, {user_name}!**
<action>Save {{status_file_path}}</action>
</check>
<output>**✅ Brainstorming Session Complete, {user_name}!**
**Session Results:**
- Brainstorming results saved to: {output_folder}/brainstorming-session-results-{{date}}.md
- Brainstorming results saved to: {output_folder}/bmm-brainstorming-session-{{date}}.md
**Status file updated:**
- Current step: brainstorm-project ✓
- Progress: {{new_progress_percentage}}%
{{#if standalone_mode != true}}
**Status Updated:**
- Progress tracking updated
{{/if}}
**Next Steps:**
1. Review brainstorming results
@@ -94,26 +84,11 @@ What would you like to do?</ask>
- `product-brief` workflow to formalize product vision
- Or proceed directly to `plan-project` if ready
{{#if standalone_mode != true}}
Check status anytime with: `workflow-status`
</output>
</check>
<check if="status file not found">
<output>**✅ Brainstorming Session Complete, {user_name}!**
**Session Results:**
- Brainstorming results saved to: {output_folder}/brainstorming-session-results-{{date}}.md
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-status` first.
**Next Steps:**
1. Review brainstorming results
2. Run research or product-brief workflows
</output>
</check>
{{/if}}
</output>
</step>
</workflow>
````
```

View File

@@ -8,85 +8,47 @@
<critical>This router determines workflow mode and delegates to specialized sub-workflows</critical>
<step n="1" goal="Check and load workflow status file">
<step n="1" goal="Validate workflow and get project info">
<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>
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: data</param>
<param>data_request: project_config</param>
</invoke-workflow>
<check if="exists">
<action>Load the status file</action>
<action>Extract key information:</action>
- current_step: From "Current Step:" field
- next_step: From "Next Step:" field
- planned_workflow: From "Planned Workflow Journey" table
- progress_percentage: From "Overall Progress:" field
- current_phase: From "Current Phase:" field
- field_type: From "Greenfield/Brownfield:" field
<action>Validate this workflow is in the planned workflow</action>
<action>Set status_file_path = file path</action>
<action>Set status_file_found = true</action>
<check if='next_step != "document-project"'>
<ask>**⚠️ Workflow Sequence Note**
According to your status file, your next planned step is: **{{next_step}}**
But you're running: **document-project**
This is expected if plan-project invoked this workflow automatically for brownfield documentation.
Options:
1. **Continue** - Run document-project (status will be updated)
2. **Exit** - I'll follow the planned sequence instead
Your choice (1-2):</ask>
<check if='choice == "2"'>
<output>**Recommended Next Step:**
Run: {{next_step}}
You can return to document-project later if needed.
</output>
<action>Exit workflow</action>
</check>
</check>
<check if="status_exists == false">
<output>{{suggestion}}</output>
<output>Note: Documentation workflow can run standalone. Continuing without progress tracking.</output>
<action>Set standalone_mode = true</action>
<action>Set status_file_found = false</action>
</check>
<check if="not exists">
<ask>** No Workflow Status File Found**
<check if="status_exists == true">
<action>Store {{status_file_path}} for later updates</action>
<action>Set status_file_found = true</action>
This workflow works best with a workflow status file for progress tracking.
Options:
1. **Run workflow-status first** - Create status file and plan workflow (recommended)
2. **Continue anyway** - Run document-project standalone
3. **Exit** - I'll set up the workflow first
Your choice (1-3):</ask>
<check if='choice == "1"'>
<output>**To create status file:**
Load any agent and run: `workflow-status`
After planning your workflow, you can return here or follow the planned sequence.
</output>
<action>Exit workflow</action>
</check>
<check if='choice == "2"'>
<action>Set status_file_found = false</action>
<action>Set standalone_mode = true</action>
<action>Continue without status file integration</action>
<!-- Extract brownfield/greenfield from status data -->
<check if="field_type == 'greenfield'">
<output>Note: This is a greenfield project. Documentation workflow is typically for brownfield projects.</output>
<ask>Continue anyway to document planning artifacts? (y/n)</ask>
<check if="n">
<action>Exit workflow</action>
</check>
</check>
<check if='choice == "3"'>
<action>Exit workflow</action>
<!-- Now validate sequencing -->
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: document-project</param>
</invoke-workflow>
<check if="warning != ''">
<output>{{warning}}</output>
<output>Note: This may be auto-invoked by plan-project for brownfield documentation.</output>
<ask>Continue with documentation? (y/n)</ask>
<check if="n">
<output>{{suggestion}}</output>
<action>Exit workflow</action>
</check>
</check>
</check>
@@ -214,34 +176,22 @@ Your choice [1/2/3]:
</step>
<step n="4" goal="Update status file on completion">
<step n="4" goal="Update status and complete">
<check if="status_file_found == true">
<action>Load the status file from {{status_file_path}}</action>
<template-output file="{{status_file_path}}">planned_workflow</template-output>
<action>Find "document-project" in the planned_workflow table</action>
<action>Update Status field from "Planned" or "In Progress" to "Complete"</action>
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "document-project"</action>
<template-output file="{{status_file_path}}">next_step</template-output>
<action>Find next item with Status != "Complete" in planned_workflow table</action>
<action>Set to: "{{next_workflow_step}} ({{next_workflow_agent}} agent)"</action>
<template-output file="{{status_file_path}}">progress_percentage</template-output>
<action>Increment by: 10%</action>
<action>Load {{status_file_path}}</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "document-project - Complete"</action>
<template-output file="{{status_file_path}}">decisions_log</template-output>
<action>Add entry:</action>
<template-output file="{{status_file_path}}">progress_percentage</template-output>
<action>Increment by: 10%</action>
```
- **{{date}}**: Completed document-project workflow ({{workflow_mode}} mode, {{scan_level}} scan). Generated brownfield documentation in {output_folder}/. Next: {{next_step}}.
```
<template-output file="{{status_file_path}}">decisions_log</template-output>
<action>Add entry: "- **{{date}}**: Completed document-project workflow ({{workflow_mode}} mode). Generated documentation in {output_folder}/."</action>
<action>Save {{status_file_path}}</action>
</check>
<output>**✅ Document Project Workflow Complete, {user_name}!**
@@ -249,35 +199,18 @@ Your choice [1/2/3]:
- Mode: {{workflow_mode}}
- Scan Level: {{scan_level}}
- Output: {output_folder}/index.md and related files
- Output: {output_folder}/bmm-index.md and related files
**Status file updated:**
{{#if status_file_found}}
**Status Updated:**
- Current step: document-project ✓
- Next step: {{next_step}}
- Progress: {{new_progress_percentage}}%
- Progress tracking updated
{{else}}
**Note:** Running in standalone mode
{{/if}}
**To proceed:**
Load {{next_agent}} and run: `{{next_command}}`
Or check status anytime with: `workflow-status`
Check status anytime with: `workflow-status`
</output>
</check>
<check if="standalone_mode == true">
<output>**✅ Document Project Workflow Complete**
**Documentation Generated:**
- Mode: {{workflow_mode}}
- Scan Level: {{scan_level}}
- Output: {output_folder}/index.md and related files
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-status` first next time.
</output>
</check>
</step>

View File

@@ -6,31 +6,33 @@
<workflow>
<step n="0" 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="0" goal="Validate workflow readiness">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: game-brief</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}}</output>
<output>Note: Game brief is optional. Continuing without progress tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
<check if="status_exists == true">
<action>Store {{status_file_path}} for later updates</action>
This workflow creates a Game Brief document (optional Phase 1 workflow).
<check if="project_type != 'game'">
<output>Note: This is a {{project_type}} project. Game brief is designed for game projects.</output>
<ask>Continue with game brief anyway? (y/n)</ask>
<check if="n">
<action>Exit workflow</action>
</check>
</check>
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 game-brief"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
<check if="warning != ''">
<output>{{warning}}</output>
<output>Note: Game brief can provide valuable vision clarity at any stage.</output>
</check>
</check>
</step>
@@ -303,15 +305,9 @@ This brief will serve as the primary input for creating the Game Design Document
<template-output>executive_brief</template-output>
</step>
<step n="16" goal="Update status file on completion">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename)</action>
<check if="status file exists">
<action>Load the status file</action>
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "game-brief"</action>
<step n="16" goal="Update status and complete">
<check if="standalone_mode != true">
<action>Load {{status_file_path}}</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "game-brief - Complete"</action>
@@ -320,22 +316,25 @@ This brief will serve as the primary input for creating the Game Design Document
<action>Increment by: 10% (optional Phase 1 workflow)</action>
<template-output file="{{status_file_path}}">decisions_log</template-output>
<action>Add entry:</action>
<action>Add entry: "- **{{date}}**: Completed game-brief workflow. Game brief document generated. Next: Proceed to plan-project workflow to create Game Design Document (GDD)."</action>
```
- **{{date}}**: Completed game-brief workflow. Game brief document generated and saved. Next: Proceed to plan-project workflow to create Game Design Document (GDD).
```
<action>Save {{status_file_path}}</action>
</check>
<output>**✅ Game Brief Complete, {user_name}!**
**Brief Document:**
- Game brief saved to {output_folder}/game-brief-{{game_name}}-{{date}}.md
- Game brief saved to {output_folder}/bmm-game-brief-{{game_name}}-{{date}}.md
**Status file updated:**
{{#if standalone_mode != true}}
**Status Updated:**
- Current step: game-brief ✓
- Progress: {{new_progress_percentage}}%
- Progress tracking updated
{{else}}
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-init` first.
{{/if}}
**Next Steps:**
@@ -344,27 +343,10 @@ This brief will serve as the primary input for creating the Game Design Document
3. Run `plan-project` workflow to create GDD from this brief
4. Validate assumptions with target players
{{#if standalone_mode != true}}
Check status anytime with: `workflow-status`
{{/if}}
</output>
</check>
<check if="status file not found">
<output>**✅ Game Brief Complete, {user_name}!**
**Brief Document:**
- Game brief saved to {output_folder}/game-brief-{{game_name}}-{{date}}.md
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-status` first.
**Next Steps:**
1. Review the game brief document
2. Run `plan-project` workflow to create GDD
</output>
</check>
</step>
</step>
</workflow>

View File

@@ -6,31 +6,34 @@
<workflow>
<step n="0" 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="0" goal="Validate workflow readiness">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: product-brief</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}}</output>
<output>Note: Product Brief is optional. You can continue without status tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
<check if="status_exists == true">
<action>Store {{status_file_path}} for later updates</action>
This workflow creates a Product Brief document (optional Phase 1 workflow).
<check if="project_level < 2">
<output>Note: Product Brief is most valuable for Level 2+ projects. Your project is Level {{project_level}}.</output>
<output>You may want to skip directly to technical planning instead.</output>
</check>
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 product-brief"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
<check if="warning != ''">
<output>{{warning}}</output>
<ask>Continue with Product Brief anyway? (y/n)</ask>
<check if="n">
<output>Exiting. {{suggestion}}</output>
<action>Exit workflow</action>
</check>
</check>
</check>
</step>
@@ -267,14 +270,8 @@ This brief will serve as the primary input for creating the Product Requirements
</step>
<step n="16" goal="Update status file on completion">
<action>Search {output_folder}/ for files matching pattern: bmm-workflow-status.md</action>
<action>Find the most recent file (by date in filename)</action>
<check if="status file exists">
<action>Load the status file</action>
<template-output file="{{status_file_path}}">current_step</template-output>
<action>Set to: "product-brief"</action>
<check if="standalone_mode != true">
<action>Load {{status_file_path}}</action>
<template-output file="{{status_file_path}}">current_workflow</template-output>
<action>Set to: "product-brief - Complete"</action>
@@ -283,22 +280,25 @@ This brief will serve as the primary input for creating the Product Requirements
<action>Increment by: 10% (optional Phase 1 workflow)</action>
<template-output file="{{status_file_path}}">decisions_log</template-output>
<action>Add entry:</action>
<action>Add entry: "- **{{date}}**: Completed product-brief workflow. Product brief document generated and saved. Next: Proceed to plan-project workflow to create Product Requirements Document (PRD)."</action>
```
- **{{date}}**: Completed product-brief workflow. Product brief document generated and saved. Next: Proceed to plan-project workflow to create Product Requirements Document (PRD).
```
<action>Save {{status_file_path}}</action>
</check>
<output>**✅ Product Brief Complete, {user_name}!**
**Brief Document:**
- Product brief saved to {output_folder}/product-brief-{{project_name}}-{{date}}.md
- Product brief saved to {output_folder}/bmm-product-brief-{{project_name}}-{{date}}.md
**Status file updated:**
{{#if standalone_mode != true}}
**Status Updated:**
- Current step: product-brief ✓
- Progress: {{new_progress_percentage}}%
- Progress tracking updated
- Current workflow marked complete
{{else}}
**Note:** Running in standalone mode (no progress tracking)
{{/if}}
**Next Steps:**
@@ -306,27 +306,10 @@ This brief will serve as the primary input for creating the Product Requirements
2. Gather any additional stakeholder input
3. Run `plan-project` workflow to create PRD from this brief
{{#if standalone_mode != true}}
Check status anytime with: `workflow-status`
{{/if}}
</output>
</check>
<check if="status file not found">
<output>**✅ Product Brief Complete**
**Brief Document:**
- Product brief saved and ready for handoff
Note: Running in standalone mode (no status file).
To track progress across workflows, run `workflow-status` first.
**Next Steps:**
1. Review the product brief document
2. Run `plan-project` workflow to create PRD
</output>
</check>
</step>
</step>
</workflow>

View File

@@ -10,31 +10,26 @@
<critical>This is a ROUTER that directs to specialized research instruction sets</critical>
<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 readiness">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: research</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}}</output>
<output>Note: Research is optional. Continuing without progress tracking.</output>
<action>Set standalone_mode = true</action>
</check>
<check if="not exists">
<ask>**No workflow status file found.**
<check if="status_exists == true">
<action>Store {{status_file_path}} for status updates in sub-workflows</action>
<action>Pass status_file_path to loaded instruction set</action>
This workflow conducts research (optional Phase 1 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 research"</action>
<action>If user chooses option 2 → Set standalone_mode = true and continue</action>
<action>If user chooses option 3 → HALT</action>
<check if="warning != ''">
<output>{{warning}}</output>
<output>Note: Research can provide valuable insights at any project stage.</output>
</check>
</check>
</step>

View File

@@ -0,0 +1,177 @@
# Workflow Status Service - Integration Examples
## How Other Workflows Can Use the Enhanced workflow-status Service
### Example 1: Simple Validation (product-brief workflow)
Replace the old Step 0:
```xml
<!-- OLD WAY - 35+ lines of duplicate code -->
<step n="0" 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...</action>
<!-- ... 30+ more lines of checking logic ... -->
</step>
```
With the new service call:
```xml
<!-- NEW WAY - Clean and simple -->
<step n="0" goal="Validate workflow readiness">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: validate</param>
<param>calling_workflow: product-brief</param>
</invoke-workflow>
<check if="status_exists == false">
<output>{{suggestion}}</output>
<output>Note: Status tracking is optional. You can continue without it.</output>
</check>
<check if="warning != ''">
<output>{{warning}}</output>
<ask>Continue anyway? (y/n)</ask>
<check if="n">
<action>Exit workflow</action>
</check>
</check>
<action>Store {{status_file_path}} for later updates if needed</action>
</step>
```
### Example 2: Getting Story Data (create-story workflow)
Replace the complex Step 2.5:
```xml
<!-- OLD WAY - Complex parsing logic -->
<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>
<!-- ... 40+ lines of parsing and extraction ... -->
</step>
```
With the new service call:
```xml
<!-- NEW WAY - Let workflow-status handle the complexity -->
<step n="2.5" goal="Get next story to draft">
<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="status_exists == false">
<action>Fall back to legacy story discovery</action>
</check>
<check if="todo_story_id exists">
<action>Use {{todo_story_id}} as story to draft</action>
<action>Use {{todo_story_title}} for validation</action>
<action>Create file: {{todo_story_file}}</action>
<output>Drafting story {{todo_story_id}}: {{todo_story_title}}</output>
</check>
</step>
```
### Example 3: Getting Project Configuration (solution-architecture workflow)
```xml
<step n="0" goal="Load project configuration">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: data</param>
<param>data_request: project_config</param>
</invoke-workflow>
<check if="status_exists == false">
<ask>No status file. Run standalone or create status first?</ask>
</check>
<check if="status_exists == true">
<action>Use {{project_level}} to determine architecture complexity</action>
<action>Use {{project_type}} to select appropriate templates</action>
<action>Use {{field_type}} to know if brownfield constraints apply</action>
</check>
</step>
```
### Example 4: Quick Init Check (any workflow)
```xml
<step n="0" goal="Check if status exists">
<invoke-workflow path="{project-root}/bmad/bmm/workflows/1-analysis/workflow-status">
<param>mode: init-check</param>
</invoke-workflow>
<check if="status_exists == false">
<output>{{suggestion}}</output>
<output>Proceeding without status tracking...</output>
</check>
</step>
```
## Benefits of This Approach
1. **DRY Principle**: No more duplicating status check logic across 50+ workflows
2. **Centralized Logic**: Bug fixes and improvements happen in one place
3. **Backward Compatible**: Old workflows continue to work, can migrate gradually
4. **Advisory Not Blocking**: Workflows can proceed even without status file
5. **Flexible Data Access**: Get just what you need (next_story, project_config, etc.)
6. **Cleaner Workflows**: Focus on core logic, not status management
## Available Modes
### `validate` Mode
- **Purpose**: Check if this workflow should run
- **Returns**:
- `status_exists`: true/false
- `should_proceed`: true (always - advisory only)
- `warning`: Any sequence warnings
- `suggestion`: What to do
- `project_level`, `project_type`, `field_type`: For workflow decisions
- `status_file_path`: For later updates
### `data` Mode
- **Purpose**: Extract specific information
- **Parameters**: `data_request` = one of:
- `next_story`: Get TODO story details
- `project_config`: Get project configuration
- `phase_status`: Get phase completion status
- `all`: Get everything
- **Returns**: Requested fields as template outputs
### `init-check` Mode
- **Purpose**: Simple existence check
- **Returns**:
- `status_exists`: true/false
- `suggestion`: Brief message
### `interactive` Mode (default)
- **Purpose**: User-facing status check
- **Shows**: Current status, options menu
- **Returns**: User proceeds with selected action
## Migration Strategy
1. Start with high-value workflows that have complex Step 0s
2. Test with a few workflows first
3. Gradually migrate others as they're updated
4. Old workflows continue to work unchanged
## Next Steps
To integrate into your workflow:
1. Replace your Step 0 with appropriate service call
2. Remove duplicate status checking logic
3. Use returned values for workflow decisions
4. Update status file at completion (if status_exists == true)

View File

@@ -1,11 +1,33 @@
# Workflow Status Check
# Workflow Status Check - Multi-Mode Service
<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/1-analysis/workflow-status/workflow.yaml</critical>
<critical>This is the UNIVERSAL entry point - any agent can ask "what should I do now?"</critical>
<critical>This workflow operates in multiple modes: interactive (default), validate, data, init-check</critical>
<critical>Other workflows can call this as a service to avoid duplicating status logic</critical>
<workflow>
<step n="0" goal="Determine execution mode">
<action>Check for {{mode}} parameter passed by calling workflow</action>
<action>Default mode = "interactive" if not specified</action>
<check if="mode == interactive">
<action>Continue to Step 1 for normal status check flow</action>
</check>
<check if="mode == validate">
<action>Jump to Step 10 for workflow validation service</action>
</check>
<check if="mode == data">
<action>Jump to Step 20 for data extraction service</action>
</check>
<check if="mode == init-check">
<action>Jump to Step 30 for simple init check</action>
</check>
</step>
<step n="1" goal="Check for status file">
<action>Search {output_folder}/ for file: bmm-workflow-status.md</action>
@@ -102,4 +124,143 @@ Your choice:</ask>
<action>Handle user selection based on available options</action>
</step>
<!-- ============================================= -->
<!-- SERVICE MODES - Called by other workflows -->
<!-- ============================================= -->
<step n="10" goal="Validate mode - Check if calling workflow should proceed">
<action>Read {output_folder}/bmm-workflow-status.md if exists</action>
<check if="status file not found">
<template-output>status_exists = false</template-output>
<template-output>should_proceed = true</template-output>
<template-output>warning = "No status file found. Running without progress tracking."</template-output>
<template-output>suggestion = "Consider running workflow-init first for progress tracking"</template-output>
<action>Return to calling workflow</action>
</check>
<check if="status file found">
<action>Parse status file fields</action>
<action>Load workflow path file from WORKFLOW_PATH field</action>
<action>Check if {{calling_workflow}} matches CURRENT_WORKFLOW or NEXT_COMMAND</action>
<template-output>status_exists = true</template-output>
<template-output>current_phase = {{CURRENT_PHASE}}</template-output>
<template-output>current_workflow = {{CURRENT_WORKFLOW}}</template-output>
<template-output>next_workflow = {{NEXT_COMMAND}}</template-output>
<template-output>project_level = {{PROJECT_LEVEL}}</template-output>
<template-output>project_type = {{PROJECT_TYPE}}</template-output>
<template-output>field_type = {{FIELD_TYPE}}</template-output>
<check if="calling_workflow == current_workflow">
<template-output>should_proceed = true</template-output>
<template-output>warning = ""</template-output>
<template-output>suggestion = "Resuming {{current_workflow}}"</template-output>
</check>
<check if="calling_workflow == next_workflow">
<template-output>should_proceed = true</template-output>
<template-output>warning = ""</template-output>
<template-output>suggestion = "Proceeding with planned next step"</template-output>
</check>
<check if="calling_workflow != current_workflow AND calling_workflow != next_workflow">
<action>Check if calling_workflow is in optional workflows list</action>
<check if="is optional">
<template-output>should_proceed = true</template-output>
<template-output>warning = "Running optional workflow {{calling_workflow}}"</template-output>
<template-output>suggestion = "This is optional. Expected next: {{next_workflow}}"</template-output>
</check>
<check if="not optional">
<template-output>should_proceed = true</template-output>
<template-output>warning = "⚠️ Out of sequence: Expected {{next_workflow}}, running {{calling_workflow}}"</template-output>
<template-output>suggestion = "Consider running {{next_workflow}} instead, or continue if intentional"</template-output>
</check>
</check>
<template-output>status_file_path = {{path to bmm-workflow-status.md}}</template-output>
</check>
<action>Return control to calling workflow with all template outputs</action>
</step>
<step n="20" goal="Data mode - Extract specific information">
<action>Read {output_folder}/bmm-workflow-status.md if exists</action>
<check if="status file not found">
<template-output>status_exists = false</template-output>
<template-output>error = "No status file to extract data from"</template-output>
<action>Return to calling workflow</action>
</check>
<check if="status file found">
<action>Parse status file completely</action>
<template-output>status_exists = true</template-output>
<check if="data_request == next_story">
<action>Extract from Development Queue section</action>
<template-output>todo_story_id = {{TODO_STORY}}</template-output>
<template-output>todo_story_title = {{TODO_TITLE}}</template-output>
<template-output>in_progress_story = {{IN_PROGRESS_STORY}}</template-output>
<template-output>stories_sequence = {{STORIES_SEQUENCE}}</template-output>
<template-output>stories_done = {{STORIES_DONE}}</template-output>
<action>Determine story file path based on ID format</action>
<check if='todo_story_id matches "N.M" format'>
<template-output>todo_story_file = "story-{{N}}.{{M}}.md"</template-output>
</check>
<check if='todo_story_id matches "slug-N" format'>
<template-output>todo_story_file = "story-{{slug}}-{{N}}.md"</template-output>
</check>
<check if='todo_story_id matches "slug" format'>
<template-output>todo_story_file = "story-{{slug}}.md"</template-output>
</check>
</check>
<check if="data_request == project_config">
<template-output>project_name = {{PROJECT_NAME}}</template-output>
<template-output>project_type = {{PROJECT_TYPE}}</template-output>
<template-output>project_level = {{PROJECT_LEVEL}}</template-output>
<template-output>field_type = {{FIELD_TYPE}}</template-output>
<template-output>workflow_path = {{WORKFLOW_PATH}}</template-output>
</check>
<check if="data_request == phase_status">
<template-output>current_phase = {{CURRENT_PHASE}}</template-output>
<template-output>phase_1_complete = {{PHASE_1_COMPLETE}}</template-output>
<template-output>phase_2_complete = {{PHASE_2_COMPLETE}}</template-output>
<template-output>phase_3_complete = {{PHASE_3_COMPLETE}}</template-output>
<template-output>phase_4_complete = {{PHASE_4_COMPLETE}}</template-output>
</check>
<check if="data_request == all">
<action>Return all parsed fields as template outputs</action>
</check>
<template-output>status_file_path = {{path to bmm-workflow-status.md}}</template-output>
</check>
<action>Return control to calling workflow with requested data</action>
</step>
<step n="30" goal="Init-check mode - Simple existence check">
<action>Check if {output_folder}/bmm-workflow-status.md exists</action>
<check if="exists">
<template-output>status_exists = true</template-output>
<template-output>suggestion = "Status file found. Ready to proceed."</template-output>
</check>
<check if="not exists">
<template-output>status_exists = false</template-output>
<template-output>suggestion = "No status file. Run workflow-init to create one (optional for progress tracking)"</template-output>
</check>
<action>Return immediately to calling workflow</action>
</step>
</workflow>