devflow-kit 1.5.0 → 1.6.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +6 -3
  3. package/dist/commands/ambient.js +1 -1
  4. package/dist/commands/init.js +2 -2
  5. package/dist/plugins.js +23 -23
  6. package/dist/utils/post-install.js +6 -1
  7. package/package.json +1 -1
  8. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  9. package/plugins/devflow-ambient/.claude-plugin/plugin.json +25 -4
  10. package/plugins/devflow-ambient/README.md +48 -29
  11. package/plugins/devflow-ambient/agents/coder.md +135 -0
  12. package/plugins/devflow-ambient/agents/reviewer.md +165 -0
  13. package/plugins/devflow-ambient/agents/scrutinizer.md +80 -0
  14. package/plugins/devflow-ambient/agents/shepherd.md +94 -0
  15. package/plugins/devflow-ambient/agents/simplifier.md +93 -0
  16. package/plugins/devflow-ambient/agents/skimmer.md +93 -0
  17. package/plugins/devflow-ambient/agents/validator.md +86 -0
  18. package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +72 -28
  19. package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +40 -35
  20. package/plugins/devflow-ambient/skills/debug-orchestration/SKILL.md +69 -0
  21. package/plugins/devflow-ambient/skills/implementation-orchestration/SKILL.md +92 -0
  22. package/plugins/devflow-ambient/skills/plan-orchestration/SKILL.md +71 -0
  23. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +10 -1
  24. package/plugins/devflow-audit-claude/commands/audit-claude.md +4 -0
  25. package/plugins/devflow-code-review/.claude-plugin/plugin.json +2 -1
  26. package/plugins/devflow-code-review/agents/reviewer.md +10 -9
  27. package/plugins/devflow-code-review/commands/code-review-teams.md +43 -30
  28. package/plugins/devflow-code-review/commands/code-review.md +10 -1
  29. package/plugins/devflow-code-review/skills/knowledge-persistence/SKILL.md +128 -0
  30. package/plugins/devflow-code-review/skills/knowledge-persistence/references/examples.md +44 -0
  31. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +1 -1
  32. package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +7 -1
  33. package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +6 -5
  34. package/plugins/devflow-debug/.claude-plugin/plugin.json +5 -3
  35. package/plugins/devflow-debug/agents/synthesizer.md +211 -0
  36. package/plugins/devflow-debug/commands/debug-teams.md +28 -14
  37. package/plugins/devflow-debug/commands/debug.md +26 -12
  38. package/plugins/devflow-debug/skills/knowledge-persistence/SKILL.md +128 -0
  39. package/plugins/devflow-debug/skills/knowledge-persistence/references/examples.md +44 -0
  40. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  41. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  42. package/plugins/devflow-implement/.claude-plugin/plugin.json +2 -1
  43. package/plugins/devflow-implement/agents/coder.md +6 -1
  44. package/plugins/devflow-implement/agents/simplifier.md +32 -1
  45. package/plugins/devflow-implement/agents/skimmer.md +5 -0
  46. package/plugins/devflow-implement/commands/implement-teams.md +72 -55
  47. package/plugins/devflow-implement/commands/implement.md +44 -35
  48. package/plugins/devflow-implement/skills/knowledge-persistence/SKILL.md +128 -0
  49. package/plugins/devflow-implement/skills/knowledge-persistence/references/examples.md +44 -0
  50. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  51. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  52. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  53. package/plugins/devflow-resolve/.claude-plugin/plugin.json +4 -3
  54. package/plugins/devflow-resolve/agents/simplifier.md +32 -1
  55. package/plugins/devflow-resolve/commands/resolve-teams.md +16 -7
  56. package/plugins/devflow-resolve/commands/resolve.md +16 -7
  57. package/plugins/devflow-resolve/skills/knowledge-persistence/SKILL.md +128 -0
  58. package/plugins/devflow-resolve/skills/knowledge-persistence/references/examples.md +44 -0
  59. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  60. package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -1
  61. package/plugins/devflow-self-review/agents/simplifier.md +32 -1
  62. package/plugins/devflow-self-review/commands/self-review.md +10 -4
  63. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  64. package/plugins/devflow-specify/agents/skimmer.md +5 -0
  65. package/plugins/devflow-specify/commands/specify-teams.md +27 -20
  66. package/plugins/devflow-specify/commands/specify.md +26 -19
  67. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  68. package/scripts/hooks/ambient-prompt +8 -7
  69. package/scripts/hooks/session-start-memory +33 -3
  70. package/shared/agents/coder.md +6 -1
  71. package/shared/agents/reviewer.md +10 -9
  72. package/shared/agents/simplifier.md +32 -1
  73. package/shared/agents/skimmer.md +5 -0
  74. package/shared/skills/ambient-router/SKILL.md +72 -28
  75. package/shared/skills/ambient-router/references/skill-catalog.md +40 -35
  76. package/shared/skills/debug-orchestration/SKILL.md +69 -0
  77. package/shared/skills/docs-framework/SKILL.md +7 -1
  78. package/shared/skills/implementation-orchestration/SKILL.md +92 -0
  79. package/shared/skills/knowledge-persistence/SKILL.md +128 -0
  80. package/shared/skills/knowledge-persistence/references/examples.md +44 -0
  81. package/shared/skills/plan-orchestration/SKILL.md +71 -0
  82. package/shared/skills/test-driven-development/SKILL.md +6 -5
  83. package/plugins/devflow-ambient/commands/ambient.md +0 -110
