docs update

This commit is contained in:
Brian Madison
2025-10-12 16:59:54 -05:00
parent 79ac3c91fe
commit c3c51945bb
11 changed files with 1052 additions and 110 deletions

View File

@@ -27,6 +27,49 @@
<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}/project-workflow-status.md (if exists)</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### TODO (Needs Drafting)" section</action>
<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
<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>
<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>
</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>
</step>
<step n="3" goal="Determine target story (do not prompt in #yolo)">
<action>List existing story markdown files in {{story_dir}} matching pattern: "story-<epic>.<story>.md"</action>
<check>If none found → Set {{epic_num}}=1 and {{story_num}}=1</check>

View File

@@ -0,0 +1,266 @@
# Story Approved Workflow Instructions (DEV Agent)
<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}/project-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}/project-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 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}}
```
<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 project-workflow-status.md</action>
</step>
<step n="5" goal="Confirm completion to user">
<action>Display summary</action>
**Story Approved and Marked Done!**
✅ 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

@@ -0,0 +1,41 @@
# Story Approved Workflow (DEV Agent)
name: story-approved
description: "Marks a story as done (DoD complete) and moves it from IN PROGRESS → DONE in the status file. Advances the story queue. Simple status-update workflow with no searching required."
author: "BMad"
# Critical variables from config
config_source: "{project-root}/bmad/bmm/config.yaml"
output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
date: system-generated
# Workflow components
installed_path: "{project-root}/bmad/bmm/workflows/4-implementation/story-approved"
instructions: "{installed_path}/instructions.md"
# Variables and inputs
variables:
story_dir: "{config_source}:dev_story_location" # Directory where stories are stored
status_file: "{output_folder}/project-workflow-status.md" # Status file to update
auto_update_status: true # Always update status file
# Output configuration - no output file, just status updates
default_output_file: ""
required_tools:
- read_file
- edit_file
tags:
- story-management
- status-update
- dev-agent
- bmad-v6
execution_hints:
interactive: false # Minimal prompts; quick status update
autonomous: true # Proceed without user input
iterative: false # Single-pass workflow
web_bundle: false

View File

@@ -0,0 +1,152 @@
# Story Ready Workflow Instructions (SM Agent)
<workflow>
<critical>This workflow is run by SM agent AFTER user reviews a drafted story and confirms it's ready for development</critical>
<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">
<action>Read {output_folder}/project-workflow-status.md</action>
<action>Navigate to "### Implementation Progress (Phase 4 Only)" section</action>
<action>Find "#### TODO (Needs Drafting)" section</action>
<action>Extract story information:</action>
- 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
<critical>DO NOT SEARCH for stories - the status file tells you exactly which story is in TODO</critical>
</step>
<step n="2" goal="Update the story file status">
<action>Read the story file: {story_dir}/{todo_story_file}</action>
<action>Find the "Status:" line (usually at the top)</action>
<action>Update story file:</action>
- Change: `Status: Draft`
- To: `Status: Ready`
<action>Save the story file</action>
</step>
<step n="3" goal="Move story from TODO → IN PROGRESS in status file">
<action>Open {output_folder}/project-workflow-status.md</action>
<action>Update "#### TODO (Needs Drafting)" section:</action>
Read the BACKLOG section to get the next story. If BACKLOG is empty:
#### TODO (Needs Drafting)
(No more stories to draft - all stories are drafted or complete)
If BACKLOG has stories, 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
<action>Update "#### IN PROGRESS (Approved for Development)" section:</action>
Move the TODO story here:
#### IN PROGRESS (Approved for Development)
- **Story ID:** {{todo_story_id}}
- **Story Title:** {{todo_story_title}}
- **Story File:** `{{todo_story_file}}`
- **Story Status:** Ready
- **Context File:** `{{context_file_path}}` (if exists, otherwise note "Context not yet generated")
- **Action:** DEV should run `dev-story` workflow to implement this story
<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>
- Decrement backlog_count by 1 (if story was moved from BACKLOG → TODO)
- Keep in_progress_count = 1
- Keep todo_count = 1 or 0 (depending on if there's a next story)
</step>
<step n="4" goal="Update Decision Log and Next Action">
<action>Add to "## Decision Log" section:</action>
```
- **{{date}}**: Story {{todo_story_id}} ({{todo_story_title}}) marked ready for development by SM agent. Moved from TODO → IN PROGRESS. {{#if next_story}}Next story {{next_story_id}} moved from BACKLOG → TODO.{{/if}}
```
<action>Update "### Next Action Required" section:</action>
```
**What to do next:** Generate context for story {{todo_story_id}}, then implement it
**Command to run:** Run 'story-context' workflow to generate implementation context (or skip to dev-story)
**Agent to load:** bmad/bmm/agents/sm.md (for story-context) OR bmad/bmm/agents/dev.md (for dev-story)
```
<action>Save project-workflow-status.md</action>
</step>
<step n="5" goal="Confirm completion to user">
<action>Display summary</action>
**Story Marked Ready for Development!**
✅ Story file updated: `{{todo_story_file}}` → Status: Ready
✅ Status file updated: Story moved TODO → IN PROGRESS
{{#if next_story}}✅ Next story moved: BACKLOG → TODO ({{next_story_id}}: {{next_story_title}}){{/if}}
{{#if no_more_stories}}✅ All stories have been drafted - backlog is empty{{/if}}
**Current Story (IN PROGRESS):**
- **ID:** {{todo_story_id}}
- **Title:** {{todo_story_title}}
- **File:** `{{todo_story_file}}`
- **Status:** Ready for development
**Next Steps:**
1. **Recommended:** Run `story-context` workflow to generate implementation context
- This creates a comprehensive context XML for the DEV agent
- Includes relevant architecture, dependencies, and existing code
2. **Alternative:** Skip context generation and go directly to `dev-story` workflow
- Faster, but DEV agent will have less context
- Only recommended for simple, well-understood stories
**To proceed:**
- For context generation: Stay with SM agent and run `story-context` workflow
- For direct implementation: Load DEV agent and run `dev-story` workflow
</step>
</workflow>

View File

@@ -0,0 +1,41 @@
# Story Ready Workflow (SM Agent)
name: story-ready
description: "Marks a drafted story as ready for development and moves it from TODO → IN PROGRESS in the status file. Simple status-update workflow with no searching required."
author: "BMad"
# Critical variables from config
config_source: "{project-root}/bmad/bmm/config.yaml"
output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
date: system-generated
# Workflow components
installed_path: "{project-root}/bmad/bmm/workflows/4-implementation/story-ready"
instructions: "{installed_path}/instructions.md"
# Variables and inputs
variables:
story_dir: "{config_source}:dev_story_location" # Directory where stories are stored
status_file: "{output_folder}/project-workflow-status.md" # Status file to update
auto_update_status: true # Always update status file
# Output configuration - no output file, just status updates
default_output_file: ""
required_tools:
- read_file
- edit_file
tags:
- story-management
- status-update
- sm-agent
- bmad-v6
execution_hints:
interactive: false # Minimal prompts; quick status update
autonomous: true # Proceed without user input
iterative: false # Single-pass workflow
web_bundle: false