qualia-framework 6.2.9 → 6.3.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 (93) hide show
  1. package/AGENTS.md +1 -0
  2. package/CLAUDE.md +1 -0
  3. package/README.md +26 -30
  4. package/agents/builder.md +7 -7
  5. package/agents/planner.md +39 -3
  6. package/agents/research-synthesizer.md +1 -1
  7. package/agents/researcher.md +3 -3
  8. package/agents/roadmapper.md +7 -7
  9. package/agents/verifier.md +18 -6
  10. package/agents/visual-evaluator.md +8 -7
  11. package/bin/cli.js +160 -16
  12. package/bin/command-surface.js +71 -0
  13. package/bin/contract-runner.js +219 -0
  14. package/bin/harness-eval.js +296 -0
  15. package/bin/host-adapters.js +66 -0
  16. package/bin/install.js +116 -172
  17. package/bin/knowledge-flush.js +21 -10
  18. package/bin/knowledge.js +1 -1
  19. package/bin/plan-contract.js +99 -2
  20. package/bin/planning-hygiene.js +262 -0
  21. package/bin/project-snapshot.js +20 -0
  22. package/bin/report-payload.js +18 -0
  23. package/bin/runtime-manifest.js +35 -0
  24. package/bin/state-ledger.js +184 -0
  25. package/bin/state.js +330 -20
  26. package/bin/trust-score.js +268 -0
  27. package/bin/work-packet.js +228 -0
  28. package/docs/erp-contract.md +81 -1
  29. package/docs/onboarding.html +4 -14
  30. package/guide.md +16 -16
  31. package/hooks/fawzi-approval-guard.js +143 -0
  32. package/hooks/pre-deploy-gate.js +74 -1
  33. package/hooks/session-start.js +29 -1
  34. package/package.json +1 -1
  35. package/qualia-design/design-rubric.md +17 -5
  36. package/qualia-design/frontend.md +6 -2
  37. package/qualia-design/graphics.md +47 -0
  38. package/rules/codex-goal.md +1 -1
  39. package/rules/command-output.md +35 -0
  40. package/rules/one-opinion.md +2 -2
  41. package/rules/speed.md +0 -1
  42. package/skills/qualia/SKILL.md +12 -12
  43. package/skills/qualia-build/SKILL.md +20 -14
  44. package/skills/qualia-discuss/SKILL.md +10 -10
  45. package/skills/qualia-doctor/SKILL.md +140 -0
  46. package/skills/qualia-feature/SKILL.md +24 -22
  47. package/skills/qualia-fix/SKILL.md +216 -0
  48. package/skills/qualia-handoff/SKILL.md +9 -9
  49. package/skills/qualia-learn/SKILL.md +11 -11
  50. package/skills/qualia-map/SKILL.md +2 -2
  51. package/skills/qualia-milestone/SKILL.md +15 -15
  52. package/skills/qualia-new/REFERENCE.md +9 -9
  53. package/skills/qualia-new/SKILL.md +14 -14
  54. package/skills/qualia-optimize/REFERENCE.md +1 -1
  55. package/skills/qualia-optimize/SKILL.md +23 -16
  56. package/skills/qualia-plan/SKILL.md +23 -13
  57. package/skills/qualia-polish/REFERENCE.md +15 -15
  58. package/skills/qualia-polish/SKILL.md +81 -21
  59. package/skills/qualia-polish/scripts/loop.mjs +3 -3
  60. package/skills/qualia-polish/scripts/score.mjs +9 -3
  61. package/skills/{qualia-vibe/scripts/extract.mjs → qualia-polish/scripts/vibe-extract.mjs} +5 -5
  62. package/skills/{qualia-vibe/scripts/tokens.mjs → qualia-polish/scripts/vibe-tokens.mjs} +6 -6
  63. package/skills/qualia-postmortem/SKILL.md +9 -9
  64. package/skills/qualia-report/SKILL.md +23 -23
  65. package/skills/qualia-research/SKILL.md +5 -5
  66. package/skills/qualia-review/SKILL.md +28 -12
  67. package/skills/qualia-road/SKILL.md +30 -22
  68. package/skills/qualia-ship/SKILL.md +31 -24
  69. package/skills/qualia-test/SKILL.md +5 -5
  70. package/skills/qualia-verify/SKILL.md +45 -23
  71. package/skills/zoho-workflow/SKILL.md +1 -1
  72. package/templates/help.html +11 -20
  73. package/tests/bin.test.sh +178 -76
  74. package/tests/hooks.test.sh +81 -1
  75. package/tests/install-smoke.test.sh +35 -5
  76. package/tests/lib.test.sh +432 -0
  77. package/tests/published-install-smoke.test.sh +4 -3
  78. package/tests/refs.test.sh +9 -4
  79. package/tests/runner.js +32 -28
  80. package/tests/skills.test.sh +4 -4
  81. package/tests/state.test.sh +133 -3
  82. package/skills/qualia-debug/SKILL.md +0 -185
  83. package/skills/qualia-flush/SKILL.md +0 -198
  84. package/skills/qualia-help/SKILL.md +0 -74
  85. package/skills/qualia-hook-gen/SKILL.md +0 -206
  86. package/skills/qualia-idk/SKILL.md +0 -166
  87. package/skills/qualia-issues/SKILL.md +0 -151
  88. package/skills/qualia-pause/SKILL.md +0 -68
  89. package/skills/qualia-resume/SKILL.md +0 -52
  90. package/skills/qualia-skill-new/SKILL.md +0 -173
  91. package/skills/qualia-triage/SKILL.md +0 -152
  92. package/skills/qualia-vibe/SKILL.md +0 -226
  93. package/skills/qualia-zoom/SKILL.md +0 -51