@@ -46,7 +46,7 @@ Return the branch setup summary."
46
46
  - `ISSUE_CONTENT`: Full issue body including description (if provided)
47
47
  - `ACCEPTANCE_CRITERIA`: Extracted acceptance criteria from issue (if provided)
48
48
 
49
- ### Phase 1.5: Orient
49
+ ### Phase 2: Orient
50
50
 
51
51
  Spawn Skimmer agent for codebase overview:
52
52
 
@@ -56,7 +56,7 @@ Task(subagent_type="Skimmer"):
56
56
  Use skim to identify relevant files, functions, integration points"
57
57
  ```
58
58
 
59
- ### Phase 2: Exploration Team
59
+ ### Phase 3: Exploration Team
60
60
 
61
61
  Create an agent team for collaborative codebase exploration:
62
62
 
@@ -69,48 +69,56 @@ Spawn exploration teammates with self-contained prompts:
69
69
  Prompt: |
70
70
  You are exploring a codebase for task: {task description}
71
71
  1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md`
72
- 2. Skimmer context (files/patterns already identified):
72
+ 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist.
73
+ Consider prior decisions and known pitfalls relevant to this task.
74
+ 3. Skimmer context (files/patterns already identified):
73
75
  {skimmer output}
74
- 3. Your deliverable: Find similar implementations, established patterns,
76
+ 4. Your deliverable: Find similar implementations, established patterns,
75
77
  module structure, and architectural conventions relevant to this task.
