qualia-framework-v2 2.5.0 → 2.6.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.
@@ -1,17 +1,35 @@
1
1
  #!/bin/bash
2
- # Qualia session start — load project context
3
- # Triggered on Claude Code session start
2
+ # Qualia session start — show branded context panel on every new session.
3
+ # Delegates to qualia-ui.js so formatting matches the rest of the framework.
4
4
 
5
+ UI="$HOME/.claude/bin/qualia-ui.js"
5
6
  STATE=".planning/STATE.md"
6
- TRACKING=".planning/tracking.json"
7
7
 
8
+ # Fallback if qualia-ui.js is missing (first install before mirror)
9
+ if [ ! -f "$UI" ]; then
10
+ if [ -f "$STATE" ]; then
11
+ PHASE=$(grep "^Phase:" "$STATE" 2>/dev/null | head -1)
12
+ STATUS=$(grep "^Status:" "$STATE" 2>/dev/null | head -1)
13
+ echo "QUALIA: Project loaded. $PHASE | $STATUS"
14
+ echo "QUALIA: Run /qualia for next step."
15
+ elif [ -f ".continue-here.md" ]; then
16
+ echo "QUALIA: Handoff file found. Read .continue-here.md to resume."
17
+ else
18
+ echo "QUALIA: No project detected. Run /qualia-new to start."
19
+ fi
20
+ exit 0
21
+ fi
22
+
23
+ # Branded banner for every session start
8
24
  if [ -f "$STATE" ]; then
9
- PHASE=$(grep "^Phase:" "$STATE" 2>/dev/null | head -1)
10
- STATUS=$(grep "^Status:" "$STATE" 2>/dev/null | head -1)
11
- echo "QUALIA: Project loaded. $PHASE | $STATUS"
12
- echo "QUALIA: Run /qualia for next step."
25
+ node "$UI" banner router
26
+ # Read next command from state.js and suggest it
27
+ NEXT=$(node "$HOME/.claude/bin/state.js" check 2>/dev/null | node -e "try{let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const j=JSON.parse(d);process.stdout.write(j.next_command||'')})}" 2>/dev/null)
28
+ [ -n "$NEXT" ] && node "$UI" info "Run $NEXT to continue"
13
29
  elif [ -f ".continue-here.md" ]; then
14
- echo "QUALIA: Handoff file found. Read .continue-here.md to resume."
30
+ node "$UI" banner router
31
+ node "$UI" warn "Handoff found — read .continue-here.md to resume"
15
32
  else
