@tgoodington/intuition 6.0.0 → 7.0.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.
@@ -35,6 +35,8 @@ These are non-negotiable. Violating any of these means the protocol has failed.
35
35
  5. You MUST NOT "refresh" or "regenerate" briefs — that's handoff's job.
36
36
  6. You MUST NOT manage .project-memory-state.json — handoff owns state transitions.
37
37
  7. You MUST keep output concise. Curate, don't dump.
38
+ 8. You MUST resolve context_path from active_context before reading any workflow artifacts.
39
+ 9. If state has version "3.0" or no active_context field, you MUST warn the user to upgrade — do not attempt phase detection on v3.0 state.
38
40
 
39
41
  ## PROTOCOL: COMPLETE FLOW
40
42
 
@@ -43,10 +45,12 @@ Execute these steps in order:
43
45
  ```
44
46
  Step 0: Check package version and notify if update available (non-blocking)
45
47
  Step 1: Check for docs/project_notes/.project-memory-state.json
46
- Step 2: Detect current phase using decision tree
47
- Step 3: Load relevant memory files for context
48
- Step 4: Curate a concise status summary
49
- Step 5: Suggest the correct next skill
48
+ Step 2: Detect schema version; warn if v3.0
49
+ Step 3: Resolve active_context and context_path
50
+ Step 4: Detect current phase using decision tree
51
+ Step 5: Load relevant memory files for context
52
+ Step 6: Curate a concise status summary
53
+ Step 7: Suggest the correct next skill
50
54
  ```
51
55
 
52
56
  ## VERSION CHECK (Step 0)
@@ -63,57 +67,91 @@ Review the "Package Version Info" section above. Parse the version numbers from
63
67
 
64
68
  IMPORTANT: This check is NON-BLOCKING. If the version commands failed or output is unparseable, skip version notification and proceed with normal protocol. NEVER let version checking prevent you from completing the session primer.
65
69
 
66
- ## PHASE DETECTION
70
+ ## SCHEMA VERSION CHECK (Step 2)
67
71
 
68
- Read `docs/project_notes/.project-memory-state.json`. Use this decision tree:
72
+ After reading `.project-memory-state.json`, check the version field:
73
+
74
+ ```
75
+ IF state.version == "3.0" OR state.active_context is missing:
76
+ → STOP phase detection
77
+ → OUTPUT:
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."
81
+ → END protocol here
82
+ ```
83
+
84
+ ## CONTEXT PATH RESOLUTION (Step 3)
85
+
86
+ After confirming v4.0 schema:
87
+
88
+ ```
89
+ active_context = state.active_context (e.g. "trunk" or "feature-auth")
90
+
91
+ IF active_context == "trunk":
92
+ context_path = "docs/project_notes/trunk/"
93
+ context_workflow = state.trunk
94
+ ELSE:
95
+ context_path = "docs/project_notes/branches/{active_context}/"
96
+ context_workflow = state.branches[active_context]
97
+ ```
98
+
99
+ Use `context_path` for ALL artifact reads in this session.
100
+ Use `context_workflow` for ALL phase detection.
101
+
102
+ ## PHASE DETECTION (Step 4)
103
+
104
+ Use `context_workflow` resolved above. Apply this decision tree:
69
105
 