@@ -0,0 +1,216 @@
1
+ ---
2
+ name: qualia-fix
3
+ description: "Practical repair lane for broken existing behavior. Combines root-cause investigation with /qualia-feature execution discipline. Use when the user says 'fix this', 'bug', 'broken', 'error', 'failing test', 'regression', 'hotfix', 'not working', 'layout broken', 'slow page', or 'config is wrong'."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
12
+ argument-hint: "[--quick|--frontend|--perf|--test|--no-commit] <symptom>"
13
+ ---
14
+
15
+ # /qualia-fix - Repair Broken Existing Behavior
16
+
17
+ Fix is the practical lane for "this used to work, or should work, and now it does not." It combines root-cause evidence gathering with the small-work execution path of `/qualia-feature`.
18
+
19
+ ## Usage
20
+
21
+ - `/qualia-fix {symptom}` - diagnose and repair a named problem
22
+ - `/qualia-fix --quick {symptom}` - micro-fix, max 1 file, direct edit
23
+ - `/qualia-fix --frontend {symptom}` - bias diagnostics toward layout, CSS, hydration, responsive, and visual bugs
24
+ - `/qualia-fix --perf {symptom}` - bias diagnostics toward slow pages, wasteful renders, bundles, queries, and sequential awaits
25
+ - `/qualia-fix --test {failing command}` - start from a failing test/build command
26
+ - `/qualia-fix --no-commit {symptom}` - patch and verify, but leave changes uncommitted
27
+
28
+ ## When To Use
29
+
30
+ - A failing test, build, typecheck, lint, deploy, or runtime path
31
+ - A broken existing UI, route, form, API, config, or integration
32
+ - A regression after recent work
33
+ - A small bug report with enough detail to reproduce or inspect
34
+ - A hotfix where the expected behavior is already known
35
+
36
+ ## When Not To Use
37
+
38
+ - Net-new capability -> `/qualia-feature`
39
+ - Phase-sized work or 5+ likely files -> `/qualia-plan`
40
+ - Read-only audit -> `/qualia-review`
41
+ - No concrete symptom and no failing command -> `/qualia-review`
42
+ - Visual craft/design quality with no functional bug -> `/qualia-polish`
43
+ - Whole-site aesthetic pivot -> `/qualia-polish --vibe`
44
+
45
+ ## Process
46
+
47
+ ```bash
48
+ node ${QUALIA_BIN}/qualia-ui.js banner fix
49
+ ```
50
+
51
+ ### 1. Classify The Request
52
+
53
+ Parse `$ARGUMENTS` into:
54
+
55
+ - symptom
56
+ - mode: quick | frontend | perf | test | general
57
+ - expected behavior
58
+ - observed behavior
59
+ - named files/routes/tests if provided
60
+
61
+ If the request is actually a new feature, stop and route:
62
+
63
+ ```bash
64
+ node ${QUALIA_BIN}/qualia-ui.js end "ROUTED" "/qualia-feature"
65
+ ```
66
+
67
+ If the request is phase-sized, stop and route:
68
+
69
+ ```bash
70
+ node ${QUALIA_BIN}/qualia-ui.js end "ROUTED" "/qualia-plan"
71
+ ```
72
+
73
+ ### 2. Build The Feedback Loop
74
+
75
+ Use the cheapest check that can prove the bug is real and later prove it is fixed.
76
+
77
+ Prefer, in order:
78
+
79
+ 1. User-provided failing command
80
+ 2. Targeted test
81
+ 3. Typecheck or lint error
82
+ 4. Reproduction grep or route/component inspection
83
+ 5. Recent diff inspection
84
+
85
+ Useful starting commands:
86
+
87
+ ```bash
88
+ git status --short
89
+ git diff --stat
90
+ npm test -- --runInBand 2>/dev/null || npm test 2>/dev/null || true
91
+ npx tsc --noEmit 2>&1 | head -40
92
+ ```
93
+
94
+ For `--test`, run the exact command first and preserve the failing output.
95
+
96
+ ### 3. Find Root Cause
97
+
98
+ Use a hard inspection budget of 12 Read/Grep/Bash calls before returning insufficient evidence.
99
+
100
+ Root cause must include:
101
+
102
+ - `file:line`
103
+ - the specific bad assumption or broken contract
104
+ - why the symptom follows from it
105
+
106
+ No root cause, no patch. If evidence is insufficient, write the report and stop.
107
+
108
+ ### 4. Patch Minimally
109
+
110
+ Patch rules:
111
+
112
+ - Touch only files required by the root cause.
113
+ - Default max: 3 files.
114
+ - `--quick` max: 1 file.
115
+ - If more than 3 files are required, stop and route to `/qualia-plan` or ask for permission to widen.
116
+ - Do not include cleanup, refactors, formatting churn, or adjacent improvements.
117
+ - Preserve unrelated user changes.
118
+
119
+ ### 5. Verify
120
+
121
+ Re-run the feedback loop from Step 2. Then run the smallest broad safety check that matches the stack.
122
+
123
+ Common verification:
124
+
125
+ ```bash
126
+ npx tsc --noEmit
127
+ npm test -- --runInBand 2>/dev/null || npm test 2>/dev/null || true
128
+ ```
129
+
130
+ If verification fails, do not commit. Either repair the verification failure if it is the same root cause, or write the report with the remaining failure.
131
+
132
+ ### 6. Write FIX Report
133
+
134
+ Create the report directory and write `.planning/reports/fix/FIX-{YYYY-MM-DD-HHMM}.md`:
135
+
136
+ ```bash
137
+ mkdir -p .planning/reports/fix
138
+ ```
139
+
140
+ ```markdown
141
+ # Fix Report - {YYYY-MM-DD HH:MM}
142
+
143
+ **Symptom:** {user symptom}
144
+ **Mode:** general | quick | frontend | perf | test
145
+ **Outcome:** fixed | insufficient-evidence | partial
146
+
147
+ ## Feedback Loop
148
+ - Initial failing check: `{command or inspection}`
149
+ - Final passing check: `{command or inspection}`
150
+
151
+ ## Root Cause
152
+ `{file}:{line}` - {one sentence}
153
+
154
+ ## Patch
155
+ - Files changed: {list}
156
+ - Change summary: {brief summary}
157
+
158
+ ## Verification
159
+ - `{command}` - PASS|FAIL
160
+ - `{command}` - PASS|FAIL
161
+
162
+ ## Remaining Notes
163
+ - {adjacent issue not fixed, or "None"}
164
+ ```
165
+
166
+ ### 7. Commit
167
+
168
+ Unless `--no-commit` was passed:
169
+
170
+ ```bash
171
+ git add {specific changed files} .planning/reports/fix/FIX-{timestamp}.md
172
+ git commit -m "fix: {short symptom/root-cause summary}"
173
+ ```
174
+
175
+ Record state:
176
+
177
+ ```bash
178
+ node ${QUALIA_BIN}/state.js transition --to note --notes "{short fix summary}" --tasks-done 1
179
+ ```
180
+
181
+ ### 8. Output
182
+
183
+ ```bash
184
+ node ${QUALIA_BIN}/qualia-ui.js divider
185
+ node ${QUALIA_BIN}/qualia-ui.js ok "Root cause: {file:line}"
186
+ node ${QUALIA_BIN}/qualia-ui.js ok "Files: {changed files}"
187
+ node ${QUALIA_BIN}/qualia-ui.js ok "Verification: {commands}"
188
+ node ${QUALIA_BIN}/qualia-ui.js end "FIXED" "{next command if any}"
189
+ ```
190
+
191
+ ## Insufficient Evidence Return
192
+
193
+ If no confident root cause after 12 inspection calls, write the same FIX report with:
194
+
195
+ ```markdown
196
+ **Outcome:** insufficient-evidence
197
+
198
+ ## Narrowed To
199
+ - Files examined: {list}
200
+ - Ruled out: {list}
201
+ - Remaining suspects: {list}
202
+
203
+ ## Recommended Next Diagnostic
204
+ - {specific command or reproduction step}
205
+ ```
206
+
207
+ Do not patch and do not commit speculative work.
208
+
209
+ ## Rules
210
+
211
+ 1. **Repair existing behavior only.** New work belongs in `/qualia-feature`.
212
+ 2. **Feedback loop first.** Know how the bug will be proven fixed before editing.
213
+ 3. **Root cause or stop.** No plausible patches.
214
+ 4. **Small patch.** Default max 3 files; quick max 1 file.
215
+ 5. **Report every run.** The FIX report becomes searchable repair memory.
216
+ 6. **Commit only after verification.** `--no-commit` is the only exception.
@@ -31,7 +31,7 @@ Every Handoff milestone must produce these. They are checked against in `REQUIRE
31
31
  ## Process
32
32
 
33
33
  ```bash
