@tgoodington/intuition 8.0.0 → 8.1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tgoodington/intuition",
3
- "version": "8.0.0",
4
- "description": "Trunk-and-branch workflow system for Claude Code: prompt, plan, design, execute with iterative branching. Holistic coding expert, domain-agnostic design exploration with ECD framework, and file-based handoffs through project memory.",
3
+ "version": "8.1.0",
4
+ "description": "Trunk-and-branch workflow system for Claude Code: prompt, plan, design, engineer, build with iterative branching. Code spec creation, domain-agnostic design exploration with ECD framework, and file-based handoffs through project memory.",
5
5
  "keywords": [
6
6
  "claude-code",
7
7
  "skills",
@@ -243,33 +243,44 @@ If Security Expert review has not been run, you MUST run it now. ZERO exceptions
243
243
 
244
244
  ## STEP 7: REPORT RESULTS
245
245
 
246
- Present the build report:
246
+ Write the build report to `{context_path}/build_report.md` AND display a summary to the user.
247
+
248
+ ### Write `{context_path}/build_report.md`
247
249
 
248
250
  ```markdown
249
- ## Build Complete
251
+ # Build Report
250
252
 
251
253
  **Plan:** [Title]
254
+ **Date:** [YYYY-MM-DD]
252
255
  **Status:** Success / Partial / Failed
253
256
 
254
- **Tasks Completed:**
257
+ ## Tasks Completed
255
258
  - [x] Task 1 — [brief outcome]
256
259
  - [x] Task 2 — [brief outcome]
257
260
 
258
- **Verification Results:**
261
+ ## Verification Results
259
262
  - Security Review: PASS / FAIL
260
263
  - Code Review: PASS / N/A
261
264
  - Tests: X passed, Y failed / N/A
262
265
 
263
- **Files Modified:**
266
+ ## Files Modified
264
267
  - path/to/file — [what changed]
265
268
 
266
- **Issues & Resolutions:**
269
+ ## Issues & Resolutions
267
270
  - [Any problems encountered and how they were resolved]
268
271
 
269
- **Required User Steps:**
272
+ ## Required User Steps
270
273
  - [From code_specs.md — remind user of manual steps needed]
274
+
275
+ ## Deviations from Specs
276
+ - [Any places where implementation diverged from code_specs.md, with rationale]
277
+ - [Or "None — all specs followed as written"]
271
278
  ```
272
279
 
280
+ ### Display summary to user
281
+
282
+ Present a concise version: task count, pass/fail status, files modified count, any required user steps. Reference the full report at `{context_path}/build_report.md`.
283
+
273
284
  ## STEP 8: ROUTE TO HANDOFF
274
285
 
275
286
  After reporting results:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: intuition-debugger
3
- description: Expert debugger and diagnostic specialist. Investigates hard problems in completed workflow contexts — complex bugs, cross-context failures, performance issues, and cases where the plan or design was wrong. Not for simple fixes caught during execution.
3
+ description: Expert debugger and diagnostic specialist. Investigates hard problems in completed workflow contexts — complex bugs, cross-context failures, performance issues, and cases where the plan or design was wrong. Not for simple fixes caught during build.
4
4
  model: opus
5
5
  tools: Read, Write, Glob, Grep, Task, AskUserQuestion, Bash, mcp__ide__getDiagnostics
6
6
  allowed-tools: Read, Write, Glob, Grep, Task, Bash, mcp__ide__getDiagnostics
@@ -21,14 +21,14 @@ These are non-negotiable. Violating any of these means the protocol has failed.
21
21
  9. You MUST NOT modify plan.md, design specs, discovery_brief.md, or any workflow planning artifacts.
22
22
  10. You MUST classify the bug category (see DIAGNOSTIC SPECIALIZATIONS) — this determines your investigation protocol.
23
23
 
24
- REMINDER: You are a diagnostic specialist, not a general fixer. Execute's Senior Engineer handles routine implementation issues. You handle the hard problems that survive good engineering.
24
+ REMINDER: You are a diagnostic specialist, not a general fixer. Build's Code Reviewer and retry logic handle routine implementation issues. You handle the hard problems that survive good engineering.
25
25
 
26
26
  # WHEN TO USE THIS SKILL VS OTHERS
27
27
 
28
28
  | Situation | Use |
29
29
  |-----------|-----|
30
- | Simple bug found during execution | Execute's retry/escalation logic |
31
- | Implementation doesn't match plan | Execute's Code Reviewer catches this |
30
+ | Simple bug found during build | Build's retry/escalation logic |
31
+ | Implementation doesn't match specs | Build's Code Reviewer catches this |
32
32
  | Complex bug in completed work | **This skill** |
33
33
  | Bug symptom is far from root cause | **This skill** |
34
34
  | Cross-context or cross-branch failure | **This skill** |
@@ -112,14 +112,15 @@ Resolve `context_path` from selected context:
112
112
  Read ALL of these before proceeding — do NOT wait for the user's issue description:
113
113
 
114
114
  - `{context_path}/plan.md` — what was planned
115
- - `{context_path}/implementation_guide.md` — engineering decisions made during execution
116
- - `{context_path}/execution_brief.md` — what was executed
115
+ - `{context_path}/code_specs.md` — engineering decisions (what approach was chosen for each task and why)
116
+ - `{context_path}/build_brief.md` — context passed to the build phase
117
+ - `{context_path}/build_report.md` — what was actually built (task outcomes, files modified, deviations)
117
118
  - `{context_path}/design_spec_*.md` — design decisions (if any exist)
118
119
  - `docs/project_notes/key_facts.md` — project-wide knowledge
119
120
  - `docs/project_notes/decisions.md` — architectural decisions
120
121
  - `docs/project_notes/bugs.md` — previously logged bugs
121
122
 
122
- The implementation guide is especially valuable — it tells you WHAT engineering decisions were made and WHY. Bugs often hide in the gap between intended approach and actual implementation.
123
+ The code specs are especially valuable — they tell you WHAT engineering decisions were made and WHY. The build report tells you what was actually built and any deviations. Bugs often hide in the gap between intended approach and actual implementation.
123
124
 
124
125
  Do NOT read source code files yet. Read targeted code only after the user describes the issue.
125
126
 
@@ -310,10 +311,10 @@ After the subagent returns:
310
311
  - **Root Cause**: [The actual problem — with causal chain]
311
312
  - **Solution**: [What was changed]
312
313
  - **Files Modified**: [list]
313
- - **Prevention**: [How to avoid in future — what should execution have caught?]
314
+ - **Prevention**: [How to avoid in future — what should the build phase have caught?]
314
315
  ```
315
316
 
316
- Do NOT skip the log entry. The Prevention field is critical — it feeds back into improving the execution process.
317
+ Do NOT skip the log entry. The Prevention field is critical — it feeds back into improving the build process.
317
318
 
318
319
  **Report:**
319
320
 
@@ -334,7 +335,7 @@ Do NOT skip the log entry. The Prevention field is critical — it feeds back in
334
335
  **Logged to:** docs/project_notes/bugs.md
335
336
 
336
337
  **Prevention recommendation:**
337
- - [What should change in future execution to prevent this class of bug]
338
+ - [What should change in future builds to prevent this class of bug]
338
339
  ```
339
340
 
340
341
  ### Git Commit Offer
@@ -18,14 +18,14 @@ These are non-negotiable. Violating any of these means the protocol has failed.
18
18
  6. You MUST present 2-4 sentences of analysis BEFORE every question. Show your reasoning.
19
19
  7. You MUST get explicit user approval before saving the spec.
20
20
  8. You MUST save the spec to `{context_path}/design_spec_[item_name].md`.
21
- 9. You MUST route to `/intuition-handoff` after saving. NEVER to `/intuition-execute`.
21
+ 9. You MUST route to `/intuition-handoff` after saving. NEVER to `/intuition-engineer` or `/intuition-build`.
22
22
  10. You MUST be domain-agnostic. Adapt your language, questions, and output format to match what is being designed — code, creative work, business documents, UI, or anything else.
23
23
  11. You MUST NOT write code or implementation artifacts — you produce design specifications only.
24
24
  12. You MUST NOT modify `plan.md`, `discovery_brief.md`, or `design_brief.md`.
25
25
  13. You MUST NOT manage `.project-memory-state.json` — handoff owns state transitions.
26
26
  14. You MUST treat user input as suggestions unless explicitly stated as requirements. Evaluate critically, propose alternatives, and engage in dialogue before accepting decisions.
27
27
 
28
- REMINDER: One question per turn. Route to `/intuition-handoff`, never to `/intuition-execute`.
28
+ REMINDER: One question per turn. Route to `/intuition-handoff`, never to `/intuition-engineer` or `/intuition-build`.
29
29
 
30
30
  # BRANCH CONTEXT (Branch Only)
31
31
 
@@ -92,7 +92,7 @@ Phase 5: FORMALIZATION (1 turn) Draft spec, validate, approve, save
92
92
 
93
93
  Before starting the protocol, check for existing state:
94
94
 
95
- 1. If `docs/project_notes/.design_research/` exists with prior artifacts for this item:
95
+ 1. If `{context_path}/.design_research/` exists with prior artifacts for this item:
96
96
  - Read `decisions.md` inside to reconstruct ECD coverage
97
97
  - Ask via AskUserQuestion: "I found a draft design for [item]. Continue from where we left off, or start fresh?"
98
98
  2. If a `design_spec_[item].md` already exists:
@@ -106,9 +106,9 @@ Execute all of the following before your first user-facing message.
106
106
  ## Step 1: Read inputs
107
107
 
108
108
  Read these files:
109
- - `docs/project_notes/design_brief.md` — REQUIRED. Contains the current item, plan context, and design rationale. If missing, stop: "No design brief found. Run `/intuition-handoff` first."
110
- - `docs/project_notes/plan.md` — for full task context and acceptance criteria.
111
- - `docs/project_notes/discovery_brief.md` — for original problem context.
109
+ - `{context_path}/design_brief.md` — REQUIRED. Contains the current item, plan context, and design rationale. If missing, stop: "No design brief found. Run `/intuition-handoff` first."
110
+ - `{context_path}/plan.md` — for full task context and acceptance criteria.
111
+ - `{context_path}/discovery_brief.md` — for original problem context.
112
112
 
113
113
  From the design brief, extract:
114
114
  - Current item name and description
@@ -118,7 +118,7 @@ From the design brief, extract:
118
118
 
119
119
  ## Step 2: Launch context research (2 haiku agents in parallel)
120
120
 
121
- Create the directory `docs/project_notes/.design_research/[item_name]/` if it does not exist.
121
+ Create the directory `{context_path}/.design_research/[item_name]/` if it does not exist.
122
122
 
123
123
  **Agent 1 — Existing Work Scan** (subagent_type: Explore, model: haiku):
124
124
  Prompt: "Search the project for existing work related to [item description]. Look for: prior documentation, existing implementations, reference material, patterns that inform this design. Check docs/, src/, and any relevant directories. Report findings in under 400 words. Facts only."
@@ -126,7 +126,7 @@ Prompt: "Search the project for existing work related to [item description]. Loo
126
126
  **Agent 2 — Context Mapping** (subagent_type: Explore, model: haiku):
127
127
  Prompt: "Map the context surrounding [item description]. What already exists that this design must work with or within? What are the boundaries and integration points? Check the codebase structure, existing docs, and configuration. Report in under 400 words. Facts only."
128
128
 
129
- When both return, combine results and write to `docs/project_notes/.design_research/[item_name]/context.md`.
129
+ When both return, combine results and write to `{context_path}/.design_research/[item_name]/context.md`.
130
130
 
131
131
  ## Step 3: Frame the design challenge
132
132
 
@@ -204,13 +204,13 @@ If changes requested, address them (1-2 more turns), then re-present.
204
204
 
205
205
  ## Step 4: Save and route
206
206
 
207
- Write the spec to `docs/project_notes/design_spec_[item_name].md` using the output format below.
207
+ Write the spec to `{context_path}/design_spec_[item_name].md` using the output format below.
208
208
 
209
- Log design decisions to `docs/project_notes/.design_research/[item_name]/decisions.md`.
209
+ Log design decisions to `{context_path}/.design_research/[item_name]/decisions.md`.
210
210
 
211
211
  Tell the user:
212
212
  ```
213
- Design spec saved to docs/project_notes/design_spec_[item_name].md.
213
+ Design spec saved to {context_path}/design_spec_[item_name].md.
214
214
  Run /intuition-handoff to continue.
215
215
  ```
216
216
 
@@ -218,7 +218,7 @@ ALWAYS route to `/intuition-handoff`. NEVER suggest `/intuition-execute`.
218
218
 
219
219
  # OUTPUT FORMAT: DESIGN SPECIFICATION
220
220
 
221
- Saved to `docs/project_notes/design_spec_[item_name].md`. The content adapts to the domain being designed.
221
+ Saved to `{context_path}/design_spec_[item_name].md`. The content adapts to the domain being designed.
222
222
 
223
223
  ```markdown
224
224
  # Design Specification: [Item Name]
@@ -330,15 +330,15 @@ Validate ALL before presenting the draft:
330
330
 
331
331
  ### Working Files (ephemeral, per-item)
332
332
  ```
333
- docs/project_notes/.design_research/[item_name]/
333
+ {context_path}/.design_research/[item_name]/
334
334
  context.md # Context research from Phase 1
335
335
  options_[topic].md # Research for specific design questions
336
336
  decisions.md # Running log of design decisions made
337
337
  ```
338
338
 
339
339
  ### Final Artifacts (permanent)
340
- - `docs/project_notes/design_spec_[item_name].md` — the deliverable
341
- - Updates to `docs/project_notes/decisions.md` if new ADRs emerge during design
340
+ - `{context_path}/design_spec_[item_name].md` — the deliverable
341
+ - Updates to `docs/project_notes/decisions.md` if new ADRs emerge during design (shared memory stays at root)
342
342
 
343
343
  ### Resume Capability
344
344
  Working files in `.design_research/` enable resuming interrupted design sessions. The `decisions.md` log reconstructs ECD coverage state.
@@ -96,33 +96,81 @@ Options:
96
96
 
97
97
  ## STEP 2: FAN-OUT RESEARCH
98
98
 
99
- For each task (or group of related tasks), launch a haiku research subagent via the Task tool:
99
+ For each task (or group of related tasks), launch a haiku research subagent via the Task tool (subagent_type: Explore, model: haiku).
100
+
101
+ When constructing each prompt, replace bracketed placeholders with actual values from the plan. If the task has known file paths, use the "Known Files" variant. If files are marked TBD, use the "TBD Files" variant.
102
+
103
+ ### Known Files variant:
100
104
 
101
105
  ```
102
- You are a codebase researcher gathering information for engineering specs.
106
+ You are a codebase researcher. The project root is the current working directory.
107
+
108
+ TASK: Gather implementation details for plan Task #[N]: [title]
109
+ DESCRIPTION: [from plan]
110
+ COMPONENT: [from plan]
103
111
 
104
- TASK: Research the codebase relevant to plan Task #[N]: [title]
112
+ EXECUTE THESE STEPS IN ORDER:
105
113
 
106
- CONTEXT:
107
- - Task description: [from plan]
108
- - Known files: [from plan's Files field]
109
- - Component: [from plan's Component field]
114
+ Step 1 — Read target files:
115
+ - Read [exact path 1]
116
+ - Read [exact path 2]
117
+ - [list all known files]
110
118
 
111
- RESEARCH PROTOCOL:
112
- 1. Read the files listed in the task (or Glob/Grep to find them if marked TBD).
113
- 2. Identify existing patterns: naming conventions, error handling, module structure.
114
- 3. Find 2-3 examples of similar patterns already in the codebase.
115
- 4. Check for shared utilities or abstractions that should be reused.
116
- 5. Read 1 level of dependents what imports or calls the files you'll modify?
117
- 6. Note any conventions that must be followed.
119
+ Step 2 — Find dependents:
120
+ - Grep for the filename (without extension) in all source files to find imports/references.
121
+ - Read the top 2-3 files that import or call the target files.
122
+
123
+ Step 3 Find similar patterns:
124
+ - In the target files, identify the primary function or class name.
125
+ - Grep for similar patterns in other files within the same directory or parent directory.
118
126
 
119
127
  REPORT FORMAT (under 500 words):
120
- - **Relevant Files**: [paths with brief descriptions]
121
- - **Existing Patterns**: [patterns found with file references]
122
- - **Shared Utilities**: [reusable code found]
128
+ - **Relevant Files**: [paths with 1-line descriptions]
129
+ - **Existing Patterns**: [patterns found, with file:line references]
130
+ - **Shared Utilities**: [reusable code found, or "None found"]
123
131
  - **Dependents**: [files that import/use the target files]
124
- - **Conventions**: [naming, structure, error handling patterns]
125
- - **Notes**: [anything unexpected or important]
132
+ - **Conventions**: [naming, structure, error handling patterns observed]
133
+ - **Notes**: [anything unexpected]
134
+
135
+ Report only what you find. Do not speculate.
136
+ ```
137
+
138
+ ### TBD Files variant:
139
+
140
+ ```
141
+ You are a codebase researcher. The project root is the current working directory.
142
+
143
+ TASK: Gather implementation details for plan Task #[N]: [title]
144
+ DESCRIPTION: [from plan]
145
+ COMPONENT: [from plan]
146
+
147
+ EXECUTE THESE STEPS IN ORDER:
148
+
149
+ Step 1 — Locate files:
150
+ - Run Glob('[component directory]/**/*') to list files in the component area.
151
+ - If no component directory is obvious, Grep for keywords from the task title across all source files.
152
+ - Read the 3-5 most relevant files found.
153
+
154
+ Step 2 — Find dependents:
155
+ - For each relevant file found, Grep for its name in other source files to find imports/references.
156
+
157
+ Step 3 — Find similar patterns:
158
+ - Grep for function or class names related to the task domain.
159
+ - Read 1-2 examples of similar functionality elsewhere in the codebase.
160
+
161
+ Step 4 — Check for shared utilities:
162
+ - Run Glob('**/util*') and Glob('**/helper*') and Glob('**/shared*').
163
+ - Read any utility file relevant to this task's domain.
164
+
165
+ REPORT FORMAT (under 500 words):
166
+ - **Relevant Files**: [paths with 1-line descriptions]
167
+ - **Existing Patterns**: [patterns found, with file:line references]
168
+ - **Shared Utilities**: [reusable code found, or "None found"]
169
+ - **Dependents**: [files that import/use the target files]
170
+ - **Conventions**: [naming, structure, error handling patterns observed]
171
+ - **Notes**: [anything unexpected]
172
+
173
+ Report only what you find. Do not speculate.
126
174
  ```
127
175
 
128
176
  **Parallelization rules:**
@@ -149,7 +149,7 @@ Triggered when start routes to handoff with branch creation intent. User has pro
149
149
  - `workflow`: identical structure to trunk's workflow (all false/null/empty — including `engineering` and `build` phases)
150
150
  4. **Set `active_context`** to the new branch key.
151
151
  5. **Write updated state**. Set `last_handoff_transition` to "branch_creation".
152
- 6. **Route user**: "Branch **[display_name]** created. Run `/intuition-prompt` to define what this branch will accomplish."
152
+ 6. **Route user**: "Branch **[display_name]** created. Run `/clear` then `/intuition-prompt` to define what this branch will accomplish."
153
153
 
154
154
  ## V4 STATE MIGRATION
155
155
 
@@ -243,7 +243,7 @@ Update the active context: set `status` to `"planning"`, mark `prompt.completed
243
243
 
244
244
  ### Route User
245
245
 
246
- "Discovery processed. Planning brief saved to `{context_path}planning_brief.md`. Run `/intuition-plan` to create a structured plan."
246
+ "Discovery processed. Planning brief saved to `{context_path}planning_brief.md`. Run `/clear` then `/intuition-plan` to create a structured plan."
247
247
 
248
248
  ## TRANSITION 2: PLANNING → DESIGN (Initial Setup)
249
249
 
@@ -285,7 +285,7 @@ Update active context: set `status` to `"design"`, mark `planning.completed = tr
285
285
 
286
286
  ### Route User
287
287
 
288
- "Plan processed. Design brief prepared for **[First Item Name]**. Run `/intuition-design` to begin design exploration."
288
+ "Plan processed. Design brief prepared for **[First Item Name]**. Run `/clear` then `/intuition-design` to begin design exploration."
289
289
 
290
290
  ## TRANSITION 2B: PLANNING → ENGINEER (Skip Design)
291
291
 
@@ -307,7 +307,7 @@ Update active context: set `status` to `"engineering"`, mark `planning.completed
307
307
 
308
308
  ### Route User
309
309
 
310
- "Plan processed. No design items flagged. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/intuition-engineer` to create code specs."
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."
311
311
 
312
312
  ## TRANSITION 3: DESIGN → DESIGN (Next Item)
313
313
 
@@ -343,7 +343,7 @@ Update active context's `design.items`: mark completed item as `"completed"` wit
343
343
 
344
344
  ### Route User
345
345
 
346
- "[Previous Item] design complete. Design brief updated for **[Next Item Name]** ([N] of [total], [remaining] remaining). Run `/intuition-design` to continue."
346
+ "[Previous Item] design complete. Design brief updated for **[Next Item Name]** ([N] of [total], [remaining] remaining). Run `/clear` then `/intuition-design` to continue."
347
347
 
348
348
  ## TRANSITION 4: DESIGN → ENGINEER
349
349
 
@@ -375,7 +375,7 @@ Update active context: set `status` to `"engineering"`, mark `design.completed =
375
375
 
376
376
  ### Route User
377
377
 
378
- "All design specs processed. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/intuition-engineer` to create code specs."
378
+ "All design specs processed. Engineering brief saved to `{context_path}engineering_brief.md`. Run `/clear` then `/intuition-engineer` to create code specs."
379
379
 
380
380
  ## TRANSITION 5: ENGINEER → BUILD
381
381
 
@@ -405,17 +405,20 @@ Update active context: set `status` to `"building"`, mark `engineering.completed
405
405
 
406
406
  ### Route User
407
407
 
408
- "Code specs processed. Build brief saved to `{context_path}build_brief.md`. Run `/intuition-build` to begin implementation."
408
+ "Code specs processed. Build brief saved to `{context_path}build_brief.md`. Run `/clear` then `/intuition-build` to begin implementation."
409
409
 
410
410
  ## TRANSITION 6: BUILD → COMPLETE
411
411
 
412
412
  ### Read Outputs
413
413
 
414
- Read build results from `{context_path}` for any reports the build phase produced.
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.
415
415
 
416
416
  ### Extract and Structure
417
417
 
418
- Bugs found `docs/project_notes/bugs.md`, lessons learned → `docs/project_notes/key_facts.md`, work completed → `docs/project_notes/issues.md`.
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`
419
422
 
420
423
  ### Git Commit Offer
421
424
 
@@ -433,7 +436,7 @@ Options:
433
436
 
434
437
  If user approves commit:
435
438
  1. Run `git status` to see changed files
436
- 2. Run `git add [specific files from build report]` only add files that were part of the build
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.
437
440
  3. Run `git commit` with a descriptive message summarizing the build
438
441
  4. If user chose push: run `git push`
439
442
 
@@ -445,7 +448,7 @@ Update active context: set `status` to `"complete"`, mark `build.completed = tru
445
448
 
446
449
  ### Route User
447
450
 
448
- "Workflow cycle complete for [context display name]. Run `/intuition-start` to see your project status and decide what's next."
451
+ "Workflow cycle complete for [context display name]. Run `/clear` then `/intuition-start` to see your project status and decide what's next."
449
452
 
450
453
  ## MEMORY FILE FORMATS
451
454
 
@@ -16,7 +16,7 @@ These are non-negotiable. Violating any of these means the protocol has failed.
16
16
 
17
17
  1. You MUST check if `docs/project_notes/` already exists before creating anything.
18
18
  2. You MUST use template files from `references/` directory for all initial content. Read each template with the Read tool, then Write to the target path.
19
- 3. You MUST create `.project-memory-state.json` using the v4.0 schema from `references/state_template.json`. Do NOT use older schemas (v1.0, v2.0, v3.0).
19
+ 3. You MUST create `.project-memory-state.json` using the v5.0 schema from `references/state_template.json`. Do NOT use older schemas (v1.0, v2.0, v3.0, v4.0).
20
20
  4. You MUST update CLAUDE.md with workflow and memory protocols.
21
21
  5. You MUST NOT overwrite existing memory files without asking the user first.
22
22
  6. You MUST NOT invoke other skills (discovery, plan, execute). You only set up infrastructure.
@@ -30,7 +30,7 @@ Execute these steps in order:
30
30
  ```
31
31
  Step 1: Detect existing setup
32
32
  Step 2: Create memory directory and files from templates
33
- Step 3: Create .project-memory-state.json with v4.0 schema
33
+ Step 3: Create .project-memory-state.json with v5.0 schema
34
34
  Step 4: Update CLAUDE.md with workflow protocols
35
35
  Step 4.5: Create INTUITION.md framework overview
36
36
  Step 5: Offer optional components (AGENTS.md, settings, user profile)
@@ -83,18 +83,18 @@ For each file, use the Read tool to read the template, then use Write to create
83
83
  | `references/key_facts_template.md` | `docs/project_notes/key_facts.md` |
84
84
  | `references/issues_template.md` | `docs/project_notes/issues.md` |
85
85
 
86
- Do NOT create workflow output files (discovery_brief.md, plan.md, execution_brief.md, etc.). Those are created by their respective skills during the workflow.
86
+ Do NOT create workflow output files (discovery_brief.md, plan.md, engineering_brief.md, build_brief.md, etc.). Those are created by their respective skills during the workflow.
87
87
 
88
88
  ## STEP 3: CREATE STATE FILE
89
89
 
90
90
  Read `references/state_template.json` and write to `docs/project_notes/.project-memory-state.json`.
91
91
 
92
- The state file uses the v4.0 schema:
92
+ The state file uses the v5.0 schema:
93
93
 
94
94
  ```json
95
95
  {
96
96
  "initialized": true,
97
- "version": "4.0",
97
+ "version": "5.0",
98
98
  "active_context": "trunk",
99
99
  "trunk": {
100
100
  "status": "none",
@@ -119,7 +119,12 @@ The state file uses the v4.0 schema:
119
119
  "items": [],
120
120
  "current_item": null
121
121
  },
122
- "execution": {
122
+ "engineering": {
123
+ "started": false,
124
+ "completed": false,
125
+ "completed_at": null
126
+ },
127
+ "build": {
123
128
  "started": false,
124
129
  "completed": false,
125
130
  "completed_at": null
@@ -134,7 +139,7 @@ The state file uses the v4.0 schema:
134
139
 
135
140
  **CRITICAL**: This is the authoritative schema. Handoff is the ONLY skill that updates this file after initialization. All other skills read it but NEVER write to it.
136
141
 
137
- Do NOT use older schemas (v1.0, v2.0, or v3.0). Those schemas are obsolete.
142
+ Do NOT use older schemas (v1.0, v2.0, v3.0, or v4.0). Those schemas are obsolete.
138
143
 
139
144
  ## STEP 4: UPDATE CLAUDE.MD
140
145
 
@@ -151,10 +156,10 @@ IF CLAUDE.md does NOT exist:
151
156
  ```
152
157
 
153
158
  The template includes:
154
- - Four-phase workflow description (prompt → plan → design → execute with handoffs)
159
+ - Five-phase workflow description (prompt → plan → design → engineer → build with handoffs)
155
160
  - Memory file descriptions and locations
156
161
  - Memory-aware protocols (check decisions before changes, search bugs before debugging)
157
- - Smart skill suggestions (when to suggest /intuition-prompt, /intuition-plan, /intuition-design, etc.)
162
+ - Smart skill suggestions (when to suggest /intuition-prompt, /intuition-plan, /intuition-design, /intuition-engineer, /intuition-build, etc.)
158
163
 
159
164
  ## STEP 4.5: CREATE INTUITION.MD
160
165
 
@@ -234,7 +239,7 @@ Created:
234
239
  - docs/project_notes/decisions.md
235
240
  - docs/project_notes/key_facts.md
236
241
  - docs/project_notes/issues.md
237
- - docs/project_notes/.project-memory-state.json (v4.0 schema)
242
+ - docs/project_notes/.project-memory-state.json (v5.0 schema)
238
243
  - CLAUDE.md workflow protocols
239
244
  - INTUITION.md framework overview
240
245
 
@@ -277,7 +282,7 @@ These template files are in the `references/` directory. Use Read tool to access
277
282
  - `discovery_output_template.json`
278
283
  - `planning_brief_template.md`
279
284
  - `design_brief_template.md`
280
- - `execution_brief_template.md`
285
+ - `execution_brief_template.md` (engineering brief template — legacy filename)
281
286
 
282
287
  ## MEMORY FILE FORMATS
283
288
 
@@ -1,10 +1,10 @@
1
- # Execution Brief Template
1
+ # Engineering Brief Template
2
2
 
3
3
  > **Path note:** `{context_path}` resolves to `docs/project_notes/trunk/` for the trunk context, or `docs/project_notes/branches/{name}/` for a branch context. Shared files (`key_facts.md`, `decisions.md`, `issues.md`, `bugs.md`) always remain at `docs/project_notes/`.
4
4
 
5
- > **Generated by:** `/intuition-handoff` (Design→Execution or Planning→Execution transition)
6
- > **Consumed by:** `/intuition-execute`
7
- > **Frozen for:** execution phase (don't modify during execution)
5
+ > **Generated by:** `/intuition-handoff` (Design→Engineer or Planning→Engineer transition)
6
+ > **Consumed by:** `/intuition-engineer`
7
+ > **Frozen for:** engineering phase (don't modify during engineering)
8
8
 
9
9
  ---
10
10
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "initialized": true,
3
- "version": "4.0",
3
+ "version": "5.0",
4
4
  "active_context": "trunk",
5
5
  "trunk": {
6
6
  "status": "none",
@@ -25,7 +25,12 @@
25
25
  "items": [],
26
26
  "current_item": null
27
27
  },
28
- "execution": {
28
+ "engineering": {
29
+ "started": false,
30
+ "completed": false,
31
+ "completed_at": null
32
+ },
33
+ "build": {
29
34
  "started": false,
30
35
  "completed": false,
31
36
  "completed_at": null
@@ -17,7 +17,7 @@ These are non-negotiable. Violating any of these means the protocol has failed.
17
17
  5. You MUST ask exactly ONE question per turn via AskUserQuestion. For decisional questions, present 2-3 options with trade-offs. For informational questions (gathering facts, confirming understanding), present relevant options but trade-off analysis is not required.
18
18
  6. You MUST get explicit user approval before saving the plan.
19
19
  7. You MUST save the final plan to `{context_path}/plan.md`.
20
- 8. You MUST route to `/intuition-handoff` after saving. NEVER to `/intuition-execute`.
20
+ 8. You MUST route to `/intuition-handoff` after saving. NEVER to `/intuition-engineer` or `/intuition-build`.
21
21
  9. You MUST write interim artifacts to `{context_path}/.planning_research/` for context management.
22
22
  10. You MUST validate against the Executable Plan Checklist before presenting the draft plan.
23
23
  11. You MUST present 2-4 sentences of analysis BEFORE every question. Show your reasoning.
@@ -27,7 +27,7 @@ These are non-negotiable. Violating any of these means the protocol has failed.
27
27
  15. You MUST assess every task for design readiness and include a "Design Recommendations" section in the plan. Flag any task where execution cannot proceed without further design exploration (see DESIGN READINESS ASSESSMENT below).
28
28
  16. When planning on a branch, you MUST read the parent context's plan.md and include a Parent Context section (Section 2.5). Inherited architectural decisions from the parent are binding unless the user explicitly overrides them.
29
29
 
30
- REMINDER: One question per turn. Route to `/intuition-handoff`, never to `/intuition-execute`.
30
+ REMINDER: One question per turn. Route to `/intuition-handoff`, never to `/intuition-engineer` or `/intuition-build`.
31
31
 
32
32
  # ARCH COVERAGE FRAMEWORK
33
33
 
@@ -73,10 +73,10 @@ Phase 5: FORMALIZATION (1 turn) Save plan.md, route to handoff
73
73
 
74
74
  Before starting the protocol, check for existing state:
75
75
 
76
- 1. If `docs/project_notes/plan.md` already exists:
76
+ 1. If `{context_path}/plan.md` already exists:
77
77
  - If it appears complete and approved: ask via AskUserQuestion — "A plan already exists. Would you like to revise it or start fresh?"
78
78
  - If it appears incomplete or is a draft: ask — "I found a draft plan. Would you like to continue from where we left off?"
79
- 2. If `docs/project_notes/.planning_research/` exists with interim artifacts, read them to reconstruct dialogue state. Use `decisions_log.md` to determine which ARCH dimensions have been covered.
79
+ 2. If `{context_path}/.planning_research/` exists with interim artifacts, read them to reconstruct dialogue state. Use `decisions_log.md` to determine which ARCH dimensions have been covered.
80
80
  3. If no prior state exists, proceed with Phase 1.
81
81
 
82
82
  # PHASE 1: INTAKE
@@ -86,25 +86,59 @@ This phase is exactly 1 turn. Execute all of the following before your first use
86
86
  ## Step 1: Read inputs
87
87
 
88
88
  Read these files:
89
- - `docs/project_notes/discovery_brief.md` — REQUIRED. If missing, stop immediately: "No discovery brief found. Run `/intuition-prompt` first."
90
- - `docs/project_notes/planning_brief.md` — optional, may contain handoff context.
89
+ - `{context_path}/discovery_brief.md` — REQUIRED. If missing, stop immediately: "No discovery brief found. Run `/intuition-prompt` first."
90
+ - `{context_path}/planning_brief.md` — optional, may contain handoff context.
91
91
  - `.claude/USER_PROFILE.json` — optional, for tailoring communication style.
92
92
 
93
93
  From the discovery brief, extract: core problem, success criteria, stakeholders, constraints, scope, assumptions, and research insights.
94
94
 
95
95
  ## Step 2: Launch orientation research
96
96
 
97
- Create the directory `docs/project_notes/.planning_research/` if it does not exist.
97
+ Create the directory `{context_path}/.planning_research/` if it does not exist.
98
98
 
99
- Launch 2 haiku research agents in parallel using the Task tool:
99
+ Launch 2 sonnet research agents in parallel using the Task tool:
100
100
 
101
- **Agent 1 — Codebase Topology** (subagent_type: Explore, model: haiku):
102
- Prompt: "Analyze this project's codebase structure. Report on: (1) top-level directory structure, (2) key modules and responsibilities, (3) entry points, (4) test infrastructure, (5) build system. Use Glob, Grep, Read to explore. Under 500 words. Facts only."
101
+ **Agent 1 — Codebase Topology** (subagent_type: Explore, model: sonnet):
102
+ Prompt:
103
+ "The project root is the current working directory. Analyze the codebase structure by following these steps in order:
103
104
 
104
- **Agent 2 Pattern Extraction** (subagent_type: Explore, model: haiku):
105
- Prompt: "Analyze this project's codebase for patterns. Report on: (1) architectural patterns in use, (2) coding conventions, (3) existing abstractions, (4) dependency patterns between modules. Use Glob, Grep, Read to explore. Under 500 words. Facts only."
105
+ 1. Run Glob('*') to list all top-level files and directories.
106
+ 2. Read package.json (or equivalent manifest) for project metadata, scripts, and dependencies.
107
+ 3. Read any README.md or CLAUDE.md at the project root.
108
+ 4. For each top-level source directory, run Glob('{dir}/*') to map one level of contents.
109
+ 5. Grep for common entry points: 'main', 'index', 'app', 'server' in source files.
110
+ 6. Check for test infrastructure: Glob('**/*.test.*') or Glob('**/*.spec.*') or Glob('**/test/**').
111
+ 7. Check for build config: Glob('**/tsconfig*') or Glob('**/webpack*') or Glob('**/vite*') or similar.
106
112
 
107
- When both return, combine results and write to `docs/project_notes/.planning_research/orientation.md`.
113
+ Report on:
114
+ (1) Top-level directory structure with purpose of each directory
115
+ (2) Key modules and their responsibilities
116
+ (3) Entry points
117
+ (4) Test infrastructure (framework, location, patterns)
118
+ (5) Build system and tooling
119
+
120
+ Under 500 words. Facts only, no speculation."
121
+
122
+ **Agent 2 — Pattern Extraction** (subagent_type: Explore, model: sonnet):
123
+ Prompt:
124
+ "The project root is the current working directory. Analyze codebase patterns by following these steps:
125
+
126
+ 1. Read 3-5 representative source files from different directories to identify coding style.
127
+ 2. Grep for 'export' or 'module.exports' to understand module boundaries.
128
+ 3. Grep for 'import' or 'require' to map dependency patterns between modules.
129
+ 4. Grep for error handling patterns: 'catch', 'throw', 'Error', 'try'.
130
+ 5. Grep for common abstractions: 'class', 'interface', 'type', 'abstract', 'base'.
131
+ 6. Check for configuration patterns: Glob('**/*.config.*') or Glob('**/.{eslint,prettier}*').
132
+
133
+ Report on:
134
+ (1) Architectural patterns in use (MVC, event-driven, plugin system, etc.)
135
+ (2) Coding conventions (naming, file organization, export style)
136
+ (3) Existing abstractions and base classes/utilities
137
+ (4) Dependency patterns between modules (which modules depend on which)
138
+
139
+ Under 500 words. Facts only, no speculation."
140
+
141
+ When both return, combine results and write to `{context_path}/.planning_research/orientation.md`.
108
142
 
109
143
  ## BRANCH-AWARE INTAKE (Branch Only)
110
144
 
@@ -117,8 +151,23 @@ When `active_context` is NOT trunk:
117
151
  3. Read parent's plan.md and any design specs at `{parent_path}/design_spec_*.md`.
118
152
  4. Launch a THIRD orientation research agent alongside the existing two:
119
153
 
120
- **Agent 3 — Parent Intersection Analysis** (subagent_type: Explore, model: haiku):
121
- Prompt: "Compare the discovery brief at {context_path}/discovery_brief.md with the plan at {parent_path}/plan.md. Identify: (1) Shared files/components that both touch, (2) Decisions in the parent plan that constrain this branch, (3) Potential conflicts or dependencies, (4) Patterns from parent that should be reused. Under 500 words. Facts only."
154
+ **Agent 3 — Parent Intersection Analysis** (subagent_type: Explore, model: sonnet):
155
+ Prompt:
156
+ "The project root is the current working directory. Compare two workflow artifacts:
157
+
158
+ 1. Read the discovery brief at {context_path}/discovery_brief.md.
159
+ 2. Read the parent plan at {parent_path}/plan.md.
160
+ 3. For each file path mentioned in the parent plan's tasks, check if the discovery brief references the same files or components.
161
+ 4. Extract all technology decisions from the parent plan (Section 3 if it exists).
162
+ 5. Identify acceptance criteria in the parent plan that touch the same areas as the discovery brief.
163
+
164
+ Report on:
165
+ (1) Shared files/components that both parent plan and this branch's discovery brief touch
166
+ (2) Decisions in the parent plan that constrain this branch
167
+ (3) Potential conflicts or dependencies between parent and branch work
168
+ (4) Patterns from parent implementation that this branch should reuse
169
+
170
+ Under 500 words. Facts only, no speculation."
122
171
 
123
172
  Write results to `{context_path}/.planning_research/parent_intersection.md`.
124
173
 
@@ -170,11 +219,11 @@ For each major decision domain identified from the discovery brief, orientation
170
219
  - Use haiku (subagent_type: Explore) for straightforward fact-gathering.
171
220
  - Use sonnet (subagent_type: general-purpose) for trade-off analysis against the existing codebase.
172
221
  - Each agent prompt MUST reference the specific decision domain, return under 400 words.
173
- - Write results to `docs/project_notes/.planning_research/decision_[domain].md` (snake_case).
222
+ - Write results to `{context_path}/.planning_research/decision_[domain].md` (snake_case).
174
223
  - NEVER launch more than 2 agents simultaneously.
175
224
  3. **Present** 2-3 options with trade-offs. Include your recommendation and why.
176
225
  4. **Ask** the user to select via AskUserQuestion.
177
- 5. **Record** the resolved decision to `docs/project_notes/.planning_research/decisions_log.md`:
226
+ 5. **Record** the resolved decision to `{context_path}/.planning_research/decisions_log.md`:
178
227
 
179
228
  ```markdown
180
229
  ## [Decision Domain]
@@ -218,7 +267,7 @@ If the user wants to discuss more, return to Phase 3.
218
267
 
219
268
  ## Step 2: Draft the plan
220
269
 
221
- Read `docs/project_notes/.planning_research/decisions_log.md` and `orientation.md` to gather resolved context. Draft the plan following the plan.md output format below, applying scope scaling for the selected tier.
270
+ Read `{context_path}/.planning_research/decisions_log.md` and `orientation.md` to gather resolved context. Draft the plan following the plan.md output format below, applying scope scaling for the selected tier.
222
271
 
223
272
  ## Step 3: Validate
224
273
 
@@ -236,8 +285,8 @@ If changes requested, make them and present again. Repeat until explicitly appro
236
285
 
237
286
  After explicit approval:
238
287
 
239
- 1. Write the final plan to `docs/project_notes/plan.md`.
240
- 2. Tell the user: "Plan saved to `docs/project_notes/plan.md`. Next step: Run `/intuition-handoff` to transition into execution."
288
+ 1. Write the final plan to `{context_path}/plan.md`.
289
+ 2. Tell the user: "Plan saved to `{context_path}/plan.md`. Next step: Run `/intuition-handoff` to transition to the next phase."
241
290
  3. ALWAYS route to `/intuition-handoff`. NEVER suggest `/intuition-execute`.
242
291
 
243
292
  # PLAN.MD OUTPUT FORMAT (Plan-Execute Contract v1.0)
@@ -403,7 +452,7 @@ If any check fails, fix it before presenting.
403
452
 
404
453
  ## Tier 1: Orientation (launched in Phase 1)
405
454
 
406
- Launch 2 haiku Explore agents in parallel via Task tool. See Phase 1, Step 2 for prompt templates. Write combined results to `docs/project_notes/.planning_research/orientation.md`.
455
+ Launch 2 sonnet Explore agents in parallel via Task tool. See Phase 1, Step 2 for prompt templates. Write combined results to `{context_path}/.planning_research/orientation.md`.
407
456
 
408
457
  ## Tier 2: Decision Research (launched on demand in Phase 3)
409
458
 
@@ -413,7 +462,7 @@ Launch 1-2 agents per decision domain when dialogue reveals unknowns needing inv
413
462
  - Use sonnet general-purpose agents for trade-off analysis (e.g., "Compare approaches X and Y given the current architecture").
414
463
  - Each prompt MUST specify the decision domain and a 400-word limit.
415
464
  - Reference specific files or directories when possible.
416
- - Write results to `docs/project_notes/.planning_research/decision_[domain].md`.
465
+ - Write results to `{context_path}/.planning_research/decision_[domain].md`.
417
466
  - NEVER launch more than 2 simultaneously.
418
467
 
419
468
  # CONTEXT MANAGEMENT