@torka/claude-workflows 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,758 @@
1
+ ---
2
+ stepsCompleted: [1, 2, 3, 4, 5, 6, 7, 8, 9]
3
+ planApproved: true
4
+ outputFormatDesigned: true
5
+ structureDesigned: true
6
+ buildComplete: true
7
+ status: COMPLETE
8
+ completionDate: 2026-01-04
9
+ ---
10
+
11
+ # Workflow Creation Plan: implement-epic-with-subagents
12
+
13
+ ## Initial Project Context
14
+
15
+ - **Module:** bmm (BMAD Method Module)
16
+ - **Phase:** 4-implementation
17
+ - **Target Location:** `_bmad/bmm/workflows/4-implementation/implement-epic-with-subagents/`
18
+ - **Created:** 2026-01-03
19
+
20
+ ## Workflow Overview
21
+
22
+ **Name:** implement-epic-with-subagents
23
+ **Purpose:** Automate entire epic execution by orchestrating sub-agents to execute all stories sequentially, with minimal human intervention.
24
+
25
+ ## Problem Statement
26
+
27
+ Epic execution currently requires:
28
+ - Significant time investment
29
+ - Constant human-in-the-loop to manage agent session changes
30
+ - Manual coordination between different workflow phases
31
+
32
+ ## Target Users
33
+
34
+ - Entrepreneurs
35
+ - Full stack developers
36
+ - Semi-tech Builders
37
+
38
+ ---
39
+
40
+ ## Key Requirements
41
+
42
+ ### Workflow Type Classification
43
+
44
+ - **Primary Type:** Meta-Workflow (coordinates other workflows/agents)
45
+ - **Secondary Type:** Autonomous Workflow (runs with minimal human input)
46
+ - **Execution Model:** Fully autonomous with critical checkpoint pauses
47
+
48
+ ### Core Workflow Flow
49
+
50
+ **Pattern: Sequential Epic Executor (Enhanced)**
51
+
52
+ ```
53
+ Load Epic
54
+ → Parse all stories from epic file
55
+ → For each story (in sequence):
56
+ → Create-story (story-prep-master agent)
57
+ → Execute dev-story (specialist/dev agent)
58
+ → Quality-gate (quality-gate-verifier agent) ← Independent verification
59
+ → Code-review (principal-code-reviewer agent)
60
+ → Git commit
61
+ → Update sprint-status.yaml
62
+ → Generate Epic Completion Report
63
+ → Epic Complete
64
+ ```
65
+
66
+ ### Agent Orchestration
67
+
68
+ | Step | Agent | Invocation Pattern | Source |
69
+ |------|-------|-------------------|--------|
70
+ | Create Story | story-prep-master | "Create story N.M" | `.claude/agents/story-prep-master.md` |
71
+ | Implement | **Dynamic Selection** | "Develop story N.M" | See Agent Selection Logic below |
72
+ | Quality Gate | quality-gate-verifier | "Verify story N.M" | `.claude/agents/quality-gate-verifier.md` |
73
+ | Review | principal-code-reviewer | "Review story N.M" | `.claude/agents/principal-code-reviewer.md` |
74
+
75
+ **Agent Context Rules:**
76
+ - Each agent starts with fresh context
77
+ - Agents receive explicit task instructions
78
+ - No accumulated context between agent invocations
79
+
80
+ ### Development Agent Selection Logic
81
+
82
+ **Primary Source:** `.claude/agents/vt-bmad-dev-agents/`
83
+
84
+ The workflow should automatically determine the correct specialist dev agent based on:
85
+ - Story title and description
86
+ - Task types within the story
87
+ - Technology stack involved (e.g., frontend, backend, database, API)
88
+
89
+ **Selection Algorithm:**
90
+ 1. Parse story content (title, tasks, dev notes)
91
+ 2. Scan `.claude/agents/vt-bmad-dev-agents/` for available specialist agents
92
+ 3. Match story requirements to agent specializations (based on agent descriptions)
93
+ 4. If match found → invoke specialist agent
94
+ 5. If no match found → fallback to `dev` (Amelia) agent at `_bmad/bmm/agents/dev.md`
95
+
96
+ **Example Specialist Agents (to be created):**
97
+ - `frontend-specialist.md` - React, Next.js, UI components
98
+ - `backend-specialist.md` - API routes, server logic
99
+ - `database-specialist.md` - Schema, migrations, queries
100
+ - `integration-specialist.md` - External APIs, third-party services
101
+
102
+ ### Specialist Agent Format
103
+
104
+ Each specialist agent in `.claude/agents/vt-bmad-dev-agents/` must follow this structure:
105
+
106
+ ```markdown
107
+ ---
108
+ name: frontend-specialist
109
+ specialty: React/Next.js UI components and frontend architecture
110
+ description: Specialist dev agent for frontend implementation...
111
+ model: sonnet
112
+ ---
113
+
114
+ ## Specialty Context
115
+
116
+ **Domain:** Frontend Development
117
+ **Technologies:** React, Next.js, TypeScript, Tailwind CSS, Shadcn/UI
118
+ **Story Types:** UI components, pages, client-side logic, styling
119
+ **Keywords:** component, page, UI, form, button, modal, layout, responsive
120
+
121
+ ## Matching Criteria
122
+ - Story title contains: "UI", "component", "page", "frontend"
123
+ - Tasks involve: React components, CSS, client-side state
124
+ - Dev Notes reference: src/components/*, src/app/*
125
+ ```
126
+
127
+ The orchestrator scans:
128
+ 1. `specialty` field (one-liner in frontmatter)
129
+ 2. `Specialty Context` section for detailed matching
130
+
131
+ ### Agent Handoff Contract
132
+
133
+ **Dual Communication Model:**
134
+
135
+ **PRIMARY: File Artifacts**
136
+ - `story-{N.M}.md` - created/updated by agents
137
+ - `sprint-status.yaml` - status field updated atomically
138
+ - `completion-report-{N.M}.md` - optional detailed log
139
+
140
+ **SECONDARY: Structured Handoff Message**
141
+
142
+ Each agent outputs a parseable handoff block at completion:
143
+
144
+ ```
145
+ === AGENT HANDOFF ===
146
+ agent: dev | story-prep-master | principal-code-reviewer
147
+ story: N.M
148
+ status: completed | failed | blocked
149
+ files_changed:
150
+ - path/to/file1.tsx
151
+ - path/to/file2.test.tsx
152
+ tests_passed: true | false
153
+ tests_run: 12
154
+ tests_failed: 0
155
+ coverage: 92%
156
+ blockers: none | ["db_migration_required", "architecture_decision"]
157
+ next_action: proceed | escalate | retry
158
+ error_summary: null | "Brief description of failure"
159
+ === END HANDOFF ===
160
+ ```
161
+
162
+ **Orchestrator Validation:**
163
+ 1. Parse structured handoff message
164
+ 2. Verify against sprint-status.yaml
165
+ 3. Double-check = reliable status determination
166
+
167
+ ### Quality Gate Agent
168
+
169
+ **Agent:** `quality-gate-verifier`
170
+ **Location:** `.claude/agents/quality-gate-verifier.md`
171
+ **Purpose:** Independent verification of implementation quality before code review
172
+
173
+ **Why Separate Agent:**
174
+ - Fresh context for objective verification
175
+ - Preserves orchestrator's context window
176
+ - Independent verification (doesn't trust dev agent's self-reporting)
177
+
178
+ **Agent Responsibilities:**
179
+ 1. Run test suite independently (`npm test` or equivalent)
180
+ 2. Generate and parse coverage report
181
+ 3. Compare actual results with dev agent's handoff message
182
+ 4. Detect discrepancies (if dev agent misreported)
183
+ 5. Check for test quality indicators (not just pass/fail)
184
+ 6. Validate no skipped or pending tests
185
+
186
+ **Checks:**
187
+ - All tests pass (independently verified)
188
+ - Coverage meets threshold (configurable, default 80%)
189
+ - No skipped/pending tests
190
+ - Handoff message matches actual results
191
+ - No unresolved blockers in code (TODO/FIXME checks)
192
+
193
+ **Handoff Output:**
194
+ ```
195
+ === QUALITY GATE HANDOFF ===
196
+ agent: quality-gate-verifier
197
+ story: N.M
198
+ verification_status: passed | failed | suspicious
199
+ tests_run: 12
200
+ tests_passed: 12
201
+ tests_failed: 0
202
+ tests_skipped: 0
203
+ coverage: 92%
204
+ dev_handoff_match: true | false
205
+ issues_found:
206
+ - none | [list of issues]
207
+ recommendation: proceed | retry | escalate
208
+ notes: "Optional verification notes"
209
+ === END HANDOFF ===
210
+ ```
211
+
212
+ **Actions:**
213
+ - Pass → proceed to code-review
214
+ - Fail (simple) → retry dev-story (up to 3 attempts)
215
+ - Fail (complex) → escalate to human
216
+ - Suspicious (handoff mismatch) → escalate with warning
217
+
218
+ ### Input Requirements
219
+
220
+ | Input | Format | Source |
221
+ |-------|--------|--------|
222
+ | Epic File | BMAD epics-template format | `_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md` |
223
+ | Sprint Status | YAML status tracking | `_bmad/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml` |
224
+ | Project Context | Markdown (optional) | `**/project-context.md` |
225
+
226
+ **Story Format Reference:** `_bmad/bmm/workflows/4-implementation/create-story/template.md`
227
+
228
+ ### Output Specifications
229
+
230
+ | Output | Description |
231
+ |--------|-------------|
232
+ | Updated sprint-status.yaml | Status updated after each story phase |
233
+ | Story files | Created by story-prep-master for each story |
234
+ | Epic Completion Report | Simple summary of execution (stories completed, failed, time, issues) |
235
+
236
+ ### Autonomy & Human Checkpoint Rules
237
+
238
+ **Fully Autonomous Unless:**
239
+ - Database migration required
240
+ - New architecture decision needed (rare)
241
+ - Critical blocker encountered
242
+ - Complex failure that cannot be auto-resolved
243
+
244
+ **Human has pre-reviewed epic** - no need for approval checkpoints during normal execution.
245
+
246
+ ### Failure Handling Strategy
247
+
248
+ | Failure Type | Action |
249
+ |--------------|--------|
250
+ | Simple (lint, type errors, fixable test failures) | Auto-retry up to 3 attempts |
251
+ | Moderate (test failures requiring code changes) | Agent attempts fix, escalate after 2 failed attempts |
252
+ | Complex (architectural issues, missing dependencies) | Stop immediately, escalate with full context |
253
+
254
+ **Escalation Information:**
255
+ - Error logs and stack traces
256
+ - What was attempted
257
+ - Suggested fixes (if identifiable)
258
+ - Full context of the story being executed
259
+
260
+ ### Progress Tracking
261
+
262
+ - Use existing BMAD sprint-status.yaml format
263
+ - Update status after each phase:
264
+ - `backlog` → `ready-for-dev` (after story creation)
265
+ - `ready-for-dev` → `in-progress` (during dev)
266
+ - `in-progress` → `review` (after dev complete)
267
+ - `review` → `done` (after code review passes)
268
+
269
+ ### Story Execution Order
270
+
271
+ - **Linear execution** - stories processed in order as they appear in epic
272
+ - No complex dependency handling required
273
+ - If a story fails and escalates, workflow pauses at that story
274
+
275
+ ### Instruction Style
276
+
277
+ - **Intent-Based** for orchestration logic (flexible, adaptive)
278
+ - **Prescriptive** for agent invocation (exact commands)
279
+
280
+ ### Success Criteria
281
+
282
+ 1. All stories in epic reach `done` status
283
+ 2. All code reviews pass
284
+ 3. Sprint-status.yaml accurately reflects completion
285
+ 4. Completion report generated
286
+ 5. No unhandled failures or silent errors
287
+
288
+ ---
289
+
290
+ ## Tools Configuration
291
+
292
+ ### Core LLM Features (Required)
293
+
294
+ | Tool | Status | Purpose |
295
+ |------|--------|---------|
296
+ | **Sub-Agents** | ✅ Required | Core orchestration - spawn story-prep-master, dev agents, principal-code-reviewer |
297
+ | **File I/O** | ✅ Required | Read epic files, update sprint-status.yaml, create/update story files |
298
+ | **Web-Browsing** | ✅ Included | Research documentation, troubleshoot issues, access current information |
299
+
300
+ ### Memory Systems
301
+
302
+ | Tool | Status | Purpose |
303
+ |------|--------|---------|
304
+ | **Sidecar File** | ✅ Included | Persist epic execution state across session boundaries, track progress, enable resume |
305
+
306
+ **Sidecar File Schema:**
307
+ ```yaml
308
+ epic_execution_state:
309
+ epic_file: "path/to/epic.md"
310
+ current_story: "2.3"
311
+ stories_completed: ["2.1", "2.2"]
312
+ stories_pending: ["2.3", "2.4", "2.5"]
313
+ last_action: "dev-story"
314
+ last_status: "in-progress"
315
+ started_at: "2026-01-03T10:00:00Z"
316
+ last_updated: "2026-01-03T14:30:00Z"
317
+ ```
318
+
319
+ ### Core BMAD Tools
320
+
321
+ | Tool | Status | Reason |
322
+ |------|--------|--------|
323
+ | **Party-Mode** | ❌ Excluded | Not needed for autonomous execution |
324
+ | **Advanced Elicitation** | ❌ Excluded | Not needed for autonomous execution |
325
+ | **Brainstorming** | ❌ Excluded | Not a creative workflow |
326
+
327
+ ### External Integrations
328
+
329
+ | Tool | Status | Implementation | Purpose |
330
+ |------|--------|----------------|---------|
331
+ | **Git Auto-Commit** | ✅ Included | Bash tool (`git add . && git commit`) | Commit after each story completion |
332
+ | **Context-7 MCP** | ✅ Required | MCP server | Access up-to-date API docs and library references |
333
+ | **Playwright MCP** | ⚪ Optional | MCP server (if installed) | E2E testing automation |
334
+
335
+ ### Git Auto-Commit Integration
336
+
337
+ After each story reaches `done` status:
338
+ ```bash
339
+ git add .
340
+ git commit -m "feat(story-N.M): [story title]
341
+
342
+ Implemented via implement-epic-with-subagents workflow.
343
+ Agent: [dev-agent-name]
344
+ Coverage: [X]%
345
+ Tests: [passed/total]
346
+
347
+ Co-Authored-By: [agent-name] <noreply@anthropic.com>"
348
+ ```
349
+
350
+ **Commit Timing:**
351
+ - After code-review passes
352
+ - Before moving to next story
353
+ - Include structured commit message with story context
354
+
355
+ ### Installation Requirements
356
+
357
+ | Tool | Requires Install | Status |
358
+ |------|------------------|--------|
359
+ | Context-7 MCP | Yes | Required - must be configured |
360
+ | Playwright MCP | Yes | Optional - use if available |
361
+ | All other tools | No | Built-in LLM capabilities |
362
+
363
+ ---
364
+
365
+ ## Output Format Design
366
+
367
+ ### Output Documents Summary
368
+
369
+ | Output | Format Type | Template Source |
370
+ |--------|-------------|-----------------|
371
+ | Story files | Strict | Existing BMAD template (`create-story/template.md`) |
372
+ | Sidecar state file | Strict | YAML schema (defined in Tools Configuration) |
373
+ | Epic Completion Report | Structured | New template (below) |
374
+
375
+ ### Epic Completion Report Template
376
+
377
+ **Format Type:** Structured (required sections, flexible content)
378
+ **File Format:** Markdown
379
+ **Location:** `{output_folder}/epic-reports/epic-completion-{epic-name}-{date}.md`
380
+
381
+ ```markdown
382
+ # Epic Completion Report: {epic_name}
383
+
384
+ ## Execution Summary
385
+
386
+ | Field | Value |
387
+ |-------|-------|
388
+ | **Epic File** | {epic_file_path} |
389
+ | **Started** | {start_timestamp} |
390
+ | **Completed** | {end_timestamp} |
391
+ | **Duration** | {total_duration} |
392
+ | **Status** | Completed | Partial | Failed |
393
+
394
+ ## Stories Execution
395
+
396
+ | Story | Title | Status | Agent | Coverage | Tests | Duration |
397
+ |-------|-------|--------|-------|----------|-------|----------|
398
+ | N.M | {title} | done/failed | {agent_name} | X% | P/T | Xm |
399
+
400
+ ### Stories Completed: {completed_count}/{total_count}
401
+
402
+ ## Quality Metrics
403
+
404
+ - **Average Coverage:** {avg_coverage}%
405
+ - **Total Tests Run:** {total_tests}
406
+ - **Tests Passed:** {passed_tests}
407
+ - **Tests Failed:** {failed_tests}
408
+ - **Git Commits Created:** {commit_count}
409
+
410
+ ## Agent Selection Summary
411
+
412
+ | Agent | Stories Handled | Selection Reason |
413
+ |-------|-----------------|------------------|
414
+ | {agent_name} | [N.M, N.M] | {matching_criteria} |
415
+
416
+ ## Issues & Escalations
417
+
418
+ ### Retries
419
+ - {story}: {retry_reason} - {outcome}
420
+
421
+ ### Escalations
422
+ - {story}: {escalation_reason} - {resolution}
423
+
424
+ ### Blockers Encountered
425
+ - {blocker_description}
426
+
427
+ ## Session Information
428
+
429
+ - **Orchestrator Sessions:** {session_count}
430
+ - **Resume Points:** {resume_count}
431
+ - **Sidecar File:** {sidecar_path}
432
+ ```
433
+
434
+ ### Template Placeholders
435
+
436
+ | Placeholder | Source |
437
+ |-------------|--------|
438
+ | `{epic_name}` | Parsed from epic file |
439
+ | `{start_timestamp}` | Workflow initialization |
440
+ | `{end_timestamp}` | Final story completion |
441
+ | `{agent_name}` | Dynamic agent selection |
442
+ | `{coverage}` | Quality gate handoff |
443
+
444
+ ---
445
+
446
+ ## Workflow Structure Design
447
+
448
+ ### Step Architecture Overview
449
+
450
+ ```
451
+ step-01-init.md ─────→ step-02-orchestrate.md ─────→ step-03-complete.md
452
+ │ ↑
453
+ ↓ │
454
+ step-01b-continue.md ───────────┘
455
+ ```
456
+
457
+ ### Step Definitions
458
+
459
+ #### Step 1: Initialization (`step-01-init.md`)
460
+
461
+ **Purpose:** Load epic, validate prerequisites, initialize execution state
462
+
463
+ **Sequence:**
464
+ 1. Load epic file (prompt user for path or auto-detect)
465
+ 2. Parse all stories from epic (N.1, N.2, N.3...)
466
+ 3. Validate prerequisites:
467
+ - story-prep-master agent exists
468
+ - quality-gate-verifier agent exists
469
+ - principal-code-reviewer agent exists
470
+ - Specialist agents folder exists (or fallback dev agent)
471
+ - Context-7 MCP available
472
+ 4. Load sprint-status.yaml
473
+ 5. Check for existing sidecar file:
474
+ - If exists → route to step-01b-continue
475
+ - If not → create new sidecar file
476
+ 6. Present execution plan summary
477
+ 7. Menu: [C] Start Epic Execution
478
+
479
+ **Outputs:**
480
+ - Initialized sidecar state file
481
+ - Parsed story list in memory
482
+
483
+ ---
484
+
485
+ #### Step 1b: Continuation (`step-01b-continue.md`)
486
+
487
+ **Purpose:** Resume epic execution from previous session
488
+
489
+ **Sequence:**
490
+ 1. Load sidecar state file
491
+ 2. Determine resume point:
492
+ - Current story (N.M)
493
+ - Current phase (create/dev/quality/review)
494
+ - Stories completed vs pending
495
+ 3. Display progress summary
496
+ 4. Confirm with user
497
+ 5. Menu: [C] Continue from Story N.M | [R] Restart Epic
498
+
499
+ **Outputs:**
500
+ - Updated sidecar with resume timestamp
501
+
502
+ ---
503
+
504
+ #### Step 2: Orchestration Loop (`step-02-orchestrate.md`)
505
+
506
+ **Purpose:** Execute all stories autonomously with sub-agents
507
+
508
+ **Sequence:**
509
+ For each pending story in epic:
510
+
511
+ ```
512
+ ┌─────────────────────────────────────────────────────────────┐
513
+ │ STORY EXECUTION LOOP │
514
+ ├─────────────────────────────────────────────────────────────┤
515
+ │ │
516
+ │ PHASE A: Create Story │
517
+ │ ├── Update sidecar: current_phase = "create" │
518
+ │ ├── Spawn: story-prep-master agent │
519
+ │ ├── Instruction: "Create story N.M from epic" │
520
+ │ ├── Parse handoff message │
521
+ │ ├── Update sprint-status: story → ready-for-dev │
522
+ │ └── If failed → handle failure │
523
+ │ │
524
+ │ PHASE B: Develop Story │
525
+ │ ├── Update sidecar: current_phase = "dev" │
526
+ │ ├── Select specialist agent (or fallback to dev) │
527
+ │ ├── Spawn: selected dev agent │
528
+ │ ├── Instruction: "Develop story N.M" │
529
+ │ ├── Parse handoff message │
530
+ │ ├── Update sprint-status: story → in-progress │
531
+ │ └── If failed → handle failure │
532
+ │ │
533
+ │ PHASE C: Quality Gate │
534
+ │ ├── Update sidecar: current_phase = "quality" │
535
+ │ ├── Spawn: quality-gate-verifier agent │
536
+ │ ├── Instruction: "Verify story N.M" │
537
+ │ ├── Parse handoff message │
538
+ │ ├── If failed → retry dev (up to 3x) or escalate │
539
+ │ └── If passed → proceed │
540
+ │ │
541
+ │ PHASE D: Code Review │
542
+ │ ├── Update sidecar: current_phase = "review" │
543
+ │ ├── Spawn: principal-code-reviewer agent │
544
+ │ ├── Instruction: "Review story N.M" │
545
+ │ ├── Parse handoff message │
546
+ │ ├── Update sprint-status: story → review │
547
+ │ └── If failed → handle failure │
548
+ │ │
549
+ │ PHASE E: Git Commit │
550
+ │ ├── Update sidecar: current_phase = "commit" │
551
+ │ ├── Execute: git add . && git commit │
552
+ │ └── Commit message with story context │
553
+ │ │
554
+ │ PHASE F: Finalize Story │
555
+ │ ├── Update sprint-status: story → done │
556
+ │ ├── Update sidecar: add to stories_completed │
557
+ │ ├── Output brief status to user │
558
+ │ └── Proceed to next story │
559
+ │ │
560
+ └─────────────────────────────────────────────────────────────┘
561
+ ```
562
+
563
+ **Failure Handling:**
564
+
565
+ ```
566
+ On failure (after retries exhausted):
567
+ 1. Determine failure type (simple/moderate/complex)
568
+ 2. If simple: auto-retry (already handled)
569
+ 3. If requires human input:
570
+ a. Display failure context
571
+ b. Present options: [S] Skip this story | [X] Stop execution
572
+ c. Wait for user decision
573
+ d. If Skip: mark story as skipped, continue
574
+ e. If Stop: save state, proceed to step-03 (partial)
575
+ ```
576
+
577
+ **Progress Reporting:**
578
+
579
+ After each story completion:
580
+ ```
581
+ ✅ Story N.M: [title]
582
+ Agent: [agent-name] | Coverage: X% | Tests: P/T | Duration: Xm
583
+ ```
584
+
585
+ **Outputs:**
586
+ - Created story files
587
+ - Git commits
588
+ - Updated sprint-status.yaml
589
+ - Updated sidecar state
590
+
591
+ ---
592
+
593
+ #### Step 3: Completion (`step-03-complete.md`)
594
+
595
+ **Purpose:** Generate completion report, finalize epic
596
+
597
+ **Sequence:**
598
+ 1. Gather all execution data from sidecar
599
+ 2. Generate Epic Completion Report (using template)
600
+ 3. Save report to output folder
601
+ 4. Update sprint-status: epic → done (or partial)
602
+ 5. Optionally archive/delete sidecar file
603
+ 6. Present summary to user
604
+
605
+ **Outputs:**
606
+ - Epic Completion Report (markdown)
607
+ - Final sprint-status.yaml update
608
+
609
+ ---
610
+
611
+ ### Design Decisions
612
+
613
+ | Decision | Choice | Rationale |
614
+ |----------|--------|-----------|
615
+ | **Escalation Handling** | Pause in same session | User can resolve immediately without context loss |
616
+ | **Progress Reporting** | Brief status per story | Keeps user informed without verbose output |
617
+ | **Story Failure** | Ask user to skip or stop | User decides based on epic context and dependencies |
618
+
619
+ ### Interaction Patterns
620
+
621
+ | Phase | User Interaction Level |
622
+ |-------|------------------------|
623
+ | Init | Interactive (confirm epic, start) |
624
+ | Continue | Interactive (confirm resume) |
625
+ | Orchestration | Autonomous (interrupt only on blocker) |
626
+ | Failure | Interactive (skip/stop decision) |
627
+ | Complete | Interactive (review summary) |
628
+
629
+ ### File Structure
630
+
631
+ ```
632
+ implement-epic-with-subagents/
633
+ ├── workflow.yaml # Workflow configuration
634
+ ├── workflow.md # Main workflow entry (optional)
635
+ ├── steps/
636
+ │ ├── step-01-init.md
637
+ │ ├── step-01b-continue.md
638
+ │ ├── step-02-orchestrate.md
639
+ │ └── step-03-complete.md
640
+ ├── templates/
641
+ │ └── epic-completion-report.md
642
+ └── validation/
643
+ └── checklist.md # Pre-execution validation
644
+ ```
645
+
646
+ ### State Management
647
+
648
+ **Sidecar File Updates:**
649
+ - On init: Create with epic info + story list
650
+ - On each phase start: Update current_story, current_phase
651
+ - On story complete: Add to stories_completed
652
+ - On failure: Record failure details
653
+ - On resume: Add resume timestamp
654
+
655
+ ### Agent Spawning Pattern
656
+
657
+ ```
658
+ Task tool invocation:
659
+ {
660
+ subagent_type: "general-purpose",
661
+ prompt: "[Agent instructions with story context]",
662
+ description: "[Phase] story N.M"
663
+ }
664
+ ```
665
+
666
+ Each agent receives:
667
+ - Story file path
668
+ - Sprint status path
669
+ - Project context path (if exists)
670
+ - Specific task instructions
671
+
672
+ ---
673
+
674
+ ## Build Summary
675
+
676
+ ### Files Generated
677
+
678
+ **Workflow Files:**
679
+ | File | Path | Size |
680
+ |------|------|------|
681
+ | workflow.yaml | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/workflow.yaml` | Main config |
682
+ | step-01-init.md | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/steps/step-01-init.md` | Initialization |
683
+ | step-01b-continue.md | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/steps/step-01b-continue.md` | Continuation |
684
+ | step-02-orchestrate.md | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/steps/step-02-orchestrate.md` | Main loop |
685
+ | step-03-complete.md | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/steps/step-03-complete.md` | Completion |
686
+
687
+ **Templates:**
688
+ | File | Path |
689
+ |------|------|
690
+ | epic-completion-report.md | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/templates/epic-completion-report.md` |
691
+
692
+ **Validation:**
693
+ | File | Path |
694
+ |------|------|
695
+ | checklist.md | `_bmad-output/bmb-creations/workflows/implement-epic-with-subagents/validation/checklist.md` |
696
+
697
+ **New Agents Created:**
698
+ | Agent | Path |
699
+ |-------|------|
700
+ | quality-gate-verifier | `.claude/agents/quality-gate-verifier.md` |
701
+
702
+ **Folders Created:**
703
+ | Folder | Purpose |
704
+ |--------|---------|
705
+ | `.claude/agents/vt-bmad-dev-agents/` | Specialist dev agents (empty, ready for population) |
706
+
707
+ ### Installation Notes
708
+
709
+ To install workflow to bmm module:
710
+ ```bash
711
+ cp -r _bmad-output/bmb-creations/workflows/implement-epic-with-subagents _bmad/bmm/workflows/4-implementation/
712
+ ```
713
+
714
+ ### Next Steps
715
+
716
+ 1. **Review generated files** - Verify content matches requirements
717
+ 2. **Create specialist agents** - Populate `.claude/agents/vt-bmad-dev-agents/` with specialists
718
+ 3. **Test workflow** - Run with a small epic to validate
719
+ 4. **Install to bmm** - Copy to final location when ready
720
+
721
+ ### Build Timestamp
722
+
723
+ Generated: 2026-01-04
724
+
725
+ ---
726
+
727
+ ## Fresh-Eyes Review (2026-01-04)
728
+
729
+ ### Validation Results
730
+
731
+ | Category | Result |
732
+ |----------|--------|
733
+ | Configuration validation | ⚠️ PASSED with notes |
734
+ | Step compliance | ✅ PASSED |
735
+ | Cross-file consistency | ⚠️ PASSED with notes |
736
+ | Requirements verification | ✅ PASSED |
737
+
738
+ ### Issues Found
739
+
740
+ **Warnings (2):**
741
+ 1. **Config Path Assumption** - workflow.yaml references `_bmad/bmm/config.yaml`. Verify bmm config exists with `implementation_artifacts` before first run.
742
+ 2. **Template Placeholder Syntax** - epic-completion-report.md uses `{{placeholder}}` while steps use `{variable}`. Minor inconsistency.
743
+
744
+ **Suggestions (2):**
745
+ 1. Consider adding `validation/pre-flight.sh` script for automated checks
746
+ 2. Include example specialist agent template in package
747
+
748
+ ### Review Outcome
749
+
750
+ All critical checks passed. Workflow is ready for deployment and testing. Minor warnings are documented for awareness but do not block usage.
751
+
752
+ ### Reviewer Notes
753
+
754
+ - All original requirements from plan are implemented
755
+ - Step files follow BMAD template structure
756
+ - Agent orchestration pattern is well-designed
757
+ - Failure handling is comprehensive
758
+ - Resume capability via sidecar is robust