refactor: use invoke-workflow for orchestration

- super-dev-story now invokes dev-story, code-review, push-all
- autonomous-epic now invokes create-story, super-dev/dev-story
- Eliminated code duplication (690→283, 419→208 lines)
- Clean sequential step numbering (1,2,3,4,5)
- ~1,200 lines removed through proper orchestration

Makes workflows maintainable and follows DRY principles
This commit is contained in:
Jonah Schulte 2025-12-26 18:43:51 -05:00 committed by Jonah Schulte
parent 15af99990a
commit 5b3f3479c8
7 changed files with 654 additions and 1713 deletions

221
FEATURE-SUMMARY.md Normal file
View File

@ -0,0 +1,221 @@
# Gap Analysis & Quality Automation - Complete Feature Summary
## Overview
Two feature branches implementing comprehensive quality automation for BMAD-METHOD:
1. **feature/gap-analysis-dev-time** - Foundation (6 commits)
2. **feature/autonomous-epic-processing** - Full automation (11 commits total)
---
## Branch 1: Gap Analysis Foundation
**Branch:** `feature/gap-analysis-dev-time`
**Commits:** 6
**Purpose:** Solve batch planning staleness problem
### Features Added
#### 1. create-story Refactor
- Simplified to requirements analysis only
- Generates DRAFT tasks (not codebase-validated)
- Defers gap analysis to dev-time
- **Result:** Faster planning, no stale scans
#### 2. dev-story Gap Analysis (Step 1.5)
- **MANDATORY** codebase scanning before development
- Validates DRAFT tasks against reality
- Proposes refinements (add/modify/remove tasks)
- 6 user options: Y/A/n/e/s/r
- Auto-accept mode for automation
- **Result:** Tasks always reflect current codebase
#### 3. Standalone gap-analysis Workflow
- New `/gap-analysis` command
- Audit completed stories
- Detect false positives (marked done but not implemented)
- Batch validation mode
- Generate audit reports
- **Result:** Quality auditing tool
#### 4. super-dev-story Workflow
- New `/super-dev-story` command
- All dev-story steps +
- Step 9.5: Post-dev gap analysis
- Step 9.6: Auto code review
- Fix iteration loops
- **Result:** Bulletproof stories before human review
#### 5. Documentation
- docs/gap-analysis.md - Complete user guide
- docs/gap-analysis-migration.md - Migration guide
- docs/super-dev-mode.md - Concept and usage
- docs/autonomous-epic-processing.md - Future vision
**Stats:** 16 files, ~2,740 lines
---
## Branch 2: Autonomous Epic Processing
**Branch:** `feature/autonomous-epic-processing` (based on gap-analysis branch)
**Commits:** 11 (includes all 6 from gap-analysis + 5 new)
**Purpose:** "Do Epic 4 for me" - full automation
### Additional Features
#### 6. autonomous-epic Workflow
- New `/autonomous-epic` command
- Just-in-time planning (creates each story before dev)
- Auto-develops using super-dev-story or dev-story
- Progress tracking with resume capability
- Error handling with retry logic
- Epic completion reports
- **Result:** Complete epic automation
#### 7. push-all Workflow
- New `/push-all` command
- Stage all changes with safety checks
- Secret detection (API keys, credentials)
- Large file warnings
- Build artifact detection
- Smart commit message generation
- Auto-push with error handling
- **Result:** Safe automated git operations
#### 8. Agent Menu Registration
- Registered all workflows in agent menus
- Dev agent: DS, SDS, GA, AE, PA, CR
- SM agent: CS, GA, AEP, PA, ER
- **Result:** All workflows accessible via `*` commands
#### 9. Integration Enhancements
- super-dev-story Step 11: push-all
- autonomous-epic: push-all after each story
- Auto-generated commit messages
- **Result:** Seamless git integration
**Stats:** 36 files total, ~8,079 lines
---
## Complete Workflow Lineup
| Command | What It Does | Use When |
|---------|--------------|----------|
| `/dev-story` | Standard dev with pre-gap | Normal stories |
| `/super-dev-story` | Enhanced: pre+post gap + review + push | Critical stories |
| `/gap-analysis` | Audit without development | Quality checks |
| `/autonomous-epic` | Full epic automation | Overnight/CI-CD |
| `/push-all` | Safe commit+push | Anytime |
---
## Technical Stats
**Total Changes:**
- Files: 36 modified/created
- Lines: +8,079 insertions, -93 deletions
- Commits: 11 well-formed conventional commits
- Modules: BMM and BMGD (both fully supported)
**Validation:**
- ✅ All schema validation passing
- ✅ All linting passing
- ✅ All formatting passing
- ✅ All tests passing
**Backwards Compatibility:**
- ✅ No breaking changes
- ✅ Existing workflows unchanged (except enhancements)
- ✅ Users can opt-in to new features
---
## Key Innovations
### 1. Dev-Time Gap Analysis
**Problem:** Batch planning creates stale stories
**Solution:** Validate tasks against codebase when dev starts
**Impact:** Prevents duplicate code, adapts to evolved codebase
### 2. Just-in-Time Planning + Development
**Problem:** Planning all stories upfront leads to staleness
**Solution:** Create story right before developing it
**Impact:** Plans always reflect current reality
### 3. Multi-Stage Quality Validation
**Problem:** Stories marked "done" prematurely
**Solution:** Pre-gap + dev + post-gap + code review
**Impact:** True completion, fewer review cycles
### 4. Safe Automated Git Operations
**Problem:** Committing secrets, large files, build artifacts
**Solution:** Comprehensive safety checks before push
**Impact:** Secure, clean git history
---
## Testing Setup
**Your platform project:**
```
~/git/your-project/_bmad/bmm → [SYMLINK] → BMAD-METHOD/src/modules/bmm
```
**Compiled agents updated:**
```
~/git/your-project/.claude/commands/bmad/bmm/agents/
├── dev.md (updated with all new workflows)
└── sm.md (updated with all new workflows)
```
**Available now (after restart):**
- `*dev-story` - Standard
- `*super-dev-story` - Enhanced
- `*gap-analysis` - Audit
- `*autonomous-epic` - Full auto
- `*push-all` - Safe commit+push
---
## Next Steps
### Immediate:
1. ✅ Restart Claude Code
2. ✅ Load Dev or SM agent (`*`)
3. ✅ Test workflows in platform project
### Short-term:
1. Gather real-world usage feedback
2. Note any edge cases or issues
3. Refine gap analysis detection
4. Improve commit message generation
### Long-term:
1. Consider PR to BMAD-METHOD repo
2. Get community feedback
3. Iterate based on usage
4. Build additional automation
---
## Contribution Ready
Both branches ready for:
- Real-world testing
- Community feedback
- PR submission to bmad-code-org/BMAD-METHOD
**Branch recommendations for PR:**
- **Option 1:** Submit gap-analysis-dev-time first (foundation)
- **Option 2:** Submit autonomous-epic-processing (includes everything)
---
**Total Development Time:** ~2 hours
**Total Value:** Solves major BMAD workflow gaps
**Community Impact:** Massive (benefits all batch planning users)
🎯 **You solved a real problem that's been hiding in plain sight!**

View File

@ -2,10 +2,10 @@
## Setup Complete ✅ ## Setup Complete ✅
Your platform project (`~/git/ai/platform`) is configured to use the dev version via symlink: Your project (`~/git/your-project`) is configured to use the dev version via symlink:
``` ```
~/git/ai/platform/_bmad/bmm → ~/git/ai/BMAD-METHOD/src/modules/bmm ~/git/your-project/_bmad/bmm → ~/git/BMAD-METHOD/src/modules/bmm
``` ```
All changes from `feature/gap-analysis-dev-time` branch are **live and testable**. All changes from `feature/gap-analysis-dev-time` branch are **live and testable**.
@ -19,7 +19,7 @@ All changes from `feature/gap-analysis-dev-time` branch are **live and testable*
**Goal:** Verify gap analysis runs and proposes task updates **Goal:** Verify gap analysis runs and proposes task updates
```bash ```bash
cd ~/git/ai/platform cd ~/git/your-project
# Load PM or Dev agent # Load PM or Dev agent
# Run: # Run:
@ -247,7 +247,7 @@ Track these metrics:
## Rollback (If Issues Found) ## Rollback (If Issues Found)
```bash ```bash
cd ~/git/ai/platform/_bmad cd ~/git/your-project/_bmad
rm bmm rm bmm
mv bmm.backup bmm mv bmm.backup bmm

View File

@ -162,7 +162,7 @@ git checkout v6.0.0-alpha.21 -- src/modules/bmm/workflows/4-implementation/
git checkout v6.0.0-alpha.21 -- src/modules/bmgd/workflows/4-production/ git checkout v6.0.0-alpha.21 -- src/modules/bmgd/workflows/4-production/
# Reinstall in your project # Reinstall in your project
cd ~/git/ai/platform cd ~/git/your-project
rm -rf _bmad rm -rf _bmad
npx bmad-method@alpha install npx bmad-method@alpha install
``` ```

View File

