murmur8 4.3.4 → 4.5.0

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.
package/SKILL.md CHANGED
@@ -27,95 +27,24 @@ description: Run the Alex → Cass → Nigel → Codey pipeline using Task tool
27
27
  | `{HANDOFF_NIGEL}` | `{FEAT_DIR}/handoff-nigel.md` |
28
28
  | `{BACKLOG}` | `.blueprint/features/BACKLOG.md` |
29
29
 
30
- ## Multi-Feature Paths (Murmuration Mode)
31
-
32
- | Var | Path |
33
- |-----|------|
34
- | `{WORKTREE_DIR}` | `.claude/worktrees` |
35
- | `{WORKTREE_slug}` | `{WORKTREE_DIR}/feat-{slug}` |
36
- | `{MURM_QUEUE}` | `.claude/murm-queue.json` |
37
-
38
30
  ## Invocation
39
31
 
40
32
  ```bash
41
- # Single feature
42
- /implement-feature # Interactive slug prompt
43
- /implement-feature "user-auth" # New feature
44
- /implement-feature "user-auth" --interactive # Force interactive spec creation
45
- /implement-feature "user-auth" --pause-after=alex|cass|nigel|codey-plan
46
- /implement-feature "user-auth" --no-commit
47
- /implement-feature "user-auth" --no-diff-preview # Skip diff preview before commit
48
- /implement-feature "user-auth" --no-feedback # Skip feedback collection
49
- /implement-feature "user-auth" --no-validate # Skip pre-flight validation
50
- /implement-feature "user-auth" --no-history # Skip history recording
51
-
52
- # Multiple features — parallel execution (murmuration mode)
53
- /implement-feature feat-a feat-b feat-c # Run 3 features in parallel
54
- /implement-feature feat-a feat-b --max-concurrency=2 # Limit parallelism
55
- /implement-feature feat-a feat-b --sequential # Run one at a time (no worktrees)
33
+ /implement-feature "slug" # Single feature
34
+ /implement-feature "slug" --pause-after=alex|cass|nigel|codey-plan
35
+ /implement-feature "slug" --no-commit|--no-feedback|--no-validate|--no-history|--no-diff-preview
36
+ /implement-feature "slug" --interactive # Force interactive spec creation
37
+ /implement-feature feat-a feat-b feat-c # Multiple → murmuration mode
56
38
  ```
57
39
 
58
- ## Pipeline Overview
40
+ ## Pipeline Flow
59
41
 
60
42
  ```
61
- /implement-feature "slug"
62
-
63
-
64
- ┌─────────────────────────────────────────┐
65
- │ 0. Pre-flight validation (validate.js) │
66
- │ 1. Parse args, get slug │
67
- │ 2. Check system spec exists (gate) │
68
- │ 3. Show insights preview (insights.js) │
69
- │ 4. Initialize queue + history entry │
70
- │ 5. Route based on flags/state │
71
- └─────────────────────────────────────────┘
72
-
73
-
74
- ALEX → [feedback] → CASS → [feedback] → NIGEL → [feedback] → CODEY
75
- │ │
76
- └──────────── Record timing + tokens in history.js ─────────┘
77
- │ │
78
- └──────────── On failure: retry.js strategy ────────────────┘
79
-
80
-
81
- DIFF-PREVIEW → AUTO-COMMIT → Record completion + cost in history
43
+ ALEX → [feedback] → CASS → [feedback] → NIGEL(spec) → NIGEL(tests) → [feedback] → CODEY(plan) → CODEY(steps) → DIFF-PREVIEW → COMMIT
82
44
  ```
83
45
 
84
- ## Multi-Feature Pipeline Overview (Murmuration Mode)
85
-
86
- When multiple slugs are provided, the pipeline uses worktree isolation and parallel Task sub-agents:
87
-
88
- ```
89
- /implement-feature slug-a slug-b slug-c
90
-
91
-
92
- ┌─────────────────────────────────────────────────────┐
93
- │ M0. Detect multi-feature mode │
94
- │ M1. Pre-flight validation for ALL features │
95
- │ M2. Check for file overlap conflicts │
96
- │ M3. Create git worktrees (one per feature) │
97
- └─────────────────────────────────────────────────────┘
98
-
99
-
100
- ┌─────────────────────────────────────────────────────┐
101
- │ M4. Spawn PARALLEL Task sub-agents │
102
- │ │
103
- │ Task(slug-a) ─┐ │
104
- │ Task(slug-b) ─┼─► Run concurrently │
105
- │ Task(slug-c) ─┘ │
106
- │ │
107
- │ Each Task runs full pipeline in its worktree: │
108
- │ Alex → [Cass] → Nigel → Codey │
109
- └─────────────────────────────────────────────────────┘
110
-
111
-
112
- ┌─────────────────────────────────────────────────────┐
113
- │ M5. Collect results as sub-agents complete │
114
- │ M6. Merge successful features to main │
115
- │ M7. Report conflicts/failures │
116
- │ M8. Cleanup worktrees │
117
- └─────────────────────────────────────────────────────┘
118
- ```
46
+ On failure at any stage: load `.blueprint/prompts/skill-error-recovery.md`
47
+ Multiple slugs: load `.blueprint/prompts/skill-murm-mode.md`
119
48
 
120
49
  ## Output Constraints (CRITICAL)
121
50
 
@@ -156,304 +85,13 @@ node bin/cli.js validate
156
85
 
157
86
  ---
158
87
 
159
- ## Step M0: Multi-Feature Detection
88
+ ## Murmuration Mode (Multi-Feature)
160
89
 
161
90
  **Trigger:** More than one slug provided in arguments.
162
91
 
163
- Parse all slugs from arguments:
164
- ```
165
- /implement-feature feat-a feat-b feat-c --no-commit
166
- → slugs = ["feat-a", "feat-b", "feat-c"]
167
- → flags = { noCommit: true }
168
- ```
169
-
170
- **Routing:**
171
- - If `slugs.length > 1`: Enter murmuration mode (Steps M1-M8)
172
- - If `slugs.length === 1`: Continue to Step 1 (single-feature mode)
173
- - If `--sequential` flag: Run features one at a time without worktrees
174
-
175
- ---
176
-
177
- ## Step M1: Multi-Feature Pre-flight Validation
178
-
179
- For EACH slug, verify:
180
- 1. Feature spec exists at `.blueprint/features/feature_{slug}/FEATURE_SPEC.md`
181
- 2. Spec has required sections (Intent, Scope, Actors)
182
-
183
- **Display validation table:**
184
- ```
185
- Pre-flight Validation
186
- =====================
187
-
188
- ✓ feat-a: Spec complete, 3 stories
189
- ✓ feat-b: Spec complete, 2 stories
190
- ✗ feat-c: Missing FEATURE_SPEC.md
191
- ```
92
+ **Load full instructions:** Read `.blueprint/prompts/skill-murm-mode.md` before proceeding.
192
93
 
