qualia-framework 3.4.0 → 4.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.
Files changed (42) hide show
  1. package/README.md +96 -51
  2. package/agents/builder.md +25 -14
  3. package/agents/plan-checker.md +29 -16
  4. package/agents/planner.md +33 -24
  5. package/agents/research-synthesizer.md +25 -12
  6. package/agents/roadmapper.md +89 -84
  7. package/agents/verifier.md +11 -2
  8. package/bin/cli.js +13 -2
  9. package/bin/install.js +28 -5
  10. package/bin/qualia-ui.js +267 -1
  11. package/bin/state.js +377 -52
  12. package/bin/statusline.js +40 -20
  13. package/docs/erp-contract.md +23 -2
  14. package/guide.md +84 -21
  15. package/hooks/auto-update.js +54 -70
  16. package/hooks/branch-guard.js +64 -6
  17. package/hooks/migration-guard.js +85 -10
  18. package/hooks/pre-compact.js +28 -4
  19. package/hooks/pre-deploy-gate.js +46 -6
  20. package/hooks/pre-push.js +94 -27
  21. package/hooks/session-start.js +6 -0
  22. package/package.json +1 -1
  23. package/skills/qualia/SKILL.md +3 -1
  24. package/skills/qualia-build/SKILL.md +40 -5
  25. package/skills/qualia-handoff/SKILL.md +87 -12
  26. package/skills/qualia-idk/SKILL.md +155 -3
  27. package/skills/qualia-map/SKILL.md +4 -4
  28. package/skills/qualia-milestone/SKILL.md +122 -79
  29. package/skills/qualia-new/SKILL.md +151 -230
  30. package/skills/qualia-optimize/SKILL.md +4 -4
  31. package/skills/qualia-plan/SKILL.md +14 -9
  32. package/skills/qualia-quick/SKILL.md +1 -1
  33. package/skills/qualia-report/SKILL.md +12 -0
  34. package/skills/qualia-verify/SKILL.md +59 -5
  35. package/templates/help.html +98 -31
  36. package/templates/journey.md +113 -0
  37. package/templates/plan.md +56 -11
  38. package/templates/requirements.md +82 -22
  39. package/templates/roadmap.md +41 -14
  40. package/templates/tracking.json +12 -1
  41. package/tests/runner.js +560 -0
  42. package/tests/state.test.sh +40 -0
@@ -1,15 +1,23 @@
1
1
  ---
2
2
  name: qualia-new
3
- description: "Set up a new project from scratch — deep questioning, parallel research, REQUIREMENTS.md, ROADMAP.md, approval gate. Use when starting any new client project."
3
+ description: "Set up a new project from scratch — deep questioning, ALWAYS-AUTO research, JOURNEY.md with all milestones to handoff, single approval gate, optional auto-chain into building. Use when starting any new client project."
4
4
  ---
5
5
 
6
- # /qualia-new — New Project
6
+ # /qualia-new — New Project (Full Journey)
7
7
 
8
- Comprehensive project initialization. Deep questioning 4 parallel research agents REQUIREMENTS.md with REQ-IDs ROADMAP.md with phases approval scaffold ready to plan Phase 1.
8
+ Initialize a project with the **entire arc mapped from kickoff to handoff**. All milestones defined upfront so the team follows a clear path, not improvising after each ship.
9
9
 
