@tgoodington/intuition 8.1.3 → 9.2.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 (111) hide show
  1. package/docs/v9/decision-framework-direction.md +142 -0
  2. package/docs/v9/decision-framework-implementation.md +114 -0
  3. package/docs/v9/domain-adaptive-team-architecture.md +1016 -0
  4. package/docs/v9/test/SESSION_SUMMARY.md +117 -0
  5. package/docs/v9/test/TEST_PLAN.md +119 -0
  6. package/docs/v9/test/blueprints/legal-analyst.md +166 -0
  7. package/docs/v9/test/output/07_cover_letter.md +41 -0
  8. package/docs/v9/test/phase2/mock_plan.md +89 -0
  9. package/docs/v9/test/phase2/producers.json +32 -0
  10. package/docs/v9/test/phase2/specialists/database-architect.specialist.md +10 -0
  11. package/docs/v9/test/phase2/specialists/financial-analyst.specialist.md +10 -0
  12. package/docs/v9/test/phase2/specialists/legal-analyst.specialist.md +10 -0
  13. package/docs/v9/test/phase2/specialists/technical-writer.specialist.md +10 -0
  14. package/docs/v9/test/phase2/team_assignment.json +61 -0
  15. package/docs/v9/test/phase3/blueprints/legal-analyst.md +840 -0
  16. package/docs/v9/test/phase3/legal-analyst-full.specialist.md +111 -0
  17. package/docs/v9/test/phase3/project_context/nh_landlord_tenant_notes.md +35 -0
  18. package/docs/v9/test/phase3/project_context/property_facts.md +32 -0
  19. package/docs/v9/test/phase3b/blueprints/legal-analyst.md +1715 -0
  20. package/docs/v9/test/phase3b/legal-analyst.specialist.md +153 -0
  21. package/docs/v9/test/phase3b/scratch/legal-analyst-stage1.md +270 -0
  22. package/docs/v9/test/phase4/TEST_PLAN.md +32 -0
  23. package/docs/v9/test/phase4/blueprints/financial-analyst-T2.md +538 -0
  24. package/docs/v9/test/phase4/blueprints/legal-analyst-T4.md +253 -0
  25. package/docs/v9/test/phase4/cross-blueprint-check.md +280 -0
  26. package/docs/v9/test/phase4/scratch/financial-analyst-T2-stage1.md +67 -0
  27. package/docs/v9/test/phase4/scratch/legal-analyst-T4-stage1.md +54 -0
  28. package/docs/v9/test/phase4/specialists/financial-analyst.specialist.md +156 -0
  29. package/docs/v9/test/phase4/specialists/legal-analyst.specialist.md +153 -0
  30. package/docs/v9/test/phase5/TEST_PLAN.md +35 -0
  31. package/docs/v9/test/phase5/blueprints/code-architect-hw-vetter.md +375 -0
  32. package/docs/v9/test/phase5/output/04_compliance_checklist.md +149 -0
  33. package/docs/v9/test/phase5/output/hardware-vetter-SKILL-v2.md +561 -0
  34. package/docs/v9/test/phase5/output/hardware-vetter-SKILL.md +459 -0
  35. package/docs/v9/test/phase5/producers/code-writer.producer.md +49 -0
  36. package/docs/v9/test/phase5/producers/document-writer.producer.md +62 -0
  37. package/docs/v9/test/phase5/regression-comparison-v2.md +60 -0
  38. package/docs/v9/test/phase5/regression-comparison.md +197 -0
  39. package/docs/v9/test/phase5/review-5A-specialist.md +213 -0
  40. package/docs/v9/test/phase5/specialist-test/TEST_PLAN.md +60 -0
  41. package/docs/v9/test/phase5/specialist-test/blueprint-comparison.md +252 -0
  42. package/docs/v9/test/phase5/specialist-test/blueprints/code-architect-hw-vetter.md +916 -0
  43. package/docs/v9/test/phase5/specialist-test/scratch/code-architect-stage1.md +427 -0
  44. package/docs/v9/test/phase5/specialists/code-architect.specialist.md +168 -0
  45. package/docs/v9/test/phase5b/TEST_PLAN.md +219 -0
  46. package/docs/v9/test/phase5b/blueprints/5B-10-stage2-with-decisions.md +286 -0
  47. package/docs/v9/test/phase5b/decisions/5B-2-accept-all-decisions.json +68 -0
  48. package/docs/v9/test/phase5b/decisions/5B-3-promote-decisions.json +70 -0
  49. package/docs/v9/test/phase5b/decisions/5B-4-individual-decisions.json +68 -0
  50. package/docs/v9/test/phase5b/decisions/5B-5-triage-decisions.json +110 -0
  51. package/docs/v9/test/phase5b/decisions/5B-6-fallback-decisions.json +40 -0
  52. package/docs/v9/test/phase5b/decisions/5B-8-partial-decisions.json +46 -0
  53. package/docs/v9/test/phase5b/decisions/5B-9-complete-decisions.json +54 -0
  54. package/docs/v9/test/phase5b/scratch/code-architect-stage1.md +133 -0
  55. package/docs/v9/test/phase5b/specialists/code-architect.specialist.md +202 -0
  56. package/docs/v9/test/phase5b/stage1-many-decisions.md +139 -0
  57. package/docs/v9/test/phase5b/stage1-no-assumptions.md +70 -0
  58. package/docs/v9/test/phase5b/stage1-with-assumptions.md +86 -0
  59. package/docs/v9/test/phase5b/test-5B-1-results.md +157 -0
  60. package/docs/v9/test/phase5b/test-5B-10-results.md +130 -0
  61. package/docs/v9/test/phase5b/test-5B-2-results.md +75 -0
  62. package/docs/v9/test/phase5b/test-5B-3-results.md +104 -0
  63. package/docs/v9/test/phase5b/test-5B-4-results.md +114 -0
  64. package/docs/v9/test/phase5b/test-5B-5-results.md +126 -0
  65. package/docs/v9/test/phase5b/test-5B-6-results.md +60 -0
  66. package/docs/v9/test/phase5b/test-5B-7-results.md +141 -0
  67. package/docs/v9/test/phase5b/test-5B-8-results.md +115 -0
  68. package/docs/v9/test/phase5b/test-5B-9-results.md +76 -0
  69. package/docs/v9/test/producers/document-writer.producer.md +62 -0
  70. package/docs/v9/test/specialists/legal-analyst.specialist.md +58 -0
  71. package/package.json +4 -2
  72. package/producers/code-writer/code-writer.producer.md +86 -0
  73. package/producers/data-file-writer/data-file-writer.producer.md +116 -0
  74. package/producers/document-writer/document-writer.producer.md +117 -0
  75. package/producers/form-filler/form-filler.producer.md +99 -0
  76. package/producers/presentation-creator/presentation-creator.producer.md +109 -0
  77. package/producers/spreadsheet-builder/spreadsheet-builder.producer.md +107 -0
  78. package/scripts/install-skills.js +88 -7
  79. package/scripts/uninstall-skills.js +3 -0
  80. package/skills/intuition-agent-advisor/SKILL.md +107 -0
  81. package/skills/intuition-assemble/SKILL.md +261 -0
  82. package/skills/intuition-build/SKILL.md +211 -151
  83. package/skills/intuition-debugger/SKILL.md +4 -4
  84. package/skills/intuition-design/SKILL.md +7 -3
  85. package/skills/intuition-detail/SKILL.md +377 -0
  86. package/skills/intuition-engineer/SKILL.md +8 -4
  87. package/skills/intuition-handoff/SKILL.md +251 -213
  88. package/skills/intuition-handoff/references/handoff_core.md +16 -16
  89. package/skills/intuition-initialize/SKILL.md +20 -5
  90. package/skills/intuition-initialize/references/state_template.json +16 -1
  91. package/skills/intuition-plan/SKILL.md +139 -59
  92. package/skills/intuition-plan/references/magellan_core.md +8 -8
  93. package/skills/intuition-plan/references/templates/plan_template.md +5 -5
  94. package/skills/intuition-prompt/SKILL.md +89 -27
  95. package/skills/intuition-start/SKILL.md +42 -9
  96. package/skills/intuition-start/references/start_core.md +12 -12
  97. package/skills/intuition-test/SKILL.md +345 -0
  98. package/specialists/api-designer/api-designer.specialist.md +291 -0
  99. package/specialists/business-analyst/business-analyst.specialist.md +270 -0
  100. package/specialists/copywriter/copywriter.specialist.md +268 -0
  101. package/specialists/database-architect/database-architect.specialist.md +275 -0
  102. package/specialists/devops-infrastructure/devops-infrastructure.specialist.md +314 -0
  103. package/specialists/financial-analyst/financial-analyst.specialist.md +269 -0
  104. package/specialists/frontend-component/frontend-component.specialist.md +293 -0
  105. package/specialists/instructional-designer/instructional-designer.specialist.md +285 -0
  106. package/specialists/legal-analyst/legal-analyst.specialist.md +260 -0
  107. package/specialists/marketing-strategist/marketing-strategist.specialist.md +281 -0
  108. package/specialists/project-manager/project-manager.specialist.md +266 -0
  109. package/specialists/research-analyst/research-analyst.specialist.md +273 -0
  110. package/specialists/security-auditor/security-auditor.specialist.md +354 -0
  111. package/specialists/technical-writer/technical-writer.specialist.md +275 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: intuition-handoff