70
106
  ```
71
107
  IF .project-memory-state.json does NOT exist:
72
108
  → PHASE: first_time
73
- → ACTION: Welcome, suggest /intuition-prompt
74
109
 
75
- ELSE IF workflow.prompt.started == false OR workflow.prompt.completed == false:
76
- → PHASE: prompt_in_progress
77
- → ACTION: Note prompt is underway, suggest /intuition-prompt
110
+ ELSE IF any context is complete AND no context is in-progress:
111
+ → PHASE: post_completion
78
112
 
79
- ELSE IF workflow.planning.started == false:
80
- PHASE: ready_for_planning
81
- → ACTION: Summarize discovery, suggest /intuition-plan
113
+ ELSE IF a context is in-progress (active_context has status not "complete"):
114
+ Apply the following against context_workflow:
82
115
 
83
- ELSE IF workflow.planning.completed == false:
84
- PHASE: planning_in_progress
85
- ACTION: Note planning is underway, suggest /intuition-plan
116
+ IF context_workflow.workflow.prompt.started == false
117
+ OR context_workflow.workflow.prompt.completed == false:
118
+ PHASE: prompt_in_progress
86
119
 
87
- ELSE IF workflow.status == "design" AND workflow.design.started == true
88
- AND workflow.design.completed == false:
89
- → PHASE: design_in_progress
90
- → ACTION: Show design queue progress, suggest /intuition-design or /intuition-handoff
120
+ ELSE IF context_workflow.workflow.planning.started == false:
121
+ PHASE: ready_for_planning
91
122
 
92
- ELSE IF workflow.execution.started == false:
93
- → PHASE: ready_for_execution
94
- → ACTION: Summarize plan, suggest /intuition-execute
123
+ ELSE IF context_workflow.workflow.planning.completed == false:
124
+ → PHASE: planning_in_progress
95
125
 
96
- ELSE IF workflow.execution.completed == false:
97
- PHASE: execution_in_progress
98
- ACTION: Note execution progress, suggest /intuition-execute
126
+ ELSE IF context_workflow.status == "design"
127
+ AND context_workflow.workflow.design.started == true
128
+ AND context_workflow.workflow.design.completed == false:
129
+ → PHASE: design_in_progress
99
130
 
100
- ELSE:
101
- → PHASE: complete
102
- → ACTION: Celebrate, suggest /intuition-prompt for next cycle
131
+ ELSE IF context_workflow.workflow.execution.started == false:
132
+ → PHASE: ready_for_execution
133
+
134
+ ELSE IF context_workflow.workflow.execution.completed == false:
135
+ → PHASE: execution_in_progress
136
+
137
+ ELSE:
138
+ → PHASE: post_completion
103
139
  ```
104
140
 
105
- If `.project-memory-state.json` exists but is corrupted or unreadable, infer the phase from which output files exist:
106
- - `discovery_brief.md` exists → prompt complete
107
- - `plan.md` exists planning complete
108
- - `design_spec_*.md` exists → design in progress or complete
141
+ **"Any context is complete"** means: `state.trunk.status == "complete"` OR any entry in `state.branches` has `status == "complete"`.
142
+
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.
144
+
145
+ If `.project-memory-state.json` exists but is corrupted or unreadable, infer phase from which files exist under `context_path`:
146
+ - `{context_path}discovery_brief.md` exists → prompt complete
147
+ - `{context_path}plan.md` exists → planning complete
148
+ - `{context_path}design_spec_*.md` exist → design in progress or complete
109
149
  - Ask user to confirm if ambiguous.
110
150
 
111
151
  ## PHASE HANDLERS
112
152
 
113
153
  ### First Time (No Project Memory)
114
154
 
115
- Output a welcome message, then suggest getting started:
116
-
117
155
  ```
118
156
  Welcome to Intuition!
119
157
 
@@ -123,15 +161,78 @@ Run /intuition-prompt to describe what you want to build or change.
123
161
  I'll help you sharpen it into something the planning phase can run with.
124
162
  ```
125
163
 
