@tgoodington/intuition 7.1.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,17 +94,51 @@ From the discovery brief, extract: core problem, success criteria, stakeholders,
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
 
@@ -304,10 +353,9 @@ Ordered list forming a valid dependency DAG. Each task:
304
353
  [minimum 2 per task]
305
354
  - **Dependencies**: [Task numbers] or "None"
306
355
  - **Files**: [Specific paths when known] or "TBD — [component area]"
307
- - **Implementation Latitude**: [What Execute gets to decide — patterns, error handling, internal structure, approach]
308
356
  ```
309
357
 
310
- **Acceptance criteria rule:** If a criterion can only be satisfied ONE way, it is over-specified. Criteria describe outcomes ("users can reset passwords via email"), not implementations ("add a resetPassword() method that calls sendEmail()"). Execute and its engineers decide the code-level HOW.
358
+ **Acceptance criteria rule:** If a criterion can only be satisfied ONE way, it is over-specified. Criteria describe outcomes ("users can reset passwords via email"), not implementations ("add a resetPassword() method that calls sendEmail()"). The engineer and build phases decide the code-level HOW.
311
359
 
312
360
  ### 7. Testing Strategy (Standard+, when code is produced)
313
361
  Test types required. Which tasks need tests (reference task numbers). Critical test scenarios. Infrastructure needed.
@@ -326,20 +374,20 @@ Test types required. Which tasks need tests (reference task numbers). Critical t
326
374
 
327
375
  Every open question MUST have a Recommended Default. The execution phase uses the default unless the user provides direction. If you cannot write a reasonable default, the question is not ready to be left open — resolve it during dialogue.
328
376
 
329
- ### 10. Planning Context for Execute (always)
330
- Context and considerations for the execution phase — NOT instructions. Execute owns all implementation decisions.
377
+ ### 10. Planning Context for Engineer (always)
378
+ Context and considerations for the engineering phase — NOT instructions. Engineer owns all implementation decisions.
331
379
 
332
- - **Sequencing Considerations**: Factors that affect task ordering (NOT a prescribed order — Execute decides)
333
- - **Parallelization Opportunities**: Which tasks touch independent surfaces (Execute validates and decides)
334
- - **Engineering Questions**: Open implementation questions Execute must resolve during its Engineering Assessment (e.g., "How should error propagation work across Tasks 3-5?" / "Tasks 2 and 6 both touch the auth layer — shared abstraction or independent?")
335
- - **Constraints**: Hard boundaries Execute must respect (performance targets, API contracts, backward compatibility)
336
- - **Risk Context**: What could go wrong and why — Execute decides mitigation strategy
380
+ - **Sequencing Considerations**: Factors that affect task ordering (NOT a prescribed order — Engineer decides)
381
+ - **Parallelization Opportunities**: Which tasks touch independent surfaces (Engineer validates and decides)
382
+ - **Engineering Questions**: Open implementation questions Engineer must resolve during code spec creation (e.g., "How should error propagation work across Tasks 3-5?" / "Tasks 2 and 6 both touch the auth layer — shared abstraction or independent?")
383
+ - **Constraints**: Hard boundaries Engineer must respect (performance targets, API contracts, backward compatibility)
384
+ - **Risk Context**: What could go wrong and why — Engineer decides mitigation strategy
337
385
 
338
386
  ## Architect-Engineer Boundary
339
387
 
340
- The planning phase decides WHAT to build, WHERE it lives in the architecture, and WHY each decision was made. The execution phase decides HOW to build it at the code level — internal implementation, code patterns, file decomposition within components. Execute produces an `implementation_guide.md` documenting its engineering decisions before delegating work.
388
+ The planning phase decides WHAT to build, WHERE it lives in the architecture, and WHY each decision was made. The engineering phase decides HOW to build it at the code level — internal implementation, code patterns, file decomposition within components. Engineer produces `code_specs.md` documenting its engineering decisions, then Build implements against those specs.
341
389
 
342
- Overlap resolution: Planning specifies public interfaces between components and known file paths. Execution owns everything internal to a component and determines paths for new files marked TBD. The Implementation Latitude field on each task explicitly marks what Execute gets to decide.
390
+ Overlap resolution: Planning specifies public interfaces between components and known file paths. Engineer owns everything internal to a component and determines paths for new files marked TBD.
343
391
 
344
392
  Interim artifacts in `.planning_research/` are working files for planning context management. They are NOT part of the plan-execute contract. Only `plan.md` crosses the handoff boundary.
345
393
 
@@ -394,8 +442,7 @@ Validate ALL before presenting the draft:
394
442
  - [ ] Technology decisions explicitly marked Locked or Recommended (Standard+)
395
443
  - [ ] Interface contracts provided where components interact (Comprehensive)
396
444
  - [ ] Risks have mitigations (Standard+)
397
- - [ ] Planning Context for Execute includes engineering questions, not prescriptive instructions
398
- - [ ] Every task has an Implementation Latitude field identifying what Execute decides
445
+ - [ ] Planning Context for Engineer includes engineering questions, not prescriptive instructions
399
446
  - [ ] Design Recommendations section included with every task assessed
400
447
  - [ ] Each DESIGN REQUIRED flag has a specific rationale (not generic)
401
448
 
@@ -405,7 +452,7 @@ If any check fails, fix it before presenting.
405
452
 
406
453
  ## Tier 1: Orientation (launched in Phase 1)
407
454
 
408
- 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`.
409
456
 