3
- description: Universal phase transition orchestrator. Processes phase outputs, updates project memory, generates fresh briefs for next agent. Manages the design loop for multi-item design cycles.
4
- model: haiku
3
+ description: Universal phase transition orchestrator. Processes phase outputs, updates project memory, generates fresh briefs for next agent. Manages the design loop for multi-item design cycles and v9 team assembly for specialist workflows.
4
+ model: sonnet
5
5
  tools: Read, Write, Glob, Grep, AskUserQuestion, Bash
6
6
  allowed-tools: Read, Write, Glob, Grep, Bash
7
7
  ---
@@ -23,7 +23,7 @@ These are non-negotiable. Violating any of these means the protocol has failed.
23
23
  7. You MUST NOT evaluate or critique phase outputs. Process and document, never judge.
24
24
  8. You MUST NOT skip the user profile merge step during prompt→planning transitions.
25
25
  9. You MUST suggest the correct next skill after completing the transition.
26
- 10. You MUST NOT modify discovery_brief.md, plan.md, design_spec_*.md, code_specs.md, or other phase output files — they are read-only inputs.
26
+ 10. You MUST NOT modify prompt_brief.md, plan.md, design_spec_*.md, code_specs.md, or other phase output files — they are read-only inputs.
27
27
  11. You MUST manage the design loop: track which items are designed, route to next item or to engineer when all are done.
28
28
 
29
29
  ## CONTEXT PATH RESOLUTION
@@ -41,10 +41,20 @@ Before ANY transition, resolve the active context:
41
41
  6. Use `context_workflow` for all status checks and state writes
42
42
  7. Shared files (key_facts.md, decisions.md, issues.md, bugs.md) always stay at `docs/project_notes/` — do NOT use context_path for these.
43
43
 
44
+ ## MODE DETECTION
45
+
46
+ After resolving context_path, determine the workflow version:
47
+
48
+ 1. Read `{context_path}plan.md` (if it exists)
49
+ 2. IF plan contains a `### 6.5 Detail Assessment` section → **v9 mode**
50
+ 3. IF plan contains a `Design Recommendations` section OR no plan exists yet → **v8 mode**
51
+ 4. Store the detected mode for use in transition detection below.
52
+
44
53
  ## PROTOCOL: COMPLETE FLOW
45
54
 
46
55
  ```
47
56
  Step 1: Resolve context_path and context_workflow (see above)
57
+ Step 1.5: Detect mode (v8 or v9)
48
58
  Step 2: Detect transition type from context_workflow
49
59
  Step 3: Read phase output files from {context_path}
50
60
  Step 4: Extract insights and structure findings
@@ -57,18 +67,30 @@ Step 9: Report what was processed and suggest next skill
57
67
 
58
68
  ## STEP 1: DETECT TRANSITION
59
69
 
60
- After resolving context_path and context_workflow, determine:
70
+ After resolving context_path, context_workflow, and mode:
61
71
 
62
72
  ```
63
73
  IF context_workflow.status == "prompt" AND workflow.prompt.completed == true
64
74
  AND workflow.planning.started == false:
65
75
  → TRANSITION: Prompt → Planning (Transition 1)
66
76
 
67
- IF context_workflow.status == "planning" AND workflow.planning.completed == true
68
- AND workflow.design.started == false AND workflow.engineering.started == false:
69
- TRANSITION: Planning → Design (Transition 2) OR Planning → Engineer (Transition 2B)
70
-
71
- IF context_workflow.status == "design":
77
+ IF context_workflow.status == "planning" AND workflow.planning.completed == true:
78
+ IF v9 mode AND NOT (workflow.detail exists AND workflow.detail.started == true):
79
+ IF {context_path}team_assignment.json exists:
80
+ → TRANSITION: Assemble → Detail (Transition 2.5v9)
81
+ ELSE:
82
+ → TRANSITION: Plan → Assemble (Transition 2v9)
83
+ ELSE IF v8 mode AND workflow.design.started == false AND workflow.engineering.started == false:
84
+ → TRANSITION: Planning → Design (Transition 2) OR Planning → Engineer (Transition 2B)
85
+
86
+ IF v9 mode AND context_workflow.status == "detail":
87
+ → Check workflow.detail.specialists array
88
+ → IF current specialist status == "completed" AND more specialists remain in current or later execution phases:
89
+ → TRANSITION: Specialist → Specialist (Transition 3v9)
90
+ → IF ALL specialists completed:
91
+ → TRANSITION: Detail → Build (Transition 4v9)
92
+
93
+ IF v8 mode AND context_workflow.status == "design":
72
94
  → Check workflow.design.items array
73
95
  → IF current item just completed AND more items remain:
74
96
  → TRANSITION: Design → Design (Transition 3)
@@ -77,32 +99,44 @@ IF context_workflow.status == "design":
77
99
 
78
100
  IF context_workflow.status == "engineering" AND workflow.engineering.completed == true
79
101
  AND workflow.build.started == false:
