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
@@ -13,6 +13,7 @@ Spawn a planner agent to break the current phase into executable tasks, then val
13
13
  `/qualia-plan {N}` — plan specific phase N
14
14
  `/qualia-plan {N} --gaps` — plan fixes for verification failures
15
15
  `/qualia-plan {N} --skip-check` — skip the plan-checker validation loop (not recommended)
16
+ `/qualia-plan {N} --auto` — plan + auto-chain into `/qualia-build {N} --auto` when done (no human approval between plan and build)
16
17
 
17
18
  ## Process
18
19
 
@@ -153,16 +154,10 @@ Show the remaining issues. Ask:
153
154
 
154
155
  ### 5. Present Final Plan
155
156
 
156
- ```bash
157
- node ~/.claude/bin/qualia-ui.js divider
158
- node ~/.claude/bin/qualia-ui.js ok "Plan ready: {count} tasks across {count} waves"
159
- ```
157
+ Render the story-file dashboard — this is a single command that parses the plan and shows the phase goal, waves, tasks, personas, dependencies, acceptance-criteria counts, and validation counts:
160
158
 
161
- For each wave:
162
159
  ```bash
163
- node ~/.claude/bin/qualia-ui.js wave {wave_num} {wave_total} {task_count}
164
- node ~/.claude/bin/qualia-ui.js task 1 "{task title}"
165
- node ~/.claude/bin/qualia-ui.js task 2 "{task title}"
160
+ node ~/.claude/bin/qualia-ui.js plan-summary .planning/phase-{N}-plan.md
166
161
  ```
167
162
 
168
163
  End with plain text: *"Approve? (yes / adjust)"*
@@ -177,7 +172,17 @@ node ~/.claude/bin/state.js transition --to planned --phase {N}
177
172
 
178
173
  If state.js returns an error, show it and stop. Do NOT manually edit STATE.md or tracking.json.
179
174
 
180
- ### 7. Route
175
+ ### 7. Route (auto-chain aware)
176
+
177
+ **If invoked with `--auto`:** immediately invoke `/qualia-build {N} --auto` inline. The user already approved the whole journey at `/qualia-new` time — no additional approval needed per phase plan.
178
+
179
+ ```bash
180
+ node ~/.claude/bin/qualia-ui.js info "Auto mode — chaining into /qualia-build {N}"
181
+ ```
182
+
183
+ Then invoke the `qualia-build` skill inline with `--auto`.
184
+
185
+ **Otherwise (guided mode):** stop and show the next step:
181
186
 
182
187
  ```bash
183
188
  node ~/.claude/bin/qualia-ui.js end "PHASE {N} PLANNED" "/qualia-build {N}"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: qualia-quick
3
- description: "Fast path for small tasks — bug fixes, tweaks, hot fixes. Skips full phase planning."
3
+ description: "Fast path for small tasks — bug fixes, tweaks, hot fixes. Skips full phase planning. Trigger on 'quick fix', 'small change', 'tweak', 'hot fix', 'one-line fix', 'quick edit', 'small bug'."
4
4
  ---
5
5
 
6
6
  # /qualia-quick — Quick Task
@@ -92,6 +92,9 @@ SUBMITTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
92
92
  # Only upload if ERP is enabled
93
93
  if [ "$ERP_ENABLED" = "true" ]; then
94
94
  # Build structured JSON payload from tracking.json (matches ERP contract /api/v1/reports)
95
+ # v4: include milestone_name, milestones[], team_id, project_id, git_remote,
96
+ # session_started_at, last_pushed_at, build_count, deploy_count — the ERP
97
+ # uses these to render the project tree (milestone → phases → unphased) correctly.
95
98
  PAYLOAD=$(node -e "
96
99
  const fs = require('fs');
97
100
  const t = JSON.parse(fs.readFileSync('.planning/tracking.json', 'utf8'));
@@ -104,8 +107,13 @@ if [ "$ERP_ENABLED" = "true" ]; then
104
107
  } catch {}
105
108
  console.log(JSON.stringify({
106
109
  project: t.project || require('path').basename(process.cwd()),
110
+ project_id: t.project_id || '',
111
+ team_id: t.team_id || '',
112
+ git_remote: t.git_remote || '',
107
113
  client: t.client || '',
108
114
  milestone: t.milestone || 1,
115
+ milestone_name: t.milestone_name || '',
116
+ milestones: Array.isArray(t.milestones) ? t.milestones : [],
109
117
  phase: t.phase,
110
118
  phase_name: t.phase_name,
111
119
  total_phases: t.total_phases,
@@ -114,7 +122,11 @@ if [ "$ERP_ENABLED" = "true" ]; then
114
122
  tasks_total: t.tasks_total || 0,
115
123
  verification: t.verification || 'pending',
116
124
  gap_cycles: (t.gap_cycles || {})[String(t.phase)] || 0,
125
+ build_count: t.build_count || 0,
126
+ deploy_count: t.deploy_count || 0,
117
127
  deployed_url: t.deployed_url || '',
128
+ session_started_at: t.session_started_at || '',
129
+ last_pushed_at: t.last_pushed_at || '',
118
130
  lifetime: t.lifetime || {},
119
131
  commits: commits,
120
132
  notes: notes,
@@ -10,6 +10,7 @@ Spawn a verifier agent to check if the phase goal was achieved. Does NOT trust b
10
10
  ## Usage
11
11
  `/qualia-verify` — verify the current built phase
12
12
  `/qualia-verify {N}` — verify specific phase
13
+ `/qualia-verify {N} --auto` — verify + auto-chain: PASS → next phase (or milestone close); FAIL → gap closure; gap limit → halt with escalation
13
14
 
14
15
  ## Process
15
16
 
@@ -31,7 +32,7 @@ node ~/.claude/bin/qualia-ui.js spawn verifier "Goal-backward check..."
31
32
 
32
33
  ```
