feat: parallel story creation in Step 2.7

**Performance Improvement:**
- Spawn Task agents in PARALLEL for story creation
- Each story created by independent agent (fresh context)
- No context bloat in main orchestrator
- No agent fatigue from sequential creation

**Benefits:**
- 5 stories × 10 min = 50 min sequential → 10 min parallel (80% faster)
- Fresh 0% context for each story creation agent
- No quality degradation
- Follows GSD pattern (parallel independent work)

**Implementation:**
- Step 2.7a: Spawn all agents in single message
- Each agent gets fresh context, reads PRD/epic/architecture
- Lightweight story creation (no gap analysis)
- Step 2.7b: Verify all outputs after completion

Ready for Epic 18 batch story creation!
This commit is contained in:
Jonah Schulte 2026-01-26 00:14:49 -05:00
parent 3f5b975d88
commit 11af0b38be
1 changed files with 44 additions and 9 deletions

View File

@ -675,24 +675,59 @@ Gap analysis will happen just-in-time during implementation (Step 2 of super-dev
</check> </check>
</check> </check>
<output>🚀 Spawning {{needs_creation.length}} parallel agents for story creation...</output>
<action>Spawn Task agents in PARALLEL (send all Task calls in SINGLE message):</action>
<iterate>For each story in needs_creation:</iterate> <iterate>For each story in needs_creation:</iterate>
<substep n="2.7a" title="Create individual story file"> <substep n="2.7a" title="Spawn story creation agent">
<output>📝 Creating story {{@index}}/{{needs_creation.length}}: {{story_key}}...</output> <action>
Task tool call:
- subagent_type: "general-purpose"
- description: "Create story {{story_key}}"
- prompt: "Create basic story file for {{story_key}}.
<action>Invoke workflow: /bmad_bmm_create-story</action> INSTRUCTIONS:
<action>Parameters: 1. Read epic description from docs/epics.md (Epic {{epic_num}})
- story_key: {{story_key}} 2. Read PRD requirements (docs/prd-art-collective-tenants.md)
- epic_num: {{epic_num}} 3. Read architecture (docs/architecture-space-rentals.md)
- mode: batch (auto-approve, minimal prompts) 4. Extract FRs for this story from PRD
5. Break down into 3-7 tasks with subtasks
6. Create story file at: docs/sprint-artifacts/{{story_key}}.md
7. Use template from: _bmad/bmm/workflows/4-implementation/create-story/template.md
8. NO gap analysis (defer to implementation)
9. Commit story file when complete
10. Report: story file path
Mode: batch (lightweight, no codebase scanning)"
- Store returned agent_id for tracking
</action> </action>
</substep>
<check if="story creation succeeded"> <output>
⏳ Waiting for {{needs_creation.length}} parallel agents to complete...
Story creation agents:
{{#each needs_creation}}
- Agent {{@index}}: {{story_key}}
{{/each}}
</output>
<action>Wait for ALL agents to complete (blocking)</action>
<iterate>Check each agent output:</iterate>
<substep n="2.7b" title="Verify story creation results">
<action>Parse agent output for {{story_key}}</action>
<check if="agent succeeded AND story file exists">
<output>✅ Story created: {{story_key}}</output> <output>✅ Story created: {{story_key}}</output>
<action>Verify file exists at docs/sprint-artifacts/{{story_key}}.md</action>
<action>Mark story.needs_story_creation = false</action> <action>Mark story.needs_story_creation = false</action>
</check> </check>
<check if="story creation failed"> <check if="agent failed OR story file missing">
<output>❌ Failed to create story: {{story_key}}</output> <output>❌ Failed to create story: {{story_key}}</output>
<action>Add to failed_creations list</action> <action>Add to failed_creations list</action>
<action>Remove from selected_stories</action> <action>Remove from selected_stories</action>