34
- node ~/.claude/bin/qualia-ui.js banner handoff
34
+ node ${QUALIA_BIN}/qualia-ui.js banner handoff
35
35
  ```
36
36
 
37
37
  ### 1. Verify Production URL (Deliverable 1)
@@ -39,13 +39,13 @@ node ~/.claude/bin/qualia-ui.js banner handoff
39
39
  ```bash
40
40
  URL=$(node -e "const t=JSON.parse(require('fs').readFileSync('.planning/tracking.json','utf8'));console.log(t.deployed_url||'')")
41
41
  if [ -z "$URL" ]; then
42
- node ~/.claude/bin/qualia-ui.js fail "No deployed_url — run /qualia-ship first"
42
+ node ${QUALIA_BIN}/qualia-ui.js fail "No deployed_url — run /qualia-ship first"
43
43
  exit 1
44
44
  fi
45
45
  HTTP=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
46
46
  LATENCY=$(curl -s -o /dev/null -w "%{time_total}" "$URL")
47
47
  AUTH=$(curl -s -o /dev/null -w "%{http_code}" "$URL/api/auth/callback" 2>/dev/null || echo "N/A")
48
- node ~/.claude/bin/qualia-ui.js ok "URL: $URL (HTTP $HTTP, ${LATENCY}s, auth:$AUTH)"
48
+ node ${QUALIA_BIN}/qualia-ui.js ok "URL: $URL (HTTP $HTTP, ${LATENCY}s, auth:$AUTH)"
49
49
  ```
50
50
 
51
51
  If HTTP is not 2xx or latency > 1.0s → halt; deliverable fails.
@@ -119,7 +119,7 @@ git push
119
119
  ### 5. Update State
120
120
 
121
121
  ```bash