164
+ ### Post-Completion
165
+
166
+ Read the state file and build the status tree. Read `{context_path}plan.md` for the trunk objective (first sentence of Section 1).
167
+
168
+ Display:
169
+
170
+ ```
171
+ Welcome back! Here's your project status:
172
+
173
+ Project Status:
174
+ ├── Trunk: [status]
175
+ │ └── "[trunk objective — 1 sentence]"
176
+ [For each branch in state.branches:]
177
+ ├── Branch: [display_name] (from [created_from]): [status]
178
+ │ └── "[purpose]"
179
+ ```
180
+
181
+ Status labels: `none` → "Not started", `prompt` → "Prompting...", `planning` → "Planning...", `design` → "Designing...", `executing` → "Executing...", `complete` → "Complete"
182
+
183
+ **If any context is in-progress:**
184
+
185
+ ```
186
+ You have work in progress on [context display name] (status: [status]).
187
+ Run /intuition-[next skill] to continue.
188
+ ```
189
+
190
+ Do NOT proceed to the two-choice prompt — resume the in-progress context instead.
191
+
192
+ **If all contexts are complete (or only complete + none):**
193
+
194
+ Use AskUserQuestion:
195
+
196
+ ```
197
+ Question: "All current work is complete. What's next?"
198
+ Header: "Next Step"
199
+ Options:
200
+ - "Create a new branch (new feature or change)"
201
+ - "Troubleshoot an issue (/intuition-engineer)"
202
+ ```
203
+
204
+ **If "Create a new branch":**
205
+
206
+ Collect the following via sequential AskUserQuestion prompts:
207
+
208
+ 1. Branch name: "What should we call this branch? Use a short, descriptive name (e.g. feature-auth, caching-layer, ui-overhaul)." (Header: "Branch Name")
209
+ 2. Branch purpose: "In one sentence, what will this branch accomplish?" (Header: "Branch Purpose")
210
+ 3. Parent context (only if multiple completed contexts exist): "Which completed context should this branch build from?" with options listing each completed context. (Header: "Branch From")
211
+ - If only one completed context exists, auto-select it and tell the user.
212
+
213
+ Then tell the user:
214
+
215
+ ```
216
+ Got it. Branch "[name]" will [purpose], building from [parent].
217
+
218
+ Run /intuition-handoff to register the branch and begin.
219
+ Pass along: branch name "[name]", purpose "[purpose]", parent "[parent]".
220
+ ```
221
+
222
+ **If "Troubleshoot":**
223
+
224
+ ```
225
+ Run /intuition-engineer to diagnose and fix issues in any completed context.
226
+ ```
227
+
126
228
  ### Prompt In Progress
127
229
 
128
- Check if `docs/project_notes/discovery_brief.md` exists for progress context.
230
+ Check if `{context_path}discovery_brief.md` exists.
129
231
 
130
- Output:
131
232
  ```
132
233
  Welcome back! Prompt refinement is in progress.
133
234
 
134
- [If brief exists]: Progress saved at docs/project_notes/discovery_brief.md
235
+ [If brief exists]: Progress saved at {context_path}discovery_brief.md
135
236
  [If no brief yet]: No brief saved yet — still early in refinement.
136
237
 
137
238
  Run /intuition-prompt to continue.
@@ -140,11 +241,10 @@ Run /intuition-prompt to continue.
140
241
  ### Ready for Planning
141
242
 
142
243
  Read and curate from:
143
- - `docs/project_notes/discovery_brief.md` — extract problem, goals, constraints
144
- - `docs/project_notes/planning_brief.md` — reference location (don't read in detail)
244
+ - `{context_path}discovery_brief.md` — extract problem, goals, constraints
245
+ - `{context_path}planning_brief.md` — reference location (don't read in detail)
145
246
  - `docs/project_notes/decisions.md` — extract 2-4 recent ADRs
146
247
 
147
- Output:
148
248
  ```
149
249
  Welcome back! Discovery is complete.
150
250
 
@@ -156,21 +256,20 @@ Here's what was discovered:
156
256
  Relevant Decisions:
157
257
  - [ADR titles if any exist]
158
258
 
159
- Planning brief ready at: docs/project_notes/planning_brief.md
259
+ Planning brief ready at: {context_path}planning_brief.md
160
260
 
161
261
  Run /intuition-plan to create a structured plan.
162
262
  ```
163
263
 
164
264
  ### Planning In Progress
165
265
 
166
- Read `docs/project_notes/plan.md` for task count and scope.
266
+ Read `{context_path}plan.md` for task count and scope.
167
267
 
168
- Output:
169
268
  ```
170
269
  Welcome back! Planning is in progress.
171
270
 
172
271
  Discovery: Complete
173
- Plan: In progress (docs/project_notes/plan.md)
272
+ Plan: In progress ({context_path}plan.md)
174
273
  - [N] tasks identified so far
175
274
  - Scope: [Simple/Moderate/Complex if determinable]
176
275
 
@@ -179,9 +278,8 @@ Run /intuition-plan to continue.
179
278
 