@ -3,15 +3,15 @@
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</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}</critical>
<critical>🤖 AUTONOMOUS EPIC PROCESSING - Full automation of epic completion!</critical> <critical>🤖 AUTONOMOUS EPIC PROCESSING - Full automation of epic completion!</critical>
<critical>This workflow creates and develops ALL stories in an epic with minimal human intervention</critical> <critical>This workflow orchestrates create-story and super-dev-story for each story in an epic</critical>
<step n="1" goal="Initialize autonomous epic processing"> <step n="1" goal="Initialize and validate epic">
<output>🤖 **Autonomous Epic Processing** <output>🤖 **Autonomous Epic Processing**
This workflow will automatically: This workflow will automatically:
1. Create all stories in the epic (just-in-time planning) 1. Create each story just-in-time (using create-story)
2. Develop each story with comprehensive validation 2. Develop each story (using super-dev-story or dev-story)
3. Commit changes after each story 3. Commit and push after each story (integrated in super-dev)
4. Generate epic completion report 4. Generate epic completion report
**Time Estimate:** Varies by epic size **Time Estimate:** Varies by epic size
@ -20,22 +20,17 @@
- Large epic (11+ stories): 12-24 hours - Large epic (11+ stories): 12-24 hours
**Token Usage:** ~100K-150K per story **Token Usage:** ~100K-150K per story
- Uses super-dev-story by default (highest quality)
- Auto-accepts gap analysis (minimal prompts)
---
</output> </output>
<check if="{{epic_num}} provided by user"> <check if="{{epic_num}} provided">
<action>Use provided epic number</action> <action>Use provided epic number</action>
<goto anchor="validate_epic" /> <goto anchor="validate_epic" />
</check> </check>
<ask>Enter epic number to process (e.g., "2", "epic-3"), or [q] to quit:</ask> <ask>Enter epic number to process (e.g., "2" or "epic-3"), or [q] to quit:</ask>
<check if="user provides epic number"> <check if="user provides epic number">
<action>Parse epic number from input (handle "2", "epic-2", "Epic 2" formats)</action> <action>Parse epic number from input</action>
<action>Set {{epic_num}} to parsed number</action>
<goto anchor="validate_epic" /> <goto anchor="validate_epic" />
</check> </check>
@ -47,37 +42,8 @@
<anchor id="validate_epic" /> <anchor id="validate_epic" />
<action>Load {{sprint_status}} file</action> <action>Load {{sprint_status}} file</action>
<action>Find epic-{{epic_num}} entry in development_status</action> <action>Find epic-{{epic_num}} entry</action>
<action>Count stories by status (backlog, ready-for-dev, in-progress, review, done)</action>
<check if="epic not found in sprint status">
<output>❌ Epic {{epic_num}} not found in sprint-status.yaml
Available epics:
{{list_available_epics}}
Run sprint-planning to initialize sprint tracking.
</output>
<action>HALT</action>
</check>
<action>Get epic status from sprint-status</action>
<check if="epic status is 'done'">
<output>✅ Epic {{epic_num}} is already complete!
All stories marked done. Nothing to process.
</output>
<action>HALT</action>
</check>
<action>Count stories in epic (pattern: {{epic_num}}-*)</action>
<action>Count stories by status:
- backlog: Not yet created
- ready-for-dev: Created but not developed
- in-progress: Partially developed
- review: Developed, pending review
- done: Fully complete
</action>
<output> <output>
📊 **Epic {{epic_num}} Status** 📊 **Epic {{epic_num}} Status**
@ -86,294 +52,145 @@
- Backlog: {{backlog_count}} (will create + develop) - Backlog: {{backlog_count}} (will create + develop)
- Ready-for-dev: {{ready_count}} (will develop) - Ready-for-dev: {{ready_count}} (will develop)
- In-progress: {{inprogress_count}} (will resume) - In-progress: {{inprogress_count}} (will resume)
- Review: {{review_count}} (will skip - needs human review) - Review/Done: {{done_count}} (will skip)
- Done: {{done_count}} (will skip - already complete)
**Work Remaining:** {{backlog_count + ready_count + inprogress_count}} stories **Work Remaining:** {{work_count}} stories
**Estimated Time:** {{estimated_hours}} hours **Estimated Time:** {{estimated_hours}} hours
**Estimated Tokens:** ~{{estimated_tokens}}K **Estimated Tokens:** ~{{estimated_tokens}}K
</output> </output>
</step>
<step n="2" goal="Get user confirmation and settings">
<ask>**Proceed with autonomous processing?** <ask>**Proceed with autonomous processing?**
This will: [Y] Yes - Use super-dev-story (comprehensive validation)
- Process {{work_count}} stories automatically [D] Dev-story - Faster, less validation
- Use {{dev_workflow}} for development (super-dev-story or dev-story) [n] No - Cancel
- Create git commits after each story
- Take approximately {{estimated_hours}} hours
- Use approximately {{estimated_tokens}}K tokens
Options:
[Y] Yes - Start autonomous processing with default settings
[C] Custom - Let me configure settings first
[n] No - Cancel autonomous processing
</ask> </ask>
<check if="user approves with Y"> <check if="user says Y">
<action>Use default autonomous_settings from workflow.yaml</action> <action>Set {{dev_workflow}} = "super-dev-story"</action>
<output>✅ Starting autonomous epic processing with defaults...</output>
<goto anchor="create_branch" />
</check> </check>
<check if="user chooses Custom with C"> <check if="user says D">
<ask>Use super-dev-story (comprehensive validation) or dev-story (faster)? [super/dev]:</ask> <action>Set {{dev_workflow}} = "dev-story"</action>
<action>Store user choice as {{dev_workflow}}</action>
<ask>Auto-accept gap analysis refinements? [Y/n]:</ask>
<action>Store user choice as {{auto_accept_gap}}</action>
<ask>Create git commits after each story? [Y/n]:</ask>
<action>Store user choice as {{create_commits}}</action>
<ask>Halt on first error or continue? [halt/continue]:</ask>
<action>Store user choice as {{error_handling}}</action>
<output>✅ Custom settings configured. Starting autonomous processing...</output>
<goto anchor="create_branch" />
</check> </check>
<check if="user says no with n"> <check if="user says n">
<output>Autonomous epic processing cancelled.</output> <output>❌ Cancelled</output>
<action>HALT</action> <action>HALT</action>
</check> </check>
<anchor id="create_branch" />
</step> </step>
<step n="3" goal="Create git branch and initialize progress tracking"> <step n="2" goal="Create git branch and initialize tracking">
<check if="{{create_commits}} is true"> <action>Get current branch name</action>
<action>Check current git branch</action> <action>Create new branch: auto-epic-{{epic_num}}</action>
<action>Create new branch: {{git_branch_prefix}}{{epic_num}}</action> <output>📝 Created branch: auto-epic-{{epic_num}}</output>
<output>📝 Created git branch: {{git_branch_prefix}}{{epic_num}}</output>
</check>
<!-- Initialize progress tracking --> <action>Initialize progress tracking file:
<action>Create progress file: {{progress_file}}</action> - epic_num
<action>Write initial progress state: - started timestamp
epic_num: {{epic_num}} - total_stories
started: {{date}} - completed_stories: []
total_stories: {{total_story_count}} - current_story: null
completed_stories: [] - status: running
failed_stories: []
current_story: null
status: running
</action> </action>
<output>🚀 **Autonomous Epic Processing Started**
Epic: {{epic_num}}
Branch: {{git_branch_name}}
Progress tracking: {{progress_file}}
Processing {{work_count}} stories...
</output>
</step> </step>
<step n="4" goal="Process all stories in epic"> <step n="3" goal="Process all stories in epic">
<critical>🔄 STORY PROCESSING LOOP - Just-in-time planning + development</critical> <critical>🔄 STORY LOOP - Create and develop each story</critical>
<action>Load {{sprint_status}} file</action> <action>Find all stories in epic {{epic_num}} needing work</action>
<action>Find all stories in epic {{epic_num}} (pattern: {{epic_num}}-*)</action> <action>Sort by story number (ascending)</action>
<action>Sort stories by story number (ascending order)</action> <action>Initialize counters: success=0, failure=0</action>
<action>Filter to stories needing work (backlog, ready-for-dev, in-progress statuses)</action>
<action>Initialize {{story_counter}} = 0</action>
<action>Initialize {{success_count}} = 0</action>
<action>Initialize {{failure_count}} = 0</action>
<!-- STORY LOOP --> <!-- STORY LOOP -->
<loop foreach="{{stories_needing_work}}"> <loop foreach="{{stories_needing_work}}">
<action>Set {{current_story}} = current story from loop</action> <action>Set {{current_story}}</action>
<action>Increment {{story_counter}}</action>
<action>Update progress file with current_story</action>
<output> <output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Story {{story_counter}}/{{work_count}}: {{current_story.key}} Story {{counter}}/{{work_count}}: {{current_story.key}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Status: {{current_story.status}}
Started: {{current_time}}
</output> </output>
<!-- CREATE STORY IF NEEDED --> <!-- CREATE STORY IF NEEDED -->
<check if="current_story.status == 'backlog'"> <check if="status == 'backlog'">
<output>📝 Creating story {{current_story.key}}...</output> <output>📝 Creating story...</output>
<try> <try>
<action>Run create-story workflow for this story</action> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/create-story/workflow.yaml">
<action>Wait for story file to be created</action> <note>Create story just-in-time</note>
<output>✅ Story created: {{story_file}}</output> </invoke-workflow>
<output>✅ Story created</output>
</try> </try>
<catch> <catch>
<output>❌ Failed to create story {{current_story.key}} <output>❌ Failed to create story: {{error}}</output>
<action>Add to failed_stories, continue to next</action>
Error: {{error_message}} <continue />
</output>
<check if="{{halt_on_error}} is true">
<action>Update progress file with failure</action>
<output>🛑 Halting due to error (halt_on_error=true)</output>
<action>HALT</action>
</check>
<check if="{{halt_on_error}} is false">
<action>Add to {{failed_stories}} list</action>
<action>Increment {{failure_count}}</action>
<output>⏭️ Skipping to next story...</output>
<continue>Next story in loop</continue>
</check>
</catch> </catch>
</check> </check>
<!-- DEVELOP STORY --> <!-- DEVELOP STORY -->
<output>💻 Developing story {{current_story.key}} using {{dev_workflow}}...</output> <output>💻 Developing with {{dev_workflow}}...</output>
<try> <try>
<check if="{{dev_workflow}} == 'super-dev-story'"> <check if="{{dev_workflow}} == 'super-dev-story'">
<action>Run super-dev-story workflow with auto-accept mode enabled</action> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/super-dev-story/workflow.yaml">
<input name="story_file" value="{{current_story_file}}" />
<note>Includes: dev + post-gap + review + push-all</note>
</invoke-workflow>
</check> </check>
<check if="{{dev_workflow}} == 'dev-story'"> <check if="{{dev_workflow}} == 'dev-story'">
<action>Run dev-story workflow with auto-accept mode enabled</action> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/dev-story/workflow.yaml">
<input name="story_file" value="{{current_story_file}}" />
</invoke-workflow>
<!-- Push after dev-story -->
<invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/push-all/workflow.yaml">
<note>Commit and push story changes</note>
</invoke-workflow>
</check> </check>
<action>Wait for story to be marked "review"</action> <output>✅ Story complete and pushed</output>
<action>Increment success_count</action>
<output>✅ Story {{current_story.key}} completed <action>Update progress file</action>
Status: review
Tasks completed: {{task_count}}
Files changed: {{file_count}}
Time: {{elapsed_time}}
</output>
<!-- RUN PUSH-ALL WORKFLOW -->
<output>📝 Running push-all to commit and push story changes...</output>
<try>
<action>Run push-all workflow with auto-accept mode:</action>
<action>- Safety checks run automatically</action>
<action>- Generate commit message based on story</action>
<action>- Commit with message: "feat(epic-{{epic_num}}): complete story {{current_story.key}} - {{story_title}}"</action>
<action>- Push to remote automatically</action>
<output>✅ Pushed to remote: {{commit_hash}}</output>
</try>
<catch>
<output>⚠️ Push-all failed for story {{current_story.key}}
Error: {{push_error}}
Story is complete but not pushed to remote yet.
You can push manually later.
</output>
<check if="{{halt_on_error}} is true">
<output>🛑 Halting due to push error (halt_on_error=true)</output>
<action>Update progress file with failure</action>
<action>HALT</action>
</check>
<action>Note: Story complete locally, push failed - continuing...</action>
</catch>
<action>Increment {{success_count}}</action>
<action>Add to progress file completed_stories list</action>
<action>Update progress file with success</action>
</try> </try>
<catch> <catch>
<output>❌ Failed to develop story {{current_story.key}} <output>❌ Story failed: {{error}}</output>
<action>Add to failed_stories, continue</action>
Error: {{error_message}} <action>Increment failure_count</action>
Attempt: {{retry_count}}/{{max_retry_per_story}}
</output>
<check if="{{retry_count}} < {{max_retry_per_story}}">
<output>🔄 Retrying story {{current_story.key}}...</output>
<action>Increment {{retry_count}}</action>
<retry>Retry this story</retry>
</check>
<check if="{{retry_count}} >= {{max_retry_per_story}}">
<output>⚠️ Max retries reached for story {{current_story.key}}</output>
<check if="{{halt_on_error}} is true">
<action>Update progress file with failure and halt</action>
<output>🛑 Halting due to repeated errors (halt_on_error=true)</output>
<action>HALT</action>
</check>
<check if="{{halt_on_error}} is false">
<action>Add to {{failed_stories}} list</action>
<action>Increment {{failure_count}}</action>
<output>⏭️ Skipping to next story...</output>
<continue>Next story in loop</continue>
</check>
</check>
</catch> </catch>
<!-- Progress update --> <output>Progress: {{success_count}} ✅ | {{failure_count}} ❌ | {{remaining}} pending</output>
<output>
Progress: {{success_count}} ✅ | {{failure_count}} ❌ | {{remaining_count}} pending
</output>
</loop> </loop>
<!-- After all stories processed -->
<action>Update progress file status: complete</action> <action>Update progress file status: complete</action>
</step> </step>
<step n="5" goal="Epic completion and reporting"> <step n="4" goal="Epic completion and reporting">
<critical>📊 EPIC COMPLETE - Generate completion report</critical>
<action>Load all completed story files from this epic</action>
<action>Aggregate statistics:
- Total files created/modified
- Total test coverage
- Total code review issues found and fixed
- Total development time
- Success rate
</action>
<action>Generate epic completion report: {{story_dir}}/epic-{{epic_num}}-completion-report.md</action>
<output> <output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎉 EPIC {{epic_num}} AUTONOMOUS PROCESSING COMPLETE! 🎉 EPIC {{epic_num}} COMPLETE!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Results:** **Results:**
✅ Stories completed: {{success_count}}/{{total_story_count}} ✅ Stories completed: {{success_count}}/{{total_count}}
{{if_failures}} {{if_failures}}❌ Stories failed: {{failure_count}}{{endif}}
❌ Stories failed: {{failure_count}}
{{list_failed_stories_with_reasons}} **Branch:** auto-epic-{{epic_num}}
**All changes pushed to remote**
{{if_all_success}}
**Epic {{epic_num}} marked complete in sprint-status.yaml**
{{endif}} {{endif}}
**Statistics:**
- Total development time: {{total_time}}
- Files created/modified: {{total_files}}
- Test coverage achieved: {{avg_coverage}}%
- Code review issues found: {{total_issues}}
- Code review issues fixed: {{total_fixes}}
**Git Branch:** {{git_branch_name}}
**Commits:** {{commit_count}}
**Completion Report:** {{report_file}}
---
**Next Steps:** **Next Steps:**
1. Review the completion report 1. Review the work on branch auto-epic-{{epic_num}}
2. Manually review/fix any failed stories 2. Run human code review
3. Run human code review on the branch 3. Merge when approved
4. Merge {{git_branch_name}} when approved
{{if_failures}} {{if_failures}}
**Failed Stories Need Attention:** **Failed Stories Need Attention:**
@ -381,61 +198,11 @@
{{endif}} {{endif}}
</output> </output>
<!-- Update sprint status --> <check if="{{success_count}} == {{total_count}}">
<check if="{{success_count}} == {{total_story_count}}"> <action>Update sprint-status: epic-{{epic_num}} = "done"</action>
<action>Load {{sprint_status}} file</action>
<action>Update epic-{{epic_num}} status to "done"</action>
<output>✅ Epic {{epic_num}} marked complete in sprint-status.yaml</output>
</check> </check>
<check if="{{failure_count}} > 0"> <action>Remove progress file</action>
<output> Epic {{epic_num}} partially complete - some stories failed.
Epic status remains "in-progress" until failed stories resolved.
</output>
</check>
<!-- Final git operations -->
<check if="{{create_commits}} is true">
<output>📝 All changes committed to branch: {{git_branch_name}}
To merge:
git checkout main
git merge {{git_branch_name}}
Or create PR:
gh pr create --base main --head {{git_branch_name}}
</output>
</check>
</step>
<step n="6" goal="Cleanup and user support">
<action>Remove progress file (no longer needed)</action>
<ask>Would you like explanations about:
- How autonomous processing works
- What was implemented in this epic
- Why any stories failed
- How to review and merge the work
- Anything else?
[Enter topic or 'n' to skip]
</ask>
<check if="user asks for explanations">
<action>Provide clear explanations about requested topics</action>
<action>Reference specific stories, code, or decisions</action>
</check>
<output>💡 **Tips for Future Autonomous Processing:**
- Use super-dev-story for critical epics (higher quality, more tokens)
- Use dev-story for experimental epics (faster, fewer tokens)
- Review completion report for patterns and improvements
- Failed stories often indicate unclear requirements
- Monitor token usage and adjust epic size accordingly
**Epic {{epic_num}} processing complete, {user_name}!**
</output>
</step> </step>
</workflow> </workflow>

View File

@ -4,43 +4,60 @@
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</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>Generate all documents in {document_output_language}</critical>
<critical>🚀 SUPER-DEV MODE: Enhanced quality workflow with post-implementation validation and automated code review</critical> <critical>🚀 SUPER-DEV MODE: Enhanced quality workflow with post-implementation validation and automated code review</critical>
<critical>This workflow ensures stories are TRULY complete through multi-stage validation before marking done</critical> <critical>This workflow orchestrates existing workflows with additional validation steps</critical>
<critical>⚙️ EXECUTION FLOW: First execute ALL dev-story steps (1-8), then continue with super-dev enhancements (9.5-9.6)</critical>
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- STEPS 1-8: STANDARD DEV-STORY WORKFLOW --> <!-- STEP 1: INVOKE STANDARD DEV-STORY WORKFLOW -->
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<critical>🎯 EXECUTE DEV-STORY STEPS 1-8 FIRST</critical> <step n="1" goal="Execute standard dev-story workflow">
<critical>Follow all instructions in: {project-root}/_bmad/bmgd/workflows/4-production/dev-story/instructions.xml</critical> <critical>🎯 RUN DEV-STORY - Complete all standard development steps</critical>
<critical>Complete Steps 1 through 8 exactly as specified in dev-story workflow</critical> <note>This includes: story loading, pre-dev gap analysis, development, testing, and task completion</note>
<critical>After Step 8 completes (all tasks checked), return here and continue with Step 9.5 below</critical>
<note>⚙️ Super-dev-story includes ALL standard dev-story steps (1-8): <output>🚀 **Super-Dev-Story: Enhanced Quality Workflow**
**Standard Development Flow:** Running standard dev-story workflow (Steps 1-8)...
- Step 1: Find and load story (sprint-status or user-provided path)
- Step 1.5: ✅ PRE-DEV GAP ANALYSIS - Validate tasks against codebase
- Step 2: Load project context and story information
- Step 3: Detect review continuation (if resuming after code-review)
- Step 4: Mark story in-progress in sprint-status
- Step 5: Implement task following red-green-refactor cycle (TDD)
- Step 6: Author comprehensive tests (unit, integration, e2e)
- Step 7: Run validations and tests (regression suite)
- Step 8: Validate and mark task complete (strict gates)
After completing Steps 1-8, super-dev mode adds ADDITIONAL quality validation below. This includes:
✅ Story loading and validation
✅ Pre-dev gap analysis
✅ TDD implementation cycle
✅ Comprehensive testing
✅ Task completion validation
**For complete details of Steps 1-8, see:** {project-root}/_bmad/bmgd/workflows/4-production/dev-story/instructions.xml After dev-story completes, super-dev will add:
</note> ✅ Post-dev gap analysis
✅ Automated code review
✅ Auto push-all
</output>
<invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/dev-story/workflow.yaml">
<input name="story_file" value="{{story_file}}" />
<note>Pass through any user-provided story file path</note>
</invoke-workflow>
<check if="dev-story completed successfully">
<output>✅ Dev-story complete - all tasks implemented and tested
Proceeding to super-dev enhancements...
</output>
</check>
<check if="dev-story failed or halted">
<output>❌ Dev-story did not complete successfully
Cannot proceed with super-dev enhancements.
Fix issues and retry.
</output>
<action>HALT - dev-story must complete first</action>
</check>
</step>
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- SUPER-DEV ENHANCEMENTS: POST-IMPLEMENTATION VALIDATION --> <!-- STEP 2: POST-DEV GAP ANALYSIS -->
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- SUPER-DEV ENHANCEMENTS START HERE --> <step n="2" goal="Post-development gap analysis">
<step n="9.5" goal="Post-development gap analysis">
<critical>🔍 POST-DEV VALIDATION - Verify all work actually completed!</critical> <critical>🔍 POST-DEV VALIDATION - Verify all work actually completed!</critical>
<note>This catches incomplete implementations that were prematurely marked done</note> <note>This catches incomplete implementations that were prematurely marked done</note>
@ -51,8 +68,8 @@
</output> </output>
<!-- Re-scan codebase with fresh eyes --> <!-- Re-scan codebase with fresh eyes -->
<action>Re-read story requirements and acceptance criteria</action> <action>Re-read story file to get requirements and tasks</action>
<action>Extract all tasks and subtasks that are marked [x] complete</action> <action>Extract all tasks marked [x] complete</action>
<action>For each completed task, identify what should exist in codebase</action> <action>For each completed task, identify what should exist in codebase</action>
<!-- SCAN PHASE --> <!-- SCAN PHASE -->
@ -77,52 +94,29 @@
- Note partial implementations marked as complete - Note partial implementations marked as complete
</action> </action>
<action>⚠️ Quality Issues:
- Implementations that exist but don't meet requirements
- Tests that exist but have poor coverage
- Code that works but violates architecture patterns
</action>
<!-- DECISION PHASE --> <!-- DECISION PHASE -->
<check if="false positives found OR quality issues found"> <check if="false positives found">
<output> <output>
⚠️ **Post-Dev Gaps Detected!** ⚠️ **Post-Dev Gaps Detected!**
**False Positives (marked done but not complete):** **Tasks marked complete but implementation incomplete:**
{{list_false_positives_with_details}} {{list_false_positives_with_details}}
**Quality Issues:**
{{list_quality_issues_with_details}}
**Proposed Actions:**
{{list_tasks_to_add_for_missing_work}}
---
These issues must be addressed before story can be marked complete. These issues must be addressed before story can be marked complete.
</output> </output>
<action>Uncheck false positive tasks in story file</action> <action>Uncheck false positive tasks in story file</action>
<action>Add new tasks for missing work to Tasks/Subtasks section</action> <action>Add new tasks for missing work</action>
<action>Add note to Dev Agent Record: "Post-dev gap analysis found incomplete work - continuing implementation"</action>
<action>Update Gap Analysis section with post-dev findings</action> <action>Update Gap Analysis section with post-dev findings</action>
<action>Set {{fix_iteration_count}} = {{fix_iteration_count}} + 1</action>
<check if="{{fix_iteration_count}} > {{max_fix_iterations}}"> <output>🔄 Re-invoking dev-story to complete missing work...</output>
<output>🛑 **Maximum Fix Iterations Reached**
Attempted {{fix_iteration_count}} fix cycles. <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/dev-story/workflow.yaml">
Manual intervention required. <input name="story_file" value="{{story_file}}" />
<note>Resume with added tasks for missing work</note>
</invoke-workflow>
Issues remaining: <output>✅ Missing work completed. Proceeding to code review...</output>
{{list_remaining_issues}}
</output>
<action>Add to Dev Agent Record: "HALTED - exceeded max fix iterations, manual review needed"</action>
<action>HALT - require user intervention</action>
</check>
<output>🔄 Adding missing work to task list and continuing implementation...</output>
<goto step="5">Continue implementation with added tasks</goto>
</check> </check>
<check if="no gaps found"> <check if="no gaps found">
@ -132,13 +126,15 @@
Proceeding to code review... Proceeding to code review...
</output> </output>
<action>Update Gap Analysis section with post-dev verification results</action> <action>Update Gap Analysis section with post-dev verification results</action>
<action>Continue to Step 9.6</action>
</check> </check>
</step> </step>
<step n="9.6" goal="Automated code review"> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- STEP 3: AUTOMATED CODE REVIEW -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<step n="3" goal="Automated code review">
<critical>👀 AUTO CODE REVIEW - Independent quality validation</critical> <critical>👀 AUTO CODE REVIEW - Independent quality validation</critical>
<note>Fresh perspective catches issues the dev agent might miss</note>
<output> <output>
🔍 **Running Automated Code Review** 🔍 **Running Automated Code Review**
@ -146,107 +142,56 @@
Analyzing implementation for issues... Analyzing implementation for issues...
</output> </output>
<!-- Identify files to review --> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/code-review/workflow.yaml">
<action>Extract File List from Dev Agent Record</action> <input name="story_file" value="{{story_file}}" />
<action>Identify all files created or modified during implementation</action> <note>Run code review on completed story</note>
</invoke-workflow>
<!-- REVIEW PHASE: Use code-review workflow logic --> <action>Parse code review results from story file "Code Review" section</action>
<action>Perform comprehensive code review checking:</action> <action>Extract issues by severity (Critical, High, Medium, Low)</action>
<action>- **Correctness:** Logic errors, edge cases, error handling</action> <action>Count total issues found</action>
<action>- **Architecture:** Compliance with patterns and standards</action>
<action>- **Security:** Vulnerabilities, input validation, authentication</action>
<action>- **Performance:** Inefficiencies, N+1 queries, memory leaks</action>
<action>- **Testing:** Test coverage, edge cases, test quality</action>
<action>- **Code Quality:** Readability, maintainability, documentation</action>
<!-- CATEGORIZE FINDINGS --> <check if="critical or high severity issues found">
<action>Categorize all findings by severity:</action> <output>🚨 **Code Review Found Issues Requiring Fixes**
<action>- CRITICAL: Security vulnerabilities, data loss, broken functionality</action>
<action>- HIGH: Logic errors, missing error handling, test gaps</action>
<action>- MEDIUM: Code quality issues, minor bugs, performance concerns</action>
<action>- LOW: Style issues, documentation improvements, minor refactoring</action>
<!-- DECISION PHASE --> Issues found: {{total_issue_count}}
<check if="CRITICAL or HIGH severity issues found"> - Critical: {{critical_count}}
<output> - High: {{high_count}}
🚨 **Code Review Found Issues Requiring Fixes** - Medium: {{medium_count}}
- Low: {{low_count}}
**Critical Issues ({{critical_count}}):** Adding review findings to story tasks and re-running dev-story...
{{list_critical_issues}}
**High Priority Issues ({{high_count}}):**
{{list_high_issues}}
{{if_medium_or_low_exist}}
**Medium/Low Issues ({{med_low_count}}):**
{{list_medium_low_issues}}
{{endif}}
---
**These issues must be fixed before story completion.**
</output> </output>
<action>Add "Code Review Findings" section to story file</action> <action>Add code review findings as tasks in story file</action>
<action>Add review findings as new tasks in Tasks/Subtasks with [AI-Review] prefix</action>
<action>Add to Dev Agent Record: "Code review found {{total_issue_count}} issues - continuing with fixes"</action>
<action>Set {{fix_iteration_count}} = {{fix_iteration_count}} + 1</action>
<check if="{{fix_iteration_count}} > {{max_fix_iterations}}"> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/dev-story/workflow.yaml">
<output>🛑 **Maximum Fix Iterations Reached** <input name="story_file" value="{{story_file}}" />
<note>Fix code review issues</note>
</invoke-workflow>
Code review found issues on iteration {{fix_iteration_count}}. <output>✅ Code review issues resolved. Proceeding to push...</output>
Manual review recommended.
Issues found:
{{list_all_issues}}
</output>
<action>Add to Dev Agent Record: "HALTED - code review issues after max iterations, manual review needed"</action>
<action>HALT - require user intervention</action>
</check>
<output>🔧 Adding review findings to task list and implementing fixes...</output>
<goto step="5">Implement fixes</goto>
</check> </check>
<check if="only MEDIUM or LOW severity issues found"> <check if="only medium or low issues found">
<output> <output> **Code Review Found Minor Issues**
**Code Review Found Minor Issues**
**Medium Issues ({{medium_count}}):** - Medium: {{medium_count}}
{{list_medium_issues}} - Low: {{low_count}}
**Low Priority Issues ({{low_count}}):**
{{list_low_issues}}
---
</output> </output>
<ask>Auto-fix these minor issues? <ask>Auto-fix these minor issues? [Y/n/skip]:</ask>
Options:
[Y] Yes - Add to task list and fix now
[n] No - Document in story but don't fix (can address later)
[s] Skip - Ignore these findings
</ask>
<check if="user approves Y"> <check if="user approves Y">
<action>Add review findings as tasks with [AI-Review] prefix</action> <action>Add review findings as tasks</action>
<action>Add to Dev Agent Record: "Addressing {{issue_count}} minor code review findings"</action> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/dev-story/workflow.yaml">
<output>🔧 Implementing minor fixes...</output> <input name="story_file" value="{{story_file}}" />
<goto step="5">Implement fixes</goto> </invoke-workflow>
</check> </check>
<check if="user says n"> <check if="user says skip">
<action>Add "Code Review Findings" section documenting issues</action> <action>Document issues in story file</action>
<action>Add to Dev Agent Record: "Code review found {{issue_count}} minor issues - documented for future work"</action> <output> Minor issues documented. Proceeding to push...</output>
<output> Issues documented in story. Proceeding to completion...</output>
<action>Continue to Step 9</action>
</check>
<check if="user says s">
<output>⚠️ Skipping minor issues. Proceeding to completion...</output>
<action>Continue to Step 9</action>
</check> </check>
</check> </check>
@ -254,81 +199,55 @@
<output>✅ **Code Review Passed** <output>✅ **Code Review Passed**
No issues found. Implementation meets quality standards. No issues found. Implementation meets quality standards.
Proceeding to push...
</output> </output>
<action>Add to Dev Agent Record: "Code review completed - no issues found"</action>
<action>Continue to Step 9</action>
</check> </check>
</step> </step>
<step n="9" goal="Story completion and mark for review" tag="sprint-status"> <!-- ═══════════════════════════════════════════════════════════════ -->
<critical>🎯 FINAL VALIDATION - All quality gates must pass!</critical> <!-- STEP 4: PUSH ALL CHANGES -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<action>Verify ALL tasks and subtasks are marked [x] (re-scan the story document now)</action> <step n="4" goal="Commit and push all changes">
<action>Run the full regression suite (do not skip)</action> <critical>📝 PUSH-ALL - Stage, commit, and push with safety validation</critical>
<action>Confirm File List includes every changed file</action>
<action>Execute enhanced definition-of-done validation</action>
<!-- Enhanced Definition of Done for Super-Dev --> <output>📝 **Committing and Pushing Story Changes**
<action>Validate super-dev quality gates:
- ✅ Pre-dev gap analysis completed and approved
- ✅ All tasks/subtasks marked complete with [x]
- ✅ Implementation satisfies every Acceptance Criterion
- ✅ All tests pass (no regressions, new tests successful)
- ✅ Post-dev gap analysis passed (no false positives)
- ✅ Code review completed (critical/high issues resolved)
- ✅ File List includes every new/modified/deleted file
- ✅ Dev Agent Record contains implementation notes
- ✅ Change Log includes summary of changes
</action>
<action>Update the story Status to: "review"</action> Running push-all workflow with safety checks...
</output>
<!-- Mark story ready for review - sprint status conditional --> <invoke-workflow path="{project-root}/_bmad/bmgd/workflows/4-production/push-all/workflow.yaml">
<check if="{sprint_status} file exists AND {{current_sprint_status}} != 'no-sprint-tracking'"> <note>Commit and push all story changes</note>
<action>Load the FULL file: {sprint_status}</action> </invoke-workflow>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "in-progress" (expected previous state)</action> <check if="push-all succeeded">
<action>Update development_status[{{story_key}}] = "review"</action> <output>✅ Changes pushed to remote successfully</output>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<output>✅ Story status updated to "review" in sprint-status.yaml</output>
</check> </check>
<check if="{sprint_status} file does NOT exist OR {{current_sprint_status}} == 'no-sprint-tracking'"> <check if="push-all failed">
<output> Story status updated to "review" in story file (no sprint tracking configured)</output> <output>⚠️ Push failed but story is complete locally
</check>
<!-- Final validation gates --> You can push manually when ready.
<action if="any task is incomplete">HALT - Complete remaining tasks before marking ready for review</action> </output>
<action if="regression failures exist">HALT - Fix regression issues before completing</action> </check>
<action if="File List is incomplete">HALT - Update File List with all changed files</action>
<action if="post-dev gap analysis not completed">HALT - Run post-dev validation before completing</action>
<action if="code review not completed">HALT - Run code review before completing</action>
</step> </step>
<step n="10" goal="Super-dev completion communication"> <!-- ═══════════════════════════════════════════════════════════════ -->
<action>Prepare comprehensive summary in Dev Agent Record → Completion Notes</action> <!-- STEP 5: COMPLETION -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<step n="5" goal="Super-dev completion summary">
<output>🎉 **SUPER-DEV STORY COMPLETE, {user_name}!** <output>🎉 **SUPER-DEV STORY COMPLETE, {user_name}!**
**Story:** {{story_key}} - {{story_title}}
**Status:** review (ready for human review)
---
**Quality Gates Passed:** **Quality Gates Passed:**
✅ Pre-dev gap analysis - Tasks validated before work started ✅ Pre-dev gap analysis - Tasks validated before work
✅ Development - All tasks completed with TDD ✅ Development - All tasks completed with TDD
✅ Post-dev gap analysis - Implementation verified complete ✅ Post-dev gap analysis - Implementation verified
✅ Code review - {{total_issues_found}} issues found and resolved ✅ Code review - Quality and security validated
✅ All tests passing - No regressions ✅ Pushed to remote - Changes backed up
**Implementation Summary:**
- Files changed: {{file_count}}
- Tests added: {{test_count}}
- Issues fixed: {{review_issues_fixed}}
- Fix iterations: {{fix_iteration_count}}/{{max_fix_iterations}}
**Story File:** {{story_file}} **Story File:** {{story_file}}
**Status:** review (ready for human review)
--- ---
@ -337,7 +256,7 @@
2. 💻 Implementation completed per requirements 2. 💻 Implementation completed per requirements
3. ✅ No false positive completions (all work verified) 3. ✅ No false positive completions (all work verified)
4. 👀 Code quality and security validated 4. 👀 Code quality and security validated
5. 🧪 Comprehensive test coverage achieved 5. 📝 Changes committed and pushed to remote
**Next Steps:** **Next Steps:**
- Review the completed story - Review the completed story
@ -348,343 +267,17 @@
It should require minimal human review. It should require minimal human review.
</output> </output>
<action>Based on {user_skill_level}, ask if user needs any explanations about: <action>Based on {user_skill_level}, ask if user needs explanations about implementation, decisions, or findings</action>
- What was implemented and how it works
- Why certain technical decisions were made
- Gap analysis or code review findings
- Any patterns, libraries, or approaches used
</action>
<check if="user asks for explanations"> <check if="user asks for explanations">
<action>Provide clear, contextual explanations tailored to {user_skill_level}</action> <action>Provide clear, contextual explanations</action>
<action>Use examples and references to specific code when helpful</action>
</check> </check>
<output>💡 **Tip:** This story was developed with super-dev-story for enhanced quality. <output>💡 **Tip:** This story was developed with super-dev-story for enhanced quality.
For faster development (fewer validations), use standard `dev-story` workflow. For faster development, use standard `dev-story` workflow.
For maximum quality and fewer review cycles, continue using `super-dev-story`. For maximum quality, continue using `super-dev-story`.
</output> </output>
</step> </step>
<step n="11" goal="Commit and push all changes">
<critical>📝 PUSH-ALL - Stage, commit, and push all changes with safety validation</critical>
<note>⚠️ Use with caution - commits ALL changes in repository</note>
<output>🔄 **Analyzing Repository Changes**
Scanning for changes to commit and push...
</output>
<!-- ANALYZE CHANGES PHASE -->
<action>Run git commands in parallel:</action>
<action>- git status - Show modified/added/deleted/untracked files</action>
<action>- git diff --stat - Show change statistics</action>
<action>- git log -1 --oneline - Show recent commit for message style</action>
<action>- git branch --show-current - Confirm current branch</action>
<action>Parse git status output to identify:
- Modified files
- Added files
- Deleted files
- Untracked files
- Total insertion/deletion counts
</action>
<!-- SAFETY CHECKS PHASE -->
<critical>🔒 SAFETY VALIDATION - Check for secrets, large files, and unwanted artifacts</critical>
<action>Scan all changed files for dangerous patterns:</action>
**Secret Detection:**
<action>Check for files matching secret patterns:
- .env*, *.key, *.pem, credentials.json, secrets.yaml
- id_rsa, *.p12, *.pfx, *.cer
- Any file containing: _API_KEY=, _SECRET=, _TOKEN= with real values
</action>
<action>Validate API keys are placeholders only:</action>
<action>✅ Acceptable: API_KEY=your-api-key-here, SECRET=placeholder, TOKEN=xxx, API_KEY=${'{YOUR_KEY}'}</action>
<action>❌ BLOCK: OPENAI_API_KEY=sk-proj-*, AWS_SECRET_KEY=AKIA*, STRIPE_API_KEY=sk_live_*</action>
**File Size Check:**
<action>Check for files >10MB without Git LFS</action>
**Build Artifacts:**
<action>Check for unwanted directories/files:
- node_modules/, dist/, build/, __pycache__/, *.pyc, .venv/
- .DS_Store, thumbs.db, *.swp, *.tmp
</action>
**Git State:**
<action>Verify:
- .gitignore properly configured
- No merge conflicts
- Repository initialized
</action>
<!-- SAFETY DECISION -->
<check if="secrets detected OR real API keys found">
<output>🚨 **DANGER: Secrets Detected!**
The following sensitive data was found:
{{list_detected_secrets}}
❌ **BLOCKED:** Cannot commit secrets to version control.
**Actions Required:**
1. Move secrets to .env file
2. Add .env to .gitignore
3. Use environment variables in code
4. Remove secrets from tracked files
Halting push-all workflow.
</output>
<action>HALT - Cannot proceed with secrets in changeset</action>
</check>
<check if="large files detected without Git LFS">
<output>⚠️ **Warning: Large Files Detected**
Files >10MB found:
{{list_large_files}}
**Recommendation:** Use Git LFS for large files
Continue anyway? [y/n]:
</output>
<ask>Proceed with large files? [y/n]:</ask>
<check if="user says n">
<output>Halting push-all. Please set up Git LFS for large files.</output>
<action>HALT</action>
</check>
</check>
<check if="build artifacts detected">
<output>⚠️ **Warning: Build Artifacts Detected**
Should not be committed:
{{list_build_artifacts}}
**These should be in .gitignore**
Continue anyway? [y/n]:
</output>
<ask>Proceed despite build artifacts? [y/n]:</ask>
<check if="user says n">
<output>Halting push-all. Update .gitignore to exclude build artifacts.</output>
<action>HALT</action>
</check>
</check>
<check if="current branch is main or master">
<output>⚠️ **Warning: Pushing to {{branch_name}}**
You're on the main/master branch. Consider:
- Creating a feature branch
- Opening a PR for review
Continue pushing to {{branch_name}}? [y/n]:
</output>
<ask>Push directly to {{branch_name}}? [y/n]:</ask>
<check if="user says n">
<output>Halting push-all. Create a feature branch instead.</output>
<action>HALT</action>
</check>
</check>
<!-- PRESENT SUMMARY AND GET CONFIRMATION -->
<output>
📊 **Changes Summary**
**Files:**
- Modified: {{modified_count}}
- Added: {{added_count}}
- Deleted: {{deleted_count}}
- Untracked: {{untracked_count}}
**Changes:**
- Insertions: +{{insertion_count}}
- Deletions: -{{deletion_count}}
**Safety Checks:**
{{if_all_safe}}
✅ No secrets detected
✅ No large files
✅ No build artifacts
✅ .gitignore configured
{{endif}}
{{if_warnings}}
⚠️ {{warning_list}}
{{endif}}
**Git:**
- Branch: {{current_branch}} → origin/{{current_branch}}
- Last commit: {{last_commit}}
---
**I will execute:**
1. git add .
2. git commit -m "[generated message]"
3. git push
</output>
<ask>**Proceed with commit and push?**
Type 'yes' to proceed, 'no' to cancel, or 'review' to see detailed diff:
</ask>
<check if="user says review">
<action>Run: git diff --stat</action>
<action>Show detailed file changes</action>
<ask>Still proceed with commit and push? [yes/no]:</ask>
</check>
<check if="user says no">
<output>❌ Push-all cancelled. Changes remain unstaged.
You can commit manually when ready.
</output>
<action>HALT - User cancelled</action>
</check>
<check if="user says yes">
<!-- STAGE ALL CHANGES -->
<action>Execute: git add .</action>
<action>Execute: git status</action>
<output>✅ All changes staged</output>
<!-- GENERATE COMMIT MESSAGE -->
<action>Analyze changes to determine commit type and scope:</action>
<action>- feat: New feature implementation</action>
<action>- fix: Bug fixes</action>
<action>- docs: Documentation updates</action>
<action>- refactor: Code restructuring</action>
<action>- test: Test additions/updates</action>
<action>- chore: Tooling, configs, dependencies</action>
<action>Generate commit message in conventional commit format:</action>
<action>Format:
[type](optional scope): Brief summary (max 72 chars)
- Key change 1
- Key change 2
- Key change 3
</action>
<action>Base message on:
- Story title and key
- Files changed
- Acceptance criteria met
- Recent commit style
</action>
<output>📝 **Generated Commit Message:**
```
{{generated_commit_message}}
```
</output>
<ask>Use this commit message? [yes/edit/cancel]:</ask>
<check if="user says edit">
<ask>Enter your commit message:</ask>
<action>Use user-provided message as {{commit_message}}</action>
</check>
<check if="user says cancel">
<output>❌ Push-all cancelled. Changes remain staged.
Run: git reset to unstage
</output>
<action>HALT</action>
</check>
<check if="user says yes">
<action>Set {{commit_message}} = {{generated_commit_message}}</action>
</check>
<!-- COMMIT CHANGES -->
<action>Execute git commit with message:
git commit -m "$(cat &lt;&lt;'EOF'
{{commit_message}}
EOF
)"
</action>
<check if="commit fails">
<output>❌ Commit failed
Error: {{commit_error}}
Common issues:
- Pre-commit hooks failing
- Missing git config (user.name/email)
- Locked files
Fix the issue and try again.
</output>
<action>HALT - Fix errors before proceeding</action>
</check>
<output>✅ Commit created: {{commit_hash}}</output>
<!-- PUSH CHANGES -->
<action>Execute: git push</action>
<check if="push fails with non-fast-forward">
<output>⚠️ Push rejected - remote has changes
Attempting: git pull --rebase && git push
</output>
<action>Execute: git pull --rebase</action>
<action>Execute: git push</action>
</check>
<check if="push fails with no upstream branch">
<output> No upstream branch set
Executing: git push -u origin {{current_branch}}
</output>
<action>Execute: git push -u origin {{current_branch}}</action>
</check>
<check if="push fails with other error">
<output>❌ Push failed
Error: {{push_error}}
Your changes are committed locally but not pushed.
You can push manually later with: git push
</output>
<action>HALT - Manual push required</action>
</check>
<!-- SUCCESS -->
<output>✅ **Successfully Pushed to Remote!**
**Commit:** {{commit_hash}} - {{commit_subject}}
**Branch:** {{current_branch}} → origin/{{current_branch}}
**Files changed:** {{file_count}} (+{{insertions}}, -{{deletions}})
**Story work is now on remote and ready for team review.**
</output>
<action>Execute: git log -1 --oneline --decorate</action>
<output>
Final commit: {{git_log_output}}
</output>
</check>
</step>
</workflow> </workflow>