122
- node ~/.claude/bin/state.js transition --to handed_off
122
+ node ${QUALIA_BIN}/state.js transition --to handed_off
123
123
  ```
124
124
 
125
125
  Do NOT manually edit STATE.md or tracking.json — state.js handles both.
@@ -131,11 +131,11 @@ Trigger the final `/qualia-report`. This uploads the closing state to the ERP wi
131
131
  In `--auto` mode, inline-invoke `/qualia-report` now. In guided mode, show the next step:
132
132
 
133
133
  ```bash
134
- node ~/.claude/bin/qualia-ui.js ok "Production URL verified"
135
- node ~/.claude/bin/qualia-ui.js ok "Documentation updated"
136
- node ~/.claude/bin/qualia-ui.js ok "Client assets archived + handoff doc written"
137
- node ~/.claude/bin/qualia-ui.js ok "Ready for final ERP report"
138
- node ~/.claude/bin/qualia-ui.js end "DELIVERED" "/qualia-report"
134
+ node ${QUALIA_BIN}/qualia-ui.js ok "Production URL verified"
135
+ node ${QUALIA_BIN}/qualia-ui.js ok "Documentation updated"
136
+ node ${QUALIA_BIN}/qualia-ui.js ok "Client assets archived + handoff doc written"
137
+ node ${QUALIA_BIN}/qualia-ui.js ok "Ready for final ERP report"
138
+ node ${QUALIA_BIN}/qualia-ui.js end "DELIVERED" "/qualia-report"
139
139
  ```
140
140
 
141
141
  ## Rules
@@ -12,7 +12,7 @@ allowed-tools:
12
12
 
13
13
  # /qualia-learn — Save Knowledge
14
14
 
15
- Persist learnings across projects and sessions. Saved to `~/.claude/knowledge/`.
15
+ Persist learnings across projects and sessions. Saved to `${QUALIA_KNOWLEDGE}/`.
16
16
 
17
17
  ## Usage
18
18
 
@@ -39,7 +39,7 @@ Client-specific preferences, design choices, requirements.
39
39
  ## Process
40
40
 
41
41
  ```bash
42
- node ~/.claude/bin/qualia-ui.js banner learn
42
+ node ${QUALIA_BIN}/qualia-ui.js banner learn
43
43
  ```
44
44
 
45
45
  ### 1. Classify
@@ -60,7 +60,7 @@ unified loader, **never** raw `cat` or `grep` directly — the loader handles
60
60
  missing-file edge cases and stays consistent across skills.
61
61
 
62
62
  ```bash
63
- node ~/.claude/bin/knowledge.js search "{title keywords}"
63
+ node ${QUALIA_BIN}/knowledge.js search "{title keywords}"
64
64
  ```
65
65
 
66
66
  If a near-match exists:
@@ -76,7 +76,7 @@ detection, and the canonical entry format — one call, no shell escaping
76
76
  concerns:
77
77
 
78
78
  ```bash
79
- node ~/.claude/bin/knowledge.js append \
79
+ node ${QUALIA_BIN}/knowledge.js append \
80
80
  --type {pattern|fix|client} \
81
81
  --title "{Title}" \
82
82
  --body "{The learning — be specific enough that future-you understands without context}" \
@@ -102,27 +102,27 @@ to bootstrap it.
102
102
 
103
103
  ## Reading Knowledge
104
104
 