193
- **On any failure:**
194
- - Show which features are not ready
195
- - Suggest: `/implement-feature "feat-c" --pause-after=alex` to create spec
196
- - Ask: "Continue with ready features only?" or "Abort"
197
-
198
- ---
199
-
200
- ## Step M2: Conflict Detection
201
-
202
- Scan implementation plans (if they exist) for file overlap:
203
-
204
- ```bash
205
- # For each feature with IMPLEMENTATION_PLAN.md, extract files to modify
206
- grep -h "src/\|lib/\|bin/" .blueprint/features/feature_*/IMPLEMENTATION_PLAN.md
207
- ```
208
-
209
- **Display if conflicts found:**
210
- ```
211
- Conflict Analysis
212
- =================
213
-
214
- ⚠ File overlap detected:
215
- • src/utils.js: feat-a, feat-b both modify
216
-
217
- Recommendation: Run feat-a and feat-b sequentially, or resolve manually.
218
- ```
219
-
220
- **On conflict:** Ask user to confirm or adjust feature list.
221
-
222
- ---
223
-
224
- ## Step M3: Create Worktrees
225
-
226
- For each validated slug, create an isolated git worktree:
227
-
228
- ```bash
229
- # Ensure clean working tree first
230
- git status --porcelain
231
-
232
- # Create worktrees (one per feature)
233
- git worktree add .claude/worktrees/feat-{slug-a} -b feature/{slug-a}
234
- git worktree add .claude/worktrees/feat-{slug-b} -b feature/{slug-b}
235
- git worktree add .claude/worktrees/feat-{slug-c} -b feature/{slug-c}
236
- ```
237
-
238
- **Announce:**
239
- ```
240
- Creating worktrees...
241
- ✓ .claude/worktrees/feat-a → branch feature/feat-a
242
- ✓ .claude/worktrees/feat-b → branch feature/feat-b
243
- ✓ .claude/worktrees/feat-c → branch feature/feat-c
244
- ```
245
-
246
- ---
247
-
248
- ## Step M4: Spawn Parallel Feature Pipelines
249
-
250
- **CRITICAL:** Use multiple Task tool calls IN THE SAME MESSAGE to run concurrently.
251
-
252
- For each feature, spawn a Task sub-agent that runs the COMPLETE pipeline in its worktree. All Task calls must be made in a single assistant response to enable parallel execution.
253
-
254
- ### Task Prompt Template (for each slug):
255
-
256
- Use the Task tool with `subagent_type="general-purpose"`:
257
-
258
- ```
259
- You are running the implement-feature pipeline for "{slug}".
260
-
261
- ## Working Directory
262
- All file operations must use this worktree: .claude/worktrees/feat-{slug}
263
-
264
- ## Task
265
- Run the complete feature pipeline in the worktree:
266
-
267
- 1. **Read Feature Spec**
268
- - Path: .claude/worktrees/feat-{slug}/.blueprint/features/feature_{slug}/FEATURE_SPEC.md
269
-
270
- 2. **Classify Feature**
271
- - Technical (refactoring, optimization, infrastructure): Skip to step 4
272
- - User-facing: Continue to step 3
273
-
274
- 3. **Cass** (if user-facing) — Write user stories
275
- - Read feature spec for context
276
- - Write story-*.md files to feature directory
277
- - Write handoff-cass.md
278
-
279
- 4. **Nigel** — Create tests
280
- - Read handoff (from Alex or Cass)
281
- - Write: .claude/worktrees/feat-{slug}/test/artifacts/feature_{slug}/test-spec.md
282
- - Write: .claude/worktrees/feat-{slug}/test/feature_{slug}.test.js
283
- - Write: handoff-nigel.md
284
-
285
- 5. **Codey Plan** — Create implementation plan
286
- - Read handoff-nigel.md
287
- - Write: IMPLEMENTATION_PLAN.md
288
-
289
- 6. **Codey Implement** — Write code to pass tests
290
- - Follow the implementation plan
291
- - Run tests: node --test test/feature_{slug}.test.js
292
- - Iterate until tests pass
293
-
294
- ## Rules
295
- - Work ONLY within .claude/worktrees/feat-{slug}
296
- - Do NOT commit changes (will be merged later)
297
- - Do NOT modify files outside the worktree
298
- - Run tests from within the worktree directory
299
-
300
- ## Completion
301
- When done, report status as:
302
- PIPELINE_RESULT: {"slug": "{slug}", "status": "success|failed", "tests": "X/Y passing", "files": ["list of created/modified files"], "error": "if failed, why"}
303
- ```
304
-
305
- **Example: 3 features in parallel**
306
-
307
- Make THREE Task tool calls in a single message:
308
- - Task 1: Pipeline for `feat-a` in `.claude/worktrees/feat-a`
309
- - Task 2: Pipeline for `feat-b` in `.claude/worktrees/feat-b`
310
- - Task 3: Pipeline for `feat-c` in `.claude/worktrees/feat-c`
311
-
312
- The Task tool executes these concurrently.
313
-
314
- ---
315
-
316
- ## Step M5: Collect Results
317
-
318
- As each Task sub-agent completes, parse its PIPELINE_RESULT:
319
-
320
- ```javascript
321
- results = [
322
- { slug: "feat-a", status: "success", tests: "5/5", files: ["src/a.js"] },
323
- { slug: "feat-b", status: "success", tests: "3/3", files: ["src/b.js"] },
324
- { slug: "feat-c", status: "failed", error: "Tests failed: 2/4 passing" }
325
- ]
326
- ```
327
-
328
- Wait for ALL sub-agents to complete before proceeding.
329
-
330
- ---
331
-
332
- ## Step M5.5: Diff Preview & Commit Worktree Changes
333
-
334
- For each successful pipeline, show diff preview (unless `--no-diff-preview`) then commit the changes in its worktree.
335
-
336
- **Diff Preview per Worktree:**
337
- - Show changes for each worktree before committing
338
- - User can approve/abort each worktree individually
339
- - If user aborts a worktree, mark it as `user-aborted` (not failed)
340
- - Continue to next worktree regardless
341
-
342
- **IMPORTANT:** Use absolute paths to avoid context confusion.
343
-
344
- ```bash
345
- # For each slug with status: "success"
346
- cd /absolute/path/to/.claude/worktrees/feat-{slug}
347
- git add -A
348
- git commit -m "feat({slug}): {brief summary from PIPELINE_RESULT}
349
-
350
- {tests} passing, {file count} files changed.
351
-
352
- Co-Authored-By: Claude <noreply@anthropic.com>"
353
- ```
354
-
355
- **Example with 3 features:**
356
- ```bash
357
- # Commit each worktree (can run in parallel)
358
- cd /workspaces/project/.claude/worktrees/feat-a && git add -A && git commit -m "..."
359
- cd /workspaces/project/.claude/worktrees/feat-b && git add -A && git commit -m "..."
360
- cd /workspaces/project/.claude/worktrees/feat-c && git add -A && git commit -m "..."
361
- ```
362
-
363
- **Skip failed pipelines** — their worktrees are preserved uncommitted for debugging.
364
-
365
- **Return to main repo** before proceeding to merge:
366
- ```bash
367
- cd /workspaces/project # Back to main repo root
368
- ```
369
-
370
- ---
371
-
372
- ## Step M6: Merge Successful Features
373
-
374
- For each feature with `status: "success"`:
375
-
376
- ```bash
377
- # From main repository (not worktree)
378
- git checkout main
379
-
380
- # Merge the feature branch
381
- git merge feature/{slug} --no-ff -m "feat({slug}): Add {slug} feature
382
-
383
- Implemented via murmuration pipeline.
384
-
385
- Co-Authored-By: Claude <noreply@anthropic.com>"
386
- ```
387
-
388
- **Handle merge conflicts:**
389
- - Do NOT force resolve or abort
390
- - Record: `{ slug, status: "conflict", branch: "feature/{slug}" }`
391
- - Preserve worktree for manual resolution
392
- - Continue merging other features
393
-
394
- ### Remove Merged Features from Backlog
395
-
396
- After all merges complete, update `{BACKLOG}` to remove successfully merged features:
397
-
398
- 1. Read `.blueprint/features/BACKLOG.md`
399
- 2. For each merged slug, remove its row from the table
400
- 3. Remove any corresponding Details sections
401
- 4. Write the updated backlog
402
- 5. Commit the backlog update:
403
- ```bash
404
- git add .blueprint/features/BACKLOG.md
405
- git commit -m "chore: remove completed features from backlog
406
-
407
- Removed: {list of merged slugs}
408
-
409
- Co-Authored-By: Claude <noreply@anthropic.com>"
410
- ```
411
-
412
- **If backlog doesn't exist:** Skip silently.
413
-
414
- ---
415
-
416
- ## Step M7: Report Summary
417
-
418
- **Display murmuration summary:**
419
- ```
420
- --- Murmuration Complete ---
421
-
422
- ## Landed (merged to main)
423
- ✓ feat-a: 5 tests passing, 3 files changed
424
- ✓ feat-b: 3 tests passing, 2 files changed
425
-
426
- ## Turbulence (merge conflicts)
427
- ⚠ (none)
428
-
429
- ## Lost Formation (pipeline failed)
430
- ✗ feat-c: Tests failed (2/4 passing)
431
- Worktree preserved: .claude/worktrees/feat-c
432
- To debug: cd .claude/worktrees/feat-c && node --test
433
-
434
- ## Next Steps
435
- - Run `node --test` to verify all merged tests pass
436
- - Resolve any conflicts manually, then: git worktree remove .claude/worktrees/feat-X
437
- ```
438
-
439
- ---
440
-
441
- ## Step M8: Cleanup Worktrees
442
-
443
- **For successfully merged features:**
444
- ```bash
445
- git worktree remove .claude/worktrees/feat-{slug} --force
446
- git branch -d feature/{slug} # Safe delete (already merged)
447
- ```
448
-
449
- **Preserve worktrees for:**
450
- - Failed pipelines (for debugging)
451
- - Merge conflicts (for manual resolution)
452
-
453
- **Final cleanup check:**
454
- ```bash
455
- git worktree list # Verify cleanup
456
- ```
94
+ **Summary:** Creates git worktrees for isolation, spawns parallel Task sub-agents (one per feature), merges successful features, preserves failures for debugging.
457
95
 