80
- → TRANSITION: Engineer → Build (Transition 5)
102
+ → TRANSITION: Engineer → Build (Transition 5) — v8 only
81
103
 
82
104
  IF context_workflow.status == "building" AND workflow.build.completed == true:
83
- TRANSITION: Build Complete (Transition 6)
105
+ IF v9 mode AND workflow.test.started == false:
106
+ Read {context_path}/team_assignment.json
107
+ IF any producer_assignments entry has producer == "code-writer":
108
+ → TRANSITION: Build → Test (Transition 6.5v9)
109
+ ELSE:
110
+ → TRANSITION: Build → Complete (Transition 6)
111
+ ELSE IF v8 mode:
112
+ → TRANSITION: Build → Complete (Transition 6)
113
+
114
+ IF context_workflow.status == "testing" AND workflow.test.completed == true:
115
+ → TRANSITION: Test → Complete (Transition 7)
84
116
 
85
117
  IF no clear transition detected:
86
118
  → ASK USER: "Which phase just completed?" (use AskUserQuestion)
87
119
  ```
88
120
 
89
- ## STATE SCHEMA (v5.0)
121
+ ## STATE SCHEMA (v7.0)
90
122
 
91
123
  This is the authoritative schema for `.project-memory-state.json`:
92
124
 
93
125
  ```json