16
- echo "QUALIA: No project detected. Run /qualia-new to start."
33
+ node "$UI" banner router
34
+ node "$UI" info "No project detected. Run /qualia-new to start."
17
35
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualia-framework-v2",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "Claude Code workflow framework by Qualia Solutions. Plan, build, verify, ship.",
5
5
  "bin": {
6
6
  "qualia-framework-v2": "./bin/cli.js"
@@ -52,20 +52,17 @@ Use the state.js JSON output plus gathered context:
52
52
 
53
53
  ### 3. Display
54
54
 
55
- **Clear next step:**
56
- ```
57
- QUALIA
58
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59
- Project {name}
60
- Phase {N} of {total} — {name}
61
- Status {status}
62
- Progress {bar} {percent}%
63
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
64
-
65
- → Run: {next_command from state.js}
55
+ **Clear next step** (use the UI helper — it reads state.js itself):
56
+ ```bash
57
+ node ~/.claude/bin/qualia-ui.js banner router
58
+ node ~/.claude/bin/qualia-ui.js next "{next_command from state.js}"
66
59
  ```
67
60
 
68
61
  **Ambiguous situation (multiple options):**
62
+ Print the banner first, then use plain markdown for the options:
63
+ ```bash
64
+ node ~/.claude/bin/qualia-ui.js banner router
65
+ ```
69
66
  ```
70
67
  ## Where You Are
71
68
  {1-2 sentences}
@@ -80,4 +77,11 @@ Use the state.js JSON output plus gathered context:
80
77
  3. **{option}** — {what}
81
78
  ```
82
79
 
80
+ **Blocker detected** (gap-limit, bug-loop, employee escalation):
81
+ ```bash
82
+ node ~/.claude/bin/qualia-ui.js banner router
83
+ node ~/.claude/bin/qualia-ui.js fail "{blocker description}"
84
+ node ~/.claude/bin/qualia-ui.js warn "Escalate to Fawzi or re-plan from scratch"
85
+ ```
86
+
83
87
  User can respond with a number, "just do it", or natural language.
@@ -23,19 +23,22 @@ Parse: tasks, waves, file references.
23
23
 
24
24
  ### 2. Execute Waves
25
25
 
26
- ```
27
- QUALIA BUILDING Phase {N}
28
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
+ ```bash
27
+ node ~/.claude/bin/qualia-ui.js banner build {N} "{phase name}"
29
28
  ```
30
29
 
31
30
  **For each wave (sequential):**
32
31
 
33
- ```
34
- Wave {W} ({count} tasks)
32
+ ```bash
33
+ node ~/.claude/bin/qualia-ui.js wave {W} {total_waves} {tasks_in_wave}
35
34
  ```
36
35
 
37
36
  **For each task in the wave (parallel if multiple):**
38
37
 
38
+ ```bash
39
+ node ~/.claude/bin/qualia-ui.js task {task_num} "{task title}"
40
+ ```
41
+
39
42
  Spawn a fresh builder subagent:
40
43
 
41
44
  ```
@@ -55,8 +58,8 @@ Execute this task. Read all @file references before writing. Commit when done.
55
58
  **After each task completes:**
56
59
  - Verify the commit exists: `git log --oneline -1`
57
60
  - Show result:
58
- ```
59
- Task {N}: {title} ({commit hash})
61
+ ```bash
62
+ node ~/.claude/bin/qualia-ui.js done {task_num} "{title}" {commit_hash}
60
63
  ```
61
64
 
62
65
  **After each wave completes:**
@@ -67,13 +70,11 @@ Execute this task. Read all @file references before writing. Commit when done.
67
70
 
68
71
  After all waves complete:
69
72
 
70
- ```
71
- QUALIA ► Phase {N} Built
72
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
- Tasks: {done}/{total} ✓
74
- Commits: {count}
75
- Waves: {count}
76
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
+ ```bash
74
+ node ~/.claude/bin/qualia-ui.js divider
75
+ node ~/.claude/bin/qualia-ui.js ok "Tasks: {done}/{total}"
76
+ node ~/.claude/bin/qualia-ui.js ok "Commits: {count}"
77
+ node ~/.claude/bin/qualia-ui.js ok "Waves: {count}"
77
78
  ```
78
79
 
79
80
  ### 4. Handle Failures
@@ -91,6 +92,6 @@ node ~/.claude/bin/state.js transition --to built --phase {N} --tasks-done {done
91
92
  If state.js returns an error, show it to the employee and stop.
92
93
  Do NOT manually edit STATE.md or tracking.json — state.js handles both.
93
94
 
94
- ```
95
- Run: /qualia-verify {N}
95
+ ```bash
96
+ node ~/.claude/bin/qualia-ui.js end "PHASE {N} BUILT" "/qualia-verify {N}"
96
97
  ```
@@ -15,6 +15,20 @@ Systematic debugging. Don't guess — gather symptoms, confirm diagnosis, then f
15
15
 
16
16
  ## Interactive Mode (Default)
17
17
 
18
+ ```bash
19
+ node ~/.claude/bin/qualia-ui.js banner debug
20
+ ```
21
+
22
+ ### 0. Check Known Fixes First
23
+
24
+ Before gathering symptoms, check if we've seen this before:
25
+
26
+ ```bash
27
+ cat ~/.claude/knowledge/common-fixes.md 2>/dev/null
28
+ ```
29
+
30
+ If the user's description matches a known fix, suggest it first: *"I've seen this before — check {fix title}. Want to try that before we dig deeper?"* Only proceed to full investigation if the known fix doesn't apply.
31
+
18
32
  ### 1. Gather Symptoms
19
33
 
20
34
  Ask:
@@ -15,6 +15,10 @@ Read the code, understand what's wrong, fix everything, move on. No reports, no
15
15
 
16
16
  ## Process
17
17
 
18
+ ```bash
19
+ node ~/.claude/bin/qualia-ui.js banner design
20
+ ```
21
+
18
22
  ### 1. Read Brand Context
19
23
 
20
24
  ```bash
@@ -9,9 +9,8 @@ Prepare and deliver the finished project to the client.
9
9
 
10
10
  ## Process
11
11
 
12
- ```
13
- QUALIA HANDOFF
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ ```bash
13
+ node ~/.claude/bin/qualia-ui.js banner handoff
15
14
  ```
16
15
 
17
16
  ### 1. Generate Handover Doc
@@ -61,10 +60,7 @@ node ~/.claude/bin/state.js transition --to handed_off
61
60
  ```
62
61
  Do NOT manually edit STATE.md or tracking.json — state.js handles both.
63
62
 
64
- ```
65
- QUALIA DELIVERED
66
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
- {Project Name} handed off to {client}.
68
- Don't forget: /qualia-report
69
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+ ```bash
64
+ node ~/.claude/bin/qualia-ui.js ok "{Project Name} handed off to {client}"
65
+ node ~/.claude/bin/qualia-ui.js end "DELIVERED" "/qualia-report"
70
66
  ```
@@ -31,6 +31,10 @@ Client-specific preferences, design choices, requirements.
31
31
 
32
32
  ## Process
33
33
 
34
+ ```bash
35
+ node ~/.claude/bin/qualia-ui.js banner learn
36
+ ```
37
+
34
38
  ### 1. Classify
35
39
 
36
40
  If description given, classify automatically. Otherwise ask:
@@ -13,9 +13,8 @@ Interactive project setup. Ask one step at a time using AskUserQuestion. Never d
13
13
 
14
14
  Print this FIRST, before anything else:
15
15
 
16
- ```
17
- QUALIA NEW PROJECT
18
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
+ ```bash
17
+ node ~/.claude/bin/qualia-ui.js banner new
19
18
  ```
20
19
 
21
20
  Then say: **"Let's build something. Tell me what you're making."**
@@ -161,6 +160,14 @@ options:
161
160
 
162
161
  If client project, ask: **"What's the client's name?"** (free text, no AskUserQuestion)
163
162
 
163
+ After capturing the client name, check for saved preferences:
164
+
165
+ ```bash
166
+ cat ~/.claude/knowledge/client-prefs.md 2>/dev/null
167
+ ```
168
+
169
+ If there's an entry for this client, show it to the user: *"I have notes on {client} — {preferences summary}. Applying these to the project defaults unless you say otherwise."* Then use those preferences in Step 8a (Design System) and Step 9 (Roadmap).
170
+
164
171
  ### Step 6. Confirm & Scaffold
165
172
 
166
173
  Present a summary:
@@ -225,7 +232,7 @@ Create Supabase project (via MCP or manual).
225
232
 
226
233
  ### Step 8a. Create Design System
227
234
 
228
- Generate **`.planning/DESIGN.md`** using `templates/DESIGN.md` as the template.
235
+ Generate **`.planning/DESIGN.md`** using `~/.claude/qualia-templates/DESIGN.md` as the template.
229
236
 
230
237
  Fill in based on the design direction chosen in Step 3:
231
238
 
@@ -311,14 +318,6 @@ git commit -m "init: project setup with planning files"
311
318
  git push -u origin main
312
319
  ```
313
320
 
314
- ```
315
- QUALIA PROJECT READY
316
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
317
-
318
- {Project Name}
319
- Type {type}
320
- Phases {N}
321
- Client {client}
322
-
323
- → Run: /qualia-plan 1
321
+ ```bash
322
+ node ~/.claude/bin/qualia-ui.js end "PROJECT READY" "/qualia-plan 1"
324
323
  ```
@@ -9,6 +9,10 @@ Save context so the next session picks up where you left off.
9
9
 
10
10
  ## Process
11
11
 
12
+ ```bash
13
+ node ~/.claude/bin/qualia-ui.js banner pause
14
+ ```
15
+
12
16
  ### 1. Read State
13
17
 
14
18
  ```bash
@@ -14,20 +14,23 @@ Spawn a planner agent to break the current phase into executable tasks.
14
14
 
15
15
  ## Process
16
16
 
17
- ### 1. Determine Phase
17
+ ### 1. Determine Phase & Load Knowledge
18
18
 
19
19
  ```bash
20
20
  cat .planning/STATE.md 2>/dev/null
21
+ cat ~/.claude/knowledge/learned-patterns.md 2>/dev/null
22
+ cat ~/.claude/knowledge/client-prefs.md 2>/dev/null
21
23
  ```
22
24
 
23
25
  If no phase number given, use the current phase from STATE.md.
26
+ If any learned patterns apply to this phase's work, pass them to the planner in the spawn prompt under a `## Relevant Learnings` section.
27
+ If this is a client project and `client-prefs.md` has an entry for the client, include those preferences in the planner context.
24
28
 
25
29
  ### 2. Spawn Planner (Fresh Context)
26
30
 
27
- ```
28
- QUALIA PLANNING Phase {N}
29
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
- Spawning planner...
31
+ ```bash
32
+ node ~/.claude/bin/qualia-ui.js banner plan {N} "{phase name from STATE.md}"
33
+ node ~/.claude/bin/qualia-ui.js spawn planner "Breaking phase into tasks..."
31
34
  ```
32
35
 
33
36
  Spawn a subagent with `agents/planner.md` instructions:
@@ -53,25 +56,23 @@ Create the plan file at .planning/phase-{N}-plan.md
53
56
 
54
57
  ### 3. Review Plan
55
58
 
56
- Read the generated plan. Present to employee:
59
+ Read the generated plan. Present the summary using the UI helpers:
57
60
 
61
+ ```bash
62
+ node ~/.claude/bin/qualia-ui.js divider
63
+ node ~/.claude/bin/qualia-ui.js ok "Plan ready: {count} tasks across {count} waves"
58
64
  ```
59
- ◆ Phase {N} Plan
60
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
-
62
- Tasks: {count}
63
- Waves: {count}
64
-
65
- Wave 1 (parallel):
66
- Task 1: {title}
67
- Task 2: {title}
68
65
 
69
- Wave 2 (after Wave 1):
70
- Task 3: {title}
66
+ Then, for each wave, print:
71
67
 
72
- Approve? (yes / adjust)
68
+ ```bash
69
+ node ~/.claude/bin/qualia-ui.js wave {wave_num} {wave_total} {task_count_in_wave}
70
+ node ~/.claude/bin/qualia-ui.js task 1 "{task title}"
71
+ node ~/.claude/bin/qualia-ui.js task 2 "{task title}"
73
72
  ```
74
73
 
74
+ End with an approval prompt (plain text, no UI helper): *"Approve? (yes / adjust)"*
75
+
75
76
  If "adjust" — get feedback, re-spawn planner with revision context.
76
77
 
77
78
  ### 4. Update State
@@ -82,8 +83,8 @@ node ~/.claude/bin/state.js transition --to planned --phase {N}
82
83
  If state.js returns an error, show it to the employee and stop.
83
84
  Do NOT manually edit STATE.md or tracking.json — state.js handles both.
84
85
 
85
- ```
86
- Run: /qualia-build {N}
86
+ ```bash
87
+ node ~/.claude/bin/qualia-ui.js end "PHASE {N} PLANNED" "/qualia-build {N}"
87
88
  ```
88
89
 
89
90
  ### Gap Closure Mode (`--gaps`)
@@ -9,9 +9,8 @@ Run after all feature phases are verified. Makes it look production-ready.
9
9
 
10
10
  ## Process
11
11
 
12
- ```
13
- QUALIA POLISHING
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ ```bash
13
+ node ~/.claude/bin/qualia-ui.js banner polish
15
14
  ```
16
15
 
17
16
  ### 0. Load Design Context
@@ -142,20 +141,17 @@ Do NOT manually edit STATE.md or tracking.json — state.js handles both.
142
141
 
143
142
  ### 6. Report
144
143
 
145
- ```
146
- QUALIA ► POLISHED
147
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
148
- Files modified: {N}
149
-
150
- Typography ✓ {brief}
151
- Color ✓ {brief}
152
- Layout ✓ {brief}
153
- States ✓ {brief}
154
- Motion ✓ {brief}
155
- Accessibility {brief}
156
- Responsive ✓ {brief}
157
- Performance ✓ {brief}
158
- Hardening ✓ {brief}
159
-
160
- → Run: /qualia-ship
144
+ ```bash
145
+ node ~/.claude/bin/qualia-ui.js divider
146
+ node ~/.claude/bin/qualia-ui.js info "Files modified: {N}"
147
+ node ~/.claude/bin/qualia-ui.js ok "Typography — {brief}"
148
+ node ~/.claude/bin/qualia-ui.js ok "Color — {brief}"
149
+ node ~/.claude/bin/qualia-ui.js ok "Layout — {brief}"
150
+ node ~/.claude/bin/qualia-ui.js ok "States — {brief}"
151
+ node ~/.claude/bin/qualia-ui.js ok "Motion — {brief}"
152
+ node ~/.claude/bin/qualia-ui.js ok "Accessibility — {brief}"
153
+ node ~/.claude/bin/qualia-ui.js ok "Responsive — {brief}"
154
+ node ~/.claude/bin/qualia-ui.js ok "Performance — {brief}"
155
+ node ~/.claude/bin/qualia-ui.js ok "Hardening — {brief}"
156
+ node ~/.claude/bin/qualia-ui.js end "POLISHED" "/qualia-ship"
161
157
  ```
@@ -9,12 +9,21 @@ For tasks under 1 hour that don't need full phase planning. Single file changes,
9
9
 
10
10
  ## Process
11
11
 
12
+ ```bash
13
+ node ~/.claude/bin/qualia-ui.js banner quick
14
+ ```
15
+
12
16
  1. **Understand:** Ask what needs to be done (or read the instruction)
13
17
  2. **Build:** Do it directly — read before write, MVP only
14
18
  3. **Verify:** Run `npx tsc --noEmit`, test locally
15
19
  4. **Commit:** Atomic commit with clear message
16
20
  5. **Update:** Update tracking.json notes field
17
21
 
22
+ End with:
23
+ ```bash
24
+ node ~/.claude/bin/qualia-ui.js end "QUICK FIX DONE"
25
+ ```
26
+
18
27
  ```bash
19
28
  git add {specific files}
20
29
  git commit -m "fix: {description}"
@@ -9,6 +9,10 @@ Generate a concise report of what was done. Committed to git and uploaded to the
9
9
 
10
10
  ## Process
11
11
 
12
+ ```bash
13
+ node ~/.claude/bin/qualia-ui.js banner report
14
+ ```
15
+
12
16
  ### 1. Gather Data
13
17
 
14
18
  ```bash
@@ -31,14 +31,19 @@ Restore context and route to the right next action.
31
31
 
32
32
  ### 4. Present and Route
33
33
 
34
+ ```bash
35
+ node ~/.claude/bin/qualia-ui.js banner resume
36
+ node ~/.claude/bin/qualia-ui.js info "Last session: {summary}"
34
37
  ```
35
- ◆ QUALIA ► RESUMING
36
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
37
- Last session: {summary}
38
- Phase: {N} — {status}
39
- {Uncommitted changes if any}
40
38
 
41
- {next command}
39
+ If uncommitted changes:
40
+ ```bash
41
+ node ~/.claude/bin/qualia-ui.js warn "{N} uncommitted files"
42
+ ```
43
+
44
+ End with the next command:
45
+ ```bash
46
+ node ~/.claude/bin/qualia-ui.js next "{next command}"
42
47
  ```
43
48
 
44
49
  Clean up `.continue-here.md` after restoration (or offer to keep it).
@@ -15,6 +15,10 @@ Deep review with severity-scored findings. Different from `/qualia-verify` (whic
15
15
 
16
16
  ## General Review (default)
17
17
 
18
+ ```bash
19
+ node ~/.claude/bin/qualia-ui.js banner review
20
+ ```
21
+
18
22
  Spawn parallel agents analyzing:
19
23
 
20
24
  1. **Code Quality** — Clean code, TypeScript strictness, naming, readability
@@ -9,9 +9,8 @@ Full deployment pipeline with quality gates.
9
9
 
10
10
  ## Process
11
11
 
12
- ```
13
- QUALIA SHIPPING
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ ```bash
13
+ node ~/.claude/bin/qualia-ui.js banner ship
15
14
  ```
16
15
 
17
16
  ### 1. Quality Gates
@@ -73,14 +72,12 @@ curl -s -o /dev/null -w "%{http_code}" {domain}/api/auth/callback
73
72
 
74
73
  ### 6. Report
75
74
 
76
- ```
77
- QUALIA ► SHIPPED ✓
78
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
79
- URL {production url}
80
- Status HTTP 200
81
- Latency {time}ms
82
- Auth ✓
83
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+ ```bash
76
+ node ~/.claude/bin/qualia-ui.js divider
77
+ node ~/.claude/bin/qualia-ui.js ok "URL: {production url}"
78
+ node ~/.claude/bin/qualia-ui.js ok "Status: HTTP 200"
79
+ node ~/.claude/bin/qualia-ui.js ok "Latency: {time}ms"
80
+ node ~/.claude/bin/qualia-ui.js ok "Auth endpoint responds"
84
81
  ```
85
82
 
86
83
  ```bash
@@ -88,6 +85,6 @@ node ~/.claude/bin/state.js transition --to shipped --deployed-url {production u
88
85
  ```
89
86
  Do NOT manually edit STATE.md or tracking.json — state.js handles both.
90
87
 
91
- ```
92
- Run: /qualia-handoff
88
+ ```bash
89
+ node ~/.claude/bin/qualia-ui.js end "SHIPPED" "/qualia-handoff"
93
90
  ```