458
96
  ---
459
97
 
@@ -472,34 +110,9 @@ Check `{SYS_SPEC}` exists. If not: run Alex to create it, then **stop for review
472
110
 
473
111
  **Module:** `src/interactive.js`
474
112
 
475
- The pipeline automatically enters interactive mode when:
476
- 1. `--interactive` flag is explicitly passed
477
- 2. System spec (`{SYS_SPEC}`) is missing - creates system spec interactively
478
- 3. Feature spec (`{FEAT_SPEC}`) is missing - creates feature spec interactively
479
-
480
- **Interactive Session Flow:**
481
- ```
482
- idle → gathering → questioning → drafting → finalizing
483
- ```
484
-
485
- **Available Commands During Session:**
486
- | Command | Action |
487
- |---------|--------|
488
- | `/approve` or `yes` | Mark section complete, proceed to next |
489
- | `/change <feedback>` | Revise current section with feedback |
490
- | `/skip` | Mark section TBD, proceed to next |
491
- | `/restart` | Discard draft, restart current section |
492
- | `/abort` | Exit without writing spec |
493
- | `/done` | Finalize spec (if min sections complete) |
494
-
495
- **Minimum Required Sections:**
496
- - Feature spec: Intent, Scope, Actors
497
- - System spec: Purpose, Actors, Boundaries
498
-
499
- **On Interactive Completion:**
500
- - Writes spec to appropriate path
501
- - Generates `handoff-alex.md` with session metrics
502
- - Records `mode: "interactive"` in history entry
113
+ Enters interactive mode when: `--interactive` flag is set, or system/feature spec is missing.
114
+ Commands: `/approve`, `/change <feedback>`, `/skip`, `/restart`, `/abort`, `/done`
115
+ Minimum sections: Feature spec needs Intent, Scope, Actors. System spec needs Purpose, Actors, Boundaries.
503
116
 
504
117
  ### Step 3.5: Insights Preview (NEW)
505
118
 
@@ -525,19 +138,7 @@ If no history exists, skip this step silently.
525
138
  ### Step 5: Initialize
526
139
  Create/read `{QUEUE}`. Ensure dirs exist: `mkdir -p {FEAT_DIR} {TEST_DIR}`
527
140
 
528
- **History Integration (NEW):**
529
-
530
- Unless `--no-history` flag is set, start a history entry:
531
-
532
- ```javascript
533
- // Conceptual - orchestrator tracks this in memory
534
- historyEntry = {
535
- slug: "{slug}",
536
- startedAt: new Date().toISOString(),
537
- stages: {},
538
- feedback: {}
539
- }
540
- ```
141
+ Unless `--no-history`, start a history entry (slug, startedAt, stages, feedback).
541
142
 
542
143
  ---
543
144
 
@@ -599,8 +200,6 @@ Create a feature specification for "{slug}" that translates system intent into a
599
200
  ## Completion
600
201
  Brief summary (5 bullets max): intent, key behaviours, scope, story themes, tensions
601
202
 
602
- ## Reference
603
- For detailed guidance, see: .blueprint/agents/AGENT_SPECIFICATION_ALEX.md
604
203
  ```
605
204
 
606
205
  **On completion:**
@@ -613,17 +212,26 @@ For detailed guidance, see: .blueprint/agents/AGENT_SPECIFICATION_ALEX.md
613
212
 
614
213
  ---
615
214
 
616
- ## Step 6.5: Cass Feedback on Alex (NEW)
215
+ ## Step 6.5: Feedback — Cass Reviews Alex
617
216
 
618
217
  **Module:** `src/feedback.js`
619
218
 
620
- Unless `--no-feedback` flag is set, collect feedback before Cass writes stories:
219
+ Unless `--no-feedback` flag is set, spawn a micro-Task for quality assessment:
621
220
 
622
- **Prompt addition to Cass:**
221
+ Use the Task tool with `subagent_type="general-purpose"`:
222
+
223
+ **Prompt:**
623
224
  ```