105
- **Always use the loader.** Hardcoded `cat ~/.claude/knowledge/X.md` is an
105
+ **Always use the loader.** Hardcoded `cat ${QUALIA_KNOWLEDGE}/X.md` is an
106
106
  anti-pattern — it makes new files invisible (this was v4.1.0 audit finding
107
107
  #3). The loader, by contrast, lets agents discover available knowledge via
108
108
  the index.
109
109
 
110
110
  ```bash
111
111
  # Print the index (entry point — read this first)
112
- node ~/.claude/bin/knowledge.js
112
+ node ${QUALIA_BIN}/knowledge.js
113
113
 
114
114
  # Print a specific file (accepts aliases: patterns, fixes, client)
115
- node ~/.claude/bin/knowledge.js load patterns
116
- node ~/.claude/bin/knowledge.js load common-fixes.md
115
+ node ${QUALIA_BIN}/knowledge.js load patterns
116
+ node ${QUALIA_BIN}/knowledge.js load common-fixes.md
117
117
 
118
118
  # List everything available
119
- node ~/.claude/bin/knowledge.js list
119
+ node ${QUALIA_BIN}/knowledge.js list
120
120
 
121
121
  # Search across all files
122
- node ~/.claude/bin/knowledge.js search "RLS"
122
+ node ${QUALIA_BIN}/knowledge.js search "RLS"
123
123
  ```
124
124
 
125
- The `/qualia-debug` skill should check `common-fixes.md` (`load fixes`) before
125
+ The `/qualia-fix` skill should check `common-fixes.md` (`load fixes`) before
126
126
  investigating. The `/qualia-new` skill should check `client-prefs.md`
127
127
  (`load client`) when setting up client projects. The `/qualia-plan` skill
128
128
  should check `learned-patterns.md` (`load patterns`) when planning phases.
@@ -46,7 +46,7 @@ If `ALREADY_MAPPED`, ask:
46
46
  ### 2. Banner
47
47
 
48
48
  ```bash
49
- node ~/.claude/bin/qualia-ui.js banner map
49
+ node ${QUALIA_BIN}/qualia-ui.js banner map
50
50
  ```
51
51
 
52
52
  ### 3. Spawn 5 Mapper Agents (parallel)
@@ -175,7 +175,7 @@ git commit -m "docs: map existing codebase"
175
175
  ### 7. Route
176
176
 
177
177
  ```bash
178
- node ~/.claude/bin/qualia-ui.js end "CODEBASE MAPPED" "/qualia-new"
178
+ node ${QUALIA_BIN}/qualia-ui.js end "CODEBASE MAPPED" "/qualia-new"
179
179
  ```
180
180
 
181
181
  ## What `/qualia-new` Does With This
@@ -29,7 +29,7 @@ Triggered after `/qualia-verify` passes on the LAST phase of the current milesto
29
29
  ### 1. Validate Readiness
30
30
 
31
31
  ```bash
32
- node ~/.claude/bin/state.js check
32
+ node ${QUALIA_BIN}/state.js check
33
33
  ```
34
34
 
35
35
  `state.js close-milestone` enforces two guards:
@@ -67,7 +67,7 @@ Roadmapper prompt for the extension:
67
67
 
68
68
  ```
69
69
  Agent(prompt="
70
- Read your role: @~/.claude/agents/roadmapper.md
70
+ Read your role: @${QUALIA_AGENTS}/roadmapper.md
71
71
 
72
72
  <mode>extend-demo-to-full</mode>
73
73
  <existing_journey>.planning/JOURNEY.md</existing_journey>
@@ -95,8 +95,8 @@ milestone when /qualia-milestone opens each one.
95
95
  **If "Demo only — close here":** treat the demo as a shipped-and-done project. Skip Steps 2-9 of the normal flow. Just run:
96
96
 
97
97
  ```bash
98
- node ~/.claude/bin/state.js close-milestone --force
99
- node ~/.claude/bin/qualia-ui.js end "DEMO SHIPPED" "/qualia-report"
98
+ node ${QUALIA_BIN}/state.js close-milestone --force
99
+ node ${QUALIA_BIN}/qualia-ui.js end "DEMO SHIPPED" "/qualia-report"
100
100
  ```
101
101
 
102
102
  In `--auto` mode, inline-invoke `/qualia-report` and stop.
@@ -104,7 +104,7 @@ In `--auto` mode, inline-invoke `/qualia-report` and stop.
104
104
  **If "Pause":** stop, show:
105
105
 
106
106
  ```bash
107
- node ~/.claude/bin/qualia-ui.js info "Demo milestone left open. Run /qualia-milestone again when you decide."
107
+ node ${QUALIA_BIN}/qualia-ui.js info "Demo milestone left open. Run /qualia-milestone again when you decide."
108
108
  ```
109
109
 
110
110
  If the demo branch did NOT fire (full project, or demo with multiple milestones already after extension), continue to Step 2.
@@ -112,8 +112,8 @@ If the demo branch did NOT fire (full project, or demo with multiple milestones
112
112
  ### 2. Banner + Confirm
113
113
 
114
114
  ```bash
115
- node ~/.claude/bin/qualia-ui.js banner milestone
116
- node ~/.claude/bin/qualia-ui.js journey-tree .planning/JOURNEY.md
115
+ node ${QUALIA_BIN}/qualia-ui.js banner milestone
116
+ node ${QUALIA_BIN}/qualia-ui.js journey-tree .planning/JOURNEY.md
117
117
  ```
118
118
 
119
119
  The journey-tree shows the user WHERE they are on the ladder before asking the close question. Read `.planning/JOURNEY.md` to find the next milestone's name + scope. Show:
@@ -152,7 +152,7 @@ Edit `.planning/REQUIREMENTS.md`:
152
152
  Closes current milestone's counters, appends a summary to `tracking.json` milestones[]:
153
153
 
154
154
  ```bash
155
- node ~/.claude/bin/state.js close-milestone
155
+ node ${QUALIA_BIN}/state.js close-milestone
156
156
  ```
157
157
 
158
158
  If all phases are verified and ≥ 2 phases exist, this succeeds without `--force`. Otherwise add `--force` (rare — usually means the user is closing a preview/demo milestone).
@@ -180,7 +180,7 @@ Spawn the roadmapper with the next milestone's JOURNEY.md sketch as input:
180
180
 
181
181
  ```
182
182
  Agent(prompt="
183
- Read your role: @~/.claude/agents/roadmapper.md
183
+ Read your role: @${QUALIA_AGENTS}/roadmapper.md
184
184
 
185
185
  <mode>next-milestone</mode>
186
186
  <journey_file>.planning/JOURNEY.md</journey_file>
@@ -198,7 +198,7 @@ Do NOT re-plan completed milestones. Do NOT create a new JOURNEY.md — the
198
198
  existing one stays the source of truth.
199
199
 
200
200
  After writing ROADMAP.md, update STATE.md via:
201
- node ~/.claude/bin/state.js init --force \\
201
+ node ${QUALIA_BIN}/state.js init --force \\
202
202
  --project '{project}' --client '{client}' --type '{type}' \\
203
203
  --milestone_name '{next name}' \\
204
204
  --phases '<JSON: next milestone phases>' \\
@@ -221,8 +221,8 @@ git commit -m "milestone: close M{N} ({current name}) → open M{N+1} ({next nam
221
221
  **Case A: this WAS the Handoff milestone closing → project is done.**
222
222
 
223
223
  ```bash
224
- node ~/.claude/bin/qualia-ui.js milestone-complete {N} "Handoff" ""
225
- node ~/.claude/bin/qualia-ui.js end "PROJECT SHIPPED" "/qualia-report"
224
+ node ${QUALIA_BIN}/qualia-ui.js milestone-complete {N} "Handoff" ""
225
+ node ${QUALIA_BIN}/qualia-ui.js end "PROJECT SHIPPED" "/qualia-report"
226
226
  ```
227
227
 
228
228
  In `--auto` mode, inline-invoke `/qualia-report` and stop. No further chaining — the project is done.
@@ -230,7 +230,7 @@ In `--auto` mode, inline-invoke `/qualia-report` and stop. No further chaining
230
230
  **Case B: a non-final milestone just closed → next milestone is open.**
231
231
 
232
232
  ```bash
233
- node ~/.claude/bin/qualia-ui.js milestone-complete {N} "{current name}" "{next name}"
233
+ node ${QUALIA_BIN}/qualia-ui.js milestone-complete {N} "{current name}" "{next name}"
234
234
  ```
235
235
 
236
236
  **In `--auto` mode**, pause here and ask (this is ONE of the two human gates in auto mode, the other being journey approval at `/qualia-new` time):
@@ -244,13 +244,13 @@ node ~/.claude/bin/qualia-ui.js milestone-complete {N} "{current name}" "{next n
244
244
  If "Continue": the auto-chain resumes. If "Pause": stop, show:
245
245
 
246
246
  ```bash
247
- node ~/.claude/bin/qualia-ui.js end "M{N} CLOSED · M{N+1} READY" "/qualia-plan 1 --auto"
247
+ node ${QUALIA_BIN}/qualia-ui.js end "M{N} CLOSED · M{N+1} READY" "/qualia-plan 1 --auto"
248
248
  ```
249
249
 
250
250
  **In guided mode**, always stop and show the next step regardless of position:
251
251
 
252
252
  ```bash
253
- node ~/.claude/bin/qualia-ui.js end "M{N} CLOSED · M{N+1} OPEN" "/qualia-plan 1"
253
+ node ${QUALIA_BIN}/qualia-ui.js end "M{N} CLOSED · M{N+1} OPEN" "/qualia-plan 1"
254
254
  ```
255
255
 
256
256
  ## What Stays, What Changes
@@ -9,7 +9,7 @@ Spawn all 4 as parallel `Agent()` calls in a single message. Each uses the same
9
9
 
10
10
  ```
11
11
  Agent(prompt="
12
- Read your role: @~/.claude/agents/researcher.md
12
+ Read your role: @${QUALIA_AGENTS}/researcher.md
13
13
 
14
14
  <dimension>stack</dimension>
15
15
  <domain>{inferred domain from PROJECT.md}</domain>
@@ -19,7 +19,7 @@ Read your role: @~/.claude/agents/researcher.md
19
19
  ", subagent_type="qualia-researcher", description="Stack research")
20
20
 
21
21
  Agent(prompt="
22
- Read your role: @~/.claude/agents/researcher.md
22
+ Read your role: @${QUALIA_AGENTS}/researcher.md
23
23
 
24
24
  <dimension>features</dimension>
25
25
  <domain>{inferred domain}</domain>
@@ -29,7 +29,7 @@ Read your role: @~/.claude/agents/researcher.md
29
29
  ", subagent_type="qualia-researcher", description="Features research")
30
30
 
31
31
  Agent(prompt="
32
- Read your role: @~/.claude/agents/researcher.md
32
+ Read your role: @${QUALIA_AGENTS}/researcher.md
33
33
 
34
34
  <dimension>architecture</dimension>
35
35
  <domain>{inferred domain}</domain>
@@ -39,7 +39,7 @@ Read your role: @~/.claude/agents/researcher.md
39
39
  ", subagent_type="qualia-researcher", description="Architecture research")
40
40
 
41
41
  Agent(prompt="
42
- Read your role: @~/.claude/agents/researcher.md
42
+ Read your role: @${QUALIA_AGENTS}/researcher.md
43
43
 
44
44
  <dimension>pitfalls</dimension>
45
45
  <domain>{inferred domain}</domain>
@@ -55,7 +55,7 @@ Spawn after all 4 researchers complete.
55
55
 
56
56
  ```
57
57
  Agent(prompt="
58
- Read your role: @~/.claude/agents/research-synthesizer.md
58
+ Read your role: @${QUALIA_AGENTS}/research-synthesizer.md
59
59
 
60
60
  Merge the 4 research files at .planning/research/ into .planning/research/SUMMARY.md.
61
61
  This is a multi-milestone project -- the SUMMARY must suggest a FULL milestone arc
@@ -70,7 +70,7 @@ Spawn with full-journey mandate. If the user passed `--full-detail`, set `<full_
70
70
 
71
71
  ```
72
72
  Agent(prompt="
73
- Read your role: @~/.claude/agents/roadmapper.md
73
+ Read your role: @${QUALIA_AGENTS}/roadmapper.md
74
74
 
75
75
  <task>
76
76
  Create the FULL JOURNEY for this project:
@@ -82,7 +82,7 @@ User-scoped v1 features:
82
82
  {list of features selected in Step 9, grouped by category}
83
83
 
84
84
  Template type: {template_type from config.json}
85
- If set, use ~/.claude/qualia-templates/projects/{type}.md as the milestone arc starting point.
85
+ If set, use ${QUALIA_TEMPLATES}/projects/{type}.md as the milestone arc starting point.
86
86
 
87
87
  <full_detail>{true if --full-detail, else false}</full_detail>
88
88
  - false (default): Milestone 1 gets full phase detail; M2..M{N-1} stay as sketches. Detail fills in when each milestone opens via /qualia-milestone.
@@ -92,7 +92,7 @@ The final milestone MUST be named 'Handoff' with the fixed 4 phases
92
92
  (Polish, Content + SEO, Final QA, Handoff). Do not omit it.
93
93
 
94
94
  After writing, update STATE.md via:
95
- node ~/.claude/bin/state.js init \
95
+ node ${QUALIA_BIN}/state.js init \
96
96
  --project '{name}' --client '{client}' --type '{type}' \
97
97
  --milestone_name '{Milestone 1 name}' \
98
98
  --phases '<JSON: Milestone 1 phases only>' \
@@ -103,7 +103,7 @@ After writing, update STATE.md via:
103
103
 
104
104
  ## Journey ladder format
105
105
 
106
- The branded journey ladder rendered in Step 11. Use `node ~/.claude/bin/qualia-ui.js journey-tree .planning/JOURNEY.md` for the programmatic version. The manual ASCII fallback format is below.
106
+ The branded journey ladder rendered in Step 11. Use `node ${QUALIA_BIN}/qualia-ui.js journey-tree .planning/JOURNEY.md` for the programmatic version. The manual ASCII fallback format is below.
107
107
 
108
108
  ```
109
109
  ## Proposed Journey
@@ -43,7 +43,7 @@ Initialize a project with the **entire arc mapped from kickoff to handoff**. All
43
43
  ### Step 0. Banner
44
44
 
45
45
  ```bash
46
- node ~/.claude/bin/qualia-ui.js banner new
46
+ node ${QUALIA_BIN}/qualia-ui.js banner new
47
47
  ```
48
48
 
49
49
  Banner only. Do NOT ask anything yet. The next thing the user sees is the project-shape gate — not a free-text "tell me what to build". Shape gate first, content second, because the shape drives the question set.
@@ -122,7 +122,7 @@ If "More questions": re-invoke `/qualia-discuss` for additional rounds. Otherwis
122
122
 
123
123
  ### Step 5. Detect Project Type
124
124
 
125
- 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 13.
125
+ From questioning answers, infer type → `website` | `ai-agent` | `voice-agent` | `mobile-app` | `null`. If matched, `cat ${QUALIA_TEMPLATES}/projects/{type}.md` gives suggested milestone arc. Store `template_type` for Step 13.
126
126
 
127
127
  ### Step 6. Design Direction (frontend only)
128
128
 
@@ -140,7 +140,7 @@ Plus free-text: "Any brand colors or reference sites I should look at?"
140
140
 
141
141
  If client, ask name. Check saved prefs:
142
142
  ```bash
143
- node ~/.claude/bin/knowledge.js search "{client name}"
143
+ node ${QUALIA_BIN}/knowledge.js search "{client name}"
144
144
  ```
145
145
 
146
146
  ### Step 8. Write PROJECT.md
@@ -159,11 +159,11 @@ The domain glossary is the single highest-leverage piece of substrate — every
159
159
 
160
160
  ```bash
161
161
  # Copy template
162
- cp ~/.claude/qualia-templates/CONTEXT.md .planning/CONTEXT.md
162
+ cp ${QUALIA_TEMPLATES}/CONTEXT.md .planning/CONTEXT.md
163
163
 
164
164
  # Initialize ADR folder with the template available for reference
165
165
  mkdir -p .planning/decisions
166
- cp ~/.claude/qualia-templates/decisions/ADR-template.md .planning/decisions/_template.md
166
+ cp ${QUALIA_TEMPLATES}/decisions/ADR-template.md .planning/decisions/_template.md
167
167
  ```
168
168
 
169
169
  Then **seed the glossary from the questioning answers**. For each domain term that came up during the Step 4 `/qualia-discuss` interview — entities, actions, statuses, key nouns the user repeatedly said — add an entry to `.planning/CONTEXT.md` under `## Language` with:
@@ -252,7 +252,7 @@ git commit -m "docs: DESIGN.md — direction commit + OKLCH palette + tokens"
252
252
  Only `/qualia-new --quick` skips this step.
253
253
 
254
254
  ```bash
255
- node ~/.claude/bin/qualia-ui.js banner research
255
+ node ${QUALIA_BIN}/qualia-ui.js banner research
256
256
  mkdir -p .planning/research
257
257
  ```
258
258
 
@@ -275,7 +275,7 @@ git commit -m "docs: research synthesis (4 dimensions, multi-milestone scope)"
275
275
 
276
276
  Show key findings:
277
277
  ```bash
278
- node ~/.claude/bin/qualia-ui.js ok "Research complete"
278
+ node ${QUALIA_BIN}/qualia-ui.js ok "Research complete"
279
279
  ```
280
280
  Display top 3 from SUMMARY.md (stack recommendation, table stakes, top pitfall).
281
281
 
@@ -300,7 +300,7 @@ Gather any additional requirements the user wants that research missed.
300
300
  ### Step 13. Run Roadmapper
301
301
 
302
302
  ```bash
303
- node ~/.claude/bin/qualia-ui.js banner roadmap
303
+ node ${QUALIA_BIN}/qualia-ui.js banner roadmap
304
304
  ```
305
305
 
306
306
  **Roadmapper output branches on `PROJECT_TYPE`:**
@@ -315,7 +315,7 @@ Spawn the roadmapper with `<project_type>$PROJECT_TYPE</project_type>` in the pr
315
315
  Render the branded journey ladder:
316
316
 
317
317
  ```bash
318
- node ~/.claude/bin/qualia-ui.js journey-tree .planning/JOURNEY.md
318
+ node ${QUALIA_BIN}/qualia-ui.js journey-tree .planning/JOURNEY.md
319
319
  ```
320
320
 
321
321
  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.
@@ -345,9 +345,9 @@ git commit -m "docs: journey + requirements + milestone 1 roadmap ({N} milestone
345
345
  **After approval, show the progressive-detail reminder explicitly:**
346
346
 
347
347
  ```bash
348
- node ~/.claude/bin/qualia-ui.js info "Milestone 1 is fully planned now."
349
- node ~/.claude/bin/qualia-ui.js info "Milestones 2..{N-1} are sketched (names + one-line goals)."
350
- node ~/.claude/bin/qualia-ui.js info "Full phase detail for each later milestone gets written when /qualia-milestone opens it."
348
+ node ${QUALIA_BIN}/qualia-ui.js info "Milestone 1 is fully planned now."
349
+ node ${QUALIA_BIN}/qualia-ui.js info "Milestones 2..{N-1} are sketched (names + one-line goals)."
350
+ node ${QUALIA_BIN}/qualia-ui.js info "Full phase detail for each later milestone gets written when /qualia-milestone opens it."
351
351
  ```
352
352
 
353
353
  (Skip this block when `--full-detail` was used — all milestones are already fully planned in that case.)
@@ -368,7 +368,7 @@ git commit -m "chore: environment setup" 2>/dev/null
368
368
  If invoked with `--auto`, skip straight into building Milestone 1:
369
369
 
370
370
  ```bash
371
- node ~/.claude/bin/qualia-ui.js info "Auto mode — chaining into /qualia-plan 1"
371
+ node ${QUALIA_BIN}/qualia-ui.js info "Auto mode — chaining into /qualia-plan 1"
372
372
  ```
373
373
 
374
374
  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:
@@ -380,7 +380,7 @@ Then inline-invoke `/qualia-plan 1`. That skill will chain into `/qualia-build 1
380
380
  **Without `--auto`**, end with a clear pointer:
381
381
 
382
382
  ```bash
383
- node ~/.claude/bin/qualia-ui.js end "JOURNEY READY" "/qualia-plan 1"
383
+ node ${QUALIA_BIN}/qualia-ui.js end "JOURNEY READY" "/qualia-plan 1"
384
384
  ```
385
385
 
386
386
  Show summary:
@@ -258,7 +258,7 @@ Constraints:
258
258
  )
259
259
  ```
260
260
 
261
- After all 3 return, present a comparison table to the user (see SKILL.md Step 5b). User picks 1, 2, 3, or hybrid. Then a single synthesizer agent writes the Refactor RFC to `.planning/REFACTOR-{slug}.md` honoring the user's pick.
261
+ After all 3 return, present a comparison table to the user (see SKILL.md Step 5b). User picks 1, 2, 3, or hybrid. Then a single synthesizer agent writes the Refactor RFC to `.planning/reports/refactor/REFACTOR-{slug}.md` honoring the user's pick.
262
262
 
263
263
  **Token cost**: ~6K per variant × 3 variants = ~18K for the fan-out. Cached prefix (CONTEXT.md + ADRs + candidate block) is shared across the 3 spawns, so effective cost is closer to ~12K. The output rfc-pick stage adds ~3K. Total per-deepening-candidate: ~15K — well within Qualia's per-skill budget.
264
264