The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xmlYou MUST have already loaded and processed: {installed_path}/workflow.yamlCommunicate all responses in {communication_language}🤖 AUTONOMOUS EPIC PROCESSING - Full automation of epic completion!This workflow orchestrates super-dev-pipeline for each story in an epicTASK-BASED COMPLETION: A story is ONLY complete when it has ZERO unchecked tasks (- [ ])⚡ AUTONOMOUS MODE: When auto_accept_gap_analysis=true in workflow.yaml, you MUST:
- NEVER ask the user to approve gap analysis refinements
- AUTOMATICALLY accept all gap analysis proposals
- PROCEED immediately without waiting for user input on gap analysis
- Only ask for user input at the START of the workflow (epic selection, Y/D/n choice)
⚡ INVOKING SUB-WORKFLOWS: When you see invoke-workflow, you must:
1. Load the referenced workflow.yaml file
2. Load its instructions.xml file
3. Execute that workflow completely
4. Return to this workflow and continue
Use provided epic numberEnter epic number to process (e.g., "2" or "epic-3"), or [q] to quit:Parse epic number from inputHALTLoad {{sprint_status}} fileFind epic-{{epic_num}} entry and all story entries for this epicFor each story in epic:
1. Read the story file from {{story_dir}}/{{story_key}}.md
2. Check file exists (if missing, mark story as "backlog")
3. Check file size (if <10KB, flag as poor quality)
4. Count unchecked tasks: grep -c "^- \[ \]" or regex match "- \[ \]"
5. Count checked tasks: grep -c "^- \[x\]" or regex match "- \[x\]"
6. Count total tasks (unchecked + checked)
7. Calculate completion rate: (checked / total * 100)
8. Categorize story:
- "truly_done": unchecked_tasks=0 AND file_size>=10KB AND total_tasks>=5
- "in_progress": unchecked_tasks>0 AND checked_tasks>0
- "ready_for_dev": unchecked_tasks=total_tasks (nothing checked yet)
- "poor_quality": file_size<10KB OR total_tasks<5 (needs regeneration)
- "needs_work": unchecked_tasks > 0 (regardless of status)
- "backlog": status=backlog (file may not exist yet)
**Proceed with autonomous processing?**
[Y] Yes - Use super-dev-pipeline (step-file architecture, brownfield-compatible)
[n] No - Cancel
Note: super-dev-pipeline uses disciplined step-file execution with smart batching!
Set {{use_super_dev_pipeline}} = trueHALTGet current branch name and store as {{current_branch}}Create new branch: auto-epic-{{epic_num}}Check for existing progress file:
1. New format: .autonomous-epic-{{epic_num}}-progress.yaml
2. Legacy format: .autonomous-epic-progress-epic-{{epic_num}}.yaml
Set {{progress_file_path}} to whichever exists, or new format if neither exist
Load existing progress from {{progress_file_path}}Initialize progress tracking file at: .autonomous-epic-{{epic_num}}-progress.yaml
- epic_num
- started timestamp
- total_stories
- completed_stories: []
- current_story: null
- status: running
🔄 STORY LOOP - Create and develop each story until ALL tasks completeBuild ordered list of stories needing work:
1. All stories with unchecked tasks (regardless of status)
2. All backlog stories
3. Sort by story number (ascending)
Initialize counters: success=0, failure=0Set {{current_story}}Read story file from {{story_dir}}/{{current_story.key}}.mdMark story as "backlog" in sprint-status.yamlContinue to next storyGet file size in KBCount unchecked tasks: grep -c "^- \[ \]"Count checked tasks: grep -c "^- \[x\]"Count total tasksCalculate completion_rate = (checked / total * 100)Determine correct status:
IF unchecked_tasks == 0 AND file_size >= 10KB AND total_tasks >= 5
→ correct_status = "done"
ELSE IF unchecked_tasks > 0 AND checked_tasks > 0
→ correct_status = "in-progress"
ELSE IF unchecked_tasks == total_tasks
→ correct_status = "ready-for-dev"
ELSE IF file_size < 10KB OR total_tasks < 5
→ correct_status = "ready-for-dev" (needs regeneration)
Update story status in sprint-status.yaml to {{correct_status}}Continue to next story (skip super-dev-pipeline)Full lifecycle: pre-gap → implement (batched) → post-validate → review → commitRe-read story file and count unchecked tasksLog incomplete tasks for reviewMark as partial successUpdate story status to "done" in sprint-status.yamlIncrement success_countUpdate progress file: {{progress_file_path}}Add to failed_stories with error detailsIncrement failure_countUpdate progress file status to complete: {{progress_file_path}}Re-scan all epic stories for unchecked tasksCalculate: total_remaining_tasks across all storiesUpdate sprint-status: epic-{{epic_num}} = "done"Remove progress file: {{progress_file_path}}