624
- FEEDBACK FIRST: Rate Alex's spec 1-5, list issues (e.g., unclear-scope), recommend proceed|pause|revise.
625
- Format: FEEDBACK: {"rating":N,"issues":["..."],"rec":"proceed|pause|revise"}
626
- Then continue with your task.
225
+ You are Cass, reviewing Alex's feature specification for "{slug}".
226
+
227
+ Read: {FEAT_DIR}/FEATURE_SPEC.md
228
+
229
+ Rate the spec 1-5 on: clarity of intent, scope boundaries, testability of behaviours.
230
+ List any issues (e.g., unclear-scope, missing-actors, ambiguous-rules).
231
+ Recommend: proceed | pause | revise.
232
+
233
+ Output ONLY this line:
234
+ FEEDBACK: {"rating":N,"issues":["..."],"rec":"proceed|pause|revise"}
627
235
  ```
628
236
 
629
237
  **Quality Gate Check:**
@@ -654,9 +262,8 @@ You are Cass, the Story Writer Agent.
654
262
  Create user stories for feature "{slug}" with explicit, testable acceptance criteria.
655
263
 
656
264
  ## Inputs (read these files)
657
- - Handoff Summary: {FEAT_DIR}/handoff-alex.md (read FIRST for quick context)
658
- - Feature Spec: {FEAT_DIR}/FEATURE_SPEC.md (full details if needed)
659
- - System Spec: .blueprint/system_specification/SYSTEM_SPEC.md
265
+ - Handoff Summary: {FEAT_DIR}/handoff-alex.md
266
+ - Feature Spec: {FEAT_DIR}/FEATURE_SPEC.md
660
267
 
661
268
  ## Outputs (write these files)
662
269
  1. Create one markdown file per user story in {FEAT_DIR}/:
@@ -688,21 +295,17 @@ Each story must include:
688
295
  ```
689
296
 
690
297
  ## Rules
691
- - Read Alex's handoff summary FIRST for quick orientation
692
298
  - Write ONE story file at a time, then move to next
693
299
  - Write handoff summary LAST after all stories complete
694
- - Keep each story focused - split large stories into multiple files
300
+ - Keep each story focused split large stories into multiple files
695
301
  - Make routing explicit (Previous, Continue, conditional paths)
696
- - Reference feature spec by path for shared context
697
302
  - Do not guess policy detail without flagging assumptions
698
- - Avoid implicit behaviour - all routes must be explicit
303
+ - Avoid implicit behaviour all routes must be explicit
699
304
  - Handoff summary must be under 30 lines
700
305
 
701
306
  ## Completion
702
307
  Brief summary: story count, filenames, behaviours covered (5 bullets max)
703
308
 
704
- ## Reference
705
- For detailed guidance, see: .blueprint/agents/AGENT_BA_CASS.md
706
309
  ```
707
310
 
708
311
  **On completion:**
@@ -716,17 +319,24 @@ For detailed guidance, see: .blueprint/agents/AGENT_BA_CASS.md
716
319
 
717
320
  ---
718
321
 
719
- ## Step 7.5: Nigel Feedback on Cass (NEW)
322
+ ## Step 7.5: Feedback — Nigel Reviews Cass
720
323
 
721
324
  **Module:** `src/feedback.js`
722
325
 
723
- Unless `--no-feedback` flag is set:
326
+ Unless `--no-feedback` flag is set, spawn a micro-Task:
724
327
 
725
- **Prompt addition to Nigel:**
328
+ **Prompt:**
726
329
  ```
727
- FEEDBACK FIRST: Rate Cass's stories 1-5, list issues (e.g., ambiguous-ac), recommend proceed|pause|revise.
728
- Format: FEEDBACK: {"rating":N,"issues":["..."],"rec":"proceed|pause|revise"}
729
- Then continue with your task.
330
+ You are Nigel, reviewing Cass's user stories for "{slug}".
331
+
332
+ Read: {FEAT_DIR}/story-*.md
333
+
334
+ Rate the stories 1-5 on: testability of ACs, explicitness of routes, coverage of edge cases.
335
+ List any issues (e.g., ambiguous-ac, implicit-routing, missing-edge-case).
336
+ Recommend: proceed | pause | revise.
337
+
338
+ Output ONLY this line:
339
+ FEEDBACK: {"rating":N,"issues":["..."],"rec":"proceed|pause|revise"}
730
340
  ```
731
341
 
732
342
  **Quality Gate Check:** Same as Step 6.5
@@ -737,12 +347,14 @@ Then continue with your task.
737
347
 
738
348
  ## Step 8: Spawn Nigel Agent
739
349
 
740
- **Announce:** ` } Nigel — building tests`
350
+ **Announce:** ` } Nigel — building test spec`
741
351
 
742
- **History:** Record `stages.nigel.startedAt` before spawning.
352
+ **History:** Record `stages.nigelSpec.startedAt` before spawning.
743
353
 
744
354
  **Runtime prompt:** `.blueprint/prompts/nigel-runtime.md`
745
355
 
356
+ ### Step 8a: Nigel — Test Spec & Handoff
357
+
746
358
  Use the Task tool with `subagent_type="general-purpose"`:
747
359
 
748
360
  **Prompt:**
@@ -751,29 +363,22 @@ You are Nigel, the Tester Agent.
751
363
 
752
364
  ## Task
753
365
 
754
- Create tests for feature "{slug}" that expose ambiguities and provide a stable contract for implementation.
366
+ Create a test specification for feature "{slug}" that maps acceptance criteria to test cases and provides a stable contract for implementation.
755
367
 
756
368
  ## Inputs (read these files)
757
369
  - Handoff Summary: {FEAT_DIR}/handoff-cass.md (read FIRST for quick context)
758
- - Stories: {FEAT_DIR}/story-*.md (full details)
759
- - Feature Spec: {FEAT_DIR}/FEATURE_SPEC.md (if additional context needed)
370
+ - Stories: {FEAT_DIR}/story-*.md
760
371
 
761
372
  ## Outputs (write these files IN ORDER)
762
373
 
763
- Step 1: Write {TEST_DIR}/test-spec.md containing:
764
- - Brief understanding (5-10 lines)
765
- - AC to Test ID mapping table (compact)
766
- - Key assumptions (bullet list)
374
+ 1. Write {TEST_DIR}/test-spec.md containing:
375
+ - Brief understanding (5-10 lines)
376
+ - AC to Test ID mapping table (compact)
377
+ - Key assumptions (bullet list)
767
378
 
768
- Step 2: Write {TEST_FILE} containing:
769
- - Executable tests (Jest or Node test runner)
770
- - One describe block per story
771
- - One test per acceptance criterion
772
-
773
- Step 3: Write handoff summary to: {FEAT_DIR}/handoff-nigel.md
379
+ 2. Write handoff summary to: {FEAT_DIR}/handoff-nigel.md
774
380
 
775
381
  ## Handoff Summary Format
776
- ```markdown
777
382
  ## Handoff Summary