180
279
  ### Design In Progress
181
280
 
182
- Read `.project-memory-state.json` for design queue status. Read `docs/project_notes/design_brief.md` for current item context.
281
+ Read `.project-memory-state.json` for design queue status. Read `{context_path}design_brief.md` for current item context.
183
282
 
184
- Output:
185
283
  ```
186
284
  Welcome back! Design exploration is in progress.
187
285
 
@@ -190,8 +288,8 @@ Plan: Approved
190
288
  Design: In progress
191
289
 
192
290
  Design Queue:
193
- [For each item in design.items:]
194
- - [x] [Item Name] (completed) → design_spec_[name].md
291
+ [For each item in context_workflow.workflow.design.items:]
292
+ - [x] [Item Name] (completed) → {context_path}design_spec_[name].md
195
293
  - [>] [Item Name] (in progress)
196
294
  - [ ] [Item Name] (pending)
197
295
 
@@ -202,12 +300,11 @@ Design Queue:
202
300
  ### Ready for Execution
203
301
 
204
302
  Read and curate from:
205
- - `docs/project_notes/plan.md` — extract objective, task count, approach
206
- - `docs/project_notes/execution_brief.md` — reference location
303
+ - `{context_path}plan.md` — extract objective, task count, approach
304
+ - `{context_path}execution_brief.md` — reference location
207
305
  - `docs/project_notes/decisions.md` — relevant ADRs
208
- - `docs/project_notes/design_spec_*.md` — list any design specs
306
+ - `{context_path}design_spec_*.md` — list any design specs
209
307
 
210
- Output:
211
308
  ```
212
309
  Welcome back! Your plan is approved and ready.
213
310
 
@@ -224,16 +321,15 @@ Key context:
224
321
  - Problem: [1 sentence from discovery]
225
322
  - Main constraint: [most limiting]
226
323
 
227
- Execution brief ready at: docs/project_notes/execution_brief.md
324
+ Execution brief ready at: {context_path}execution_brief.md
228
325
 
229
326
  Run /intuition-execute to begin implementation.
230
327
  ```
231
328
 
232
329
  ### Execution In Progress
233
330
 
234
- Read plan.md for total tasks and any execution state available.
331
+ Read `{context_path}plan.md` for total tasks and any execution state available.
235
332
 
236
- Output:
237
333
  ```
238
334
  Welcome back! Execution is in progress.
239
335
 
@@ -245,21 +341,6 @@ Execution: In progress
245
341
  Run /intuition-execute to continue.
246
342
  ```
247
343
 
248
- ### Complete
249
-
250
- Output a completion summary:
251
-
252
- ```
253
- Welcome back! This workflow cycle is complete.
254
-
255
- Discovery: Complete
256
- Plan: Complete
257
- [If design was used]: Design: Complete
258
- Execution: Complete
259
-
260
- Ready for the next cycle? Run /intuition-prompt to start a new project or feature.
261
- ```
262
-
263
344
  ## BRIEF CURATION RULES
264
345
 
265
346
  You are curating information for the user, not dumping files. Follow these rules:
@@ -295,7 +376,9 @@ You are curating information for the user, not dumping files. Follow these rules
295
376
  - **Missing files referenced by state**: Report what you found and what's missing. Don't try to fix it. Suggest `/intuition-handoff` if briefs need regeneration.
296
377
  - **State says complete but output files missing**: "State indicates [phase] is complete but I can't find [file]. Run `/intuition-handoff` to reconcile, or check if the file was moved."
297
378
  - **User manually edited memory files**: Trust file contents as source of truth. Report what you find.
298
- - **Old v2.0 state schema detected** (has `discovery` instead of `prompt`): Treat `discovery` fields as `prompt` fields. Suggest running `/intuition-initialize` to update to v3.0 schema.
379
+ - **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.
380
+ - **State file exists but active_context is null or missing**: Treat as v3.0 — output the upgrade warning and stop.
381
+ - **Branch referenced in active_context but not found in branches map**: Report the inconsistency and suggest `/intuition-handoff` to reconcile state.
299
382
 
300
383
  ## VOICE
301
384