View File

@ -3,15 +3,15 @@
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</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}</critical>
<critical>🤖 AUTONOMOUS EPIC PROCESSING - Full automation of epic completion!</critical> <critical>🤖 AUTONOMOUS EPIC PROCESSING - Full automation of epic completion!</critical>
<critical>This workflow creates and develops ALL stories in an epic with minimal human intervention</critical> <critical>This workflow orchestrates create-story and super-dev-story for each story in an epic</critical>
<step n="1" goal="Initialize autonomous epic processing"> <step n="1" goal="Initialize and validate epic">
<output>🤖 **Autonomous Epic Processing** <output>🤖 **Autonomous Epic Processing**
This workflow will automatically: This workflow will automatically:
1. Create all stories in the epic (just-in-time planning) 1. Create each story just-in-time (using create-story)
2. Develop each story with comprehensive validation 2. Develop each story (using super-dev-story or dev-story)
3. Commit changes after each story 3. Commit and push after each story (integrated in super-dev)
4. Generate epic completion report 4. Generate epic completion report
**Time Estimate:** Varies by epic size **Time Estimate:** Varies by epic size
@ -20,22 +20,17 @@
- Large epic (11+ stories): 12-24 hours - Large epic (11+ stories): 12-24 hours
**Token Usage:** ~100K-150K per story **Token Usage:** ~100K-150K per story
- Uses super-dev-story by default (highest quality)
- Auto-accepts gap analysis (minimal prompts)
---
</output> </output>
<check if="{{epic_num}} provided by user"> <check if="{{epic_num}} provided">
<action>Use provided epic number</action> <action>Use provided epic number</action>
<goto anchor="validate_epic" /> <goto anchor="validate_epic" />
</check> </check>
<ask>Enter epic number to process (e.g., "2", "epic-3"), or [q] to quit:</ask> <ask>Enter epic number to process (e.g., "2" or "epic-3"), or [q] to quit:</ask>
<check if="user provides epic number"> <check if="user provides epic number">
<action>Parse epic number from input (handle "2", "epic-2", "Epic 2" formats)</action> <action>Parse epic number from input</action>
<action>Set {{epic_num}} to parsed number</action>
<goto anchor="validate_epic" /> <goto anchor="validate_epic" />
</check> </check>
@ -47,37 +42,8 @@
<anchor id="validate_epic" /> <anchor id="validate_epic" />
<action>Load {{sprint_status}} file</action> <action>Load {{sprint_status}} file</action>
<action>Find epic-{{epic_num}} entry in development_status</action> <action>Find epic-{{epic_num}} entry</action>
<action>Count stories by status (backlog, ready-for-dev, in-progress, review, done)</action>
<check if="epic not found in sprint status">
<output>❌ Epic {{epic_num}} not found in sprint-status.yaml
Available epics:
{{list_available_epics}}
Run sprint-planning to initialize sprint tracking.
</output>
<action>HALT</action>
</check>
<action>Get epic status from sprint-status</action>
<check if="epic status is 'done'">
<output>✅ Epic {{epic_num}} is already complete!
All stories marked done. Nothing to process.
</output>
<action>HALT</action>
</check>
<action>Count stories in epic (pattern: {{epic_num}}-*)</action>
<action>Count stories by status:
- backlog: Not yet created
- ready-for-dev: Created but not developed
- in-progress: Partially developed
- review: Developed, pending review
- done: Fully complete
</action>
<output> <output>
📊 **Epic {{epic_num}} Status** 📊 **Epic {{epic_num}} Status**
@ -86,294 +52,145 @@
- Backlog: {{backlog_count}} (will create + develop) - Backlog: {{backlog_count}} (will create + develop)
- Ready-for-dev: {{ready_count}} (will develop) - Ready-for-dev: {{ready_count}} (will develop)
- In-progress: {{inprogress_count}} (will resume) - In-progress: {{inprogress_count}} (will resume)
- Review: {{review_count}} (will skip - needs human review) - Review/Done: {{done_count}} (will skip)
- Done: {{done_count}} (will skip - already complete)
**Work Remaining:** {{backlog_count + ready_count + inprogress_count}} stories **Work Remaining:** {{work_count}} stories
**Estimated Time:** {{estimated_hours}} hours **Estimated Time:** {{estimated_hours}} hours
**Estimated Tokens:** ~{{estimated_tokens}}K **Estimated Tokens:** ~{{estimated_tokens}}K
</output> </output>
</step>
<step n="2" goal="Get user confirmation and settings">
<ask>**Proceed with autonomous processing?** <ask>**Proceed with autonomous processing?**
This will: [Y] Yes - Use super-dev-story (comprehensive validation)
- Process {{work_count}} stories automatically [D] Dev-story - Faster, less validation
- Use {{dev_workflow}} for development (super-dev-story or dev-story) [n] No - Cancel
- Create git commits after each story
- Take approximately {{estimated_hours}} hours
- Use approximately {{estimated_tokens}}K tokens
Options:
[Y] Yes - Start autonomous processing with default settings
[C] Custom - Let me configure settings first
[n] No - Cancel autonomous processing
</ask> </ask>
<check if="user approves with Y"> <check if="user says Y">
<action>Use default autonomous_settings from workflow.yaml</action> <action>Set {{dev_workflow}} = "super-dev-story"</action>
<output>✅ Starting autonomous epic processing with defaults...</output>
<goto anchor="create_branch" />
</check> </check>
<check if="user chooses Custom with C"> <check if="user says D">
<ask>Use super-dev-story (comprehensive validation) or dev-story (faster)? [super/dev]:</ask> <action>Set {{dev_workflow}} = "dev-story"</action>
<action>Store user choice as {{dev_workflow}}</action>
<ask>Auto-accept gap analysis refinements? [Y/n]:</ask>
<action>Store user choice as {{auto_accept_gap}}</action>
<ask>Create git commits after each story? [Y/n]:</ask>
<action>Store user choice as {{create_commits}}</action>
<ask>Halt on first error or continue? [halt/continue]:</ask>
<action>Store user choice as {{error_handling}}</action>
<output>✅ Custom settings configured. Starting autonomous processing...</output>
<goto anchor="create_branch" />
</check> </check>
<check if="user says no with n"> <check if="user says n">
<output>Autonomous epic processing cancelled.</output> <output>❌ Cancelled</output>
<action>HALT</action> <action>HALT</action>
</check> </check>
<anchor id="create_branch" />
</step> </step>
<step n="3" goal="Create git branch and initialize progress tracking"> <step n="2" goal="Create git branch and initialize tracking">
<check if="{{create_commits}} is true"> <action>Get current branch name</action>
<action>Check current git branch</action> <action>Create new branch: auto-epic-{{epic_num}}</action>
<action>Create new branch: {{git_branch_prefix}}{{epic_num}}</action> <output>📝 Created branch: auto-epic-{{epic_num}}</output>
<output>📝 Created git branch: {{git_branch_prefix}}{{epic_num}}</output>
</check>
<!-- Initialize progress tracking --> <action>Initialize progress tracking file:
<action>Create progress file: {{progress_file}}</action> - epic_num
<action>Write initial progress state: - started timestamp
epic_num: {{epic_num}} - total_stories
started: {{date}} - completed_stories: []
total_stories: {{total_story_count}} - current_story: null
completed_stories: [] - status: running
failed_stories: []
current_story: null
status: running
</action> </action>
<output>🚀 **Autonomous Epic Processing Started**
Epic: {{epic_num}}
Branch: {{git_branch_name}}
Progress tracking: {{progress_file}}
Processing {{work_count}} stories...
</output>
</step> </step>
<step n="4" goal="Process all stories in epic"> <step n="3" goal="Process all stories in epic">
<critical>🔄 STORY PROCESSING LOOP - Just-in-time planning + development</critical> <critical>🔄 STORY LOOP - Create and develop each story</critical>
<action>Load {{sprint_status}} file</action> <action>Find all stories in epic {{epic_num}} needing work</action>
<action>Find all stories in epic {{epic_num}} (pattern: {{epic_num}}-*)</action> <action>Sort by story number (ascending)</action>
<action>Sort stories by story number (ascending order)</action> <action>Initialize counters: success=0, failure=0</action>
<action>Filter to stories needing work (backlog, ready-for-dev, in-progress statuses)</action>
<action>Initialize {{story_counter}} = 0</action>
<action>Initialize {{success_count}} = 0</action>
<action>Initialize {{failure_count}} = 0</action>
<!-- STORY LOOP --> <!-- STORY LOOP -->
<loop foreach="{{stories_needing_work}}"> <loop foreach="{{stories_needing_work}}">
<action>Set {{current_story}} = current story from loop</action> <action>Set {{current_story}}</action>
<action>Increment {{story_counter}}</action>
<action>Update progress file with current_story</action>
<output> <output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Story {{story_counter}}/{{work_count}}: {{current_story.key}} Story {{counter}}/{{work_count}}: {{current_story.key}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Status: {{current_story.status}}
Started: {{current_time}}
</output> </output>
<!-- CREATE STORY IF NEEDED --> <!-- CREATE STORY IF NEEDED -->
<check if="current_story.status == 'backlog'"> <check if="status == 'backlog'">
<output>📝 Creating story {{current_story.key}}...</output> <output>📝 Creating story...</output>
<try> <try>
<action>Run create-story workflow for this story</action> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml">
<action>Wait for story file to be created</action> <note>Create story just-in-time</note>
<output>✅ Story created: {{story_file}}</output> </invoke-workflow>
<output>✅ Story created</output>
</try> </try>
<catch> <catch>
<output>❌ Failed to create story {{current_story.key}} <output>❌ Failed to create story: {{error}}</output>
<action>Add to failed_stories, continue to next</action>
Error: {{error_message}} <continue />
</output>
<check if="{{halt_on_error}} is true">
<action>Update progress file with failure</action>
<output>🛑 Halting due to error (halt_on_error=true)</output>
<action>HALT</action>
</check>
<check if="{{halt_on_error}} is false">
<action>Add to {{failed_stories}} list</action>
<action>Increment {{failure_count}}</action>
<output>⏭️ Skipping to next story...</output>
<continue>Next story in loop</continue>
</check>
</catch> </catch>
</check> </check>
<!-- DEVELOP STORY --> <!-- DEVELOP STORY -->
<output>💻 Developing story {{current_story.key}} using {{dev_workflow}}...</output> <output>💻 Developing with {{dev_workflow}}...</output>
<try> <try>
<check if="{{dev_workflow}} == 'super-dev-story'"> <check if="{{dev_workflow}} == 'super-dev-story'">
<action>Run super-dev-story workflow with auto-accept mode enabled</action> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/super-dev-story/workflow.yaml">
<input name="story_file" value="{{current_story_file}}" />
<note>Includes: dev + post-gap + review + push-all</note>
</invoke-workflow>
</check> </check>
<check if="{{dev_workflow}} == 'dev-story'"> <check if="{{dev_workflow}} == 'dev-story'">
<action>Run dev-story workflow with auto-accept mode enabled</action> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml">
<input name="story_file" value="{{current_story_file}}" />
</invoke-workflow>
<!-- Push after dev-story -->
<invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/push-all/workflow.yaml">
<note>Commit and push story changes</note>
</invoke-workflow>
</check> </check>
<action>Wait for story to be marked "review"</action> <output>✅ Story complete and pushed</output>
<action>Increment success_count</action>
<output>✅ Story {{current_story.key}} completed <action>Update progress file</action>
Status: review
Tasks completed: {{task_count}}
Files changed: {{file_count}}
Time: {{elapsed_time}}
</output>
<!-- RUN PUSH-ALL WORKFLOW -->
<output>📝 Running push-all to commit and push story changes...</output>
<try>
<action>Run push-all workflow with auto-accept mode:</action>
<action>- Safety checks run automatically</action>
<action>- Generate commit message based on story</action>
<action>- Commit with message: "feat(epic-{{epic_num}}): complete story {{current_story.key}} - {{story_title}}"</action>
<action>- Push to remote automatically</action>
<output>✅ Pushed to remote: {{commit_hash}}</output>
</try>
<catch>
<output>⚠️ Push-all failed for story {{current_story.key}}
Error: {{push_error}}
Story is complete but not pushed to remote yet.
You can push manually later.
</output>
<check if="{{halt_on_error}} is true">
<output>🛑 Halting due to push error (halt_on_error=true)</output>
<action>Update progress file with failure</action>
<action>HALT</action>
</check>
<action>Note: Story complete locally, push failed - continuing...</action>
</catch>
<action>Increment {{success_count}}</action>
<action>Add to progress file completed_stories list</action>
<action>Update progress file with success</action>
</try> </try>
<catch> <catch>
<output>❌ Failed to develop story {{current_story.key}} <output>❌ Story failed: {{error}}</output>
<action>Add to failed_stories, continue</action>
Error: {{error_message}} <action>Increment failure_count</action>
Attempt: {{retry_count}}/{{max_retry_per_story}}
</output>
<check if="{{retry_count}} < {{max_retry_per_story}}">
<output>🔄 Retrying story {{current_story.key}}...</output>
<action>Increment {{retry_count}}</action>
<retry>Retry this story</retry>
</check>
<check if="{{retry_count}} >= {{max_retry_per_story}}">
<output>⚠️ Max retries reached for story {{current_story.key}}</output>
<check if="{{halt_on_error}} is true">
<action>Update progress file with failure and halt</action>
<output>🛑 Halting due to repeated errors (halt_on_error=true)</output>
<action>HALT</action>
</check>
<check if="{{halt_on_error}} is false">
<action>Add to {{failed_stories}} list</action>
<action>Increment {{failure_count}}</action>
<output>⏭️ Skipping to next story...</output>
<continue>Next story in loop</continue>
</check>
</check>
</catch> </catch>
<!-- Progress update --> <output>Progress: {{success_count}} ✅ | {{failure_count}} ❌ | {{remaining}} pending</output>
<output>
Progress: {{success_count}} ✅ | {{failure_count}} ❌ | {{remaining_count}} pending
</output>
</loop> </loop>
<!-- After all stories processed -->
<action>Update progress file status: complete</action> <action>Update progress file status: complete</action>
</step> </step>
<step n="5" goal="Epic completion and reporting"> <step n="4" goal="Epic completion and reporting">
<critical>📊 EPIC COMPLETE - Generate completion report</critical>
<action>Load all completed story files from this epic</action>
<action>Aggregate statistics:
- Total files created/modified
- Total test coverage
- Total code review issues found and fixed
- Total development time
- Success rate
</action>
<action>Generate epic completion report: {{story_dir}}/epic-{{epic_num}}-completion-report.md</action>
<output> <output>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎉 EPIC {{epic_num}} AUTONOMOUS PROCESSING COMPLETE! 🎉 EPIC {{epic_num}} COMPLETE!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Results:** **Results:**
✅ Stories completed: {{success_count}}/{{total_story_count}} ✅ Stories completed: {{success_count}}/{{total_count}}
{{if_failures}} {{if_failures}}❌ Stories failed: {{failure_count}}{{endif}}
❌ Stories failed: {{failure_count}}
{{list_failed_stories_with_reasons}} **Branch:** auto-epic-{{epic_num}}
**All changes pushed to remote**
{{if_all_success}}
**Epic {{epic_num}} marked complete in sprint-status.yaml**
{{endif}} {{endif}}
**Statistics:**
- Total development time: {{total_time}}
- Files created/modified: {{total_files}}
- Test coverage achieved: {{avg_coverage}}%
- Code review issues found: {{total_issues}}
- Code review issues fixed: {{total_fixes}}
**Git Branch:** {{git_branch_name}}
**Commits:** {{commit_count}}
**Completion Report:** {{report_file}}
---
**Next Steps:** **Next Steps:**
1. Review the completion report 1. Review the work on branch auto-epic-{{epic_num}}
2. Manually review/fix any failed stories 2. Run human code review
3. Run human code review on the branch 3. Merge when approved
4. Merge {{git_branch_name}} when approved
{{if_failures}} {{if_failures}}
**Failed Stories Need Attention:** **Failed Stories Need Attention:**
@ -381,61 +198,11 @@
{{endif}} {{endif}}
</output> </output>
<!-- Update sprint status --> <check if="{{success_count}} == {{total_count}}">
<check if="{{success_count}} == {{total_story_count}}"> <action>Update sprint-status: epic-{{epic_num}} = "done"</action>
<action>Load {{sprint_status}} file</action>
<action>Update epic-{{epic_num}} status to "done"</action>
<output>✅ Epic {{epic_num}} marked complete in sprint-status.yaml</output>
</check> </check>
<check if="{{failure_count}} > 0"> <action>Remove progress file</action>
<output> Epic {{epic_num}} partially complete - some stories failed.
Epic status remains "in-progress" until failed stories resolved.
</output>
</check>
<!-- Final git operations -->
<check if="{{create_commits}} is true">
<output>📝 All changes committed to branch: {{git_branch_name}}
To merge:
git checkout main
git merge {{git_branch_name}}
Or create PR:
gh pr create --base main --head {{git_branch_name}}
</output>
</check>
</step>
<step n="6" goal="Cleanup and user support">
<action>Remove progress file (no longer needed)</action>
<ask>Would you like explanations about:
- How autonomous processing works
- What was implemented in this epic
- Why any stories failed
- How to review and merge the work
- Anything else?
[Enter topic or 'n' to skip]
</ask>
<check if="user asks for explanations">
<action>Provide clear explanations about requested topics</action>
<action>Reference specific stories, code, or decisions</action>
</check>
<output>💡 **Tips for Future Autonomous Processing:**
- Use super-dev-story for critical epics (higher quality, more tokens)
- Use dev-story for experimental epics (faster, fewer tokens)
- Review completion report for patterns and improvements
- Failed stories often indicate unclear requirements
- Monitor token usage and adjust epic size accordingly
**Epic {{epic_num}} processing complete, {user_name}!**
</output>
</step> </step>
</workflow> </workflow>

View File

@ -4,43 +4,60 @@
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</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>Generate all documents in {document_output_language}</critical>
<critical>🚀 SUPER-DEV MODE: Enhanced quality workflow with post-implementation validation and automated code review</critical> <critical>🚀 SUPER-DEV MODE: Enhanced quality workflow with post-implementation validation and automated code review</critical>
<critical>This workflow ensures stories are TRULY complete through multi-stage validation before marking done</critical> <critical>This workflow orchestrates existing workflows with additional validation steps</critical>
<critical>⚙️ EXECUTION FLOW: First execute ALL dev-story steps (1-8), then continue with super-dev enhancements (9.5-9.6)</critical>
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- STEPS 1-8: STANDARD DEV-STORY WORKFLOW --> <!-- STEP 1: INVOKE STANDARD DEV-STORY WORKFLOW -->
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<critical>🎯 EXECUTE DEV-STORY STEPS 1-8 FIRST</critical> <step n="1" goal="Execute standard dev-story workflow">
<critical>Follow all instructions in: {project-root}/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml</critical> <critical>🎯 RUN DEV-STORY - Complete all standard development steps</critical>
<critical>Complete Steps 1 through 8 exactly as specified in dev-story workflow</critical> <note>This includes: story loading, pre-dev gap analysis, development, testing, and task completion</note>
<critical>After Step 8 completes (all tasks checked), return here and continue with Step 9.5 below</critical>
<note>⚙️ Super-dev-story includes ALL standard dev-story steps (1-8): <output>🚀 **Super-Dev-Story: Enhanced Quality Workflow**
**Standard Development Flow:** Running standard dev-story workflow (Steps 1-8)...
- Step 1: Find and load story (sprint-status or user-provided path)
- Step 1.5: ✅ PRE-DEV GAP ANALYSIS - Validate tasks against codebase
- Step 2: Load project context and story information
- Step 3: Detect review continuation (if resuming after code-review)
- Step 4: Mark story in-progress in sprint-status
- Step 5: Implement task following red-green-refactor cycle (TDD)
- Step 6: Author comprehensive tests (unit, integration, e2e)
- Step 7: Run validations and tests (regression suite)
- Step 8: Validate and mark task complete (strict gates)
After completing Steps 1-8, super-dev mode adds ADDITIONAL quality validation below. This includes:
✅ Story loading and validation
✅ Pre-dev gap analysis
✅ TDD implementation cycle
✅ Comprehensive testing
✅ Task completion validation
**For complete details of Steps 1-8, see:** {project-root}/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml After dev-story completes, super-dev will add:
</note> ✅ Post-dev gap analysis
✅ Automated code review
✅ Auto push-all
</output>
<invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml">
<input name="story_file" value="{{story_file}}" />
<note>Pass through any user-provided story file path</note>
</invoke-workflow>
<check if="dev-story completed successfully">
<output>✅ Dev-story complete - all tasks implemented and tested
Proceeding to super-dev enhancements...
</output>
</check>
<check if="dev-story failed or halted">
<output>❌ Dev-story did not complete successfully
Cannot proceed with super-dev enhancements.
Fix issues and retry.
</output>
<action>HALT - dev-story must complete first</action>
</check>
</step>
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- SUPER-DEV ENHANCEMENTS: POST-IMPLEMENTATION VALIDATION --> <!-- STEP 2: POST-DEV GAP ANALYSIS (Super-Dev Enhancement) -->
<!-- ═══════════════════════════════════════════════════════════════ --> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- SUPER-DEV ENHANCEMENTS START HERE --> <step n="2" goal="Post-development gap analysis">
<step n="9.5" goal="Post-development gap analysis">
<critical>🔍 POST-DEV VALIDATION - Verify all work actually completed!</critical> <critical>🔍 POST-DEV VALIDATION - Verify all work actually completed!</critical>
<note>This catches incomplete implementations that were prematurely marked done</note> <note>This catches incomplete implementations that were prematurely marked done</note>
@ -51,8 +68,8 @@
</output> </output>
<!-- Re-scan codebase with fresh eyes --> <!-- Re-scan codebase with fresh eyes -->
<action>Re-read story requirements and acceptance criteria</action> <action>Re-read story file to get requirements and tasks</action>
<action>Extract all tasks and subtasks that are marked [x] complete</action> <action>Extract all tasks marked [x] complete</action>
<action>For each completed task, identify what should exist in codebase</action> <action>For each completed task, identify what should exist in codebase</action>
<!-- SCAN PHASE --> <!-- SCAN PHASE -->
@ -77,52 +94,29 @@
- Note partial implementations marked as complete - Note partial implementations marked as complete
</action> </action>
<action>⚠️ Quality Issues:
- Implementations that exist but don't meet requirements
- Tests that exist but have poor coverage
- Code that works but violates architecture patterns
</action>
<!-- DECISION PHASE --> <!-- DECISION PHASE -->
<check if="false positives found OR quality issues found"> <check if="false positives found">
<output> <output>
⚠️ **Post-Dev Gaps Detected!** ⚠️ **Post-Dev Gaps Detected!**
**False Positives (marked done but not complete):** **Tasks marked complete but implementation incomplete:**
{{list_false_positives_with_details}} {{list_false_positives_with_details}}
**Quality Issues:**
{{list_quality_issues_with_details}}
**Proposed Actions:**
{{list_tasks_to_add_for_missing_work}}
---
These issues must be addressed before story can be marked complete. These issues must be addressed before story can be marked complete.
</output> </output>
<action>Uncheck false positive tasks in story file</action> <action>Uncheck false positive tasks in story file</action>
<action>Add new tasks for missing work to Tasks/Subtasks section</action> <action>Add new tasks for missing work</action>
<action>Add note to Dev Agent Record: "Post-dev gap analysis found incomplete work - continuing implementation"</action>
<action>Update Gap Analysis section with post-dev findings</action> <action>Update Gap Analysis section with post-dev findings</action>
<action>Set {{fix_iteration_count}} = {{fix_iteration_count}} + 1</action>
<check if="{{fix_iteration_count}} > {{max_fix_iterations}}"> <output>🔄 Re-invoking dev-story to complete missing work...</output>
<output>🛑 **Maximum Fix Iterations Reached**
Attempted {{fix_iteration_count}} fix cycles. <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml">
Manual intervention required. <input name="story_file" value="{{story_file}}" />
<note>Resume with added tasks for missing work</note>
</invoke-workflow>
Issues remaining: <output>✅ Missing work completed. Proceeding to code review...</output>
{{list_remaining_issues}}
</output>
<action>Add to Dev Agent Record: "HALTED - exceeded max fix iterations, manual review needed"</action>
<action>HALT - require user intervention</action>
</check>
<output>🔄 Adding missing work to task list and continuing implementation...</output>
<goto step="5">Continue implementation with added tasks</goto>
</check> </check>
<check if="no gaps found"> <check if="no gaps found">
@ -132,13 +126,15 @@
Proceeding to code review... Proceeding to code review...
</output> </output>
<action>Update Gap Analysis section with post-dev verification results</action> <action>Update Gap Analysis section with post-dev verification results</action>
<action>Continue to Step 9.6</action>
</check> </check>
</step> </step>
<step n="9.6" goal="Automated code review"> <!-- ═══════════════════════════════════════════════════════════════ -->
<!-- STEP 3: AUTOMATED CODE REVIEW (Super-Dev Enhancement) -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<step n="3" goal="Automated code review">
<critical>👀 AUTO CODE REVIEW - Independent quality validation</critical> <critical>👀 AUTO CODE REVIEW - Independent quality validation</critical>
<note>Fresh perspective catches issues the dev agent might miss</note>
<output> <output>
🔍 **Running Automated Code Review** 🔍 **Running Automated Code Review**
@ -146,107 +142,56 @@
Analyzing implementation for issues... Analyzing implementation for issues...
</output> </output>
<!-- Identify files to review --> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml">
<action>Extract File List from Dev Agent Record</action> <input name="story_file" value="{{story_file}}" />
<action>Identify all files created or modified during implementation</action> <note>Run code review on completed story</note>
</invoke-workflow>
<!-- REVIEW PHASE: Use code-review workflow logic --> <action>Parse code review results from story file "Code Review" section</action>
<action>Perform comprehensive code review checking:</action> <action>Extract issues by severity (Critical, High, Medium, Low)</action>
<action>- **Correctness:** Logic errors, edge cases, error handling</action> <action>Count total issues found</action>
<action>- **Architecture:** Compliance with patterns and standards</action>
<action>- **Security:** Vulnerabilities, input validation, authentication</action>
<action>- **Performance:** Inefficiencies, N+1 queries, memory leaks</action>
<action>- **Testing:** Test coverage, edge cases, test quality</action>
<action>- **Code Quality:** Readability, maintainability, documentation</action>
<!-- CATEGORIZE FINDINGS --> <check if="critical or high severity issues found">
<action>Categorize all findings by severity:</action> <output>🚨 **Code Review Found Issues Requiring Fixes**
<action>- CRITICAL: Security vulnerabilities, data loss, broken functionality</action>
<action>- HIGH: Logic errors, missing error handling, test gaps</action>
<action>- MEDIUM: Code quality issues, minor bugs, performance concerns</action>
<action>- LOW: Style issues, documentation improvements, minor refactoring</action>
<!-- DECISION PHASE --> Issues found: {{total_issue_count}}
<check if="CRITICAL or HIGH severity issues found"> - Critical: {{critical_count}}
<output> - High: {{high_count}}
🚨 **Code Review Found Issues Requiring Fixes** - Medium: {{medium_count}}
- Low: {{low_count}}
**Critical Issues ({{critical_count}}):** Adding review findings to story tasks and re-running dev-story...
{{list_critical_issues}}
**High Priority Issues ({{high_count}}):**
{{list_high_issues}}
{{if_medium_or_low_exist}}
**Medium/Low Issues ({{med_low_count}}):**
{{list_medium_low_issues}}
{{endif}}
---
**These issues must be fixed before story completion.**
</output> </output>
<action>Add "Code Review Findings" section to story file</action> <action>Add code review findings as tasks in story file</action>
<action>Add review findings as new tasks in Tasks/Subtasks with [AI-Review] prefix</action>
<action>Add to Dev Agent Record: "Code review found {{total_issue_count}} issues - continuing with fixes"</action>
<action>Set {{fix_iteration_count}} = {{fix_iteration_count}} + 1</action>
<check if="{{fix_iteration_count}} > {{max_fix_iterations}}"> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml">
<output>🛑 **Maximum Fix Iterations Reached** <input name="story_file" value="{{story_file}}" />
<note>Fix code review issues</note>
</invoke-workflow>
Code review found issues on iteration {{fix_iteration_count}}. <output>✅ Code review issues resolved. Proceeding to push...</output>
Manual review recommended.
Issues found:
{{list_all_issues}}
</output>
<action>Add to Dev Agent Record: "HALTED - code review issues after max iterations, manual review needed"</action>
<action>HALT - require user intervention</action>
</check>
<output>🔧 Adding review findings to task list and implementing fixes...</output>
<goto step="5">Implement fixes</goto>
</check> </check>
<check if="only MEDIUM or LOW severity issues found"> <check if="only medium or low issues found">
<output> <output> **Code Review Found Minor Issues**
**Code Review Found Minor Issues**
**Medium Issues ({{medium_count}}):** - Medium: {{medium_count}}
{{list_medium_issues}} - Low: {{low_count}}
**Low Priority Issues ({{low_count}}):**
{{list_low_issues}}
---
</output> </output>
<ask>Auto-fix these minor issues? <ask>Auto-fix these minor issues? [Y/n/skip]:</ask>
Options:
[Y] Yes - Add to task list and fix now
[n] No - Document in story but don't fix (can address later)
[s] Skip - Ignore these findings
</ask>
<check if="user approves Y"> <check if="user approves Y">
<action>Add review findings as tasks with [AI-Review] prefix</action> <action>Add review findings as tasks</action>
<action>Add to Dev Agent Record: "Addressing {{issue_count}} minor code review findings"</action> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml">
<output>🔧 Implementing minor fixes...</output> <input name="story_file" value="{{story_file}}" />
<goto step="5">Implement fixes</goto> </invoke-workflow>
</check> </check>
<check if="user says n"> <check if="user says skip">
<action>Add "Code Review Findings" section documenting issues</action> <action>Document issues in story file</action>
<action>Add to Dev Agent Record: "Code review found {{issue_count}} minor issues - documented for future work"</action> <output> Minor issues documented. Proceeding to push...</output>
<output> Issues documented in story. Proceeding to completion...</output>
<action>Continue to Step 9</action>
</check>
<check if="user says s">
<output>⚠️ Skipping minor issues. Proceeding to completion...</output>
<action>Continue to Step 9</action>
</check> </check>
</check> </check>
@ -254,81 +199,55 @@
<output>✅ **Code Review Passed** <output>✅ **Code Review Passed**
No issues found. Implementation meets quality standards. No issues found. Implementation meets quality standards.
Proceeding to push...
</output> </output>
<action>Add to Dev Agent Record: "Code review completed - no issues found"</action>
<action>Continue to Step 9</action>
</check> </check>
</step> </step>
<step n="9" goal="Story completion and mark for review" tag="sprint-status"> <!-- ═══════════════════════════════════════════════════════════════ -->
<critical>🎯 FINAL VALIDATION - All quality gates must pass!</critical> <!-- STEP 4: PUSH ALL CHANGES (Super-Dev Enhancement) -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<action>Verify ALL tasks and subtasks are marked [x] (re-scan the story document now)</action> <step n="4" goal="Commit and push all changes">
<action>Run the full regression suite (do not skip)</action> <critical>📝 PUSH-ALL - Stage, commit, and push with safety validation</critical>
<action>Confirm File List includes every changed file</action>
<action>Execute enhanced definition-of-done validation</action>
<!-- Enhanced Definition of Done for Super-Dev --> <output>📝 **Committing and Pushing Story Changes**
<action>Validate super-dev quality gates:
- ✅ Pre-dev gap analysis completed and approved
- ✅ All tasks/subtasks marked complete with [x]
- ✅ Implementation satisfies every Acceptance Criterion
- ✅ All tests pass (no regressions, new tests successful)
- ✅ Post-dev gap analysis passed (no false positives)
- ✅ Code review completed (critical/high issues resolved)
- ✅ File List includes every new/modified/deleted file
- ✅ Dev Agent Record contains implementation notes
- ✅ Change Log includes summary of changes
</action>
<action>Update the story Status to: "review"</action> Running push-all workflow with safety checks...
</output>
<!-- Mark story ready for review - sprint status conditional --> <invoke-workflow path="{project-root}/_bmad/bmm/workflows/4-implementation/push-all/workflow.yaml">
<check if="{sprint_status} file exists AND {{current_sprint_status}} != 'no-sprint-tracking'"> <note>Commit and push all story changes</note>
<action>Load the FULL file: {sprint_status}</action> </invoke-workflow>
<action>Find development_status key matching {{story_key}}</action>
<action>Verify current status is "in-progress" (expected previous state)</action> <check if="push-all succeeded">
<action>Update development_status[{{story_key}}] = "review"</action> <output>✅ Changes pushed to remote successfully</output>
<action>Save file, preserving ALL comments and structure including STATUS DEFINITIONS</action>
<output>✅ Story status updated to "review" in sprint-status.yaml</output>
</check> </check>
<check if="{sprint_status} file does NOT exist OR {{current_sprint_status}} == 'no-sprint-tracking'"> <check if="push-all failed">
<output> Story status updated to "review" in story file (no sprint tracking configured)</output> <output>⚠️ Push failed but story is complete locally
</check>
<!-- Final validation gates --> You can push manually when ready.
<action if="any task is incomplete">HALT - Complete remaining tasks before marking ready for review</action> </output>
<action if="regression failures exist">HALT - Fix regression issues before completing</action> </check>
<action if="File List is incomplete">HALT - Update File List with all changed files</action>
<action if="post-dev gap analysis not completed">HALT - Run post-dev validation before completing</action>
<action if="code review not completed">HALT - Run code review before completing</action>
</step> </step>
<step n="10" goal="Super-dev completion communication"> <!-- ═══════════════════════════════════════════════════════════════ -->
<action>Prepare comprehensive summary in Dev Agent Record → Completion Notes</action> <!-- STEP 5: COMPLETION -->
<!-- ═══════════════════════════════════════════════════════════════ -->
<step n="5" goal="Super-dev completion summary">
<output>🎉 **SUPER-DEV STORY COMPLETE, {user_name}!** <output>🎉 **SUPER-DEV STORY COMPLETE, {user_name}!**
**Story:** {{story_key}} - {{story_title}}
**Status:** review (ready for human review)
---
**Quality Gates Passed:** **Quality Gates Passed:**
✅ Pre-dev gap analysis - Tasks validated before work started ✅ Pre-dev gap analysis - Tasks validated before work
✅ Development - All tasks completed with TDD ✅ Development - All tasks completed with TDD
✅ Post-dev gap analysis - Implementation verified complete ✅ Post-dev gap analysis - Implementation verified
✅ Code review - {{total_issues_found}} issues found and resolved ✅ Code review - Quality and security validated
✅ All tests passing - No regressions ✅ Pushed to remote - Changes backed up
**Implementation Summary:**
- Files changed: {{file_count}}
- Tests added: {{test_count}}
- Issues fixed: {{review_issues_fixed}}
- Fix iterations: {{fix_iteration_count}}/{{max_fix_iterations}}
**Story File:** {{story_file}} **Story File:** {{story_file}}
**Status:** review (ready for human review)
--- ---
@ -337,7 +256,7 @@
2. 💻 Implementation completed per requirements 2. 💻 Implementation completed per requirements
3. ✅ No false positive completions (all work verified) 3. ✅ No false positive completions (all work verified)
4. 👀 Code quality and security validated 4. 👀 Code quality and security validated
5. 🧪 Comprehensive test coverage achieved 5. 📝 Changes committed and pushed to remote
**Next Steps:** **Next Steps:**
- Review the completed story - Review the completed story
@ -348,343 +267,17 @@
It should require minimal human review. It should require minimal human review.
</output> </output>
<action>Based on {user_skill_level}, ask if user needs any explanations about: <action>Based on {user_skill_level}, ask if user needs explanations about implementation, decisions, or findings</action>
- What was implemented and how it works
- Why certain technical decisions were made
- Gap analysis or code review findings
- Any patterns, libraries, or approaches used
</action>
<check if="user asks for explanations"> <check if="user asks for explanations">
<action>Provide clear, contextual explanations tailored to {user_skill_level}</action> <action>Provide clear, contextual explanations</action>
<action>Use examples and references to specific code when helpful</action>
</check> </check>
<output>💡 **Tip:** This story was developed with super-dev-story for enhanced quality. <output>💡 **Tip:** This story was developed with super-dev-story for enhanced quality.
For faster development (fewer validations), use standard `dev-story` workflow. For faster development, use standard `dev-story` workflow.
For maximum quality and fewer review cycles, continue using `super-dev-story`. For maximum quality, continue using `super-dev-story`.
</output> </output>
</step> </step>
<step n="11" goal="Commit and push all changes">
<critical>📝 PUSH-ALL - Stage, commit, and push all changes with safety validation</critical>
<note>⚠️ Use with caution - commits ALL changes in repository</note>
<output>🔄 **Analyzing Repository Changes**
Scanning for changes to commit and push...
</output>
<!-- ANALYZE CHANGES PHASE -->
<action>Run git commands in parallel:</action>
<action>- git status - Show modified/added/deleted/untracked files</action>
<action>- git diff --stat - Show change statistics</action>
<action>- git log -1 --oneline - Show recent commit for message style</action>
<action>- git branch --show-current - Confirm current branch</action>
<action>Parse git status output to identify:
- Modified files
- Added files
- Deleted files
- Untracked files
- Total insertion/deletion counts
</action>
<!-- SAFETY CHECKS PHASE -->
<critical>🔒 SAFETY VALIDATION - Check for secrets, large files, and unwanted artifacts</critical>
<action>Scan all changed files for dangerous patterns:</action>
**Secret Detection:**
<action>Check for files matching secret patterns:
- .env*, *.key, *.pem, credentials.json, secrets.yaml
- id_rsa, *.p12, *.pfx, *.cer
- Any file containing: _API_KEY=, _SECRET=, _TOKEN= with real values
</action>
<action>Validate API keys are placeholders only:</action>
<action>✅ Acceptable: API_KEY=your-api-key-here, SECRET=placeholder, TOKEN=xxx, API_KEY=${'{YOUR_KEY}'}</action>
<action>❌ BLOCK: OPENAI_API_KEY=sk-proj-*, AWS_SECRET_KEY=AKIA*, STRIPE_API_KEY=sk_live_*</action>
**File Size Check:**
<action>Check for files >10MB without Git LFS</action>
**Build Artifacts:**
<action>Check for unwanted directories/files:
- node_modules/, dist/, build/, __pycache__/, *.pyc, .venv/
- .DS_Store, thumbs.db, *.swp, *.tmp
</action>
**Git State:**
<action>Verify:
- .gitignore properly configured
- No merge conflicts
- Repository initialized
</action>
<!-- SAFETY DECISION -->
<check if="secrets detected OR real API keys found">
<output>🚨 **DANGER: Secrets Detected!**
The following sensitive data was found:
{{list_detected_secrets}}
❌ **BLOCKED:** Cannot commit secrets to version control.
**Actions Required:**
1. Move secrets to .env file
2. Add .env to .gitignore
3. Use environment variables in code
4. Remove secrets from tracked files
Halting push-all workflow.
</output>
<action>HALT - Cannot proceed with secrets in changeset</action>
</check>
<check if="large files detected without Git LFS">
<output>⚠️ **Warning: Large Files Detected**
Files >10MB found:
{{list_large_files}}
**Recommendation:** Use Git LFS for large files
Continue anyway? [y/n]:
</output>
<ask>Proceed with large files? [y/n]:</ask>
<check if="user says n">
<output>Halting push-all. Please set up Git LFS for large files.</output>
<action>HALT</action>
</check>
</check>
<check if="build artifacts detected">
<output>⚠️ **Warning: Build Artifacts Detected**
Should not be committed:
{{list_build_artifacts}}
**These should be in .gitignore**
Continue anyway? [y/n]:
</output>
<ask>Proceed despite build artifacts? [y/n]:</ask>
<check if="user says n">
<output>Halting push-all. Update .gitignore to exclude build artifacts.</output>
<action>HALT</action>
</check>
</check>
<check if="current branch is main or master">
<output>⚠️ **Warning: Pushing to {{branch_name}}**
You're on the main/master branch. Consider:
- Creating a feature branch
- Opening a PR for review
Continue pushing to {{branch_name}}? [y/n]:
</output>
<ask>Push directly to {{branch_name}}? [y/n]:</ask>
<check if="user says n">
<output>Halting push-all. Create a feature branch instead.</output>
<action>HALT</action>
</check>
</check>
<!-- PRESENT SUMMARY AND GET CONFIRMATION -->
<output>
📊 **Changes Summary**
**Files:**
- Modified: {{modified_count}}
- Added: {{added_count}}
- Deleted: {{deleted_count}}
- Untracked: {{untracked_count}}
**Changes:**
- Insertions: +{{insertion_count}}
- Deletions: -{{deletion_count}}
**Safety Checks:**
{{if_all_safe}}
✅ No secrets detected
✅ No large files
✅ No build artifacts
✅ .gitignore configured
{{endif}}
{{if_warnings}}
⚠️ {{warning_list}}
{{endif}}
**Git:**
- Branch: {{current_branch}} → origin/{{current_branch}}
- Last commit: {{last_commit}}
---
**I will execute:**
1. git add .
2. git commit -m "[generated message]"
3. git push
</output>
<ask>**Proceed with commit and push?**
Type 'yes' to proceed, 'no' to cancel, or 'review' to see detailed diff:
</ask>
<check if="user says review">
<action>Run: git diff --stat</action>
<action>Show detailed file changes</action>
<ask>Still proceed with commit and push? [yes/no]:</ask>
</check>
<check if="user says no">
<output>❌ Push-all cancelled. Changes remain unstaged.
You can commit manually when ready.
</output>
<action>HALT - User cancelled</action>
</check>
<check if="user says yes">
<!-- STAGE ALL CHANGES -->
<action>Execute: git add .</action>
<action>Execute: git status</action>
<output>✅ All changes staged</output>
<!-- GENERATE COMMIT MESSAGE -->
<action>Analyze changes to determine commit type and scope:</action>
<action>- feat: New feature implementation</action>
<action>- fix: Bug fixes</action>
<action>- docs: Documentation updates</action>
<action>- refactor: Code restructuring</action>
<action>- test: Test additions/updates</action>
<action>- chore: Tooling, configs, dependencies</action>
<action>Generate commit message in conventional commit format:</action>
<action>Format:
[type](optional scope): Brief summary (max 72 chars)
- Key change 1
- Key change 2
- Key change 3
</action>
<action>Base message on:
- Story title and key
- Files changed
- Acceptance criteria met
- Recent commit style
</action>
<output>📝 **Generated Commit Message:**
```
{{generated_commit_message}}
```
</output>
<ask>Use this commit message? [yes/edit/cancel]:</ask>
<check if="user says edit">
<ask>Enter your commit message:</ask>
<action>Use user-provided message as {{commit_message}}</action>
</check>
<check if="user says cancel">
<output>❌ Push-all cancelled. Changes remain staged.
Run: git reset to unstage
</output>
<action>HALT</action>
</check>
<check if="user says yes">
<action>Set {{commit_message}} = {{generated_commit_message}}</action>
</check>
<!-- COMMIT CHANGES -->
<action>Execute git commit with message:
git commit -m "$(cat &lt;&lt;'EOF'
{{commit_message}}
EOF
)"
</action>
<check if="commit fails">
<output>❌ Commit failed
Error: {{commit_error}}
Common issues:
- Pre-commit hooks failing
- Missing git config (user.name/email)
- Locked files
Fix the issue and try again.
</output>
<action>HALT - Fix errors before proceeding</action>
</check>
<output>✅ Commit created: {{commit_hash}}</output>
<!-- PUSH CHANGES -->
<action>Execute: git push</action>
<check if="push fails with non-fast-forward">
<output>⚠️ Push rejected - remote has changes
Attempting: git pull --rebase && git push
</output>
<action>Execute: git pull --rebase</action>
<action>Execute: git push</action>
</check>
<check if="push fails with no upstream branch">
<output> No upstream branch set
Executing: git push -u origin {{current_branch}}
</output>
<action>Execute: git push -u origin {{current_branch}}</action>
</check>
<check if="push fails with other error">
<output>❌ Push failed
Error: {{push_error}}
Your changes are committed locally but not pushed.
You can push manually later with: git push
</output>
<action>HALT - Manual push required</action>
</check>
<!-- SUCCESS -->
<output>✅ **Successfully Pushed to Remote!**
**Commit:** {{commit_hash}} - {{commit_subject}}
**Branch:** {{current_branch}} → origin/{{current_branch}}
**Files changed:** {{file_count}} (+{{insertions}}, -{{deletions}})
**Story work is now on remote and ready for team review.**
</output>
<action>Execute: git log -1 --oneline --decorate</action>
<output>
Final commit: {{git_log_output}}
</output>
</check>
</step>
</workflow> </workflow>