410
457
  ## Tier 2: Decision Research (launched on demand in Phase 3)
411
458
 
@@ -76,14 +76,14 @@ IF state.version == "3.0" OR state.active_context is missing:
76
76
  → STOP phase detection
77
77
  → OUTPUT:
78
78
  "This project uses the v3.0 state schema, which is no longer compatible
79
- with Intuition v7.0+. Run /intuition-handoff or /intuition-initialize
80
- to upgrade to v4.0."
79
+ with Intuition v8.0+. Run /intuition-handoff or /intuition-initialize
80
+ to upgrade to v5.0."
81
81
  → END protocol here
82
82
  ```
83
83
 
84
84
  ## CONTEXT PATH RESOLUTION (Step 3)
85
85
 
86
- After confirming v4.0 schema:
86
+ After confirming v4.0+ schema:
87
87
 
88
88
  ```
89
89
  active_context = state.active_context (e.g. "trunk" or "feature-auth")
@@ -128,11 +128,17 @@ ELSE IF a context is in-progress (active_context has status not "complete"):
128
128
  AND context_workflow.workflow.design.completed == false:
129
129
  → PHASE: design_in_progress
130
130
 
131
- ELSE IF context_workflow.workflow.execution.started == false:
132
- → PHASE: ready_for_execution
131
+ ELSE IF context_workflow.workflow.engineering.started == false:
132
+ → PHASE: ready_for_engineering
133
133
 
134
- ELSE IF context_workflow.workflow.execution.completed == false:
135
- → PHASE: execution_in_progress
134
+ ELSE IF context_workflow.workflow.engineering.completed == false:
135
+ → PHASE: engineering_in_progress
136
+
137
+ ELSE IF context_workflow.workflow.build.started == false:
138
+ → PHASE: ready_for_build
139
+
140
+ ELSE IF context_workflow.workflow.build.completed == false:
141
+ → PHASE: build_in_progress
136
142
 
137
143
  ELSE:
138
144
  → PHASE: post_completion
@@ -140,12 +146,13 @@ ELSE IF a context is in-progress (active_context has status not "complete"):
140
146
 
141
147
  **"Any context is complete"** means: `state.trunk.status == "complete"` OR any entry in `state.branches` has `status == "complete"`.
142
148
 
143
- **"No context is in-progress"** means: `state.trunk.status` is not in `["prompt","planning","design","executing"]` AND no branch has status in those values.
149
+ **"No context is in-progress"** means: `state.trunk.status` is not in `["prompt","planning","design","engineering","building"]` AND no branch has status in those values.
144
150
 
145
151
  If `.project-memory-state.json` exists but is corrupted or unreadable, infer phase from which files exist under `context_path`:
146
152
  - `{context_path}discovery_brief.md` exists → prompt complete
147
153
  - `{context_path}plan.md` exists → planning complete
148
154
  - `{context_path}design_spec_*.md` exist → design in progress or complete
155
+ - `{context_path}code_specs.md` exists → engineering complete
149
156
  - Ask user to confirm if ambiguous.
150
157
 
151
158
  ## PHASE HANDLERS
@@ -178,7 +185,7 @@ Project Status:
178
185
  │ └── "[purpose]"
179
186
  ```
180
187
 
181
- Status labels: `none` → "Not started", `prompt` → "Prompting...", `planning` → "Planning...", `design` → "Designing...", `executing` → "Executing...", `complete` → "Complete"
188
+ Status labels: `none` → "Not started", `prompt` → "Prompting...", `planning` → "Planning...", `design` → "Designing...", `engineering` → "Engineering...", `building` → "Building...", `complete` → "Complete"
182
189
 
183
190
  **If any context is in-progress:**
184
191
 
@@ -299,21 +306,59 @@ Design Queue:
299
306
  [If current item just completed]: Run /intuition-handoff to process the design and move to the next item.
300
307
  ```