778
383
  **For:** Codey
779
384
  **Feature:** {slug}
@@ -781,37 +386,81 @@ Step 3: Write handoff summary to: {FEAT_DIR}/handoff-nigel.md
781
386
  ### Key Decisions
782
387
  - (1-5 bullets: test approach, mocking strategy, coverage focus)
783
388
 
784
- ### Files Created
785
- - {TEST_DIR}/test-spec.md
786
- - {TEST_FILE}
389
+ ### Files to Create
390
+ - {TEST_DIR}/test-spec.md (written)
391
+ - {TEST_FILE} (next step)
392
+
393
+ ### Test Structure
394
+ - (describe block names and test counts per story)
787
395
 
788
396
  ### Open Questions
789
397
  - (List any unresolved questions, or "None")
790
398
 
791
399
  ### Critical Context
792
400
  (Brief context Codey needs to implement effectively)
793
- ```
794
401
 
795
402
  ## Rules
796
- - Read Cass's handoff summary FIRST for quick orientation
797
- - Write test-spec.md FIRST, then write test file, then handoff summary LAST
403
+ - Write test-spec.md FIRST, then handoff summary
798
404
  - Keep test-spec.md under 100 lines using table format
799
- - Tests should be self-documenting with minimal comments
800
- - Reference story files by path in test descriptions
801
- - Make failure states meaningful
802
405
  - Focus on externally observable behaviour
406
+ - Label assumptions explicitly: `ASSUMPTION: [statement]`
803
407
  - Handoff summary must be under 30 lines
804
408
 
805
409
  ## Completion
806
- Brief summary: test count, AC coverage %, assumptions (5 bullets max)
410
+ Brief summary: test case count planned, AC coverage %, assumptions (5 bullets max)
411
+ ```
807
412
 
808
- ## Reference
809
- For detailed guidance, see: .blueprint/agents/AGENT_TESTER_NIGEL.md
413
+ **On completion:**
414
+ 1. Verify `{TEST_SPEC}` and `{FEAT_DIR}/handoff-nigel.md` exist
415
+ 2. **Record history:** `stages.nigelSpec = { completedAt, durationMs, status: "success" }`
416
+
417
+ **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
418
+
419
+ ---
420
+
421
+ ### Step 8b: Nigel — Executable Tests
422
+
423
+ **Announce:** ` } Nigel — writing executable tests`
424
+
425
+ **History:** Record `stages.nigelTests.startedAt` before spawning.
426
+
427
+ Use the Task tool with `subagent_type="general-purpose"`:
428
+
429
+ **Prompt:**
430
+ ```
431
+ You are Nigel, the Tester Agent.
432
+
433
+ ## Task
434
+
435
+ Write executable tests for feature "{slug}" based on the test specification.
436
+
437
+ ## Inputs (read these files)
438
+ - Test Spec: {TEST_DIR}/test-spec.md
439
+ - Stories: {FEAT_DIR}/story-*.md (for AC detail)
440
+
441
+ ## Outputs
442
+
443
+ Write {TEST_FILE} containing:
444
+ - Executable tests using the project's test runner (see `.claude/stack-config.json`)
445
+ - One describe block per story
446
+ - One test per acceptance criterion
447
+ - If more than 8 test cases: split into {TEST_FILE} and test/feature_{slug}-edge.test.js
448
+
449
+ ## Rules
450
+ - Tests should be self-documenting with minimal comments
451
+ - Reference story files by path in test descriptions
452
+ - Make failure states meaningful with expected error messages
453
+ - Focus on externally observable behaviour
454
+ - Deterministic tests (avoid flaky patterns)
455
+ - Cover boundaries: min/max, empty/null, invalid formats
456
+
457
+ ## Completion
458
+ Brief summary: test count, file(s) written, any tests deferred
810
459
  ```
811
460
 
812
461
  **On completion:**
813
- 1. Verify `{TEST_SPEC}`, `{TEST_FILE}`, and `{FEAT_DIR}/handoff-nigel.md` exist
814
- 2. **Record history:** `stages.nigel = { completedAt, durationMs, status: "success" }`
462
+ 1. Verify `{TEST_FILE}` exists
463
+ 2. **Record history:** `stages.nigelTests = { completedAt, durationMs, status: "success" }`
815
464
  3. Update queue: move feature to `codeyQueue`
816
465
  4. If `--pause-after=nigel`: Show test paths, ask user to continue
817
466
 
@@ -819,17 +468,25 @@ For detailed guidance, see: .blueprint/agents/AGENT_TESTER_NIGEL.md
819
468
 
820
469
  ---
821
470
 
822
- ## Step 8.5: Codey Feedback on Nigel (NEW)
471
+ ## Step 8.5: Feedback — Codey Reviews Nigel
823
472
 
824
473
  **Module:** `src/feedback.js`
825
474
 
826
- Unless `--no-feedback` flag is set:
475
+ Unless `--no-feedback` flag is set, spawn a micro-Task:
827
476
 
828
- **Prompt addition to Codey (Plan phase):**
477
+ **Prompt:**
829
478
  ```
830
- FEEDBACK FIRST: Rate Nigel's tests 1-5, list issues (e.g., over-mocked), recommend proceed|pause|revise.
831
- Format: FEEDBACK: {"rating":N,"issues":["..."],"rec":"proceed|pause|revise"}
832
- Then continue with your task.
479
+ You are Codey, reviewing Nigel's tests for "{slug}".
480
+
481
+ Read: {TEST_FILE}
482
+ Read: {TEST_DIR}/test-spec.md
483
+
484
+ Rate the tests 1-5 on: implementability, clarity of assertions, appropriate mocking level.
485
+ List any issues (e.g., over-mocked, untestable-assertion, missing-setup).
486
+ Recommend: proceed | pause | revise.
487
+
488
+ Output ONLY this line:
489
+ FEEDBACK: {"rating":N,"issues":["..."],"rec":"proceed|pause|revise"}
833
490
  ```
834
491
 
835
492
  **Quality Gate Check:** Same as Step 6.5
@@ -857,34 +514,44 @@ You are Codey, the Developer Agent.
857
514
  Create an implementation plan for feature "{slug}". Do NOT implement yet - planning only.
858
515
 
859
516
  ## Inputs (read these files)
860
- - Handoff Summary: {FEAT_DIR}/handoff-nigel.md (read FIRST for quick context)
517
+ - Handoff Summary: {FEAT_DIR}/handoff-nigel.md
861
518
  - Test Spec: {TEST_DIR}/test-spec.md
862
519
  - Tests: {TEST_FILE}
863
- - Feature Spec: {FEAT_DIR}/FEATURE_SPEC.md (if additional context needed)
864
- - Stories: {FEAT_DIR}/story-*.md (if additional context needed)
865
520
 
866
521
  ## Outputs (write this file)
