qualia-framework 4.0.0 → 4.0.5

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 (47) hide show
  1. package/CLAUDE.md +23 -11
  2. package/agents/plan-checker.md +1 -1
  3. package/agents/roadmapper.md +10 -5
  4. package/bin/cli.js +139 -17
  5. package/bin/install.js +47 -47
  6. package/bin/qualia-ui.js +2 -2
  7. package/bin/state.js +126 -9
  8. package/bin/statusline.js +63 -38
  9. package/docs/erp-contract.md +49 -2
  10. package/guide.md +1 -1
  11. package/hooks/migration-guard.js +23 -9
  12. package/hooks/pre-compact.js +39 -11
  13. package/hooks/pre-deploy-gate.js +3 -4
  14. package/hooks/pre-push.js +6 -3
  15. package/hooks/session-start.js +8 -8
  16. package/package.json +1 -1
  17. package/rules/frontend.md +5 -13
  18. package/skills/qualia/SKILL.md +5 -0
  19. package/skills/qualia-build/SKILL.md +10 -0
  20. package/skills/qualia-debug/SKILL.md +6 -0
  21. package/skills/qualia-design/SKILL.md +9 -1
  22. package/skills/qualia-discuss/SKILL.md +6 -0
  23. package/skills/qualia-handoff/SKILL.md +5 -0
  24. package/skills/qualia-help/SKILL.md +18 -4
  25. package/skills/qualia-idk/SKILL.md +6 -0
  26. package/skills/qualia-learn/SKILL.md +6 -0
  27. package/skills/qualia-map/SKILL.md +7 -0
  28. package/skills/qualia-milestone/SKILL.md +6 -0
  29. package/skills/qualia-new/SKILL.md +31 -4
  30. package/skills/qualia-optimize/SKILL.md +8 -0
  31. package/skills/qualia-pause/SKILL.md +5 -0
  32. package/skills/qualia-plan/SKILL.md +11 -1
  33. package/skills/qualia-polish/SKILL.md +8 -0
  34. package/skills/qualia-quick/SKILL.md +7 -0
  35. package/skills/qualia-report/SKILL.md +146 -60
  36. package/skills/qualia-research/SKILL.md +7 -0
  37. package/skills/qualia-resume/SKILL.md +3 -0
  38. package/skills/qualia-review/SKILL.md +7 -0
  39. package/skills/qualia-ship/SKILL.md +5 -0
  40. package/skills/qualia-skill-new/SKILL.md +6 -0
  41. package/skills/qualia-task/SKILL.md +8 -1
  42. package/skills/qualia-test/SKILL.md +7 -0
  43. package/skills/qualia-verify/SKILL.md +8 -0
  44. package/templates/help.html +4 -4
  45. package/templates/tracking.json +1 -0
  46. package/tests/hooks.test.sh +5 -5
  47. package/tests/runner.js +310 -3
@@ -52,6 +52,14 @@ function getNextCommand() {
52
52
  }
53
53
  }
54
54
 