301
308
 
302
- ### Ready for Execution
309
+ ### Ready for Engineering
303
310
 
304
311
  Read and curate from:
305
- - `{context_path}plan.md` — extract objective, task count, approach
306
- - `{context_path}execution_brief.md` — reference location
312
+ - `{context_path}plan.md` — extract objective, task count
313
+ - `{context_path}engineering_brief.md` — reference location
307
314
  - `docs/project_notes/decisions.md` — relevant ADRs
308
315
  - `{context_path}design_spec_*.md` — list any design specs
309
316
 
310
317
  ```
311
- Welcome back! Your plan is approved and ready.
318
+ Welcome back! Ready for engineering.
319
+
320
+ Discovery: Complete
321
+ Plan: Approved
322
+ [If design specs exist]: Design: Complete ([N] specs)
323
+ Engineering: Ready
324
+
325
+ - [N] tasks to spec
326
+ - Objective: [1 sentence]
327
+
328
+ Engineering brief ready at: {context_path}engineering_brief.md
329
+
330
+ Run /intuition-engineer to create code specs.
331
+ ```
332
+
333
+ ### Engineering In Progress
334
+
335
+ ```
336
+ Welcome back! Engineering is in progress.
337
+
338
+ Discovery: Complete
339
+ Plan: Approved
340
+ [If design specs exist]: Design: Complete
341
+ Engineering: In progress
342
+
343
+ Run /intuition-engineer to continue creating code specs.
344
+ ```
345
+
346
+ ### Ready for Build
347
+
348
+ Read and curate from:
349
+ - `{context_path}plan.md` — extract objective, task count, approach
350
+ - `{context_path}code_specs.md` — reference location
351
+ - `{context_path}build_brief.md` — reference location
352
+ - `docs/project_notes/decisions.md` — relevant ADRs
353
+
354
+ ```
355
+ Welcome back! Code specs are ready.
312
356
 
313
357
  Discovery: Complete
314
358
  Plan: Approved
315
359
  [If design specs exist]: Design: Complete ([N] specs)
316
- Execution: Ready
360
+ Engineering: Complete
361
+ Build: Ready
317
362
 
318
363
  - [N] tasks
319
364
  - Approach: [1 sentence]
@@ -323,24 +368,25 @@ Key context:
323
368
  - Problem: [1 sentence from discovery]
324
369
  - Main constraint: [most limiting]
325
370
 
326
- Execution brief ready at: {context_path}execution_brief.md
371
+ Build brief ready at: {context_path}build_brief.md
327
372
 
328
- Run /intuition-execute to begin implementation.
373
+ Run /intuition-build to begin implementation.
329
374
  ```
330
375
 
331
- ### Execution In Progress
376
+ ### Build In Progress
332
377
 
333
- Read `{context_path}plan.md` for total tasks and any execution state available.
378
+ Read `{context_path}plan.md` for total tasks and any build state available.
334
379
 
335
380
  ```
336
- Welcome back! Execution is in progress.
381
+ Welcome back! Build is in progress.
337
382
 
338
383
  Discovery: Complete
339
384
  Plan: Approved
340
385
  [If design specs exist]: Design: Complete
341
- Execution: In progress
386
+ Engineering: Complete
387
+ Build: In progress
342
388
 
343
- Run /intuition-execute to continue.
389
+ Run /intuition-build to continue.
344
390
  ```
345
391
 
346
392
  ## BRIEF CURATION RULES
@@ -381,6 +427,7 @@ You are curating information for the user, not dumping files. Follow these rules
381
427
  - **Old v2.0 state schema detected** (has `discovery` instead of `prompt`): Treat `discovery` fields as `prompt` fields. Suggest running `/intuition-initialize` to update to current schema.
382
428
  - **State file exists but active_context is null or missing**: Treat as v3.0 — output the upgrade warning and stop.
383
429
  - **Branch referenced in active_context but not found in branches map**: Report the inconsistency and suggest `/intuition-handoff` to reconcile state.
430
+ - **v4.0 state detected** (has `execution` instead of `build`): Warn user: "State uses v4.0 schema. Run `/intuition-handoff` to migrate to v5.0."
384
431
 
385
432
  ## VOICE
386
433