867
522
  Write implementation plan to: {FEAT_DIR}/IMPLEMENTATION_PLAN.md
868
523
 
869
- Plan structure (aim for under 80 lines total):
870
- - Summary (2-3 sentences)
871
- - Files to Create/Modify (table: path | action | purpose)
872
- - Implementation Steps (numbered, max 10 steps)
873
- - Risks/Questions (bullet list, only if non-obvious)
524
+ Plan structure (aim for under 60 lines total):
525
+
526
+ ```markdown
527
+ ## Summary
528
+ (2-3 sentences: what this implements and the approach)
529
+
530
+ ## Steps
531
+ 1. [{file_path}] {CREATE|MODIFY} — {purpose} | Tests: {T-IDs}
532
+ 2. [{file_path}] {CREATE|MODIFY} — {purpose} | Tests: {T-IDs}
533
+ 3. [{file_path}] {CREATE|MODIFY} — {purpose} | Tests: {T-IDs}
534
+ ...
535
+
536
+ ## Risks
537
+ - (only if non-obvious, otherwise omit section)
538
+ ```
539
+
540
+ **CRITICAL FORMAT:** Each step MUST be exactly one line matching:
541
+ `N. [path/to/file.ext] ACTION — description | Tests: T-X.Y, T-X.Z`
542
+
543
+ This format is machine-parsed by the orchestrator. Do not deviate.
874
544
 
875
545
  ## Rules
876
- - Read Nigel's handoff summary FIRST for quick orientation
877
546
  - Do NOT write implementation code in this phase
878
- - Keep plan concise and actionable
547
+ - Keep plan concise one line per step, max 10 steps
879
548
  - Order steps to make tests pass incrementally
880
- - Identify which tests each step addresses
549
+ - Each step targets a single file and specific test IDs
881
550
  - Prefer editing existing files over creating new ones
882
551
 
883
552
  ## Completion
884
553
  Brief summary: files planned, step count, identified risks
885
554
 