10
- **Flags:**
11
- - `/qualia-new` — full flow (default)
12
- - `/qualia-new --quick` — 4-phase flat wizard (faster, less rigorous, for trivial projects)
10
+ ## Flags
11
+
12
+ - `/qualia-new` — full-journey flow, stops after approval (default, backward-compatible)
13
+ - `/qualia-new --auto` — full-journey flow, then auto-chains into `/qualia-plan 1 → /qualia-build → /qualia-verify` for Milestone 1
14
+ - `/qualia-new --quick` — 4-phase flat wizard for trivial projects (landing pages, prototypes). Skips research and journey mapping.
15
+
16
+ ## The Shift From Previous Versions
17
+
18
+ **Before:** `/qualia-new` produced a v1 ROADMAP and stopped. Team improvised subsequent milestones ad hoc.
19
+
20
+ **Now:** `/qualia-new` produces **JOURNEY.md** (all milestones → Handoff) + REQUIREMENTS.md (multi-milestone, REQ-IDs) + ROADMAP.md (Milestone 1's phase detail). **One approval gate** on the whole journey. Research always runs — no permission ask.
13
21
 
14
22
  ## Process
15
23
 
@@ -25,157 +33,61 @@ Wait for free-text answer. Do NOT use AskUserQuestion here — let them talk nat
25
33
 
26
34
  ### Step 0.5. Brownfield Check
27
35
 
28
- Before questioning, detect if we're in an existing codebase:
29
-
30
36
  ```bash
31
37
  test -f package.json && echo "HAS_PACKAGE"
32
38
  test -d .git && echo "HAS_GIT"
33
- ls *.ts *.tsx *.js *.jsx *.py 2>/dev/null | head -5
34
39
  test -f .planning/codebase/README.md && echo "ALREADY_MAPPED"
35
40
  ```
36
41
 
37
- **If existing code detected AND not already mapped:**
38
-
39
- - header: "Existing Code"
40
- - question: "I see existing code here. Map the codebase first so I understand what's already built?"
41
- - options:
42
- - "Map codebase first" — Run /qualia-map, then continue (recommended for brownfield)
43
- - "Skip mapping" — Treat as greenfield anyway
44
-
45
- If "Map codebase first": invoke the `qualia-map` skill inline, wait for completion, then continue to Step 1.
42
+ If existing code is detected AND not already mapped, ask the user whether to run `/qualia-map` inline first. If yes, invoke the `qualia-map` skill inline, wait for completion, then continue to Step 1.
46
43
 
47
44
  ### Step 1. Deep Questioning
48
45
 
49
- **Load the questioning methodology as your guide:**
46
+ Load the questioning methodology:
50
47
 
51
48
  ```bash
52
49
  cat ~/.claude/qualia-references/questioning.md 2>/dev/null
53
50
  ```
54
51
 
55
- Follow that methodology:
56
- - Start with their free-text answer from Step 0
57
- - Follow energy — dig into what excited them
58
- - Challenge vagueness — never accept fuzzy answers
59
- - Make abstract concrete — "walk me through using this"
60
- - Surface motivation — "what prompted this?"
61
- - Check the 4-item context checklist mentally (what, why, who, done)
52
+ Follow the thread. Challenge vagueness. Make abstract concrete. Check the 4-item mental checklist (what, why, who, done).
62
53
 
63
- **Use AskUserQuestion for forks with 2-4 concrete interpretations.** Use free text when you want them to think freely.
54
+ Use `AskUserQuestion` for forks with 2-4 concrete interpretations. Use free text when you want them to think freely.
64
55
 
65
56
  **Decision gate** — when you could write a clear PROJECT.md:
66
57
 
67
58
  - header: "Ready?"
68
- - question: "I think I understand what you're building. Ready to create PROJECT.md?"
69
- - options:
70
- - "Create PROJECT.md" — Let's move forward
71
- - "Keep exploring" — I want to share more
59
+ - question: "I understand what you're building. Create PROJECT.md and move forward?"
60
+ - options: ["Create PROJECT.md", "Keep exploring"]
72
61
 
73
62
  Loop until "Create PROJECT.md".
74
63
 
75
- ### Step 2. Detect Project Type + Load Template
76
-
77
- From the questioning answers, infer project type:
78
-
79
- - "website", "landing page", "marketing site", "SaaS", "dashboard", "portal" → `website`
80
- - "chatbot", "AI assistant", "chat agent", "RAG", "agent" → `ai-agent`
81
- - "voice agent", "phone agent", "call bot", "VAPI", "Retell" → `voice-agent`
82
- - "mobile app", "iOS", "Android", "React Native", "Expo" → `mobile-app`
83
-
84
- **If a type matches:**
85
-
86
- ```bash
87
- cat ~/.claude/qualia-templates/projects/{type}.md
88
- ```
89
-
90
- This template gives suggested phase structure and category names the roadmapper will use.
91
-
92
- **If no type matches:** continue without a template — the roadmapper will derive structure from requirements.
64
+ ### Step 2. Detect Project Type
93
65
 
94
- Store `template_type` (or `null`) for use in Step 6.
66
+ From questioning answers, infer type → `website` | `ai-agent` | `voice-agent` | `mobile-app` | `null`. If matched, `cat ~/.claude/qualia-templates/projects/{type}.md` gives suggested milestone arc. Store `template_type` for Step 10.
95
67
 
96
68
  ### Step 3. Design Direction (frontend only)
97
69
 
98
- If the project involves frontend work (most do), capture design direction:
99
-
100
70
  - header: "Design"
101
71
  - question: "What's the design vibe?"
102
- - options:
103
- - "Dark & Bold" — Dark backgrounds, neon accents, strong contrast
104
- - "Clean & Minimal" — White space, subtle shadows, refined typography
105
- - "Colorful & Playful" — Gradients, rounded shapes, vibrant palette
106
- - "Corporate / Professional" — Structured, trust signals, enterprise feel
72
+ - options: ["Dark & Bold", "Clean & Minimal", "Colorful & Playful", "Corporate / Professional"]
107
73
 
108
- Also ask (free text): "Any brand colors or reference sites I should look at?"
109
-
110
- Store these for Step 7 (DESIGN.md generation).
74
+ Plus free-text: "Any brand colors or reference sites I should look at?"
111
75
 
112
76
  ### Step 4. Client Context
113
77
 
114
78
  - header: "Client"
115
79
  - question: "Client project or internal?"
116
- - options:
117
- - "Client project" — External client, needs handoff
118
- - "Internal / Qualia" — Our own product
119
- - "Personal / Side project" — No formal client
80
+ - options: ["Client project", "Internal / Qualia", "Personal / Side project"]
120
81
 
121
- If client, ask their name (free text) and check for saved prefs:
82
+ If client, ask name. Check saved prefs:
122
83
  ```bash
123
84
  cat ~/.claude/knowledge/client-prefs.md 2>/dev/null | grep -A 10 "{client name}"
124
85
  ```
125
86
 
126
- If prefs found, mention: *"I have notes on {client} — {summary}. Applying these to defaults unless you say otherwise."*
127
-
128
87
  ### Step 5. Write PROJECT.md
129
88
 
130
- Create `.planning/PROJECT.md` from the template:
89
+ Create `.planning/PROJECT.md` from the template. Include: client, what we're building, core value, validated + active requirements (empty for greenfield), out of scope, stack, design direction, decisions table.
131
90
 
132
- ```bash
133
- mkdir -p .planning
134
- cat ~/.claude/qualia-templates/project.md
135
- ```
136
-
137
- Fill in with questioning answers. Include:
138
-
139
- ```markdown
140
- # {Project Name}
141
-
142
- ## Client
143
- {name or "Internal" or "Personal"}
144
-
145
- ## What We're Building
146
- {one-paragraph description from questioning}
147
-
148
- ## Core Value
149
- {the ONE thing that must work}
150
-
151
- ## Requirements
152
- ### Validated
153
- {if brownfield, inferred from codebase map; else "(none yet)"}
154
-
155
- ### Active (hypotheses)
156
- - [ ] {requirement 1 — from questioning}
157
- - [ ] {requirement 2}
158
- - [ ] {requirement 3}
159
-
160
- ### Out of Scope
161
- - {exclusion 1}
162
-
163
- ## Stack
164
- {from questioning — default: Next.js 16 + React 19 + TypeScript + Supabase + Vercel}
165
-
166
- ## Design Direction
167
- {from Step 3}
168
-
169
- ## Decisions
170
- | Decision | Rationale |
171
- |----------|-----------|
172
- | {choice from questioning} | {why} |
173
-
174
- ---
175
- *Created: {date}*
176
- ```
177
-
178
- Commit:
179
91
  ```bash
180
92
  git init 2>/dev/null
181
93
  git add .planning/PROJECT.md
@@ -184,8 +96,6 @@ git commit -m "docs: initialize project"
184
96
 
185
97
  ### Step 6. Create config.json
186
98
 
187
- Write `.planning/config.json`:
188
-
189
99
  ```json
190
100
  {
191
101
  "mode": "interactive",
@@ -199,40 +109,31 @@ Write `.planning/config.json`:
199
109
  }
200
110
  ```
201
111
 
202
- **If the user says "quick" or the project is clearly trivial (landing page with 2 sections, 1 form):** set `depth: "quick"` and `workflow.research: false`.
112
+ **Note:** `workflow.research` is ALWAYS `true` for v4. It exists for telemetry but is no longer read as a gate.
203
113
 
204
114
  ### Step 7. Create DESIGN.md (frontend projects)
205
115
 
206
- If frontend work is involved, generate `.planning/DESIGN.md` from `~/.claude/qualia-templates/DESIGN.md` using the design direction from Step 3. Fill in:
207
- - Palette (concrete hex values, not placeholders)
208
- - Typography (distinctive fonts, NOT Inter/Roboto/system-ui)
209
- - Spacing (8px grid)
210
- - Motion approach
211
- - Component patterns
116
+ If frontend work is involved, generate `.planning/DESIGN.md` from the template with concrete palette, distinctive typography (NEVER Inter/Roboto/system-ui), 8px spacing grid, motion approach, component patterns.
212
117
 
213
- Commit:
214
118
  ```bash
215
119
  git add .planning/DESIGN.md .planning/config.json
216
120
  git commit -m "docs: design direction + config"
217
121
  ```
218
122
 
219
- ### Step 8. Run Research (if enabled)
123
+ ### Step 8. Run Research (ALWAYS, no permission ask)
124
+
125
+ **In v4, research runs unconditionally.** The previous `workflow.research` gate is gone. Skipping research leads to generic roadmaps and surprises late in the project — the 4-agent cost is worth it.
220
126
 
221
- Check `.planning/config.json` `workflow.research`. If `true`, proceed. If `false`, skip to Step 9.
127
+ Only `/qualia-new --quick` skips this step.
222
128
 
223
- **Banner:**
224
129
  ```bash
225
130
  node ~/.claude/bin/qualia-ui.js banner research
131
+ mkdir -p .planning/research
226
132
  ```
227
133
 
228
134
  Say: **"Running 4 parallel research agents (stack, features, architecture, pitfalls)..."**
229
135
 
230
- **Create research dir:**
231
- ```bash
232
- mkdir -p .planning/research
233
- ```
234
-
235
- **Spawn 4 researchers in parallel** (single message, 4 Agent tool calls):
136
+ Spawn 4 researchers in parallel (single message, 4 Agent tool calls), with multi-milestone scope:
236
137
 
237
138
  ```
238
139
  Agent(prompt="
@@ -241,7 +142,7 @@ Read your role: @~/.claude/agents/researcher.md
241
142
  <dimension>stack</dimension>
242
143
  <domain>{inferred domain from PROJECT.md}</domain>
243
144
  <project_context>{PROJECT.md summary}</project_context>
244
- <milestone_context>greenfield</milestone_context>
145
+ <milestone_context>multi-milestone — research must cover scalability through Milestone 3+</milestone_context>
245
146
  <output_path>.planning/research/STACK.md</output_path>
246
147
  ", subagent_type="qualia-researcher", description="Stack research")
247
148
 
@@ -251,7 +152,7 @@ Read your role: @~/.claude/agents/researcher.md
251
152
  <dimension>features</dimension>
252
153
  <domain>{inferred domain}</domain>
253
154
  <project_context>{PROJECT.md summary}</project_context>
254
- <milestone_context>greenfield</milestone_context>
155
+ <milestone_context>multi-milestone — distinguish v1 table stakes from v2 differentiators</milestone_context>
255
156
  <output_path>.planning/research/FEATURES.md</output_path>
256
157
  ", subagent_type="qualia-researcher", description="Features research")
257
158
 
@@ -261,7 +162,7 @@ Read your role: @~/.claude/agents/researcher.md
261
162
  <dimension>architecture</dimension>
262
163
  <domain>{inferred domain}</domain>
263
164
  <project_context>{PROJECT.md summary}</project_context>
264
- <milestone_context>greenfield</milestone_context>
165
+ <milestone_context>multi-milestone — Phase 1 foundations must support final-milestone requirements</milestone_context>
265
166
  <output_path>.planning/research/ARCHITECTURE.md</output_path>
266
167
  ", subagent_type="qualia-researcher", description="Architecture research")
267
168
 
@@ -271,7 +172,7 @@ Read your role: @~/.claude/agents/researcher.md
271
172
  <dimension>pitfalls</dimension>
272
173
  <domain>{inferred domain}</domain>
273
174
  <project_context>{PROJECT.md summary}</project_context>
274
- <milestone_context>greenfield</milestone_context>
175
+ <milestone_context>multi-milestone — flag risks that stall LATER milestones, not just v1</milestone_context>
275
176
  <output_path>.planning/research/PITFALLS.md</output_path>
276
177
  ", subagent_type="qualia-researcher", description="Pitfalls research")
277
178
  ```
@@ -283,145 +184,170 @@ Agent(prompt="
283
184
  Read your role: @~/.claude/agents/research-synthesizer.md
284
185
 
285
186
  Merge the 4 research files at .planning/research/ into .planning/research/SUMMARY.md.
286
- Include roadmap implications.
187
+ This is a multi-milestone project — the SUMMARY must suggest a FULL milestone arc
188
+ (2-5 milestones including Handoff), not just a v1 phase list. Include roadmap
189
+ implications AND handoff implications (what client takeover requires).
287
190
  ", subagent_type="qualia-research-synthesizer", description="Synthesize research")
288
191
  ```
289
192
 
290
- **Commit research:**
193
+ **Commit:**
291
194
  ```bash
292
195
  git add .planning/research/
293
- git commit -m "docs: research synthesis (4 dimensions)"
196
+ git commit -m "docs: research synthesis (4 dimensions, multi-milestone scope)"
294
197
  ```
295
198
 
296
- **Show key findings:**
199
+ Show key findings:
297
200
  ```bash
298
201
  node ~/.claude/bin/qualia-ui.js ok "Research complete"
299
202
  ```
300
- Display top 3 findings from SUMMARY.md (stack recommendation, table stakes, top pitfall).
203
+ Display top 3 from SUMMARY.md (stack recommendation, table stakes, top pitfall).
301
204
 
302
- ### Step 9. Feature Scoping
205
+ ### Step 9. Feature Scoping (Multi-Milestone)
303
206
 
304
- Read `.planning/research/FEATURES.md` (if exists) and present the feature landscape:
207
+ Read `.planning/research/FEATURES.md` and present the feature landscape. Unlike v3, features are scoped **to milestones**, not just to v1/v2.
305
208
 
306
209
  For each category, use AskUserQuestion:
307
210
 
308
211
  - header: "{Category name}"
309
- - question: "Which {category} features are in v1?"
212
+ - question: "Which {category} features belong to v1 (Milestones 1..N-1 excluding Handoff)?"
310
213
  - multiSelect: true
311
- - options:
312
- - Each feature from FEATURES.md with brief description
313
- - "None for v1" — defer entire category
214
+ - options: each feature from FEATURES.md + "None for v1"
314
215
 
315
- Track:
316
- - Selected → v1 requirements
317
- - Unselected table stakes → v2 (users expect these)
318
- - Unselected differentiators → out of scope
319
-
320
- **If research was skipped:** Ask free text: "What are the main things users need to be able to do?" — then probe for specifics on each capability mentioned.
216
+ Track selections:
217
+ - Selected → v1 scope (roadmapper assigns to specific milestones based on dependency order)
218
+ - Unselected table stakes → Post-Handoff v2 (users expect these)
219
+ - Unselected differentiators → Out of Scope
321
220
 
322
221
  Gather any additional requirements the user wants that research missed.
323
222
 
324
223
  ### Step 10. Run Roadmapper
325
224
 
326
- **Banner:**
327
225
  ```bash
328
226
  node ~/.claude/bin/qualia-ui.js banner roadmap
329
227
  ```
330
228
 
331
- Spawn the roadmapper agent:
229
+ Spawn the roadmapper with full-journey mandate:
332
230
 
333
231
  ```
334
232
  Agent(prompt="
335
233
  Read your role: @~/.claude/agents/roadmapper.md
336
234
 
337
235
  <task>
338
- Create REQUIREMENTS.md and ROADMAP.md for this project.
236
+ Create the FULL JOURNEY for this project:
237
+ - .planning/JOURNEY.md — all milestones (2-5 including Handoff) with exit criteria
238
+ - .planning/REQUIREMENTS.md — requirements grouped by milestone
239
+ - .planning/ROADMAP.md — Milestone 1's phase detail only (ready for /qualia-plan 1)
339
240
 
340
241
  User-scoped v1 features:
341
242
  {list of features selected in Step 9, grouped by category}
342
243
 
343
244
  Template type: {template_type from config.json}
344
- If template type is set, use ~/.claude/qualia-templates/projects/{type}.md as the phase structure starting point.
245
+ If set, use ~/.claude/qualia-templates/projects/{type}.md as the milestone arc starting point.
246
+
247
+ The final milestone MUST be named 'Handoff' with the fixed 4 phases
248
+ (Polish, Content + SEO, Final QA, Handoff). Do not omit it.
345
249
 
346
- Write files immediately:
347
- - .planning/REQUIREMENTS.md
348
- - .planning/ROADMAP.md
349
- - Update STATE.md via: node ~/.claude/bin/state.js init --project '{name}' --client '{client}' --type '{type}' --phases '<JSON>' --total_phases <N>
250
+ After writing, update STATE.md via:
251
+ node ~/.claude/bin/state.js init \\
252
+ --project '{name}' --client '{client}' --type '{type}' \\
253
+ --milestone_name '{Milestone 1 name}' \\
254
+ --phases '<JSON: Milestone 1 phases only>' \\
255
+ --total_phases <count>
350
256
  </task>
351
- ", subagent_type="qualia-roadmapper", description="Create roadmap")
257
+ ", subagent_type="qualia-roadmapper", description="Create full journey")
352
258
  ```
353
259
 
354
- ### Step 11. Review Roadmap
260
+ ### Step 11. Present the Journey (single view)
355
261
 
356
- Read the generated `ROADMAP.md`. Present it inline:
262
+ Render the branded journey ladder:
263
+
264
+ ```bash
265
+ node ~/.claude/bin/qualia-ui.js journey-tree .planning/JOURNEY.md
266
+ ```
267
+
268
+ This shows M1..M{N} as a vertical ladder: shipped milestones get a green dot, current gets a teal diamond with `[CURRENT]` tag, future get dim open circles. Handoff gets `[FINAL]` tag. Why-now + phase sketch render under current and final.
269
+
270
+ Also narrate the one-glance summary:
357
271
 
358
272
  ```
359
- ## Proposed Roadmap
360
-
361
- **{N} phases** | **{X} requirements mapped** | All v1 requirements covered ✓
362
-
363
- | # | Phase | Goal | Requirements | Success Criteria |
364
- |---|-------|------|--------------|------------------|
365
- | 1 | {name} | {goal} | {REQ-IDs} | {count} |
366
- | 2 | {name} | {goal} | {REQ-IDs} | {count} |
367
- ...
368
-
369
- ### Phase 1: {Name}
370
- Goal: {goal}
371
- Requirements: {REQ-IDs}
372
- Success criteria:
373
- 1. {criterion}
374
- 2. {criterion}
375
- 3. {criterion}
376
-
377
- ### Phase 2: {Name}
378
- ...
273
+ ## Proposed Journey
274
+
275
+ **{N} milestones to handoff** | **{X} requirements mapped** | All v1 requirements covered ✓
276
+
277
+ ┌─ Milestone 1 · {Name} [CURRENT]
278
+ │ Why now: {one line}
279
+ │ Exit: {outcome 1}, {outcome 2}
280
+ │ Phases: 1. {name} 2. {name} 3. {name}
281
+ │ Requirements: {REQ-IDs}
282
+ └─
283
+
284
+ ┌─ Milestone 2 · {Name}
285
+ │ Why now: {one line}
286
+ │ Exit: {outcome 1}, {outcome 2}
287
+ │ Phases: 1. {name} → 2. {name}
288
+ │ Requirements: {REQ-IDs}
289
+ └─
290
+
291
+ ...
292
+
293
+ ┌─ Milestone {N} · Handoff [FINAL]
294
+ │ Exit: Deployed, docs, credentials, walkthrough
295
+ │ Phases: 1. Polish → 2. Content + SEO → 3. Final QA → 4. Handoff
296
+ └─
297
+
298
+ Milestone 1 is fully planned. Milestones 2..{N-1} are sketched and will be detailed
299
+ when they open. Milestone {N} (Handoff) uses the standard 4-phase template.
379
300
  ```
380
301
 
381
- ### Step 12. Approval Gate
302
+ ### Step 12. Approval Gate (single — for the whole journey)
382
303
 
383
- - header: "Roadmap"
384
- - question: "Does this roadmap work for you?"
304
+ - header: "Journey"
305
+ - question: "Does this journey work for you?"
385
306
  - options:
386
- - "Approve" — Commit and continue
387
- - "Adjust phases" — Tell me what to change
388
- - "Review full file" — Show raw ROADMAP.md
307
+ - "Approve" — commit the full journey and continue
308
+ - "Adjust" — tell me what to change (milestones, phases, exit criteria, scope)
309
+ - "Review full JOURNEY.md" — show the raw file
389
310
 
390
- **If "Adjust":**
391
- - Get the user's feedback
392
- - Re-spawn the roadmapper with revision context
393
- - Show revised roadmap
394
- - Loop until approved
311
+ **If "Adjust":** capture feedback, re-spawn roadmapper with revision context, re-present. Loop until approved.
395
312
 
396
- **If "Review full file":** `cat .planning/ROADMAP.md`, then re-ask.
313
+ **If "Review full JOURNEY.md":** `cat .planning/JOURNEY.md`, then re-ask.
397
314
 
398
315
  **If "Approve":**
399
316
 
400
317
  ```bash
401
- git add .planning/REQUIREMENTS.md .planning/ROADMAP.md .planning/STATE.md
402
- git commit -m "docs: requirements + roadmap ({N} phases)"
318
+ git add .planning/JOURNEY.md .planning/REQUIREMENTS.md .planning/ROADMAP.md .planning/STATE.md
319
+ git commit -m "docs: journey + requirements + milestone 1 roadmap ({N} milestones)"
403
320
  ```
404
321
 
405
322
  ### Step 13. Environment Setup
406
323
 
407
- Check what the project needs (from PROJECT.md stack + research):
408
-
409
- - Supabase project? Guide through `supabase link` or create new
410
- - Vercel project? Guide through `vercel link`
411
- - Env vars? Create `.env.local` with placeholders
324
+ Supabase project? `supabase link` or create. Vercel project? `vercel link`. Env vars? `.env.local` with placeholders from PROJECT.md stack.
412
325
 
413
- Only walk through what's needed. Skip if the user says "I'll handle env myself."
326
+ Skip if user says "I'll handle env myself."
414
327
 
415
- Commit:
416
328
  ```bash
417
329
  git add .gitignore
418
330
  git commit -m "chore: environment setup" 2>/dev/null
419
331
  ```
420
332
 
421
- ### Step 14. Done
333
+ ### Step 14. Auto-Apply Gate (or stop here)
334
+
335
+ If invoked with `--auto`, skip straight into building Milestone 1:
336
+
337
+ ```bash
338
+ node ~/.claude/bin/qualia-ui.js info "Auto mode — chaining into /qualia-plan 1"
339
+ ```
340
+
341
+ Then inline-invoke `/qualia-plan 1`. That skill will chain into `/qualia-build 1 → /qualia-verify 1 → /qualia-plan 2 → ...` until Milestone 1's last phase verifies, at which point the chain pauses at the milestone boundary and asks:
342
+
343
+ - header: "Milestone 1 shipped"
344
+ - question: "Continue to Milestone 2 ({next milestone name})?"
345
+ - options: ["Continue", "Pause here"]
346
+
347
+ **Without `--auto`**, end with a clear pointer:
422
348
 
423
349
  ```bash
424
- node ~/.claude/bin/qualia-ui.js end "PROJECT READY" "/qualia-plan 1"
350
+ node ~/.claude/bin/qualia-ui.js end "JOURNEY READY" "/qualia-plan 1"
425
351
  ```
426
352
 
427
353
  Show summary:
@@ -432,37 +358,32 @@ Show summary:
432
358
  | Artifact | Location |
433
359
  |----------------|-----------------------------|
434
360
  | Project | .planning/PROJECT.md |
435
- | Config | .planning/config.json |
361
+ | Journey | .planning/JOURNEY.md |
436
362
  | Requirements | .planning/REQUIREMENTS.md |
437
- | Roadmap | .planning/ROADMAP.md |
363
+ | Roadmap (M1) | .planning/ROADMAP.md |
438
364
  | Design | .planning/DESIGN.md |
439
365
  | Research | .planning/research/ |
440
366
  | State | .planning/STATE.md |
367
+ | Config | .planning/config.json |
441
368
 
442
- {N} phases | {X} requirements | Ready to build
369
+ {N} milestones | {X} requirements | Ready to build Milestone 1: {name}
443
370
 
444
- ▶ Next: /qualia-plan 1 — plan Phase 1: {phase 1 name}
371
+ ▶ Next: /qualia-plan 1
372
+ (or rerun with /qualia-new --auto to chain through automatically)
445
373
  ```
446
374
 
447
- ## --quick Flag (Fast Path)
448
-
449
- If invoked as `/qualia-new --quick`, run a 4-phase flat flow instead of the full comprehensive flow:
375
+ ## --quick Flag (Fast Path, Unchanged)
450
376
 
451
- 1. Banner + "What do you want to make?"
452
- 2. 4-step wizard (type / features / design / client)
453
- 3. Fixed 4 phases based on project type (Foundation / Core / Content / Polish)
454
- 4. Skip: research, REQUIREMENTS.md, plan-check
455
- 5. Still creates: PROJECT.md, ROADMAP.md (simplified), STATE.md, DESIGN.md
456
- 6. Route to `/qualia-plan 1`
377
+ `/qualia-new --quick` still runs the 4-phase flat wizard for trivial projects (landing pages with 1-2 sections, throwaway prototypes). Creates PROJECT.md + a simplified ROADMAP.md + DESIGN.md + STATE.md. No JOURNEY.md, no research, no multi-milestone. Routes to `/qualia-plan 1`.
457
378
 
458
- Use `--quick` for: landing pages with 1-2 sections, throwaway prototypes, personal experiments.
459
- Do NOT use `--quick` for: client projects, anything with compliance/regulatory stakes, anything longer than 1 week.
379
+ Do NOT use `--quick` for: client projects, anything with compliance stakes, anything longer than one week.
460
380
 
461
381
  ## Rules
462
382
 
463
- 1. **Questioning is not a checklist.** Follow the thread, don't follow a script.
464
- 2. **Research runs automatically** unless `depth: quick` in config. Don't ask the user every time.
465
- 3. **Approval gate is mandatory.** Never commit a roadmap the user hasn't seen.
466
- 4. **STATE.md updates go through state.js init.** Never edit STATE.md by hand the statusline reads tracking.json which state.js writes atomically.
467
- 5. **Don't skip the research synthesizer.** Four research files without a synthesis = unread bloat.
468
- 6. **Inline skill invocation.** When Step 0.5 offers `/qualia-map`, INVOKE it inline — don't exit and tell the user to re-run.
383
+ 1. **Research runs automatically.** No permission ask. Only `--quick` skips it. This is a v4 invariant.
384
+ 2. **The journey includes Handoff.** Every project's final milestone is literally named "Handoff" with 4 standard phases. The roadmapper enforces this.
385
+ 3. **Single approval gate.** One gate for the whole journey. Not per-milestone, not per-phase.
386
+ 4. **Milestone count: 2-5.** Hard floor 2, hard ceiling 5. Bigger projects defer remainder to post-handoff v2.
387
+ 5. **Milestone 1 is fully detailed.** M2..M{N-1} are sketched. Detail fills in when each milestone opens.
388
+ 6. **STATE.md through state.js.** Never edit STATE.md or tracking.json by hand.
389
+ 7. **Inline skill invocation.** When Step 0.5 offers `/qualia-map`, invoke it inline — don't exit.
@@ -140,7 +140,7 @@ For EVERY finding, output in this exact format:
140
140
  - **Fix**: [concrete fix suggestion]
141
141
  - **Severity**: CRITICAL | HIGH | MEDIUM | LOW
142
142
  </task>",
143
- subagent_type="frontend-agent",
143
+ subagent_type="general-purpose",
144
144
  description="Frontend optimization analysis"
145
145
  )
146
146
  ```
@@ -193,7 +193,7 @@ For EVERY finding, output:
193
193
  - **Fix**: [concrete suggestion]
194
194
  - **Severity**: CRITICAL | HIGH | MEDIUM | LOW
195
195
  </task>",
196
- subagent_type="backend-agent",
196
+ subagent_type="general-purpose",
197
197
  description="Backend optimization analysis"
198
198
  )
199
199
  ```
@@ -240,7 +240,7 @@ For EVERY finding, output:
240
240
  - **Fix**: [concrete suggestion]
241
241
  - **Severity**: CRITICAL | HIGH | MEDIUM | LOW
242
242
  </task>",
243
- subagent_type="performance-oracle",
243
+ subagent_type="general-purpose",
244
244
  description="Performance optimization analysis"
245
245
  )
246
246
  ```
@@ -274,7 +274,7 @@ Output:
274
274
  - **Pattern consolidation** (where Wave 1 findings share a root cause)
275
275
  - Each finding in the same format: What/Where/Why/Fix/Severity
276
276
  </task>",
277
- subagent_type="architecture-strategist",
277
+ subagent_type="general-purpose",
278
278
  description="Architecture synthesis"
279
279
  )
280
280
  ```