76
- 4. Document findings with file:path references.
77
- 5. Report completion: SendMessage(type: "message", recipient: "team-lead",
78
+ 5. Document findings with file:path references.
79
+ 6. Report completion: SendMessage(type: "message", recipient: "team-lead",
78
80
  summary: "Architecture exploration done")
79
81
 
80
82
  - Name: "integration-explorer"
81
83
  Prompt: |
82
84
  You are exploring a codebase for task: {task description}
83
85
  1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md`
84
- 2. Skimmer context (files/patterns already identified):
86
+ 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist.
87
+ Consider prior decisions and known pitfalls relevant to this task.
88
+ 3. Skimmer context (files/patterns already identified):
85
89
  {skimmer output}
86
- 3. Your deliverable: Find entry points, services, database models,
90
+ 4. Your deliverable: Find entry points, services, database models,
87
91
  configuration, and integration points relevant to this task.
88
- 4. Document findings with file:path references.
89
- 5. Report completion: SendMessage(type: "message", recipient: "team-lead",
92
+ 5. Document findings with file:path references.
93
+ 6. Report completion: SendMessage(type: "message", recipient: "team-lead",
90
94
  summary: "Integration exploration done")
91
95
 
92
96
  - Name: "reusable-code-explorer"
93
97
  Prompt: |
94
98
  You are exploring a codebase for task: {task description}
95
99
  1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md`
96
- 2. Skimmer context (files/patterns already identified):
100
+ 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist.
101
+ Consider prior decisions and known pitfalls relevant to this task.
102
+ 3. Skimmer context (files/patterns already identified):
97
103
  {skimmer output}
98
- 3. Your deliverable: Find utilities, helpers, validation patterns,
104
+ 4. Your deliverable: Find utilities, helpers, validation patterns,
99
105
  and error handling that can be reused for this task.
100
- 4. Document findings with file:path references.
101
- 5. Report completion: SendMessage(type: "message", recipient: "team-lead",
106
+ 5. Document findings with file:path references.
107
+ 6. Report completion: SendMessage(type: "message", recipient: "team-lead",
102
108
  summary: "Reusable code exploration done")
103
109
 
104
110
  - Name: "edge-case-explorer"
105
111
  Prompt: |
106
112
  You are exploring a codebase for task: {task description}
107
113
  1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md`
108
- 2. Skimmer context (files/patterns already identified):
114
+ 2. Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md` if they exist.
115
+ Consider prior decisions and known pitfalls relevant to this task.
116
+ 3. Skimmer context (files/patterns already identified):
109
117
  {skimmer output}
110
- 3. Your deliverable: Find error scenarios, race conditions, permission
118
+ 4. Your deliverable: Find error scenarios, race conditions, permission
111
119
  failures, and boundary cases relevant to this task.
112
- 4. Document findings with file:path references.
113
- 5. Report completion: SendMessage(type: "message", recipient: "team-lead",
120
+ 5. Document findings with file:path references.
121
+ 6. Report completion: SendMessage(type: "message", recipient: "team-lead",
114
122
  summary: "Edge case exploration done")
115
123
 
116
124
  After initial exploration, lead initiates debate:
@@ -125,7 +133,7 @@ Max 2 debate rounds, then submit consensus exploration findings.
125
133
 
126
134
  **Exploration team output**: Consensus findings on patterns, integration points, reusable code, edge cases.
127
135
 
128
- **Team Shutdown Protocol** (must complete before Phase 4):
136
+ **Team Shutdown Protocol** (must complete before Phase 5):
129
137
 
130
138
  ```
131
139
  Step 1: Shutdown each teammate
@@ -142,7 +150,7 @@ Step 3: GATE — Verify TeamDelete succeeded
142
150
  If retry failed → HALT and report: "Exploration team cleanup failed. Cannot create planning team."
143
151
  ```
144
152
 
145
- ### Phase 3: Synthesize Exploration
153
+ ### Phase 4: Synthesize Exploration
146
154
 
147
155
  **CRITICAL**: Do NOT synthesize outputs yourself in the main session.
148
156
  You MUST spawn the Synthesizer agent.
@@ -155,7 +163,7 @@ Explorer consensus: {team exploration consensus output}
155
163
  Combine into: patterns, integration points, reusable code, edge cases"
156
164
  ```
157
165
 
158
- ### Phase 4: Planning Team
166
+ ### Phase 5: Planning Team
159
167
 
160
168
  Create an agent team for collaborative implementation planning:
161
169
 
@@ -169,7 +177,7 @@ Spawn planning teammates with self-contained prompts:
169
177
  You are planning implementation for task: {task description}
170
178
  1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md`
171
179
  2. Exploration synthesis (what we know about the codebase):
172
- {synthesis output from Phase 3}
180
+ {synthesis output from Phase 4}
173
181
  3. Your deliverable: Step-by-step coding approach with specific files
174
182
  to create/modify, dependencies between steps, and execution order.
175
183
  4. Report completion: SendMessage(type: "message", recipient: "team-lead",
@@ -180,7 +188,7 @@ Spawn planning teammates with self-contained prompts:
180
188
  You are planning the test strategy for task: {task description}
181
189
  1. Read your skill: `Read ~/.claude/skills/test-patterns/SKILL.md`
182
190
  2. Exploration synthesis (what we know about the codebase):
183
- {synthesis output from Phase 3}
191
+ {synthesis output from Phase 4}
184
192
  3. Your deliverable: Test strategy — unit tests, integration tests,
185
193
  edge case coverage, testing patterns to follow from the codebase.
186
194
  4. Report completion: SendMessage(type: "message", recipient: "team-lead",
@@ -191,7 +199,7 @@ Spawn planning teammates with self-contained prompts:
191
199
  You are assessing risk and execution strategy for task: {task description}
192
200
  1. Read your skill: `Read ~/.claude/skills/implementation-patterns/SKILL.md`
193
201
  2. Exploration synthesis (what we know about the codebase):
194
- {synthesis output from Phase 3}
202
+ {synthesis output from Phase 4}
195
203
  3. Your deliverable: Risk assessment, rollback strategy, and execution
196
204
  strategy decision (SINGLE_CODER vs SEQUENTIAL_CODERS vs PARALLEL_CODERS)
197
205
  based on artifact independence, context capacity, and domain specialization.
@@ -222,7 +230,7 @@ Max 2 debate rounds, then submit consensus plan.
222
230
  - **HIGH**: 20-30 files, multiple modules → SEQUENTIAL_CODERS (2-3 phases)
223
231
  - **CRITICAL**: >30 files, cross-cutting concerns → SEQUENTIAL_CODERS (more phases)
224
232
 
225
- **Team Shutdown Protocol** (must complete before Phase 6):
233
+ **Team Shutdown Protocol** (must complete before Phase 7):
226
234
 
227
235
  ```
228
236
  Step 1: Shutdown each teammate
@@ -238,7 +246,7 @@ Step 3: GATE — Verify TeamDelete succeeded
238
246
  If retry failed → HALT and report: "Planning team cleanup failed. Cannot proceed to implementation."
239
247
  ```
240
248
 
241
- ### Phase 5: Synthesize Planning
249
+ ### Phase 6: Synthesize Planning
242
250
 
243
251
  **CRITICAL**: Do NOT synthesize outputs yourself in the main session.
244
252
  You MUST spawn the Synthesizer agent.
@@ -257,9 +265,9 @@ Combine into: execution plan with strategy decision (SINGLE_CODER | SEQUENTIAL_C
257
265
  - Subtask breakdown with DOMAIN hints (if not SINGLE_CODER)
258
266
  - Implementation plan with dependencies
259
267
 
260
- ### Phase 6: Implement
268
+ ### Phase 7: Implement
261
269
 
262
- Based on Phase 5 synthesis, use the three-strategy framework:
270
+ Based on Phase 6 synthesis, use the three-strategy framework:
263
271
 
264
272
  **Strategy Selection** (from planning team consensus):
265
273
 
@@ -352,7 +360,7 @@ DOMAIN: {subtask 2 domain}"
352
360
  - Different files/modules with no imports between them
353
361
  - Each subtask is self-contained
354
362
 
355
- ### Phase 6.5: Validate
363
+ ### Phase 8: Validate
356
364
 
357
365
  After Coder completes, spawn Validator to verify correctness:
358
366
 
@@ -377,12 +385,12 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
377
385
  SCOPE: Fix only the listed failures, no other changes
378
386
  CREATE_PR: false"
379
387
  ```
380
- - Loop back to Phase 6.5 (re-validate)
388
+ - Loop back to Phase 8 (re-validate)
381
389
  4. If `validation_retry_count > 2`: Report failures to user and halt
382
390
 
383
- **If PASS:** Continue to Phase 7
391
+ **If PASS:** Continue to Phase 9
384
392
 
385
- ### Phase 7: Simplify
393
+ ### Phase 9: Simplify
386
394
 
387
395
  After validation passes, spawn Simplifier to polish the code:
388
396
 
@@ -394,7 +402,7 @@ FILES_CHANGED: {list of files from Coder output}
394
402
  Focus on code modified by Coder, apply project standards, enhance clarity"
395
403
  ```
396
404
 
397
- ### Phase 8: Self-Review
405
+ ### Phase 10: Self-Review
398
406
 
399
407
  After Simplifier completes, spawn Scrutinizer as final quality gate:
400
408
 
@@ -407,7 +415,7 @@ Evaluate 9 pillars, fix P0/P1 issues, report status"
407
415
 
408
416
  If Scrutinizer returns BLOCKED, report to user and halt.
409
417
 
410
- ### Phase 8.5: Re-Validate (if Scrutinizer made changes)
418
+ ### Phase 11: Re-Validate (if Scrutinizer made changes)
411
419
 
412
420
  If Scrutinizer made code changes (status: FIXED), spawn Validator to verify:
413
421
 
@@ -420,9 +428,9 @@ Verify Scrutinizer's fixes didn't break anything."
420
428
 
421
429
  **If FAIL:** Report to user - Scrutinizer broke tests, needs manual intervention.
422
430
 
423
- **If PASS:** Continue to Phase 9
431
+ **If PASS:** Continue to Phase 12
424
432
 
425
- ### Phase 9: Shepherd↔Coder Dialogue
433
+ ### Phase 12: Shepherd↔Coder Dialogue
426
434
 
427
435
  After Scrutinizer passes (and re-validation if needed), check alignment using direct dialogue:
428
436
 
@@ -437,7 +445,7 @@ Spawn teammates with self-contained prompts:
437
445
  Prompt: |
438
446
  You are validating that the implementation aligns with the original request.
439
447
  ORIGINAL_REQUEST: {task description or issue content}
440
- EXECUTION_PLAN: {synthesized plan from Phase 5}
448
+ EXECUTION_PLAN: {synthesized plan from Phase 6}
441
449
  FILES_CHANGED: {list of files from Coder output}
442
450
  ACCEPTANCE_CRITERIA: {extracted criteria if available}
443
451
 
@@ -472,7 +480,7 @@ Spawn teammates with self-contained prompts:
472
480
  summary: "Alignment fixes complete")
473
481
  ```
474
482
 
475
- **Team Shutdown Protocol** (must complete before Phase 10):
483
+ **Team Shutdown Protocol** (must complete before Phase 13):
476
484
 
477
485
  ```
478
486
  Step 1: Shutdown each teammate
@@ -487,7 +495,7 @@ Step 3: GATE — Verify TeamDelete succeeded
487
495
  If retry failed → HALT and report: "Alignment team cleanup failed."
488
496
  ```
489
497
 
490
- **If ALIGNED:** Continue to Phase 10
498
+ **If ALIGNED:** Continue to Phase 13
491
499
 
492
500
  **If MISALIGNED:**
493
501
  1. Extract misalignment details from Shepherd output
@@ -510,19 +518,26 @@ Step 3: GATE — Verify TeamDelete succeeded
510
518
  VALIDATION_SCOPE: changed-only"
511
519
  ```
512
520
  - If Validator FAIL: Report to user
513
- - If Validator PASS: Loop back to Phase 9 (re-check alignment)
521
+ - If Validator PASS: Loop back to Phase 12 (re-check alignment)
514
522
  4. If `alignment_fix_count > 2`: Report misalignments to user for decision
515
523
 
516
- ### Phase 10: Create PR
524
+ ### Phase 13: Create PR
517
525
 
518
526
  **For SEQUENTIAL_CODERS or PARALLEL_CODERS**: The last sequential Coder (with CREATE_PR: true) handles PR creation. For parallel coders, create unified PR using `git-workflow` skill patterns. Push branch and run `gh pr create` with comprehensive description, targeting `BASE_BRANCH`.
519
527
 
520
528
  **For SINGLE_CODER**: PR is created by the Coder agent (CREATE_PR: true).
521
529
 
522
- ### Phase 11: Report
530
+ ### Phase 14: Report
523
531
 
524
532
  Display completion summary with phase status, PR info, and next steps.
525
533
 
534
+ ### Phase 15: Record Decisions (if any)
535
+
536
+ If the Coder's report includes Key Decisions with architectural significance:
537
+ 1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record decisions to `.memory/knowledge/decisions.md`
538
+ 2. Source field: `/implement {TASK_ID}`
539
+ 3. Skip entirely if no architectural decisions were made
540
+
526
541
  ## Architecture
527
542
 
528
543
  ```
@@ -531,55 +546,57 @@ Display completion summary with phase status, PR info, and next steps.
531
546
  ├─ Phase 1: Setup
532
547
  │ └─ Git agent (operation: setup-task) - creates feature branch, fetches issue
533
548
 
534
- ├─ Phase 1.5: Orient
549
+ ├─ Phase 2: Orient
535
550
  │ └─ Skimmer agent (codebase overview via skim)
536
551
 
537
- ├─ Phase 2: Exploration Team (Agent Teams)
552
+ ├─ Phase 3: Exploration Team (Agent Teams)
538
553
  │ ├─ Architecture Explorer (teammate)
539
554
  │ ├─ Integration Explorer (teammate)
540
555
  │ ├─ Reusable Code Explorer (teammate)
541
556
  │ ├─ Edge Case Explorer (teammate)
542
557
  │ └─ Debate → consensus exploration findings
543
558
 
544
- ├─ Phase 3: Synthesize Exploration
559
+ ├─ Phase 4: Synthesize Exploration
545
560
  │ └─ Synthesizer agent (mode: exploration)
546
561
 
547
- ├─ Phase 4: Planning Team (Agent Teams)
562
+ ├─ Phase 5: Planning Team (Agent Teams)
548
563
  │ ├─ Implementation Planner (teammate)
549
564
  │ ├─ Testing Planner (teammate)
550
565
  │ ├─ Risk & Execution Planner (teammate)
551
566
  │ └─ Debate → consensus plan with strategy decision
552
567
 
553
- ├─ Phase 5: Synthesize Planning
568
+ ├─ Phase 6: Synthesize Planning
554
569
  │ └─ Synthesizer agent (mode: planning) → returns strategy + DOMAIN hints
555
570
 
556
- ├─ Phase 6: Implement (3-strategy framework)
571
+ ├─ Phase 7: Implement (3-strategy framework)
557
572
  │ ├─ SINGLE_CODER (80%): One Coder, full plan, CREATE_PR: true
558
573
  │ ├─ SEQUENTIAL_CODERS (15%): N Coders with handoff summaries
559
574
  │ └─ PARALLEL_CODERS (5%): N Coders in single message (rare)
560
575
 
561
- ├─ Phase 6.5: Validate
576
+ ├─ Phase 8: Validate
562
577
  │ └─ Validator agent (build, typecheck, lint, test)
563
578
  │ └─ If FAIL: Coder fix loop (max 2 retries) → re-validate
564
579
 
565
- ├─ Phase 7: Simplify
580
+ ├─ Phase 9: Simplify
566
581
  │ └─ Simplifier agent (refines code clarity and consistency)
567
582
 
568
- ├─ Phase 8: Self-Review
583
+ ├─ Phase 10: Self-Review
569
584
  │ └─ Scrutinizer agent (final quality gate, fixes P0/P1)
570
585
 
571
- ├─ Phase 8.5: Re-Validate (if Scrutinizer made changes)
586
+ ├─ Phase 11: Re-Validate (if Scrutinizer made changes)
572
587
  │ └─ Validator agent (verify Scrutinizer fixes)
573
588
 
574
- ├─ Phase 9: Shepherd↔Coder Dialogue (Agent Teams)
589
+ ├─ Phase 12: Shepherd↔Coder Dialogue (Agent Teams)
575
590
  │ └─ Direct Shepherd↔Coder messaging (max 2 exchanges)
576
591
 
577
- ├─ Phase 10: Create PR (if needed)
592
+ ├─ Phase 13: Create PR (if needed)
578
593
  │ └─ SINGLE_CODER: handled by Coder
579
594
  │ └─ SEQUENTIAL: handled by last Coder
580
595
  │ └─ PARALLEL: orchestrator creates unified PR
581
596
 
582
- └─ Phase 11: Display agent outputs
597
+ ├─ Phase 14: Display agent outputs
598
+
599
+ └─ Phase 15: Record Decisions (inline, if any)
583
600
  ```
584
601
 
585
602
  ## Principles
@@ -46,7 +46,7 @@ Return the branch setup summary."
46
46
  - `ISSUE_CONTENT`: Full issue body including description (if provided)
47
47
  - `ACCEPTANCE_CRITERIA`: Extracted acceptance criteria from issue (if provided)
48
48
 
49
- ### Phase 1.5: Orient
49
+ ### Phase 2: Orient
50
50
 
51
51
  Spawn Skimmer agent for codebase overview:
52
52
 
@@ -56,7 +56,7 @@ Task(subagent_type="Skimmer"):
56
56
  Use skim to identify relevant files, functions, integration points"
57
57
  ```
58
58
 
59
- ### Phase 2: Explore (Parallel)
59
+ ### Phase 3: Explore (Parallel)
60
60
 
61
61
  Spawn 4 Explore agents **in a single message**, each with Skimmer context:
62
62
 
@@ -69,9 +69,9 @@ Spawn 4 Explore agents **in a single message**, each with Skimmer context:
69
69
 
70
70
  Track success/failure of each explorer for synthesis context.
71
71
 
72
- ### Phase 3: Synthesize Exploration
72
+ ### Phase 4: Synthesize Exploration
73
73
 
74
- **WAIT** for Phase 2 to complete.
74
+ **WAIT** for Phase 3 to complete.
75
75
 
76
76
  **CRITICAL**: Do NOT synthesize outputs yourself in the main session.
77
77
  You MUST spawn the Synthesizer agent - "spawn Synthesizer" means delegate to the agent, not do the work yourself.
@@ -85,7 +85,7 @@ Failed explorations: {any failures}
85
85
  Combine into: patterns, integration points, reusable code, edge cases"
86
86
  ```
87
87
 
88
- ### Phase 4: Plan (Parallel)
88
+ ### Phase 5: Plan (Parallel)
89
89
 
90
90
  Spawn 3 Plan agents **in a single message**, each with exploration synthesis:
91
91
 
@@ -109,9 +109,9 @@ Spawn 3 Plan agents **in a single message**, each with exploration synthesis:
109
109
  - **HIGH**: 20-30 files, multiple modules → SEQUENTIAL_CODERS (2-3 phases)
110
110
  - **CRITICAL**: >30 files, cross-cutting concerns → SEQUENTIAL_CODERS (more phases)
111
111
 
112
- ### Phase 5: Synthesize Planning
112
+ ### Phase 6: Synthesize Planning
113
113
 
114
- **WAIT** for Phase 4 to complete.
114
+ **WAIT** for Phase 5 to complete.
115
115
 
116
116
  **CRITICAL**: Do NOT synthesize outputs yourself in the main session.
117
117
  You MUST spawn the Synthesizer agent - "spawn Synthesizer" means delegate to the agent, not do the work yourself.
@@ -130,9 +130,9 @@ Combine into: execution plan with strategy decision (SINGLE_CODER | SEQUENTIAL_C
130
130
  - Subtask breakdown with DOMAIN hints (if not SINGLE_CODER)
131
131
  - Implementation plan with dependencies
132
132
 
133
- ### Phase 6: Implement
133
+ ### Phase 7: Implement
134
134
 
135
- Based on Phase 5 synthesis, use the three-strategy framework:
135
+ Based on Phase 6 synthesis, use the three-strategy framework:
136
136
 
137
137
  **Strategy Selection** (from Execution Strategy planner):
138
138
 
@@ -225,7 +225,7 @@ DOMAIN: {subtask 2 domain}"
225
225
  - Different files/modules with no imports between them
226
226
  - Each subtask is self-contained
227
227
 
228
- ### Phase 6.5: Validate
228
+ ### Phase 8: Validate
229
229
 
230
230
  After Coder completes, spawn Validator to verify correctness:
231
231
 
@@ -250,12 +250,12 @@ Run build, typecheck, lint, test. Report pass/fail with failure details."
250
250
  SCOPE: Fix only the listed failures, no other changes
251
251
  CREATE_PR: false"
252
252
  ```
253
- - Loop back to Phase 6.5 (re-validate)
253
+ - Loop back to Phase 8 (re-validate)
254
254
  4. If `validation_retry_count > 2`: Report failures to user and halt
255
255
 
256
- **If PASS:** Continue to Phase 7
256
+ **If PASS:** Continue to Phase 9
257
257
 
258
- ### Phase 7: Simplify
258
+ ### Phase 9: Simplify
259
259
 
260
260
  After validation passes, spawn Simplifier to polish the code:
261
261
 
@@ -267,7 +267,7 @@ FILES_CHANGED: {list of files from Coder output}
267
267
  Focus on code modified by Coder, apply project standards, enhance clarity"
268
268
  ```
269
269
 
270
- ### Phase 8: Self-Review
270
+ ### Phase 10: Self-Review
271
271
 
272
272
  After Simplifier completes, spawn Scrutinizer as final quality gate:
273
273
 
@@ -280,7 +280,7 @@ Evaluate 9 pillars, fix P0/P1 issues, report status"
280
280
 
281
281
  If Scrutinizer returns BLOCKED, report to user and halt.
282
282
 
283
- ### Phase 8.5: Re-Validate (if Scrutinizer made changes)
283
+ ### Phase 11: Re-Validate (if Scrutinizer made changes)
284
284
 
285
285
  If Scrutinizer made code changes (status: FIXED), spawn Validator to verify:
286
286
 
@@ -293,22 +293,22 @@ Verify Scrutinizer's fixes didn't break anything."
293
293
 
294
294
  **If FAIL:** Report to user - Scrutinizer broke tests, needs manual intervention.
295
295
 
296
- **If PASS:** Continue to Phase 9
296
+ **If PASS:** Continue to Phase 12
297
297
 
298
- ### Phase 9: Alignment Check
298
+ ### Phase 12: Alignment Check
299
299
 
300
300
  After Scrutinizer passes (and re-validation if needed), spawn Shepherd to validate alignment:
301
301
 
302
302
  ```
303
303
  Task(subagent_type="Shepherd"):
304
304
  "ORIGINAL_REQUEST: {task description or issue content}
305
- EXECUTION_PLAN: {synthesized plan from Phase 5}
305
+ EXECUTION_PLAN: {synthesized plan from Phase 6}
306
306
  FILES_CHANGED: {list of files from Coder output}
307
307
  ACCEPTANCE_CRITERIA: {extracted criteria if available}
308
308
  Validate alignment with request and plan. Report ALIGNED or MISALIGNED with details."
309
309
  ```
310
310
 
311
- **If ALIGNED:** Continue to Phase 10
311
+ **If ALIGNED:** Continue to Phase 13
312
312
 
313
313
  **If MISALIGNED:**
314
314
  1. Extract misalignment details from Shepherd output
@@ -331,19 +331,26 @@ Validate alignment with request and plan. Report ALIGNED or MISALIGNED with deta
331
331
  VALIDATION_SCOPE: changed-only"
332
332
  ```
333
333
  - If Validator FAIL: Report to user
334
- - If Validator PASS: Loop back to Phase 9 (re-check alignment)
334
+ - If Validator PASS: Loop back to Phase 12 (re-check alignment)
335
335
  4. If `alignment_fix_count > 2`: Report misalignments to user for decision
336
336
 
337
- ### Phase 10: Create PR
337
+ ### Phase 13: Create PR
338
338
 
339
339
  **For SEQUENTIAL_CODERS or PARALLEL_CODERS**: The last sequential Coder (with CREATE_PR: true) handles PR creation. For parallel coders, create unified PR using `git-workflow` skill patterns. Push branch and run `gh pr create` with comprehensive description, targeting `BASE_BRANCH`.
340
340
 
341
341
  **For SINGLE_CODER**: PR is created by the Coder agent (CREATE_PR: true).
342
342
 
343
- ### Phase 11: Report
343
+ ### Phase 14: Report
344
344
 
345
345
  Display completion summary with phase status, PR info, and next steps.
346
346
 
347
+ ### Phase 15: Record Decisions (if any)
348
+
349
+ If the Coder's report includes Key Decisions with architectural significance:
350
+ 1. Read `~/.claude/skills/knowledge-persistence/SKILL.md` and follow its extraction procedure to record decisions to `.memory/knowledge/decisions.md`
351
+ 2. Source field: `/implement {TASK_ID}`
352
+ 3. Skip entirely if no architectural decisions were made
353
+
347
354
  ## Architecture
348
355
 
349
356
  ```
@@ -352,54 +359,56 @@ Display completion summary with phase status, PR info, and next steps.
352
359
  ├─ Phase 1: Setup
353
360
  │ └─ Git agent (operation: setup-task) - creates feature branch, fetches issue
354
361
 
355
- ├─ Phase 1.5: Orient
362
+ ├─ Phase 2: Orient
356
363
  │ └─ Skimmer agent (codebase overview via skim)
357
364
 
358
- ├─ Phase 2: Explore (PARALLEL, with Skimmer context)
365
+ ├─ Phase 3: Explore (PARALLEL, with Skimmer context)
359
366
  │ ├─ Explore: Architecture
360
367
  │ ├─ Explore: Integration
361
368
  │ ├─ Explore: Reusable code
362
369
  │ └─ Explore: Edge cases
363
370
 
364
- ├─ Phase 3: Synthesize Exploration
371
+ ├─ Phase 4: Synthesize Exploration
365
372
  │ └─ Synthesizer agent (mode: exploration)
366
373
 
367
- ├─ Phase 4: Plan (PARALLEL)
374
+ ├─ Phase 5: Plan (PARALLEL)
368
375
  │ ├─ Plan: Implementation steps
369
376
  │ ├─ Plan: Testing strategy
370
377
  │ └─ Plan: Execution strategy (3-strategy decision)
371
378
 
372
- ├─ Phase 5: Synthesize Planning
379
+ ├─ Phase 6: Synthesize Planning
373
380
  │ └─ Synthesizer agent (mode: planning) → returns strategy + DOMAIN hints
374
381
 
375
- ├─ Phase 6: Implement (3-strategy framework)
382
+ ├─ Phase 7: Implement (3-strategy framework)
376
383
  │ ├─ SINGLE_CODER (80%): One Coder, full plan, CREATE_PR: true
377
384
  │ ├─ SEQUENTIAL_CODERS (15%): N Coders with handoff summaries
378
385
  │ └─ PARALLEL_CODERS (5%): N Coders in single message (rare)
379
386
 
380
- ├─ Phase 6.5: Validate
387
+ ├─ Phase 8: Validate
381
388
  │ └─ Validator agent (build, typecheck, lint, test)
382
389
  │ └─ If FAIL: Coder fix loop (max 2 retries) → re-validate
383
390
 
384
- ├─ Phase 7: Simplify
391
+ ├─ Phase 9: Simplify
385
392
  │ └─ Simplifier agent (refines code clarity and consistency)
386
393
 
387
- ├─ Phase 8: Self-Review
394
+ ├─ Phase 10: Self-Review
388
395
  │ └─ Scrutinizer agent (final quality gate, fixes P0/P1)
389
396
 
390
- ├─ Phase 8.5: Re-Validate (if Scrutinizer made changes)
397
+ ├─ Phase 11: Re-Validate (if Scrutinizer made changes)
391
398
  │ └─ Validator agent (verify Scrutinizer fixes)
392
399
 
393
- ├─ Phase 9: Alignment Check
400
+ ├─ Phase 12: Alignment Check
394
401
  │ └─ Shepherd agent (validates alignment - reports only, no fixes)
395
402
  │ └─ If MISALIGNED: Coder fix loop (max 2 iterations) → Validator → re-check
396
403
 
397
- ├─ Phase 10: Create PR (if needed)
404
+ ├─ Phase 13: Create PR (if needed)
398
405
  │ └─ SINGLE_CODER: handled by Coder
399
406
  │ └─ SEQUENTIAL: handled by last Coder
400
407
  │ └─ PARALLEL: orchestrator creates unified PR
401
408
 
402
- └─ Phase 11: Display agent outputs
409
+ ├─ Phase 14: Display agent outputs
410
+
411
+ └─ Phase 15: Record Decisions (inline, if any)
403
412
  ```
404
413
 
405
414
  ## Principles