886
- ## Reference
887
- For detailed guidance, see: .blueprint/agents/AGENT_DEVELOPER_CODEY.md
888
555
  ```
889
556
 
890
557
  **On completion:**
@@ -896,7 +563,7 @@ For detailed guidance, see: .blueprint/agents/AGENT_DEVELOPER_CODEY.md
896
563
 
897
564
  ---
898
565
 
899
- ## Step 10: Spawn Codey Agent (Implement)
566
+ ## Step 10: Spawn Codey Agent (Implement) — Orchestrator-Driven Loop
900
567
 
901
568
  **Announce:** ` } Codey — implementing feature`
902
569
 
@@ -904,7 +571,23 @@ For detailed guidance, see: .blueprint/agents/AGENT_DEVELOPER_CODEY.md
904
571
 
905
572
  **Runtime prompt:** `.blueprint/prompts/codey-implement-runtime.md`
906
573
 
907
- Use the Task tool with `subagent_type="general-purpose"`:
574
+ ### Orchestrator Reads the Plan
575
+
576
+ Before spawning Codey, the orchestrator reads `{PLAN}` and extracts the numbered steps. Each step becomes a separate, atomic Task call.
577
+
578
+ **Parsing:** Each step line matches: `N. [file_path] ACTION — description | Tests: T-IDs`
579
+ Extract: step number, file path, action (CREATE/MODIFY), description, and test IDs.
580
+
581
+ **Process:**
582
+ 1. Read `{FEAT_DIR}/IMPLEMENTATION_PLAN.md`
583
+ 2. Parse lines matching `^\d+\. \[` under `## Steps`
584
+ 3. For each parsed step, spawn a Codey Task with the step details
585
+ 4. After each step, run the mapped tests to verify
586
+ 5. If a step fails after retry, stop and report
587
+
588
+ ### Per-Step Task Prompt Template
589
+
590
+ For each implementation step N, use the Task tool with `subagent_type="general-purpose"`:
908
591
 
909
592
  **Prompt:**
910
593
  ```
@@ -912,44 +595,57 @@ You are Codey, the Developer Agent.
912
595
 
913
596
  ## Task
914
597
 
915
- Implement feature "{slug}" according to the plan. Work incrementally, making tests pass one group at a time.
598
+ Implement step {N} of the plan for feature "{slug}":
916
599
 
917
- ## Inputs (read these files)
918
- - Handoff Summary: {FEAT_DIR}/handoff-nigel.md (read FIRST for quick context)
919
- - Implementation Plan: {FEAT_DIR}/IMPLEMENTATION_PLAN.md
600
+ > {paste the exact step text from IMPLEMENTATION_PLAN.md}
601
+
602
+ ## Context
920
603
  - Tests: {TEST_FILE}
604
+ - Plan: {FEAT_DIR}/IMPLEMENTATION_PLAN.md (for reference only)
605
+ - This step should make these tests pass: {test names from plan, if mapped}
921
606
 
922
- ## Process (INCREMENTAL - one file at a time)
923
- 1. Read Nigel's handoff summary for orientation
924
- 2. Run tests first: node --test {TEST_FILE}
925
- 3. For each failing test group:
926
- a. Identify the minimal code needed
927
- b. Write or edit ONE file
928
- c. Run tests again
929
- d. Repeat until group passes
930
- 3. Move to next test group
607
+ ## Process
608
+ 1. Write or edit the file(s) specified in this step
609
+ 2. Run tests: node --test {TEST_FILE}
610
+ 3. If tests for this step fail, fix and re-run
931
611
 
932
612
  ## Rules
933
613
  - Write ONE source file at a time
934
- - Run tests after each file write
935
614
  - Keep functions small (under 30 lines)
936
615
  - Code should be self-documenting, minimal comments
937
616
  - Do NOT commit changes
938
617
  - Do NOT modify test assertions unless they contain bugs
618
+ - Only implement what this step requires — nothing more
939
619
 
940
620
  ## Completion
941
- Brief summary: files changed (list), test status (X/Y passing), blockers if any
621
+ Report: file(s) changed, test status (X/Y passing), any blockers
622
+ ```
942
623
 
943
- ## Reference
944
- For detailed guidance, see: .blueprint/agents/AGENT_DEVELOPER_CODEY.md
624
+ ### Orchestrator Loop Logic
625
+
626
+ ```
627
+ for each step in IMPLEMENTATION_PLAN.steps:
628
+ announce: " } Codey — step {N}: {step summary}"
629
+ spawn Task(step prompt)
630
+ if success:
631
+ record stages.codeyStep{N} timing
632
+ continue
633
+ if failure:
634
+ attempt retry (see Error Handling)
635
+ if still fails: stop, report partial progress
945
636
  ```
946
637
 
947
- **On completion:**
948
- 1. Run `npm test` to verify
949
- 2. **Record history:** `stages.codeyImplement = { completedAt, durationMs, status: "success" }`
638
+ **On all steps complete:**
639
+ 1. Run full test suite: `node --test {TEST_FILE}`
640
+ 2. **Record history:** `stages.codeyImplement = { completedAt, durationMs, status: "success", stepsCompleted: N }`
950
641
  3. Update queue: move feature to `completed`
951
642
  4. Proceed to auto-commit (unless `--no-commit`)
952
643
 
644
+ **On partial failure:**
645
+ 1. Record which steps completed and which failed
646
+ 2. **Record history:** `stages.codeyImplement = { status: "partial", stepsCompleted: M, totalSteps: N, failedAt: step }`
647
+ 3. Report to user with option to continue manually
648
+
953
649
  **On failure:** See [Error Handling with Retry](#error-handling-with-smart-retry)
954
650
 
955
651
  ---
@@ -958,43 +654,10 @@ For detailed guidance, see: .blueprint/agents/AGENT_DEVELOPER_CODEY.md
958
654
 
959
655
  **Module:** `src/diff-preview.js`
960
656
 
961
- Before committing, show the user a preview of all changes unless skipped.
657
+ **Skip if:** `--no-commit`, `--no-diff-preview`, `--yes`, or no changes detected.
962
658
 
963
- **Skip conditions** (any of these skips the preview):
964
- - `--no-commit` flag is set
965
- - `--no-diff-preview` flag is set
966
- - `--yes` flag is set (non-interactive mode)
967
- - No changes detected
968
-
969
- **Display:**
970
- ```
971
- Changes to commit for feature_{slug}:
972
-
973
- Added (3 files):
974
- + .blueprint/features/feature_{slug}/FEATURE_SPEC.md
975
- + test/feature_{slug}.test.js
976
- + src/feature.js
977
-
978
- Modified (1 file):
979
- ~ src/index.js
980
-
981
- Deleted (0 files):
982
- (none)
983
-
984
- Total: 4 files changed
985
-
986
- [c]ommit / [a]bort / [d]iff (show full diff)?
987
- ```
988
-
989
- **User choices:**
990
- - `c` or `commit`: Proceed to auto-commit
991
- - `a` or `abort`: Exit pipeline cleanly (exit code 0, not a failure)
992
- - `d` or `diff`: Show full `git diff` output, then re-prompt
993
-
994
- **On abort:**
995
- - Record in history: `status: "user-aborted"`, `reason: "User aborted at diff preview"`
996
- - Do NOT record as failure
997
- - Clean exit
659
+ Show added/modified/deleted file summary. User chooses: `[c]ommit` / `[a]bort` / `[d]iff`.
660
+ On abort: record `status: "user-aborted"` in history, clean exit (not a failure).
998
661
 
999
662
  ---
1000
663
 
@@ -1023,31 +686,7 @@ Co-Authored-By: Claude <noreply@anthropic.com>
1023
686
 
1024
687
  ### Remove from Backlog
1025
688
 
1026
- After successful commit, remove the completed feature from `{BACKLOG}`:
1027
-
1028
- 1. Read `.blueprint/features/BACKLOG.md`
1029
- 2. Find the row containing `| ... | {slug} |`
1030
- 3. Remove that row from the table
1031
- 4. If a Details section exists for `### {slug}`, remove it too
1032
- 5. Write the updated backlog
1033
-
1034
- **Example removal:**
1035
- ```markdown
1036
- # Before
1037
- | Status | P | E | Slug | Description |
1038
- |--------|---|---|------|-------------|
1039
- | ⏳ | P1 | M | user-auth | Login flow |
1040
- | ⏳ | P2 | S | theme-adoption | Use theme.js |
1041
-
1042
- # After (user-auth completed)
1043
- | Status | P | E | Slug | Description |
1044
- |--------|---|---|------|-------------|
1045
- | ⏳ | P2 | S | theme-adoption | Use theme.js |
1046
- ```
1047
-
1048
- **If backlog doesn't exist:** Skip silently (not all projects use backlogs).
1049
-
1050
- **Include in commit:** Stage the updated backlog file with the feature commit.
689
+ After commit, remove the slug's row from `{BACKLOG}` (if it exists). Stage with the commit.
1051
690
 
1052
691
  ---
1053
692
 
@@ -1067,239 +706,14 @@ historyEntry.totalCost = X.XXX;
1067
706
  // Save to .claude/pipeline-history.json
1068
707
  ```
1069
708
 
1070
- **Display summary:**
1071
- ```
1072
- } Alex — creating feature spec ✓
1073
- } Cass — writing user stories ✓
1074
- } Nigel — building tests ✓
1075
- } Codey — drafting plan ✓
1076
- } Codey — implementing feature ✓
1077
-
1078
- ## Landed
1079
- - feature_{slug}
1080
- - Stories: N
1081
- - Tests: N (all passing)
1082
- - Duration: X min (avg: Y min)
1083
- - Commit: {hash}
1084
-
1085
- ## Feedback Summary
1086
- - Alex spec: rated 4/5 by Cass
1087
- - Cass stories: rated 5/5 by Nigel
1088
- - Nigel tests: rated 4/5 by Codey
1089
-
1090
- ## Cost Summary
1091
- STAGE INPUT OUTPUT COST
1092
- alex 2,450 1,230 $0.014
1093
- cass 3,100 1,850 $0.019
1094
- nigel 2,800 2,100 $0.018
1095
- codey-plan 1,500 890 $0.009
1096
- codey-impl 4,200 3,500 $0.028
1097
- ─────────────────────────────────────────
1098
- TOTAL 14,050 9,570 $0.088
1099
-
1100
- ## Next Action
1101
- Pipeline complete. Run `npm test` to verify or `/implement-feature` for next feature.
1102
- ```
1103
-
1104
- ---
1105
-
1106
- ## Error Handling with Smart Retry (ENHANCED)
1107
-
1108
- **Modules:** `src/retry.js`, `src/feedback.js`, `src/insights.js`
1109
-
1110
- After each agent spawn, if the Task tool returns an error or output validation fails:
1111
-
1112
- ### 1. Analyze Failure Context
1113
-
1114
- **Check feedback chain for clues:**
1115
- ```
1116
- If Cass flagged "unclear-scope" on Alex's spec
1117
- → Likely root cause identified
1118
- → Recommend: "add-context" strategy
1119
- ```
1120
-
1121
- **Check history for patterns:**
1122
- ```bash
1123
- node bin/cli.js insights --failures --json
1124
- ```
1125
- - If this stage has >20% failure rate, suggest alternative strategy
1126
- - If this specific issue pattern correlates with failures, mention it
1127
-
1128
- ### 2. Get Retry Strategy Recommendation
1129
-
1130
- **Module:** `src/retry.js`
1131
-
1132
- ```
1133
- Strategy recommendation based on:
1134
- - Stage: {stage}
1135
- - Attempt: {attemptNumber}
1136
- - Failure rate: {rate}%
1137
- - Feedback issues: {issues}
1138
-
1139
- Recommended: {strategy}
1140
- ```
1141
-
1142
- **Available strategies:**
1143
- | Strategy | Effect |
1144
- |----------|--------|
1145
- | `retry` | Simple retry with same prompt |
1146
- | `simplify-prompt` | Reduce scope: "Focus only on core happy path" |
1147
- | `add-context` | Include more output from previous stages |
1148
- | `reduce-stories` | Ask for fewer, more focused stories |
1149
- | `simplify-tests` | Ask for fewer, essential tests only |
1150
- | `incremental` | Implement one test at a time |
1151
-
1152
- ### 3. Ask User with Recommendation
1153
-
1154
- ```
1155
- ## Stage Failed: {stage}
1156
-
1157
- Feedback context: Cass flagged "unclear-scope" on Alex's spec
1158
- History: This stage fails 25% of the time
1159
- Recommended strategy: add-context
1160
-
1161
- Options:
1162
- 1. Retry with "add-context" strategy (recommended)
1163
- 2. Retry with simple retry
1164
- 3. Skip this stage (warning: missing artifacts)
1165
- 4. Abort pipeline
1166
- ```
1167
-
1168
- ### 4. Apply Strategy and Retry
1169
-
1170
- If user selects a retry strategy, modify the agent prompt:
1171
-
1172
- **Example: add-context strategy**
1173
- ```
1174
- [Original prompt]
1175
-
1176
- ## Additional Context (added due to retry)
1177
- Previous stage feedback indicated: "unclear-scope"
1178
- Here is additional context from earlier stages:
1179
- - System spec key points: [summary]
1180
- - Feature spec key decisions: [summary]
1181
- ```
1182
-
1183
- ### 5. Record Failure in History
1184
-
1185
- ```javascript
1186
- historyEntry.stages[stage] = {
1187
- status: "failed",
1188
- failedAt: "...",
1189
- attempts: N,
1190
- lastStrategy: "add-context",
1191
- feedbackContext: ["unclear-scope"]
1192
- };
1193
- ```
1194
-
1195
- **On abort:** Update queue `failed` array with:
1196
- ```json
1197
- {
1198
- "slug": "{slug}",
1199
- "stage": "{stage}",
1200
- "reason": "{error message}",
1201
- "feedbackContext": ["issues from feedback chain"],
1202
- "attemptCount": N,
1203
- "timestamp": "{ISO timestamp}"
1204
- }
1205
- ```
1206
-
1207
- ---
1208
-
1209
- ## Queue Structure
1210
-
1211
- Location: `.claude/implement-queue.json`
1212
-
1213
- ```json
1214
- {
1215
- "lastUpdated": "2025-02-01T12:00:00Z",
1216
- "current": {
1217
- "slug": "user-auth",
1218
- "stage": "cass",
1219
- "startedAt": "2025-02-01T11:55:00Z"
1220
- },
1221
- "alexQueue": [],
1222
- "cassQueue": [{ "slug": "user-auth", "featureSpec": "..." }],
1223
- "nigelQueue": [],
1224
- "codeyQueue": [],
1225
- "completed": [{ "slug": "...", "testCount": 5, "commitHash": "abc123" }],
1226
- "failed": []
1227
- }
1228
- ```
1229
-
1230
- ---
1231
-
1232
- ## Recovery
1233
-
1234
- Run `/implement-feature` again - reads queue and resumes from `current.stage`.
709
+ **Display summary:** Stage status (✓/✗), test count, duration, commit hash, feedback ratings, cost breakdown per stage.
1235
710
 
1236
711
  ---
1237
712
 
1238
- ## Agent References
713
+ ## Error Handling & Recovery
1239
714
 
1240
- | Agent | File |
1241
- |-------|------|
1242
- | Alex | `.blueprint/agents/AGENT_SPECIFICATION_ALEX.md` |
1243
- | Cass | `.blueprint/agents/AGENT_BA_CASS.md` |
1244
- | Nigel | `.blueprint/agents/AGENT_TESTER_NIGEL.md` |
1245
- | Codey | `.blueprint/agents/AGENT_DEVELOPER_CODEY.md` |
1246
-
1247
- ---
1248
-
1249
- ## Module Integration Summary (NEW)
1250
-
1251
- The pipeline integrates these murmur8 modules:
1252
-
1253
- | Module | File | Integration Points |
1254
- |--------|------|-------------------|
1255
- | **validate** | `src/validate.js` | Step 0: Pre-flight checks |
1256
- | **history** | `src/history.js` | Steps 5-12: Record timing, tokens, cost |
1257
- | **insights** | `src/insights.js` | Step 3.5: Preview, On failure: Analysis |
1258
- | **feedback** | `src/feedback.js` | Steps 6.5, 7.5, 8.5: Quality gates |
1259
- | **retry** | `src/retry.js` | On failure: Strategy recommendation |
1260
- | **cost** | `src/cost.js` | Steps 6-12: Track tokens, calculate cost |
1261
- | **diff-preview** | `src/diff-preview.js` | Step 10.5: Show changes before commit |
1262
-
1263
- ### CLI Commands Available
1264
-
1265
- ```bash
1266
- # Pre-flight validation
1267
- npx murmur8 validate
1268
-
1269
- # History management
1270
- npx murmur8 history
1271
- npx murmur8 history --cost # Include cost breakdown
1272
- npx murmur8 history --stats
1273
- npx murmur8 history --stats --cost # Include cost metrics
1274
- npx murmur8 history --all
1275
-
1276
- # Pipeline insights
1277
- npx murmur8 insights
1278
- npx murmur8 insights --feedback
1279
- npx murmur8 insights --bottlenecks
1280
- npx murmur8 insights --failures
1281
-
1282
- # Cost configuration
1283
- npx murmur8 cost-config
1284
- npx murmur8 cost-config set inputPrice 3 # Per million tokens
1285
- npx murmur8 cost-config set outputPrice 15 # Per million tokens
1286
- npx murmur8 cost-config reset
1287
-
1288
- # Retry configuration
1289
- npx murmur8 retry-config
1290
- npx murmur8 retry-config set maxRetries 5
1291
-
1292
- # Feedback configuration
1293
- npx murmur8 feedback-config
1294
- npx murmur8 feedback-config set minRatingThreshold 3.5
1295
- ```
715
+ **Load full instructions on failure:** Read `.blueprint/prompts/skill-error-recovery.md`
1296
716
 
1297
- ### Data Files Created
717
+ **Summary:** On stage failure, analyze feedback chain + history patterns, recommend a retry strategy (retry, simplify-prompt, add-context, reduce-stories, simplify-tests, incremental), ask user, apply modified prompt, record outcome.
1298
718
 
1299
- | File | Purpose |
1300
- |------|---------|
1301
- | `.claude/pipeline-history.json` | Execution history with timing, feedback, and cost |
1302
- | `.claude/retry-config.json` | Retry strategies and thresholds |
1303
- | `.claude/feedback-config.json` | Feedback quality gate thresholds |
1304
- | `.claude/cost-config.json` | Token pricing configuration |
1305
- | `.claude/implement-queue.json` | Pipeline queue state (existing) |
719
+ **Recovery:** Run `/implement-feature` again — reads queue and resumes from `current.stage`.