55
+ function readConfig() {
56
+ try {
57
+ return JSON.parse(fs.readFileSync(path.join(HOME, ".claude", ".qualia-config.json"), "utf8"));
58
+ } catch {
59
+ return {};
60
+ }
61
+ }
62
+
55
63
  function fallbackText() {
56
64
  // If qualia-ui.js is missing, emit plain text. Keeps the session informative
57
65
  // even on a broken install.
@@ -121,14 +129,6 @@ try {
121
129
  // Deliberately silent — hook must never fail
122
130
  }
123
131
 
124
- function readConfig() {
125
- try {
126
- return JSON.parse(fs.readFileSync(path.join(HOME, ".claude", ".qualia-config.json"), "utf8"));
127
- } catch {
128
- return {};
129
- }
130
- }
131
-
132
132
  function _trace(hookName, result, extra) {
133
133
  try {
134
134
  const traceDir = path.join(os.homedir(), ".claude", ".qualia-traces");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualia-framework",
3
- "version": "4.0.0",
3
+ "version": "4.0.5",
4
4
  "description": "Claude Code workflow framework by Qualia Solutions. Plan, build, verify, ship.",
5
5
  "bin": {
6
6
  "qualia-framework": "./bin/cli.js"
package/rules/frontend.md CHANGED
@@ -109,18 +109,10 @@ These are Qualia brand standards — mandatory for every frontend component. Not
109
109
  If `.planning/DESIGN.md` exists in the project, it takes precedence over these defaults.
110
110
  Read it before any frontend work. It contains project-specific: palette, typography, spacing, component patterns.
111
111
 
112
- ## Impeccable Design Skills (global)
113
- - `/polish` — Final detail pass before shipping
114
- - `/bolder` — Amplify safe/boring designs
115
- - `/design-quieter` — Tone down overly aggressive designs
116
- - `/animate` — Add purposeful micro-interactions
117
- - `/colorize` — Inject strategic color into monochrome UIs
118
- - `/clarify` — Fix unclear UX copy, labels, error messages
119
- - `/critique` — Design director-level review
120
- - `/distill` — Strip unnecessary complexity
121
- - `/delight` — Add memorable touches and personality
122
- - `/harden` — Edge cases, overflow, i18n robustness
123
- - `/responsive` — Cross-device responsive adaptation
112
+ ## Qualia design commands
113
+ - `/qualia-design` — One-shot design transformation (critique + fix + polish + responsive + harden)
114
+ - `/qualia-polish` — Final detail pass before shipping (run after all phases verified)
115
+ - `/qualia-review` — Scored production audit
124
116
 
125
117
  ### Recommended workflow
126
- 1. Build feature → 2. `/critique` → 3. `/polish` → 4. `/harden` → ship
118
+ 1. Build feature → 2. `/qualia-design` → 3. `/qualia-polish` → ship
@@ -1,6 +1,11 @@
1
1
  ---
2
2
  name: qualia
3
3
  description: "Smart router — reads project state (state.js), classifies the situation mechanically, returns the exact next command. Use whenever you type /qualia, 'what next', 'next', 'what now', 'what should I do next', 'what command now'. For deeper 'I don't understand what's going on' / 'something feels off' situations, use /qualia-idk instead — that one actually scans the planning folder and codebase to diagnose the confusion."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Grep
8
+ - Glob
4
9
  ---
5
10
 
6
11
  # /qualia — What's Next?
@@ -1,6 +1,16 @@
1
1
  ---
2
2
  name: qualia-build
3
3
  description: "Execute the current phase — spawns builder subagents per task with wave-based parallelization. Fresh context per task."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
12
+ - TaskCreate
13
+ - TaskUpdate
4
14
  ---
5
15
 
6
16
  # /qualia-build — Build a Phase
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: qualia-debug
3
3
  description: "Structured debugging — symptom gathering, diagnosis confirmation, root cause analysis. Trigger on 'debug', 'find bug', 'fix error', 'something is broken', 'not working', 'weird behavior', 'layout broken', 'CSS issue', 'slow page', 'performance'."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Grep
8
+ - Glob
9
+ - Agent
4
10
  ---
5
11
 
6
12
  # /qualia-debug — Structured Debugging
@@ -1,6 +1,14 @@
1
1
  ---
2
2
  name: qualia-design
3
3
  description: "One-shot design transformation — critiques, fixes, polishes, hardens, makes responsive. No reports, no choices, just makes it professional. Trigger on 'fix the design', 'make it look better', 'redesign', 'design pass', 'make it modern', 'it looks ugly', 'fix the UI'."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
4
12
  ---
5
13
 
6
14
  # /qualia-design — One-Shot Design Transformation
@@ -87,7 +95,7 @@ git commit -m "style: design transformation"
87
95
  - {key change 2}
88
96
  - {key change 3}
89
97
 
90
- Fine-tune: /bolder, /design-quieter, /colorize, /animate
98
+ Next: /qualia-polish (final pass) · /qualia-review (scored audit)
91
99
  ```
92
100
 
93
101
  ## Rules
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: qualia-discuss
3
3
  description: "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."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - AskUserQuestion
4
10
  ---
5
11
 
6
12
  # /qualia-discuss — Phase Context Capture
@@ -1,6 +1,11 @@
1
1
  ---
2
2
  name: qualia-handoff
3
3
  description: "Client delivery — produces the 4 mandatory Handoff deliverables (production URL, documentation, client assets archive, ERP finalization). Triggered at the end of the Handoff milestone."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
4
9
  ---
5
10
 
6
11
  # /qualia-handoff — Client Delivery
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: qualia-help
3
3
  description: "Open the Qualia Framework reference guide in the browser. A beautiful themed HTML page with all commands, rules, services, and the road. Trigger on 'help', 'how does this work', 'show me the commands', 'qualia help', 'reference'."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
4
7
  ---
5
8
 
6
9
  # /qualia-help — Framework Reference
@@ -12,14 +15,25 @@ Opens a Qualia-themed HTML reference guide in your default browser.
12
15
  ### 1. Generate the HTML
13
16
 
14
17
  ```bash
15
- # Read the template and inject the current version
16
- VERSION=$(node -e "console.log(require(require('os').homedir() + '/.claude/.qualia-config.json').version || 'v3')" 2>/dev/null || echo "v3")
18
+ # Read the template and inject the current version.
19
+ # Prefer .qualia-config.json; fall back to the framework package.json; last resort is the
20
+ # literal string "latest" so the UI never lies about a specific version.
21
+ VERSION=$(node -e "
22
+ const fs = require('fs'), path = require('path'), os = require('os');
23
+ const cfg = path.join(os.homedir(), '.claude', '.qualia-config.json');
24
+ const pkg = path.join(os.homedir(), '.claude', 'qualia-framework', 'package.json');
25
+ try { const v = JSON.parse(fs.readFileSync(cfg,'utf8')).version; if (v) { console.log(v); process.exit(0); } } catch {}
26
+ try { const v = JSON.parse(fs.readFileSync(pkg,'utf8')).version; if (v) { console.log('v'+v); process.exit(0); } } catch {}
27
+ console.log('latest');
28
+ " 2>/dev/null || echo "latest")
17
29
  TEMPLATE="$HOME/.claude/qualia-templates/help.html"
18
30
  OUTPUT="/tmp/qualia-help.html"
19
31
 
20
- # If template doesn't exist, check the framework install
32
+ # If template doesn't exist in the user home, check the installed framework copy.
21
33
  if [ ! -f "$TEMPLATE" ]; then
22
- TEMPLATE="$(dirname "$(dirname "$(which qualia-framework 2>/dev/null || echo '')")")/templates/help.html"
34
+ for CANDIDATE in "$HOME/.claude/qualia-framework/templates/help.html"; do
35
+ if [ -f "$CANDIDATE" ]; then TEMPLATE="$CANDIDATE"; break; fi
36
+ done
23
37
  fi
24
38
  ```
25
39
 
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: qualia-idk
3
3
  description: "Diagnostic intelligence for 'I don't know what's going on.' Runs two isolated scans (.planning/ vs codebase), cross-references against the user's confusion, then explains the situation in plain language with a concrete recommended next step. Use whenever the user says 'I don't know', 'something feels off', 'not sure what to do', 'am I doing this right', 'what's happening', 'help me understand'."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Grep
8
+ - Glob
9
+ - Agent
4
10
  ---
5
11
 
6
12
  # /qualia-idk — "I Don't Know What's Going On"
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: qualia-learn
3
3
  description: "Save a learning, pattern, fix, or client preference to the knowledge base. Persists across projects and sessions. Trigger on 'remember this', 'save this pattern', 'learned something', 'note for future', 'client prefers', 'qualia-learn'."
4
+ allowed-tools:
5
+ - Read
6
+ - Write
7
+ - Edit
8
+ - Glob
9
+ - Grep
4
10
  ---
5
11
 
6
12
  # /qualia-learn — Save Knowledge
@@ -1,6 +1,13 @@
1
1
  ---
2
2
  name: qualia-map
3
3
  description: "Map an existing codebase to infer architecture, stack, conventions, and what's already built. For brownfield projects — run BEFORE /qualia-new so Validated requirements get inferred from existing code."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Grep
9
+ - Glob
10
+ - Agent
4
11
  ---
5
12
 
6
13
  # /qualia-map — Codebase Mapping (Brownfield)
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  name: qualia-milestone
3
3
  description: "Close the current milestone and open the next one — loads the next milestone's scope from JOURNEY.md (no ad-hoc naming). Archives artifacts, marks requirements Complete, regenerates ROADMAP.md for the next milestone."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Agent
4
10
  ---
5
11
 
6
12
  # /qualia-milestone — Milestone Closeout
@@ -1,6 +1,18 @@
1
1
  ---
2
2
  name: qualia-new
3
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
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
12
+ - AskUserQuestion
13
+ - TaskCreate
14
+ - TaskUpdate
15
+ - TaskList
4
16
  ---
5
17
 
6
18
  # /qualia-new — New Project (Full Journey)
@@ -9,8 +21,9 @@ Initialize a project with the **entire arc mapped from kickoff to handoff**. All
9
21
 
10
22
  ## Flags
11
23
 
12
- - `/qualia-new` — full-journey flow, stops after approval (default, backward-compatible)
24
+ - `/qualia-new` — full-journey flow, stops after approval (default, backward-compatible). **Progressive detail**: Milestone 1 gets full phase detail; M2..M{N-1} get sketched (names + one-line goals). Full detail for later milestones is filled in by `/qualia-milestone` when each one opens. This matches how real projects unfold — M1's discoveries reshape M3's plan, so deep-planning M3 now tends to waste effort.
13
25
  - `/qualia-new --auto` — full-journey flow, then auto-chains into `/qualia-plan 1 → /qualia-build → /qualia-verify` for Milestone 1
26
+ - `/qualia-new --full-detail` — ALL milestones get full phase-level detail upfront (success criteria per phase for every milestone, not just M1). Use when the client wants a fully-committed plan at kickoff. Trade-off: later milestones often need revision as M1 ships. Combinable with `--auto`.
14
27
  - `/qualia-new --quick` — 4-phase flat wizard for trivial projects (landing pages, prototypes). Skips research and journey mapping.
15
28
 
16
29
  ## The Shift From Previous Versions
@@ -204,7 +217,7 @@ Display top 3 from SUMMARY.md (stack recommendation, table stakes, top pitfall).
204
217
 
205
218
  ### Step 9. Feature Scoping (Multi-Milestone)
206
219
 
207
- Read `.planning/research/FEATURES.md` and present the feature landscape. Unlike v3, features are scoped **to milestones**, not just to v1/v2.
220
+ Read `.planning/research/FEATURES.md` and present the feature landscape. Features are scoped **to milestones** you'll decide per-feature which milestone owns it.
208
221
 
209
222
  For each category, use AskUserQuestion:
210
223
 
@@ -226,7 +239,7 @@ Gather any additional requirements the user wants that research missed.
226
239
  node ~/.claude/bin/qualia-ui.js banner roadmap
227
240
  ```
228
241
 
229
- Spawn the roadmapper with full-journey mandate:
242
+ Spawn the roadmapper with full-journey mandate. If the user passed `--full-detail`, include `<full_detail>true</full_detail>` in the prompt so the roadmapper writes complete phase detail for ALL milestones.
230
243
 
231
244
  ```
232
245
  Agent(prompt="
@@ -236,7 +249,7 @@ Read your role: @~/.claude/agents/roadmapper.md
236
249
  Create the FULL JOURNEY for this project:
237
250
  - .planning/JOURNEY.md — all milestones (2-5 including Handoff) with exit criteria
238
251
  - .planning/REQUIREMENTS.md — requirements grouped by milestone
239
- - .planning/ROADMAP.md — Milestone 1's phase detail only (ready for /qualia-plan 1)
252
+ - .planning/ROADMAP.md — Milestone 1's phase detail (and ALL milestones if full_detail=true)
240
253
 
241
254
  User-scoped v1 features:
242
255
  {list of features selected in Step 9, grouped by category}
@@ -244,6 +257,10 @@ User-scoped v1 features:
244
257
  Template type: {template_type from config.json}
245
258
  If set, use ~/.claude/qualia-templates/projects/{type}.md as the milestone arc starting point.
246
259
 
260
+ <full_detail>{true if --full-detail, else false}</full_detail>
261
+ - 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.
262
+ - true: every milestone (M1..Handoff) gets full phase-level detail in ROADMAP.md upfront. Useful when the client wants a fully-committed plan at kickoff.
263
+
247
264
  The final milestone MUST be named 'Handoff' with the fixed 4 phases
248
265
  (Polish, Content + SEO, Final QA, Handoff). Do not omit it.
249
266
 
@@ -319,6 +336,16 @@ git add .planning/JOURNEY.md .planning/REQUIREMENTS.md .planning/ROADMAP.md .pla
319
336
  git commit -m "docs: journey + requirements + milestone 1 roadmap ({N} milestones)"
320
337
  ```
321
338
 
339
+ **After approval, show the progressive-detail reminder explicitly:**
340
+
341
+ ```bash
342
+ node ~/.claude/bin/qualia-ui.js info "Milestone 1 is fully planned now."
343
+ node ~/.claude/bin/qualia-ui.js info "Milestones 2..{N-1} are sketched (names + one-line goals)."
344
+ node ~/.claude/bin/qualia-ui.js info "Full phase detail for each later milestone gets written when /qualia-milestone opens it."
345
+ ```
346
+
347
+ (Skip this block when `--full-detail` was used — all milestones are already fully planned in that case.)
348
+
322
349
  ### Step 13. Environment Setup
323
350
 
324
351
  Supabase project? `supabase link` or create. Vercel project? `vercel link`. Env vars? `.env.local` with placeholders from PROJECT.md stack.
@@ -1,6 +1,14 @@
1
1
  ---
2
2
  name: qualia-optimize
3
3
  description: "Deep optimization pass — reads .planning/ AND codebase to find performance, design, UI, backend, and frontend issues. Spawns parallel specialist agents. Use this skill whenever the user says 'optimize', 'optimization pass', 'find issues', 'qualia-optimize', 'deep optimize', 'performance audit', 'design alignment check', 'speed up', 'slow', 'bundle size', or wants a comprehensive quality sweep. Supports --perf, --ui, --backend, --alignment, --fix flags."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
4
12
  ---
5
13
 
6
14
  # Qualia Optimize — Deep Codebase + Planning Optimization
@@ -1,6 +1,11 @@
1
1
  ---
2
2
  name: qualia-pause
3
3
  description: "Save session context for seamless handoff. Creates .continue-here.md so the next session picks up exactly where you left off. Trigger on 'pause', 'stop for now', 'save progress', 'continue later', 'pick up tomorrow'."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
4
9
  ---
5
10
 
6
11
  # /qualia-pause — Session Handoff
@@ -1,6 +1,16 @@
1
1
  ---
2
2
  name: qualia-plan
3
3
  description: "Plan the current phase — spawns planner, validates with plan-checker in a revision loop (max 3), optionally runs discuss/research first. Use when ready to plan a phase."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
12
+ - TaskCreate
13
+ - TaskUpdate
4
14
  ---
5
15
 
6
16
  # /qualia-plan — Plan a Phase
@@ -196,7 +206,7 @@ When invoked as `/qualia-plan {N} --gaps`, the planner is in gap-closure mode:
196
206
  2. For each FAIL item, create a targeted fix task:
197
207
  - **Files:** specific files that failed verification
198
208
  - **Action:** specific fix (not "fix auth" — "add session persistence check in src/lib/auth.ts signIn function")
199
- - **Done when:** the exact verification criterion that previously failed, restated
209
+ - **Acceptance Criteria:** the exact verification criterion that previously failed, restated as an observable behavior
200
210
  3. Do NOT re-plan passing items. Do NOT add new features. Gap plans are surgical.
201
211
  4. Write to `.planning/phase-{N}-gaps-plan.md` (separate from original plan)
202
212
  5. All gap tasks are Wave 1 (parallel) unless they share files
@@ -1,6 +1,14 @@
1
1
  ---
2
2
  name: qualia-polish
3
3
  description: "Design and UX pass — anti-AI-slop, genuine craft, responsive, accessible. Run after all phases are verified."
4
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
11
+ - Agent
4
12
  ---
5
13
 
6
14
  # /qualia-polish — Design Pass
@@ -1,6 +1,13 @@
1
1
  ---
2
2
  name: qualia-quick
3
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
+ allowed-tools:
5
+ - Bash
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Grep
10
+ - Glob
4
11
  ---
5
12
 
6
13
  # /qualia-quick — Quick Task