33
34
  Agent(prompt="
34
- Read your role: @agents/verifier.md
35
+ Read your role: @~/.claude/agents/verifier.md
35
36
 
36
37
  Phase plan with success criteria AND verification contracts:
37
38
  @.planning/phase-{N}-plan.md
@@ -56,7 +57,7 @@ If frontend:
56
57
 
57
58
  ```
58
59
  Agent(prompt="
59
- Read your role: @agents/qa-browser.md
60
+ Read your role: @~/.claude/agents/qa-browser.md
60
61
 
61
62
  Phase plan: @.planning/phase-{N}-plan.md
62
63
  Existing verification: @.planning/phase-{N}-verification.md
@@ -99,11 +100,64 @@ node ~/.claude/bin/qualia-ui.js end "PHASE {N} GAPS FOUND" "/qualia-plan {N} --g
99
100
  ```bash
100
101
  node ~/.claude/bin/state.js transition --to verified --phase {N} --verification {pass|fail}
101
102
  ```
102
- If PASS and more phases: state.js auto-advances to the next phase.
103
- If FAIL and gap_cycles >= 2: state.js returns GAP_CYCLE_LIMIT — tell the employee to escalate.
104
- If FAIL and gap_cycles < 2: proceed to `/qualia-plan {N} --gaps`.
103
+ If PASS and more phases in this milestone: state.js auto-advances to the next phase.
104
+ If FAIL and gap_cycles >= limit: state.js returns GAP_CYCLE_LIMIT — escalate.
105
+ If FAIL and gap_cycles < limit: proceed to `/qualia-plan {N} --gaps`.
105
106
  Do NOT manually edit STATE.md or tracking.json — state.js handles both.
106
107
 
108
+ After state transition, capture the new state for auto-chain routing:
109
+
110
+ ```bash
111
+ NEW_STATE=$(node ~/.claude/bin/state.js check)
112
+ # Parse: .phase (new current phase), .total_phases, .status, .verification
113
+ # Also read .planning/JOURNEY.md to know if this was the last phase of a milestone
114
+ ```
115
+
116
+ ### 4b. Route (auto-chain aware)
117
+
118
+ **In `--auto` mode**, the router decides the next step based on verify result + journey position:
119
+
120
+ | Result | Journey position | Action |
121
+ |---|---|---|
122
+ | PASS | More phases remain in current milestone | Inline invoke `/qualia-plan {N+1} --auto` |
123
+ | PASS | Last phase of current milestone (not Handoff) | Inline invoke `/qualia-milestone --auto` |
124
+ | PASS | Last phase of Handoff milestone | Inline invoke `/qualia-ship`, then `/qualia-handoff`, then `/qualia-report` |
125
+ | FAIL | gap_cycles < limit | Inline invoke `/qualia-plan {N} --gaps --auto` |
126
+ | FAIL | gap_cycles >= limit | **HALT** — show escalation message, require human intervention |
127
+
128
+ Detect "last phase of current milestone":
129
+ ```bash
130
+ # tracking.json.milestone gives current milestone number
131
+ # .planning/JOURNEY.md describes phases per milestone
132
+ # If the just-verified phase's number == total phases of current milestone → last phase
133
+ ```
134
+
135
+ Detect "last phase of Handoff milestone":
136
+ ```bash
137
+ # If the current milestone's name in JOURNEY.md is "Handoff" AND this was its last phase
138
+ ```
139
+
140
+ **Halt case (gap cycle limit)** — stop auto-chain and show:
141
+
142
+ ```bash
143
+ node ~/.claude/bin/qualia-ui.js fail "Phase {N} has failed verification {cycles} times — gap limit reached"
144
+ node ~/.claude/bin/qualia-ui.js warn "Human intervention required. Options:"
145
+ echo " 1. Re-plan this phase from scratch: /qualia-plan {N}"
146
+ echo " 2. Adjust the roadmap — phase scope may be wrong"
147
+ echo " 3. Escalate to Fawzi (for EMPLOYEE role)"
148
+ ```
149
+
150
+ **Default (guided mode)** behavior is unchanged — show the next command and stop:
151
+
152
+ ```bash
153
+ # PASS
154
+ node ~/.claude/bin/qualia-ui.js end "PHASE {N} VERIFIED" "/qualia-plan {N+1}"
155
+ # (or "/qualia-milestone" if last phase of milestone, "/qualia-polish" if overall last phase)
156
+
157
+ # FAIL
158
+ node ~/.claude/bin/qualia-ui.js end "PHASE {N} GAPS FOUND" "/qualia-plan {N} --gaps"
159
+ ```
160
+
107
161
  ### 5. Passive Knowledge Capture (on FAIL)
108
162
 
109
163
  When verification fails, after showing the gaps, ask the user:
@@ -37,6 +37,22 @@
37
37
  -webkit-font-smoothing: antialiased;
38
38
  }
39
39
 
40
+ /* ─── Version Pill (top-right) ───────────── */
41
+ .version-pill {
42
+ position: fixed;
43
+ top: 1rem;
44
+ right: 1rem;
45
+ z-index: 10;
46
+ padding: 0.3rem 0.75rem;
47
+ background: var(--bg-card);
48
+ border: 1px solid var(--border);
49
+ border-radius: 999px;
50
+ font-family: var(--font-mono);
51
+ font-size: 0.7rem;
52
+ color: var(--teal);
53
+ letter-spacing: 0.04em;
54
+ }
55
+
40
56
  /* ─── Header ─────────────────────────────── */
41
57
  .header {
42
58
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 5vw, 4rem);
@@ -134,6 +150,12 @@
134
150
  color: var(--text-subtle);
135
151
  margin-bottom: 0.75rem;
136
152
  }
153
+ .cmd-group-note {
154
+ font-size: 0.78rem;
155
+ color: var(--text-subtle);
156
+ margin: -0.5rem 0 0.75rem 0;
157
+ font-style: italic;
158
+ }
137
159
  .cmd {
138
160
  display: flex;
139
161
  gap: 1rem;
@@ -150,7 +172,7 @@
150
172
  font-size: 0.85rem;
151
173
  color: var(--teal);
152
174
  white-space: nowrap;
153
- min-width: 160px;
175
+ min-width: 200px;
154
176
  }
155
177
  .cmd-desc {
156
178
  font-size: 0.85rem;
@@ -244,6 +266,14 @@
244
266
  color: var(--text-subtle);
245
267
  }
246
268
  .footer strong { color: var(--teal); font-weight: 500; }
269
+ .footer-version {
270
+ display: block;
271
+ margin-top: 0.5rem;
272
+ font-family: var(--font-mono);
273
+ font-size: 0.7rem;
274
+ color: var(--text-subtle);
275
+ letter-spacing: 0.04em;
276
+ }
247
277
 
248
278
  /* ─── Responsive ─────────────────────────── */
249
279
  @media (max-width: 640px) {
@@ -251,6 +281,7 @@
251
281
  .cmd-name { min-width: unset; }
252
282
  .road { flex-direction: column; align-items: flex-start; }
253
283
  .road-arrow { display: none; }
284
+ .version-pill { top: 0.5rem; right: 0.5rem; font-size: 0.65rem; }
254
285
  }
255
286
 
256
287
  @media (prefers-reduced-motion: reduce) {
@@ -260,11 +291,13 @@
260
291
  </head>
261
292
  <body>
262
293
 
294
+ <div class="version-pill">v3.6.0</div>
295
+
263
296
  <div class="header">
264
297
  <div class="header-content">
265
298
  <h1><span>Qualia</span> Framework</h1>
266
299
  <p>Plan, build, verify, ship. The AI-powered workflow for Qualia Solutions.</p>
267
- <div class="version">v{{VERSION}}</div>
300
+ <div class="version">v3.6.0 &middot; 26 skills</div>
268
301
  </div>
269
302
  </div>
270
303
 
@@ -293,73 +326,106 @@
293
326
  </div>
294
327
  </section>
295
328
 
296
- <!-- Commands -->
329
+ <!-- Skills -->
297
330
  <section>
298
- <h2>Commands</h2>
331
+ <h2>Skills (26)</h2>
299
332
 
333
+ <!-- Road (core flow) -->
300
334
  <div class="cmd-group">
301
- <h3>Navigation</h3>
335
+ <h3>Road &mdash; Core Flow</h3>
336
+ <p class="cmd-group-note">The seven steps every project walks through.</p>
337
+ <div class="commands">
338
+ <div class="cmd"><span class="cmd-name">/qualia-new</span><span class="cmd-desc">Set up a new project from scratch &mdash; deep questioning, parallel research, REQUIREMENTS.md, ROADMAP.md, approval gate. Use when starting any new client project.</span></div>
339
+ <div class="cmd"><span class="cmd-name">/qualia-plan</span><span class="cmd-desc">Plan the current phase &mdash; spawns planner, validates with plan-checker in a revision loop (max 3), optionally runs discuss/research first. Use when ready to plan a phase.</span></div>
340
+ <div class="cmd"><span class="cmd-name">/qualia-build</span><span class="cmd-desc">Execute the current phase &mdash; spawns builder subagents per task with wave-based parallelization. Fresh context per task.</span></div>
341
+ <div class="cmd"><span class="cmd-name">/qualia-verify</span><span class="cmd-desc">Goal-backward verification &mdash; checks if the phase ACTUALLY works, not just if tasks completed. Spawns verifier agent.</span></div>
342
+ <div class="cmd"><span class="cmd-name">/qualia-polish</span><span class="cmd-desc">Design and UX pass &mdash; anti-AI-slop, genuine craft, responsive, accessible. Run after all phases are verified.</span></div>
343
+ <div class="cmd"><span class="cmd-name">/qualia-ship</span><span class="cmd-desc">Deploy to production &mdash; quality gates, commit, push, deploy, verify. Use when ready to go live.</span></div>
344
+ <div class="cmd"><span class="cmd-name">/qualia-handoff</span><span class="cmd-desc">Client delivery &mdash; credentials, handover doc, final update. Use after shipping.</span></div>
345
+ </div>
346
+ </div>
347
+
348
+ <!-- Phase Depth (optional) -->
349
+ <div class="cmd-group">
350
+ <h3>Phase Depth &mdash; Optional</h3>
351
+ <p class="cmd-group-note">Used before / around /qualia-plan when a phase needs deeper context.</p>
302
352
  <div class="commands">
303
- <div class="cmd"><span class="cmd-name">/qualia</span><span class="cmd-desc">What should I do next? Reads project state, tells you the exact command.</span></div>
304
- <div class="cmd"><span class="cmd-name">/qualia-idk</span><span class="cmd-desc">Same as /qualia. For when you're stuck.</span></div>
305
- <div class="cmd"><span class="cmd-name">/qualia-resume</span><span class="cmd-desc">Pick up where you left off from a previous session.</span></div>
306
- <div class="cmd"><span class="cmd-name">/qualia-pause</span><span class="cmd-desc">Save progress. Creates .continue-here.md for next session.</span></div>
353
+ <div class="cmd"><span class="cmd-name">/qualia-discuss</span><span class="cmd-desc">Capture phase decisions, trade-offs, and constraints BEFORE planning. Use for complex phases with regulatory, compliance, or architectural stakes. Creates .planning/phase-{N}-context.md that planner honors as locked input.</span></div>
354
+ <div class="cmd"><span class="cmd-name">/qualia-research</span><span class="cmd-desc">Deep-research a niche domain or library BEFORE planning a specific phase. Spawns the researcher agent with Context7/WebFetch access. Writes to .planning/phase-{N}-research.md.</span></div>
355
+ <div class="cmd"><span class="cmd-name">/qualia-map</span><span class="cmd-desc">Map an existing codebase to infer architecture, stack, conventions, and what's already built. For brownfield projects &mdash; run BEFORE /qualia-new so Validated requirements get inferred from existing code.</span></div>
356
+ <div class="cmd"><span class="cmd-name">/qualia-milestone</span><span class="cmd-desc">Close out a completed milestone and prep the next one. Archives the current milestone's artifacts, updates REQUIREMENTS.md to mark v1 requirements Complete, and creates the next milestone roadmap.</span></div>
307
357
  </div>
308
358
  </div>
309
359
 
360
+ <!-- Quality -->
310
361
  <div class="cmd-group">
311
- <h3>Project Setup</h3>
362
+ <h3>Quality</h3>
363
+ <p class="cmd-group-note">Diagnose, audit, optimize, polish, test.</p>
312
364
  <div class="commands">
313
- <div class="cmd"><span class="cmd-name">/qualia-new</span><span class="cmd-desc">Interactive wizard. Asks about client, scope, design, stack. Creates everything.</span></div>
365
+ <div class="cmd"><span class="cmd-name">/qualia-debug</span><span class="cmd-desc">Structured debugging &mdash; symptom gathering, diagnosis confirmation, root cause analysis. Trigger on 'debug', 'find bug', 'fix error', 'something is broken'.</span></div>
366
+ <div class="cmd"><span class="cmd-name">/qualia-review</span><span class="cmd-desc">Production audit with scored diagnostics. Runs real commands, scores findings by severity. Trigger on 'review', 'audit', 'code review', 'security check'.</span></div>
367
+ <div class="cmd"><span class="cmd-name">/qualia-optimize</span><span class="cmd-desc">Deep optimization pass &mdash; reads .planning/ AND codebase to find performance, design, UI, backend, and frontend issues. Spawns parallel specialist agents. Supports --perf, --ui, --backend, --alignment, --fix flags.</span></div>
368
+ <div class="cmd"><span class="cmd-name">/qualia-polish</span><span class="cmd-desc">Design and UX pass &mdash; anti-AI-slop, genuine craft, responsive, accessible. Run after all phases are verified.</span></div>
369
+ <div class="cmd"><span class="cmd-name">/qualia-test</span><span class="cmd-desc">Generate or run tests for client projects. Trigger on 'write tests', 'add tests', 'test this', 'test coverage'.</span></div>
314
370
  </div>
315
371
  </div>
316
372
 
373
+ <!-- Quick Paths -->
317
374
  <div class="cmd-group">
318
- <h3>Build Loop</h3>
375
+ <h3>Quick Paths</h3>
376
+ <p class="cmd-group-note">Lightweight alternatives when the full road is overkill.</p>
319
377
  <div class="commands">
320
- <div class="cmd"><span class="cmd-name">/qualia-plan</span><span class="cmd-desc">Plan the current phase. AI generates tasks with success criteria.</span></div>
321
- <div class="cmd"><span class="cmd-name">/qualia-build</span><span class="cmd-desc">Build it. Fresh AI agent per task, parallel waves.</span></div>
322
- <div class="cmd"><span class="cmd-name">/qualia-verify</span><span class="cmd-desc">Verify it actually works. Greps code, scores on 4 dimensions.</span></div>
378
+ <div class="cmd"><span class="cmd-name">/qualia-quick</span><span class="cmd-desc">Fast path for small tasks &mdash; bug fixes, tweaks, hot fixes. Skips full phase planning.</span></div>
379
+ <div class="cmd"><span class="cmd-name">/qualia-task</span><span class="cmd-desc">Build a single task &mdash; more structured than /qualia-quick, lighter than /qualia-build. Spawns a fresh builder agent for one focused task.</span></div>
380
+ <div class="cmd"><span class="cmd-name">/qualia-design</span><span class="cmd-desc">One-shot design transformation &mdash; critiques, fixes, polishes, hardens, makes responsive. No reports, no choices, just makes it professional.</span></div>
323
381
  </div>
324
382
  </div>
325
383
 
384
+ <!-- Knowledge -->
326
385
  <div class="cmd-group">
327
- <h3>Quick Work</h3>
386
+ <h3>Knowledge</h3>
387
+ <p class="cmd-group-note">Persist learnings and log work.</p>
328
388
  <div class="commands">
329
- <div class="cmd"><span class="cmd-name">/qualia-quick</span><span class="cmd-desc">Skip planning. For bug fixes, tweaks, hot fixes under 1 hour.</span></div>
330
- <div class="cmd"><span class="cmd-name">/qualia-task</span><span class="cmd-desc">One focused task. More structured than quick, lighter than build.</span></div>
389
+ <div class="cmd"><span class="cmd-name">/qualia-learn</span><span class="cmd-desc">Save a learning, pattern, fix, or client preference to the knowledge base. Persists across projects and sessions.</span></div>
390
+ <div class="cmd"><span class="cmd-name">/qualia-report</span><span class="cmd-desc">Generate session report and commit to repo. Mandatory before clock-out.</span></div>
331
391
  </div>
332
392
  </div>
333
393
 
394
+ <!-- Session -->
334
395
  <div class="cmd-group">
335
- <h3>Design & Quality</h3>
396
+ <h3>Session</h3>
397
+ <p class="cmd-group-note">Hand off and resume context cleanly.</p>
336
398
  <div class="commands">
337
- <div class="cmd"><span class="cmd-name">/qualia-design</span><span class="cmd-desc">One-shot design fix. Reads DESIGN.md, kills AI slop, makes it professional.</span></div>
338
- <div class="cmd"><span class="cmd-name">/qualia-polish</span><span class="cmd-desc">Full design pass. Typography, color, states, motion, a11y, responsive, hardening.</span></div>
339
- <div class="cmd"><span class="cmd-name">/qualia-review</span><span class="cmd-desc">Production audit. Security, performance, reliability. Scored diagnostics.</span></div>
399
+ <div class="cmd"><span class="cmd-name">/qualia-pause</span><span class="cmd-desc">Save session context for seamless handoff. Creates .continue-here.md so the next session picks up exactly where you left off.</span></div>
400
+ <div class="cmd"><span class="cmd-name">/qualia-resume</span><span class="cmd-desc">Restore context from a previous session. Reads .continue-here.md or STATE.md, summarizes where you left off, routes to next action.</span></div>
340
401
  </div>
341
402
  </div>
342
403
 
404
+ <!-- Navigation -->
343
405
  <div class="cmd-group">
344
- <h3>Ship & Deliver</h3>
406
+ <h3>Navigation</h3>
407
+ <p class="cmd-group-note">When you don't know what to do next.</p>
345
408
  <div class="commands">
346
- <div class="cmd"><span class="cmd-name">/qualia-ship</span><span class="cmd-desc">Quality gates, commit, push, deploy to Vercel, post-deploy verification.</span></div>
347
- <div class="cmd"><span class="cmd-name">/qualia-handoff</span><span class="cmd-desc">Client delivery. Credentials, docs, handover package.</span></div>
348
- <div class="cmd"><span class="cmd-name">/qualia-report</span><span class="cmd-desc">Log your session. Mandatory before clock-out. Uploads to ERP.</span></div>
409
+ <div class="cmd"><span class="cmd-name">/qualia</span><span class="cmd-desc">Smart router &mdash; reads project state, classifies your situation, tells you the exact next command. Use whenever you're unsure about your next step.</span></div>
410
+ <div class="cmd"><span class="cmd-name">/qualia-idk</span><span class="cmd-desc">Alias for /qualia. The smart router handles all 'idk', 'what now', 'I'm stuck' situations.</span></div>
411
+ <div class="cmd"><span class="cmd-name">/qualia-help</span><span class="cmd-desc">Open the Qualia Framework reference guide in the browser. A beautiful themed HTML page with all commands, rules, services, and the road.</span></div>
349
412
  </div>
350
413
  </div>
351
414
 
415
+ <!-- Meta -->
352
416
  <div class="cmd-group">
353
- <h3>Debugging & Learning</h3>
417
+ <h3>Meta</h3>
418
+ <p class="cmd-group-note">Extend the framework itself.</p>
354
419
  <div class="commands">
355
- <div class="cmd"><span class="cmd-name">/qualia-debug</span><span class="cmd-desc">Structured debugging. Symptom &rarr; diagnosis &rarr; root cause &rarr; fix.</span></div>
356
- <div class="cmd"><span class="cmd-name">/qualia-learn</span><span class="cmd-desc">Save a pattern, fix, or client preference to the knowledge base.</span></div>
357
- <div class="cmd"><span class="cmd-name">/qualia-test</span><span class="cmd-desc">Generate or run tests. Auto-detects framework.</span></div>
420
+ <div class="cmd"><span class="cmd-name">/qualia-skill-new</span><span class="cmd-desc">Author a new Qualia skill or agent. Generates the SKILL.md, registers it in the right location, and optionally ships to the framework repo.</span></div>
358
421
  </div>
359
422
  </div>
423
+ </section>
360
424
 
425
+ <!-- CLI -->
426
+ <section>
427
+ <h2>CLI (Terminal)</h2>
361
428
  <div class="cmd-group">
362
- <h3>CLI (Terminal)</h3>
363
429
  <div class="commands">
364
430
  <div class="cmd"><span class="cmd-name">qualia-framework install</span><span class="cmd-desc">Install or reinstall the framework.</span></div>
365
431
  <div class="cmd"><span class="cmd-name">qualia-framework update</span><span class="cmd-desc">Update to the latest version.</span></div>
@@ -470,6 +536,7 @@
470
536
  <div class="footer">
471
537
  <strong>Welcome to the future with Qualia.</strong><br>
472
538
  Qualia Solutions &mdash; Nicosia, Cyprus
539
+ <span class="footer-version">qualia-framework v3.6.0 &middot; 26 skills</span>
473
540
  </div>
474
541
 
475
542
  </body>
@@ -0,0 +1,113 @@
1
+ ---
2
+ project: "{Project Name}"
3
+ total_milestones: {N}
4
+ current_milestone: 1
5
+ created: {date}
6
+ ---
7
+
8
+ # {Project Name} — Journey
9
+
10
+ The full arc from kickoff to client handoff. Every milestone. Every exit criterion.
11
+ This file is the **North Star** — all planning downstream must stay architecturally
12
+ consistent with it.
13
+
14
+ ## Mission
15
+
16
+ {one-paragraph description of what this project delivers and for whom}
17
+
18
+ ## The Path ({N} milestones to handoff)
19
+
20
+ ```
21
+ M1 ─── M2 ─── M3 ─── ... ─── M{N} (Handoff)
22
+
23
+ └── [CURRENT]
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Milestone 1 · {Name} [CURRENT]
29
+
30
+ **Why now:** {one-sentence reason this is the first release — what foundation it lays}
31
+
32
+ **Exit criteria** (what "shipped" means for M1):
33
+ - {observable outcome 1}
34
+ - {observable outcome 2}
35
+ - {observable outcome 3}
36
+
37
+ **Phases:**
38
+ 1. **{Phase Name}** — {one-line goal}
39
+ 2. **{Phase Name}** — {one-line goal}
40
+ 3. **{Phase Name}** — {one-line goal}
41
+
42
+ **Requirements covered:** {REQ-IDs — e.g. AUTH-01, AUTH-02, CORE-01}
43
+
44
+ **Research flags:** {any phases that may need deeper research during planning}
45
+
46
+ ---
47
+
48
+ ## Milestone 2 · {Name}
49
+
50
+ **Why now:** {plain-language reason this follows M1}
51
+
52
+ **Exit criteria:**
53
+ - {observable outcome 1}
54
+ - {observable outcome 2}
55
+
56
+ **Phases:**
57
+ 1. **{Phase Name}** — {one-line goal}
58
+ 2. **{Phase Name}** — {one-line goal}
59
+ 3. **{Phase Name}** — {one-line goal}
60
+
61
+ **Requirements covered:** {REQ-IDs}
62
+
63
+ ---
64
+
65
+ ## Milestone 3 · {Name}
66
+
67
+ **Why now:** {reason}
68
+
69
+ **Exit criteria:**
70
+ - {outcome}
71
+ - {outcome}
72
+
73
+ **Phases:**
74
+ 1. **{Phase Name}** — {one-line goal}
75
+ 2. **{Phase Name}** — {one-line goal}
76
+
77
+ **Requirements covered:** {REQ-IDs}
78
+
79
+ ---
80
+
81
+ ## Milestone {N} · Handoff [FINAL]
82
+
83
+ **Why now:** Production-ready for real users and client takeover.
84
+
85
+ **Exit criteria:**
86
+ - Deployed on production domain with HTTP 200 + auth flow verified
87
+ - Client has credentials, runbook, and recorded walkthrough
88
+ - `.planning/archive/` contains every milestone's verification reports
89
+ - ERP `lifetime.milestones_completed` reflects this milestone
90
+
91
+ **Phases (standard for every project):**
92
+ 1. **Polish** — design pass, responsive, accessibility, empty/error states
93
+ 2. **Content + SEO** — real copy, metadata, sitemap, robots, analytics
94
+ 3. **Final QA** — full-flow test, cross-browser, edge cases, `/qualia-review`
95
+ 4. **Handoff** — credentials doc, client walkthrough, domain transfer, support clause
96
+
97
+ **Requirements covered:** {REQ-IDs — typically ops/quality/handoff categories}
98
+
99
+ ---
100
+
101
+ ## Rules for This Journey
102
+
103
+ 1. **Hard ceiling: 5 milestones.** If the project needs more, defer to a v2 release after handoff.
104
+ 2. **Hard floor: 2 milestones.** Anything smaller should use `/qualia-new --quick` instead.
105
+ 3. **The final milestone is always Handoff.** Same 4 phases every project. Never negotiable.
106
+ 4. **Milestones ≥ 2 phases OR are a shipped release gate.** A 1-phase milestone is a phase, not a milestone.
107
+ 5. **Numbering is contiguous.** No skipped milestone numbers.
108
+ 6. **Progressive detail is OK.** M1 is fully detailed (ready for `/qualia-plan`). M2..M{N-1} have phase names + one-line goals. Full phase detail gets written by roadmapper when the milestone opens.
109
+ 7. **Exit criteria are observable.** "User can do X" not "Feature Y works."
110
+
111
+ ---
112
+
113
+ *Last updated: {date}*
package/templates/plan.md CHANGED
@@ -7,36 +7,81 @@ waves: {count}
7
7
 
8
8
  # Phase {N}: {Name}
9
9
 
10
- Goal: {what must be true when done}
10
+ **Goal:** {what must be TRUE when this phase is done}
11
+
12
+ **Why this phase:** {one sentence — what this unlocks for the user or the product}
13
+
14
+ ---
11
15
 
12
16
  ## Task 1 — {title}
17
+
13
18
  **Wave:** 1
14
- **Files:** {files to create or modify}
15
- **Action:** {exactly what to build}
19
+ **Persona:** {optional: security | architect | ux | frontend | backend | performance | none}
20
+ **Files:** {specific absolute paths — e.g. `src/lib/auth.ts`, `src/app/login/page.tsx`}
21
+ **Depends on:** {task numbers (e.g. "Task 0"), or "none"}
22
+
23
+ **Why:**
24
+ {one-sentence rationale — what problem this solves, what would break without it. Not "implement auth" but "Session persistence is the #1 abandonment trigger in onboarding — verification emails are wasted without it."}
25
+
26
+ **Acceptance Criteria:**
27
+ - {observable user-facing behavior 1}
28
+ - {observable user-facing behavior 2}
29
+ - {observable user-facing behavior 3}
30
+
31
+ **Action:**
32
+ {concrete steps the builder follows — specific function names, imports, patterns. Not "add auth" but "Add `signInWithPassword()` call in `handleSubmit`, validate email with Zod schema, redirect to `/dashboard` on success."}
33
+
34
+ **Validation:** (builder self-check before commit)
35
+ - `{exact command 1}` → expected output
36
+ - `{exact command 2}` → expected output
37
+
16
38
  **Context:** Read @{file references}
17
- **Done when:** {observable, testable criterion}
39
+
40
+ ---
18
41
 
19
42
  ## Task 2 — {title}
43
+
20
44
  **Wave:** 1
45
+ **Persona:** {optional}
21
46
  **Files:** {files}
22
- **Action:** {what to build}
23
- **Done when:** {criterion}
47
+ **Depends on:** {none | Task N}
48
+
49
+ **Why:**
50
+ {one-sentence rationale}
51
+
52
+ **Acceptance Criteria:**
53
+ - {user-facing behavior}
54
+
55
+ **Action:**
56
+ {steps}
57
+
58
+ **Validation:**
59
+ - `{command}` → expected
60
+
61
+ **Context:** Read @{files}
62
+
63
+ ---
24
64
 
25
65
  ## Success Criteria
66
+
67
+ Phase-level truths — what must be observable when this phase is done.
68
+
26
69
  - [ ] {truth 1 — what the user can do}
27
70
  - [ ] {truth 2}
28
71
  - [ ] {truth 3}
29
72
 
30
73
  ## Verification Contract
31
74
 
75
+ Machine-executable checks the verifier runs verbatim. One per task minimum.
76
+
32
77
  ### Contract for Task 1 — {title}
33
78
  **Check type:** {file-exists | grep-match | command-exit | behavioral}
34
- **Command:** `{exact command the verifier will run}`
35
- **Expected:** {what the output should be}
36
- **Fail if:** {what constitutes failure}
79
+ **Command:** `{exact command}`
80
+ **Expected:** {output}
81
+ **Fail if:** {failure condition}
37
82
 
38
83
  ### Contract for Task 2 — {title}
39
- **Check type:** {file-exists | grep-match | command-exit | behavioral}
84
+ **Check type:** {type}
40
85
  **Command:** `{exact command}`
41
- **Expected:** {expected output}
86
+ **Expected:** {output}
42
87
  **Fail if:** {failure condition}