94
126
  {
95
127
  "initialized": true,
96
- "version": "5.0",
128
+ "version": "7.0",
97
129
  "active_context": "trunk",
98
130
  "trunk": {
99
- "status": "none | prompt | planning | design | engineering | building | complete",
131
+ "status": "none | prompt | planning | design | engineering | building | testing | detail | complete",
100
132
  "workflow": {
101
133
  "prompt": { "started": false, "completed": false, "started_at": null, "completed_at": null, "output_files": [] },
102
134
  "planning": { "started": false, "completed": false, "completed_at": null, "approved": false },
103
135
  "design": { "started": false, "completed": false, "completed_at": null, "items": [], "current_item": null },
104
136
  "engineering": { "started": false, "completed": false, "completed_at": null },
105
- "build": { "started": false, "completed": false, "completed_at": null }
137
+ "build": { "started": false, "completed": false, "completed_at": null },
138
+ "test": { "started": false, "completed": false, "completed_at": null, "skipped": false },
139
+ "detail": { "started": false, "completed": false, "completed_at": null, "team_assignment": null, "specialists": [], "current_specialist": null, "execution_phase": 1 }
106
140
  }
107
141
  },
108
142
  "branches": {},
@@ -113,12 +147,16 @@ This is the authoritative schema for `.project-memory-state.json`:
113
147
 
114
148
  ### Branch Entry Schema
115
149
 
116
- Each branch in `branches` has: `display_name`, `created_from`, `created_at`, `purpose`, `status`, and a `workflow` object identical to trunk's workflow structure (including `engineering` and `build` phases).
150
+ Each branch in `branches` has: `display_name`, `created_from`, `created_at`, `purpose`, `status`, and a `workflow` object identical to trunk's workflow structure (including `engineering`, `build`, `test`, and `detail` phases).
117
151
 
118
152
  ### Design Items Schema
119
153
 
120
154
  Each item in `design.items`: `{ "name": "snake_case", "display_name": "Human Name", "status": "pending|in_progress|completed|skipped", "plan_tasks": [N], "spec_file": null, "flagged_reason": "..." }`
121
155
 
156
+ ### Detail Specialist Schema (v9)
157
+
158
+ Each entry in `detail.specialists`: `{ "name": "specialist-name", "tasks": [{"task_id": "T1", "depth": "Deep"}], "status": "pending|in_progress|completed", "stage": "stage1|user_gate|stage2|done", "stage1_path": null, "decisions_path": null, "blueprint_path": null }`
159
+
122
160
  When updating state, preserve all existing fields and only modify the relevant ones. Always set `last_handoff` to the current ISO timestamp and `last_handoff_transition` to the transition name.
123
161
 
124
162
  ### State Write Pattern
@@ -146,309 +184,302 @@ Triggered when start routes to handoff with branch creation intent. User has pro
146
184
  - `created_at`: ISO timestamp
147
185
  - `purpose`: user-provided sentence
148
186
  - `status`: "none"
149
- - `workflow`: identical structure to trunk's workflow (all false/null/empty — including `engineering` and `build` phases)
187
+ - `workflow`: identical structure to trunk's workflow (all false/null/empty — including `engineering`, `build`, `test`, and `detail` phases)
150
188
  4. **Set `active_context`** to the new branch key.
151
189
  5. **Write updated state**. Set `last_handoff_transition` to "branch_creation".
152
190
  6. **Route user**: "Branch **[display_name]** created. Run `/clear` then `/intuition-prompt` to define what this branch will accomplish."
153
191
 
154
- ## V4 STATE MIGRATION
192
+ ## V5 STATE MIGRATION
155
193
 
156
- Fires automatically when handoff detects a v4.0 state before processing any transition.
194
+ Fires when handoff detects `version == "5.0"`. For trunk and every branch: if `workflow.detail` does not exist, add `"detail": { "started": false, "completed": false, "completed_at": null, "team_assignment": null, "specialists": [], "current_specialist": null, "execution_phase": 1 }` after `build` in the workflow object. Also add `"test": { "started": false, "completed": false, "completed_at": null, "skipped": false }` after `build`. Set `version: "7.0"`, preserve all other fields, write state. Report: "Migrated state from v5.0 to v7.0 (added detail phase + test phase)." Then continue with the original transition.
157
195
 
158
- ### Detection
196
+ ## V6 STATE MIGRATION
159
197
 
160
- `version == "4.0"` OR (state has `execution` phase in workflow but no `engineering` phase).
198
+ Fires when handoff detects `version == "6.0"`. For trunk and every branch: if `workflow.test` does not exist, add `"test": { "started": false, "completed": false, "completed_at": null, "skipped": false }` after `build` in the workflow object. Set `version: "7.0"`, preserve all other fields, write state. Report: "Migrated state from v6.0 to v7.0 (added test phase for post-build quality gate)." Then continue with the original transition.
161
199
 
162
- ### Migration Steps
200
+ ## V4 STATE MIGRATION
163
201
 
164
- 1. For trunk and every branch, transform the workflow object:
165
- - Rename `execution` → `build` (preserve all field values)
166
- - Add `engineering: { "started": false, "completed": false, "completed_at": null }` before `build`
167
- - If a context has `status == "executing"`, change to `status = "building"`
168
- 2. Set `version: "5.0"`
169
- 3. Preserve all other fields unchanged.
170
- 4. Write updated state.
171
- 5. Report to user: "Migrated state from v4.0 to v5.0 (added engineering phase, renamed execution → build)." Then continue with the original transition.
202
+ Fires when handoff detects `version == "4.0"` OR (`execution` phase exists but no `engineering` phase). For trunk and every branch: rename `execution` → `build`, add `engineering: { "started": false, "completed": false, "completed_at": null }` before `build`, change any `status == "executing"` to `"building"`. Set `version: "5.0"`, preserve all other fields, write state. Report: "Migrated state from v4.0 to v5.0 (added engineering phase, renamed execution → build)." Then continue with the original transition.
172
203
 
173
204
  ## V3 STATE MIGRATION
174
205
 
175
- Fires automatically when handoff detects a v3.0 state before processing any transition.
206
+ Fires when handoff detects `version == "3.0"` OR missing `active_context`. Create `docs/project_notes/trunk/`. Move existing workflow artifacts (`prompt_brief.md`, `prompt_output.json`, `planning_brief.md`, `plan.md`, `design_brief.md`, `design_spec_*.md`, `execution_brief.md`, `.planning_research/`) from `docs/project_notes/` into `trunk/` — skip missing files. Restructure state: wrap existing `status` + `workflow` into `trunk` object, add `active_context: "trunk"`, `branches: {}`, rename `execution` → `build`, add `engineering` phase, set `version: "5.0"`. Preserve `initialized`, `last_handoff`, `last_handoff_transition`. Write state. Report what was migrated and confirm v5.0 upgrade. Leave shared files (`key_facts.md`, `decisions.md`, `issues.md`, `bugs.md`) at `docs/project_notes/`.
176
207
 
177
- ### Detection
208
+ ## TRANSITION 1: PROMPT → PLANNING
178
209
 
179
- `version == "3.0"` OR missing `active_context` field in state.
210
+ Read `{context_path}prompt_brief.md` and `{context_path}prompt_output.json` (if exists fall back to extracting from brief manually).
180
211
 
181
- ### Migration Steps
212
+ **Extract and Structure:** Key facts → `key_facts.md`, constraints → `key_facts.md` (constraints category), suggested decisions → ADRs in `decisions.md`, assumptions → reference in brief only, follow-up items → `issues.md`.
182
213
 
183
- 1. Create `docs/project_notes/trunk/` directory.
184
- 2. Move existing workflow artifacts from `docs/project_notes/` into `docs/project_notes/trunk/`:
185
- - `discovery_brief.md`, `discovery_output.json`, `planning_brief.md`, `plan.md`
186
- - `design_brief.md`, `design_spec_*.md`, `execution_brief.md`
187
- - `.planning_research/` directory (entire folder)
188
- - Only move files that exist. Skip missing files silently.
189
- 3. Restructure state:
190
- - Wrap existing `status` and `workflow` into a `trunk` object
191
- - Add `active_context: "trunk"`
192
- - Add `branches: {}`
193
- - Transform workflow: rename `execution` → `build`, add `engineering` phase
194
- - Set `version: "5.0"`
195
- - Preserve all other top-level fields (`initialized`, `last_handoff`, `last_handoff_transition`)
196
- 4. Write updated state.
197
- 5. Report to user: list which files were migrated and confirm v5.0 upgrade. Then continue with the original transition.
214
+ **User Profile Merge:** If `prompt_output.json` has `user_profile_learnings` AND `.claude/USER_PROFILE.json` exists: read profile, merge (null fields get new values, populated fields overwrite only if confidence "high"), save. Skip if no USER_PROFILE.json.
198
215
 
199
- Leave shared files (`key_facts.md`, `decisions.md`, `issues.md`, `bugs.md`) at `docs/project_notes/` do NOT move them.
216
+ **Generate Planning Brief:** Write `{context_path}planning_brief.md` with: Discovery Summary (1-2 paragraphs), Problem Statement, Goals & Success Criteria, Key Constraints, Architectural Context, Assumptions & Risks (with confidence levels), References (prompt_brief path, ADR numbers).
200
217
 
201
- ## TRANSITION 1: PROMPT PLANNING
218
+ Update state: set `status` to `"planning"`, mark `prompt.completed = true` with timestamp, set `planning.started = true`. Route: "Prompt output processed. Planning brief saved to `{context_path}planning_brief.md`. Run `/clear` then `/intuition-plan` to create a structured plan."
202
219
 
203
- ### Read Outputs
220
+ ## TRANSITION 2: PLANNING → DESIGN (Initial Setup)
204
221
 
205
- Read from `{context_path}`:
206
- - `{context_path}discovery_brief.md` — human-readable discovery summary
207
- - `{context_path}discovery_output.json` — structured data (if exists)
222
+ v8 mode only. Read `{context_path}plan.md`. Find "Design Recommendations" section — extract items flagged for design with rationale and task numbers (if no section, assess tasks yourself). Extract: decisions → `decisions.md`, risks/dependencies → include in brief, planning work → `issues.md`.
208
223
 
209
- If `discovery_output.json` doesn't exist, extract insights manually from `discovery_brief.md`.
224
+ **Present to user** via AskUserQuestion (header: "Design Items"): list each flagged item with rationale. Options: "All recommended items need design" / "Some items — let me specify" / "None — skip design, go straight to engineering". If "Some," follow up. If "None," use Transition 2B.
210
225
 
211
- ### Extract and Structure
226
+ **Generate Design Brief:** Write `{context_path}design_brief.md` for FIRST item with: Current Item, Plan Context (1-2 paragraphs), Task Details (numbers, description, acceptance criteria, dependencies), Design Rationale, Constraints, Design Queue (all items with status), References.
212
227
 
213
- From the outputs, identify:
214
- - **Key facts** → add to `docs/project_notes/key_facts.md`
215
- - **Constraints** → add to `docs/project_notes/key_facts.md` under constraints category
216
- - **Suggested decisions** → create ADRs in `docs/project_notes/decisions.md`
217
- - **Assumptions** → reference in brief, not directly added to memory
218
- - **Follow-up items** → add to `docs/project_notes/issues.md`
228
+ Update state: set `status` to `"design"`, mark `planning.completed = true` with timestamp and `approved = true`, set `design.started = true`, populate `design.items`, set `design.current_item` to first item (`"in_progress"`). Route: "Plan processed. Design brief prepared for **[First Item Name]**. Run `/clear` then `/intuition-design` to begin design exploration."
219
229
 
220
- ### User Profile Merge
230
+ ## TRANSITION 2B: PLANNING → ENGINEER (Skip Design)
221
231
 
222
- If `{context_path}discovery_output.json` contains `user_profile_learnings` AND `.claude/USER_PROFILE.json` exists:
223
- 1. Read existing USER_PROFILE.json
224
- 2. Merge learnings (null fields get new values; populated fields only overwrite if confidence is "high")
225
- 3. Save updated profile
232
+ v8 mode only. Used when user confirms NO items need design. Write `{context_path}engineering_brief.md` with: Plan Summary (1-2 paragraphs), Objective, Discovery Context, Task Summary, Known Risks, References.
226
233
 
227
- If USER_PROFILE.json does NOT exist, skip this step.
234
+ Update state: set `status` to `"engineering"`, mark `planning.completed = true` with timestamp and `approved = true`, set `design.started = false`, `design.completed = false`, `design.items = []`, set `engineering.started = true`. Route: "Plan processed. No design items flagged. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/clear` then `/intuition-engineer` to create code specs."
228
235
 
229
- ### Generate Planning Brief
236
+ ## TRANSITION 2v9: PLAN → ASSEMBLE
230
237
 
231
- Write `{context_path}planning_brief.md` with these sections:
232
- - **Discovery Summary** (1-2 paragraphs)
233
- - **Problem Statement**
234
- - **Goals & Success Criteria**
235
- - **Key Constraints**
236
- - **Architectural Context** (existing decisions/patterns)
237
- - **Assumptions & Risks** (with confidence levels)
238
- - **References** (discovery_brief path, relevant ADR numbers)
238
+ v9 mode only. Triggers when planning completes and the plan contains a `### 6.5 Detail Assessment` section.
239
239
 
240
- ### Update State
240
+ ### Protocol
241
241
 
242
- Update the active context: set `status` to `"planning"`, mark `prompt.completed = true` with timestamp, set `planning.started = true`.
242
+ 1. **Extract and structure** from plan.md: architectural decisions `docs/project_notes/decisions.md`, risks/dependencies note for brief, planning insights → `docs/project_notes/issues.md`.
243
+ 2. **Update state**: Set `status` to `"planning"`, mark `planning.completed = true` with timestamp, `approved = true`.
244
+ 3. **Route user**: "Plan processed. Run `/clear` then `/intuition-assemble` to build the specialist team and begin the detail phase."
243
245
 
244
- ### Route User
246
+ ## TRANSITION 2.5v9: ASSEMBLE → DETAIL
245
247
 
246
- "Discovery processed. Planning brief saved to `{context_path}planning_brief.md`. Run `/clear` then `/intuition-plan` to create a structured plan."
248
+ v9 mode only. Triggers when planning is complete, `{context_path}team_assignment.json` exists, and detail has not started. This means assemble has finished and the team is ready.
247
249
 
248
- ## TRANSITION 2: PLANNING → DESIGN (Initial Setup)
250
+ ### Protocol
249
251
 
250
- ### Read Outputs
252
+ 1. **Read team assignment**: Read `{context_path}team_assignment.json`. Extract specialist_assignments, execution_order, and producer_assignments.
251
253
 
252
- Read: `{context_path}plan.md`
254
+ 2. **Read specialist profiles**: For each specialist in specialist_assignments, read their profile to get `display_name` and `domain`.
253
255
 
254
- ### Extract Design Items
256
+ 3. **Determine first specialist**: From execution_order phase 1, pick the first specialist alphabetically (or the only one if solo).
255
257
 
256
- From the plan, find "Design Recommendations" section. Extract all items flagged for design with rationale and task numbers. If no section exists, assess tasks yourself and present to user.
258
+ 4. **Generate detail brief**: Write `{context_path}detail_brief.md` with:
257
259
 
258
- ### Extract and Structure
260
+ ```markdown
261
+ # Detail Brief
259
262
 
260
- From the plan: new architectural decisions → `docs/project_notes/decisions.md`, risks/dependencies → include in brief, planning work → `docs/project_notes/issues.md`.
263
+ ## Current Specialist
264
+ - **Name**: {specialist name}
265
+ - **Display Name**: {display_name from profile}
266
+ - **Domain**: {domain from profile}
267
+ - **Profile Path**: {absolute path to the specialist profile file}
261
268
 
262
- ### Present Design Items to User
269
+ ## Assigned Tasks
270
+ {For each task assigned to this specialist:}
271
+ ### Task {task_id}: {title}
272
+ - **Depth**: {depth}
273
+ - **Description**: {from plan}
274
+ - **Acceptance Criteria**: {from plan}
275
+ - **Dependencies**: {from plan}
263
276
 
264
- Use AskUserQuestion:
265
- - Header: "Design Items"
266
- - Question: List each flagged item with rationale
267
- - Options: "All recommended items need design" / "Some items let me specify" / "None — skip design, go straight to engineering"
277
+ ## Known Research
278
+ {Extract from plan.md the sections relevant to THIS specialist's domain and assigned tasks:}
279
+ {- Section 2 (Discovery Summary) full content, always include}
280
+ {- Section 4 (Risk Analysis)risks relevant to this specialist's tasks}
281
+ {- Section 7 (Architectural Decisions) — decisions touching this specialist's domain}
282
+ {- Any other plan sections that contain research findings relevant to the assigned tasks}
283
+ {Omit sections with no relevance to this specialist. If the plan has no research relevant to this specialist, write "No prior research overlaps with this specialist's domain."}
268
284
 
269
- If "Some items," follow up. If "None," use Transition 2B.
285
+ ## Prior Blueprints
286
+ None (first specialist in execution order)
270
287
 
271
- ### Generate Design Brief
288
+ ## Plan Context
289
+ {Relevant content from plan.md Section 10, if present}
272
290
 
273
- Write `{context_path}design_brief.md` for the FIRST item with these sections:
274
- - **Current Item** (name + description)
275
- - **Plan Context** (1-2 paragraphs)
276
- - **Task Details** (task numbers, description, acceptance criteria, dependencies)
277
- - **Design Rationale** (why flagged)
278
- - **Constraints**
279
- - **Design Queue** (all items with status)
280
- - **References** (plan path, discovery path)
291
+ ## Detail Queue
292
+ {All specialists with status:}
293
+ - [in_progress] {first specialist display_name}
294
+ - [pending] {second specialist display_name}
295
+ - [pending] ...
296
+ ```
281
297
 
282
- ### Update State
298
+ 5. **Update state**:
299
+ - Set `status` to `"detail"`
300
+ - Set `detail.started` to `true`, `detail.completed` to `false`
301
+ - Set `detail.team_assignment` to `"team_assignment.json"`
302
+ - Populate `detail.specialists` array from specialist_assignments. Each entry:
303
+ - `name`: specialist name
304
+ - `tasks`: task list from assignment
305
+ - `status`: `"pending"` (except first specialist: `"in_progress"`)
306
+ - `stage`: `"stage1"`
307
+ - `stage1_path`: null
308
+ - `decisions_path`: null
309
+ - `blueprint_path`: null
310
+ - Set `detail.current_specialist` to the first specialist name
311
+ - Set `detail.execution_phase` to `1`
283
312
 
284
- Update active context: set `status` to `"design"`, mark `planning.completed = true` with timestamp and `approved = true`, set `design.started = true`, populate `design.items` array with all confirmed items, set `design.current_item` to first item, mark first item status `"in_progress"`.
313
+ 6. **Route user**: "Team assignment processed. Detail brief prepared for **[First Specialist Display Name]**. Run `/clear` then `/intuition-detail` to begin specialist consultation."
285
314
 
286
- ### Route User
315
+ ## TRANSITION 3v9: SPECIALIST → SPECIALIST (Next Specialist)
287
316
 
288
- "Plan processed. Design brief prepared for **[First Item Name]**. Run `/clear` then `/intuition-design` to begin design exploration."
317
+ v9 mode only. Triggers when the current specialist's blueprint is complete and more specialists remain.
289
318
 
290
- ## TRANSITION 2B: PLANNING → ENGINEER (Skip Design)
319
+ ### Protocol
291
320
 
292
- Used when user confirms NO items need design.
321
+ 1. **Read completed blueprint**: Read `{context_path}/blueprints/{completed-specialist-name}.md`. Extract: key decisions → `docs/project_notes/decisions.md`, domain facts → `docs/project_notes/key_facts.md`.
293
322
 
294
- ### Generate Engineering Brief
323
+ 2. **Update specialist status**: In `detail.specialists`, mark the completed specialist as `status: "completed"`, `stage: "done"`, set `blueprint_path` to the blueprint file path.
295
324
 
296
- Write `{context_path}engineering_brief.md` with these sections:
297
- - **Plan Summary** (1-2 paragraphs)
298
- - **Objective**
299
- - **Discovery Context** (brief reminder)
300
- - **Task Summary** (task list with brief descriptions)
301
- - **Known Risks** (with mitigations)
302
- - **References** (plan path, discovery path)
325
+ 3. **Determine next specialist**: Check `detail.execution_order` from `{context_path}/team_assignment.json`. Within the current `execution_phase`, find the next specialist with `status: "pending"`. If all specialists in the current phase are complete, advance `execution_phase` and pick the first pending specialist in the next phase.
303
326
 
304
- ### Update State
327
+ 4. **Check dependencies**: Read `team_assignment.json` dependencies array. If the next specialist has `reads_blueprint_from` entries, verify those blueprints exist. If any dependency blueprint is missing, skip to the next eligible specialist or halt if none are ready.
305
328
 
306
- Update active context: set `status` to `"engineering"`, mark `planning.completed = true` with timestamp and `approved = true`, set `design.started = false`, `design.completed = false`, `design.items = []`, set `engineering.started = true`.
329
+ 5. **Generate detail brief for next specialist**: Overwrite `{context_path}/detail_brief.md` with:
330
+ - **Current Specialist**: name, display_name, domain (from next specialist's profile)
331
+ - **Assigned Tasks**: task details from plan
332
+ - **Specialist Profile Path**: absolute path to the next specialist's profile
333
+ - **Known Research**: same extraction as Transition 2.5v9 — plan sections relevant to this specialist's domain and tasks (Section 2 always, Sections 4/7 filtered by relevance). Omit sections with no relevance.
334
+ - **Prior Blueprints**: paths to ALL completed blueprints in `{context_path}/blueprints/` (the next specialist may need to reference them)
335
+ - **Plan Context**: section 10 content
336
+ - **Detail Queue**: all specialists with status (completed/in_progress/pending)
307
337
 
308
- ### Route User
338
+ 6. **Update state**: Set `detail.current_specialist` to next specialist name, mark next specialist `status: "in_progress"`, `stage: "stage1"`. Update `detail.execution_phase` if advanced.
309
339
 
310
- "Plan processed. No design items flagged. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/clear` then `/intuition-engineer` to create code specs."
340
+ 7. **Route user**: "[Completed Specialist] blueprint complete. Detail brief updated for **[Next Specialist Display Name]** ([N] of [total], [remaining] remaining). Run `/clear` then `/intuition-detail` to continue."
311
341
 
312
- ## TRANSITION 3: DESIGNDESIGN (Next Item)
342
+ ## TRANSITION 4v9: DETAILBUILD (Conflict Check + Completeness Gate)
313
343
 
314
- ### Read Outputs
344
+ v9 mode only. Triggers when ALL specialists in `detail.specialists` have `status: "completed"`.
315
345
 
316
- Read:
317
- - `{context_path}design_spec_[completed_item].md`
318
- - Current `.project-memory-state.json`
346
+ ### Protocol
319
347
 
320
- ### Extract and Structure
348
+ 1. **Extract from all blueprints**: For each blueprint in `{context_path}/blueprints/*.md`, extract decisions → `docs/project_notes/decisions.md`, key facts → `docs/project_notes/key_facts.md`.
321
349
 
322
- From completed spec: decisions `docs/project_notes/decisions.md`, key facts `docs/project_notes/key_facts.md`, design work → `docs/project_notes/issues.md`.
350
+ 2. **Conflict detection**: Spawn a haiku Task subagent to scan all blueprints:
351
+ - **Prompt**: "Read all blueprint files in `{context_path}/blueprints/`. Compare them for: contradictory decisions (same field/resource specified differently), overlapping file modifications (multiple blueprints targeting the same file with conflicting changes), inconsistent interface assumptions (one blueprint expects an API that another defines differently), and duplicated work (two blueprints specifying the same deliverable). Write findings to `{context_path}/blueprint-conflicts.md`. If no conflicts found, write 'No conflicts detected.' to the file."
352
+ - If conflicts found → present to user via AskUserQuestion, ask how to resolve. Do NOT proceed to build until resolved or user explicitly accepts the conflicts.
323
353
 
324
- ### Determine Next Item
354
+ 3. **Completeness gate**: For each blueprint, verify:
355
+ - Section 8 "Open Items" is empty (or contains only `[VERIFY]` / execution-time items)
356
+ - All 9 mandatory sections are present and non-empty
357
+ - Acceptance Mapping section addresses every acceptance criterion from the plan
358
+ - Producer Handoff section references a valid producer
359
+ - If any blueprint fails → report the specific failures, do NOT proceed to build.
325
360
 
326
- Find next item with status `"pending"` in `design.items`. If none remain, proceed to Transition 4.
361
+ 4. **Generate build brief**: Write `{context_path}/build_brief.md` with:
362
+ - **Plan Summary** (1-2 paragraphs)
363
+ - **Objective**
364
+ - **Team Summary**: specialists involved, blueprint count, producer assignments
365
+ - **Blueprint Index**: each blueprint with specialist, tasks covered, producer, output format
366
+ - **Conflict Check**: results (clean or resolved conflicts)
367
+ - **Quality Gates**: security review, domain specialist reviews, cross-cutting reviews
368
+ - **Known Risks**: aggregated from blueprints
369
+ - **References**: plan path, all blueprint paths, team_assignment.json path
327
370
 
328
- ### Update Design Brief
371
+ 5. **Update state**: Set `status` to `"building"`, mark `detail.completed = true` with timestamp, set `build.started = true`.
329
372
 
330
- Overwrite `{context_path}design_brief.md` for the next item with these sections:
331
- - **Current Item** (name + description)
332
- - **Plan Context**
333
- - **Task Details**
334
- - **Design Rationale**
335
- - **Prior Design Context** (relevant prior design decisions)
336
- - **Constraints** (updated with prior design decisions)
337
- - **Design Queue** (show completed, current, pending items)
338
- - **References** (plan path, completed spec paths)
373
+ 6. **Route user**: "All blueprints complete. Conflict check [passed/resolved]. Build brief saved to `{context_path}/build_brief.md`. Run `/clear` then `/intuition-build` to begin production."
339
374
 
340
- ### Update State
375
+ ## TRANSITION 3: DESIGN → DESIGN (Next Item)
341
376
 
342
- Update active context's `design.items`: mark completed item as `"completed"` with `spec_file`, mark next item as `"in_progress"`, set `design.current_item` to next item.
377
+ v8 mode only. Read `{context_path}design_spec_[completed_item].md` and current state. Extract from completed spec: decisions `decisions.md`, key facts → `key_facts.md`, design work `issues.md`. Find next `"pending"` item in `design.items`. If none remain, proceed to Transition 4.
343
378
 
344
- ### Route User
379
+ Overwrite `{context_path}design_brief.md` for the next item with: Current Item (name + description), Plan Context, Task Details, Design Rationale, Prior Design Context, Constraints (updated with prior decisions), Design Queue (completed/current/pending), References (plan path, completed spec paths).
345
380
 
346
- "[Previous Item] design complete. Design brief updated for **[Next Item Name]** ([N] of [total], [remaining] remaining). Run `/clear` then `/intuition-design` to continue."
381
+ Update state: mark completed item `"completed"` with `spec_file`, mark next item `"in_progress"`, set `design.current_item`. Route: "[Previous Item] design complete. Design brief updated for **[Next Item Name]** ([N] of [total], [remaining] remaining). Run `/clear` then `/intuition-design` to continue."
347
382
 
348
383
  ## TRANSITION 4: DESIGN → ENGINEER
349
384
 
350
- Triggers when ALL design items have status `"completed"` or `"skipped"`.
385
+ v8 mode only. Triggers when ALL design items are `"completed"` or `"skipped"`. Read all `{context_path}design_spec_*.md` and `plan.md`. Extract from specs: decisions → `decisions.md`, key facts → `key_facts.md`, design work → `issues.md`.
351
386
 
352
- ### Read Outputs
387
+ Write `{context_path}engineering_brief.md` with: Plan Summary (1-2 paragraphs), Objective, Discovery Context, Design Specifications (list each spec; include "Engineer MUST read these specs before creating code specs for flagged tasks"), Task Summary (mark tasks with design specs), Known Risks, References (plan, discovery, design spec paths).
353
388
 
354
- Read all design specs: `{context_path}design_spec_*.md`
355
- Read: `{context_path}plan.md`
389
+ Update state: set `status` to `"engineering"`, mark `design.completed = true` with timestamp, set `engineering.started = true`. Route: "All design specs processed. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/clear` then `/intuition-engineer` to create code specs."
356
390
 
357
- ### Extract and Structure
391
+ ## TRANSITION 5: ENGINEER → BUILD
358
392
 
359
- From design specs: decisions → `docs/project_notes/decisions.md`, key facts → `docs/project_notes/key_facts.md`, design work → `docs/project_notes/issues.md`.
393
+ Read `{context_path}code_specs.md` and `plan.md`. Extract: engineering decisions → `decisions.md`, implementation approach facts → `key_facts.md`.
360
394
 
361
- ### Generate Engineering Brief
395
+ Write `{context_path}build_brief.md` with: Plan Summary (1-2 paragraphs), Objective, Code Specs Summary (task count, key decisions — 1 line each), Required User Steps, Quality Gates (security review, tests, code review), Known Risks, References (plan, code_specs, design spec paths if any).
362
396
 
363
- Write `{context_path}engineering_brief.md` with these sections:
364
- - **Plan Summary** (1-2 paragraphs)
365
- - **Objective**
366
- - **Discovery Context** (brief reminder)
367
- - **Design Specifications** (list each spec with one-line summary; include: "Engineer MUST read these specs before creating code specs for flagged tasks.")
368
- - **Task Summary** (list tasks, mark tasks with design specs)
369
- - **Known Risks** (with mitigations)
370
- - **References** (plan path, discovery path, design spec paths)
397
+ Update state: set `status` to `"building"`, mark `engineering.completed = true` with timestamp, set `build.started = true`. Route: "Code specs processed. Build brief saved to `{context_path}build_brief.md`. Run `/clear` then `/intuition-build` to begin implementation."
371
398
 
372
- ### Update State
399
+ ## TRANSITION 6.5v9: BUILD → TEST
373
400
 
374
- Update active context: set `status` to `"engineering"`, mark `design.completed = true` with timestamp, set `engineering.started = true`.
401
+ v9 mode only. Triggers when build completes and `team_assignment.json` contains at least one `producer_assignments` entry with `producer == "code-writer"`.
375
402
 
376
- ### Route User
403
+ ### Protocol
377
404
 
378
- "All design specs processed. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/clear` then `/intuition-engineer` to create code specs."
405
+ 1. **Read build_report.md**: Extract files modified, task results, deviations from blueprints.
379
406
 
380
- ## TRANSITION 5: ENGINEERBUILD
407
+ 2. **Extract to memory files**: Same extraction as Transition 6 — bugs `bugs.md`, lessons/deviations → `key_facts.md`, work completed → `issues.md`. Do NOT mark build as the final step.
381
408
 
382
- ### Read Outputs
409
+ 3. **Generate test brief**: Write `{context_path}/test_brief.md`:
383
410
 
384
- Read: `{context_path}code_specs.md`
385
- Read: `{context_path}plan.md`
411
+ ```markdown
412
+ # Test Brief
386
413
 
387
- ### Extract and Structure
414
+ ## Build Summary
415
+ - **Status**: [from build_report]
416
+ - **Tasks completed**: [count and list]
417
+ - **Files modified**: [list from build_report]
388
418
 
389
- From code specs: engineering decisions → `docs/project_notes/decisions.md`, key facts about implementation approach → `docs/project_notes/key_facts.md`.
419
+ ## Code Producers Used
420
+ [For each producer_assignments entry where producer == "code-writer":]
421
+ - **Specialist**: [specialist name]
422
+ - **Tasks**: [task IDs]
423
+ - **Output files**: [from build_report]
390
424
 
391
- ### Generate Build Brief
425
+ ## Acceptance Criteria
426
+ [For each code-writer task, extract acceptance criteria from plan.md]
392
427
 
393
- Write `{context_path}build_brief.md` with these sections:
394
- - **Plan Summary** (1-2 paragraphs)
395
- - **Objective**
396
- - **Code Specs Summary** (task count, key engineering decisions — 1 line each)
397
- - **Required User Steps** (from code_specs.md — things the user must do manually)
398
- - **Quality Gates** (security review, tests, code review)
399
- - **Known Risks** (from code specs risk notes)
400
- - **References** (plan path, code_specs path, design spec paths if any)
428
+ ## Decision Log References
429
+ - Specialist decision logs: [paths to {context_path}/scratch/*-decisions.json]
430
+ - Project decisions: docs/project_notes/decisions.md
401
431
 
402
- ### Update State
432
+ ## Blueprint References
433
+ [Paths to blueprints for code-writer tasks in {context_path}/blueprints/]
403
434
 
404
- Update active context: set `status` to `"building"`, mark `engineering.completed = true` with timestamp, set `build.started = true`.
435
+ ## Specialist Test Recommendations
436
+ [From build_report "Test Deliverables Deferred" section — any test specs/files that specialists recommended but build skipped. Include the blueprint source for each so test can read the full context.]
405
437
 
406
- ### Route User
438
+ | Blueprint Source | Deferred File | Description |
439
+ |-----------------|---------------|-------------|
440
+ | [specialist-name.md] | [file path] | [what the specialist recommended] |
407
441
 
408
- "Code specs processed. Build brief saved to `{context_path}build_brief.md`. Run `/clear` then `/intuition-build` to begin implementation."
442
+ [If build_report has no "Test Deliverables Deferred" section or it says "No test deliverables found", write "No specialist test recommendations."]
409
443
 
410
- ## TRANSITION 6: BUILD → COMPLETE
444
+ ## Known Issues
445
+ [From build_report — any issues, deviations, or flagged items]
446
+ ```
411
447
 
412
- ### Read Outputs
448
+ 4. **Update state**: Set `status` to `"testing"`, mark `build.completed = true` with timestamp, set `test.started = true`.
413
449
 
414
- Read `{context_path}/build_report.md` REQUIRED. Contains task outcomes, files modified, verification results, and any deviations from specs. If missing, warn the user that build may not have completed properly, then proceed with what's available.
450
+ 5. **Route**: "Build complete. Code was produced test phase needed. Run `/clear` then `/intuition-test`."
415
451
 
416
- ### Extract and Structure
452
+ ## TRANSITION 7: TEST → COMPLETE
417
453
 
418
- From the build report:
419
- - Bugs found or issues encountered → `docs/project_notes/bugs.md`
420
- - Lessons learned or deviations → `docs/project_notes/key_facts.md`
421
- - Work completed → `docs/project_notes/issues.md`
454
+ Triggers when `context_workflow.status == "testing"` and `workflow.test.completed == true`.
422
455
 
423
- ### Git Commit Offer
456
+ ### Protocol
424
457
 
425
- Check if a `.git` directory exists at the project root (use Bash: `test -d .git && echo "yes" || echo "no"`).
458
+ 1. **Read test_report.md**: Read `{context_path}/test_report.md`. If missing, warn user but proceed with build_report only.
426
459
 
427
- If git repo exists, use AskUserQuestion:
428
- ```
429
- Question: "Build complete. Would you like to commit the changes?"
430
- Header: "Git Commit"
431
- Options:
432
- - "Yes — commit and push"
433
- - "Yes — commit only (no push)"
434
- - "No — skip git"
435
- ```
460
+ 2. **Extract to memory files**: Implementation fixes → `docs/project_notes/bugs.md`, test coverage insights → `docs/project_notes/key_facts.md`, escalated issues → `docs/project_notes/issues.md`.
461
+
462
+ 3. **Fall through to Transition 6 completion protocol**: Proceed with the full Transition 6 protocol below (build_report reading, generated specialist saving, git commit offer, state updates). When coming from test, also read test_report.md during the completion extraction and mark `test.completed = true` with timestamp.
463
+
464
+ ## TRANSITION 6: BUILD → COMPLETE
436
465
 
437
- If user approves commit:
438
- 1. Run `git status` to see changed files
439
- 2. Run `git add` for files listed in the build report's "Files Modified" section. Cross-reference with `git status` to catch any files the report missed.
440
- 3. Run `git commit` with a descriptive message summarizing the build
441
- 4. If user chose push: run `git push`
466
+ This transition also serves as the completion protocol for Transition 7 fallthrough. When coming from test (status == "testing"), also read `{context_path}/test_report.md` and include test results in memory extraction. Mark `test.completed = true` with timestamp if applicable. When coming from build with no code-writer (v9) or any v8 build, mark `test.skipped = true`.
442
467
 
443
- If no git repo or user skips: proceed without git operations.
468
+ Read `{context_path}/build_report.md` REQUIRED (warn user if missing, proceed with what's available). Extract: bugs → `bugs.md`, lessons/deviations → `key_facts.md`, work completed → `issues.md`.
444
469
 
445
- ### Update State
470
+ **Save Generated Specialists to User Pool:** Check if `{context_path}/generated-specialists/` directory exists (Glob: `{context_path}generated-specialists/*/*.specialist.md`). If any `.specialist.md` files are found, for EACH file:
471
+ 1. Read the file's YAML frontmatter to extract `display_name` and `name`.
472
+ 2. Use AskUserQuestion with header "Save Generated Specialist":
473
+ - Question: "The specialist **[display_name]** was generated during this workflow. Save it to your personal library for future projects?"
474
+ - Options: "Yes — save to ~/.claude/specialists/" / "No — discard (session-only)"
475
+ 3. If "Yes": Create the target directory and copy the file via Bash: `mkdir -p ~/.claude/specialists/{name} && cp "{source_path}" ~/.claude/specialists/{name}/{name}.specialist.md`. Log: "Saved **[display_name]** to `~/.claude/specialists/{name}/`."
476
+ 4. If "No": Skip. Log: "Skipped **[display_name]** (session-only)."
446
477
 
447
- Update active context: set `status` to `"complete"`, mark `build.completed = true` with timestamp.
478
+ This step runs only once per completed build, and only if generated specialists exist. If the glob returns no results, skip this step entirely.
448
479
 
449
- ### Route User
480
+ **Git Commit Offer:** Check for `.git` directory (Bash: `test -d .git`). If git repo exists, use AskUserQuestion with header "Git Commit", options: "Yes — commit and push" / "Yes — commit only (no push)" / "No — skip git". If approved: `git status`, `git add` files from build report's "Files Modified" (cross-reference with status), `git commit` with descriptive message, optionally `git push`. Skip if no repo or user declines.
450
481
 
451
- "Workflow cycle complete for [context display name]. Run `/clear` then `/intuition-start` to see your project status and decide what's next."
482
+ Update state: set `status` to `"complete"`, mark `build.completed = true` with timestamp. Route: "Workflow cycle complete for [context display name]. Run `/clear` then `/intuition-start` to see your project status and decide what's next."
452
483
 
453
484
  ## MEMORY FILE FORMATS
454
485
 
@@ -462,7 +493,7 @@ All shared memory files live at `docs/project_notes/` (never context_path).
462
493
 
463
494
  ## EDGE CASES
464
495
 
465
- - **Missing discovery_output.json**: Extract insights from discovery_brief.md manually.
496
+ - **Missing prompt_output.json**: Extract insights from prompt_brief.md manually.
466
497
  - **Poor output quality**: Process as-is. Note concerns in brief. Do NOT fix outputs.
467
498
  - **New constraints from planning**: Update key_facts.md, create ADR if architectural.
468
499
  - **Interrupted handoff**: Check what's updated, continue from there, don't duplicate.
@@ -471,6 +502,13 @@ All shared memory files live at `docs/project_notes/` (never context_path).
471
502
  - **No Design Recommendations in plan**: Present tasks to user, ask if any need design. If none, use 2B.
472
503
  - **Plan revision after design started**: Alert user. Ask whether to continue or re-evaluate.
473
504
  - **Missing code_specs.md at Transition 5**: Tell user to run `/intuition-engineer` first.
505
+ - **v9 plan detected but no assemble run yet**: Route to `/intuition-assemble`.
506
+ - **v9 specialist dependency blueprint missing**: Skip to next eligible specialist. If none are eligible, halt and ask user.
507
+ - **v9 conflict detection finds issues**: Present all conflicts, ask user to resolve before build. Do not auto-resolve.
508
+ - **v9 completeness gate fails**: Report exact failures per blueprint. User must fix blueprints (re-run detail) before build.
509
+ - **v9 build with no code-writer**: Skip test, mark `test.skipped = true`, direct to Transition 6 completion.
510
+ - **Test report missing at Transition 7**: Warn user, proceed with build report only for memory extraction.
511
+ - **Test skipped by user**: Set `test.skipped = true`, `test.completed = true`, proceed to completion.
474
512
 
475
513
  ## VOICE
476
514