qualia-framework 4.4.0 → 4.5.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.
@@ -0,0 +1,95 @@
1
+ # PRODUCT — {Project Name}
2
+
3
+ > **Required.** The "who and why" every Qualia agent reads before designing or building anything.
4
+ > `/qualia-new` generates this from 5 questions. Update as the product clarifies.
5
+
6
+ ## Register
7
+
8
+ **One of:** `brand` · `product`
9
+
10
+ - **brand** — design IS the product (marketing, landing, campaign, portfolio). Distinctiveness is the bar.
11
+ - **product** — design SERVES the product (app, admin, dashboard, tool). Earned familiarity is the bar.
12
+
13
+ A project may have BOTH (e.g., marketing site + app). When that's true, list both, and note which surfaces fall under each.
14
+
15
+ ```
16
+ register: product
17
+ secondary: brand (only for /marketing/* routes)
18
+ ```
19
+
20
+ ## Users (specific, not personas)
21
+
22
+ Real humans with real jobs who will use this. Not "small business owners" — Sarah, who runs a 3-person bookkeeping practice in Limassol and pays for QuickBooks because she trusts it. Three users, named, with the workflow in mind.
23
+
24
+ ```
25
+ 1. {Name} — {role + scenario}. {What they're trying to do when they open this}.
26
+ 2. ...
27
+ 3. ...
28
+ ```
29
+
30
+ ## Brand voice
31
+
32
+ How the product sounds in writing. UI strings, error messages, marketing copy. Three adjectives, then one sentence of "voice in motion."
33
+
34
+ ```
35
+ Voice: {three adjectives — e.g., "direct, confident, dry"}
36
+
37
+ Voice in motion: {one paragraph showing the voice in actual sentences. What an
38
+ error message sounds like. What a confirmation sounds like. What the empty state
39
+ sounds like. Concrete, not adjectives.}
40
+ ```
41
+
42
+ ## Anti-references (mandatory, 3-5)
43
+
44
+ Sites the project should NOT look like. Anti-references pin down what the design is reacting against — more useful than positive references.
45
+
46
+ ```
47
+ - {URL or descriptor} — {what it gets wrong for our use case}
48
+ - {URL or descriptor} — ...
49
+ - {URL or descriptor} — ...
50
+ ```
51
+
52
+ For Brand register, these are usually saturated aesthetic lanes (see `rules/design-brand.md`).
53
+ For Product register, these are usually patterns we don't want to inherit (e.g., "Salesforce Lightning — too dense, too many panels").
54
+
55
+ ## Positive references (optional, ≤3)
56
+
57
+ Sites that demonstrate qualities we want to inherit. Less important than anti-references.
58
+
59
+ ```
60
+ - {URL or app name} — {specific quality, e.g., "Linear's keyboard fluency", "Stripe's empty state copy", "Vercel's color restraint"}
61
+ ```
62
+
63
+ ## Strategic principles
64
+
65
+ 3-5 statements that resolve future arguments. Not feature ideas — design/UX principles that compound.
66
+
67
+ ```
68
+ - {Principle}. {One-line rationale.}
69
+ - {Principle}. {One-line rationale.}
70
+ - {Principle}. {One-line rationale.}
71
+ ```
72
+
73
+ Examples:
74
+ - **Density before delight.** Users live in this app 6+ hours/day. Density wins over flourish.
75
+ - **Power users are the primary persona.** Beginners get onboarding. The app optimizes for power.
76
+ - **Speed of glance, not depth of click.** Information visible without interaction beats information one click away.
77
+
78
+ ## Constraints
79
+
80
+ ```
81
+ Framework: {Next.js 16 / React 19 / Vite / Astro / etc}
82
+ Component library: {shadcn-ui · custom · radix · arco · ...}
83
+ Performance budget: {LCP < 2.5s, INP < 200ms, CLS < 0.1, etc}
84
+ Accessibility: WCAG 2.2 AA minimum
85
+ Browsers: {evergreen / IE11 / mobile-first / ...}
86
+ i18n: {languages supported, RTL needed?}
87
+ ```
88
+
89
+ ## Differentiation (one sentence)
90
+
91
+ What someone will remember about this product 24 hours after using it for the first time. If you can't write this in one sentence, the product hasn't decided what it is yet.
92
+
93
+ ```
94
+ {One sentence. What's the memory hook?}
95
+ ```
@@ -1,169 +0,0 @@
1
- ---
2
- name: qualia-design
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
12
- ---
13
-
14
- # /qualia-design — One-Shot Design Transformation
15
-
16
- Read the code, understand what's wrong, fix everything, move on. No reports, no choices.
17
-
18
- ## Usage
19
-
20
- - `/qualia-design` — Full transformation on all frontend files
21
- - `/qualia-design app/page.tsx` — Specific file(s)
22
- - `/qualia-design --scope=dashboard` — Transform a section
23
-
24
- ## Process
25
-
26
- ```bash
27
- node ~/.claude/bin/qualia-ui.js banner design
28
- ```
29
-
30
- ### 1. Read Brand Context
31
-
32
- ```bash
33
- cat .planning/DESIGN.md 2>/dev/null || echo "NO_DESIGN"
34
- ```
35
-
36
- If DESIGN.md exists → it is law. Use exact values from sections 1-9 (Visual Theme, Color Palette, Typography, Components, Layout, Depth, Do's/Don'ts, Responsive, Agent Prompt Guide). If not → use Qualia defaults from `rules/frontend.md`: distinctive fonts, sharp accents, layered backgrounds, no card grids, no blue-purple gradients, full-width layouts.
37
-
38
- ### 2. Find Target Files
39
-
40
- - If specific files given: use those
41
- - If `--scope`: grep for matching files in `app/` and `components/`
42
- - If none: find all `page.tsx`, `layout.tsx`, and component files
43
-
44
- Count them. If ≤ 5, process in main context (step 3a). If > 5, fan out to parallel agents (step 3b).
45
-
46
- ### 3a. Small File Set (≤ 5 files) — main context
47
-
48
- Read EVERY target file before modifying. Critique internally using the structured rubric below, then fix everything (step 4).
49
-
50
- **Critique rubric (required — produces the findings you then fix):**
51
-
52
- | File | Dimension | Issue | Line | Severity |
53
- |------|-----------|-------|------|----------|
54
- | {path} | Typography/Color/Spacing/States/Responsive/A11y/Motion/Microcopy | {specific problem with quote} | {N} | CRITICAL/HIGH/MEDIUM/LOW |
55
-
56
- Apply fixes to every HIGH and CRITICAL item. MEDIUM items fixed if cheap (same file, same category).
57
-
58
- ### 3b. Large File Set (> 5 files) — parallel fan-out
59
-
60
- Split target files into batches of 5. Spawn one Agent per batch IN THE SAME RESPONSE TURN (parallel execution). Each agent receives DESIGN.md inlined + its 5 files + the Design Quality Rubric from `rules/grounding.md`. Agents return their batch's critique table + the actual edits applied. The skill orchestrator fans in the results and runs the final verification (step 5).
61
-
62
- **Forked subagents (v4.2.0+):** if the current conversation already contains
63
- design taste discussion (font choices, palette discussion, motion preferences,
64
- or any color/typography critique threaded across multiple turns) AND
65
- `CLAUDE_AGENT_FORK_ENABLED=1` is set in `~/.claude/settings.json` (the v4.2.0
66
- default), prefer **forked subagents** over blank-context fan-out. Forks
67
- inherit the entire conversation history + share the prompt cache, so the
68
- batch agents see the 50k tokens of accumulated taste instead of a 2k-token
69
- compression. Anthropic shipped this in 2026-04 specifically to solve the
70
- "design subagent loses nuance" failure mode (NotebookLM 2026-04-25 source).
71
- Tell Claude explicitly: "spawn forked subagents to handle these batches in
72
- parallel." For variation-generation work (3 alternative homepage designs)
73
- forks are almost always the right call. For mechanical anti-pattern fixes
74
- (rip out `outline:none`, swap font tokens) blank context is fine — no
75
- nuance to inherit. When in doubt, fork — the cost is the same prompt cache.
76
-
77
- ```
78
- Agent(prompt="
79
- Read your role: builder for design transformation.
80
- Grounding + rubrics: @~/.claude/rules/grounding.md
81
-
82
- <design_system>
83
- {inlined DESIGN.md}
84
- </design_system>
85
-
86
- <target_files>
87
- {5 file paths + their contents}
88
- </target_files>
89
-
90
- Apply the Design Quality Rubric to each file. Fix every dimension scoring below 4. Make the literal edits with the Edit tool. Do NOT change logic — only styling.
91
-
92
- Return:
93
- - Critique table (File | Dimension | Issue | Line | Before-score | After-score)
94
- - List of files modified
95
- - Any anti-pattern greps that remain (report, don't fix beyond scope)
96
- ", subagent_type="general-purpose", description="Design batch {N}")
97
- ```
98
-
99
- Do not process files serially in main context — that's what wastes a context window.
100
-
101
- ### 4. Fix Everything (applies to step 3a OR to each agent in 3b)
102
-
103
- Use exact values from DESIGN.md when available. Sections map to fixes:
104
-
105
- **Typography (§3):** Apply fonts from hierarchy table. Replace any generic fonts (Inter, Arial) with project fonts. Use exact weights, sizes, letter-spacing from the table. Body line-height 1.5-1.7.
106
-
107
- **Color (§2):** Apply palette from CSS variables. Replace scattered hex values with `var(--color-*)`. Verify contrast ratios listed in DESIGN.md.
108
-
109
- **Components (§4):** Match button, card, input, badge specs exactly — padding, radius, shadow, hover states.
110
-
111
- **Layout (§5):** Full-width with fluid padding `clamp(1rem, 5vw, 4rem)`. Apply spacing scale. NO hardcoded max-width caps. Prose gets `max-width: 65ch`.
112
-
113
- **Depth (§6):** Apply shadow levels from elevation table. Use brand-tinted shadows, not neutral gray.
114
-
115
- **Motion (§Motion):** CSS transitions 200-300ms on hover/focus. Staggered entrance animations. `prefers-reduced-motion` respected.
116
-
117
- **States:** Loading skeleton/spinner on async ops. Error states on data fetches. Empty states on lists. Hover/focus/active/disabled on every interactive element.
118
-
119
- **Responsive (§8):** Apply collapsing strategy from table. Mobile-first. Touch targets 44x44px min. No horizontal scroll.
120
-
121
- **Anti-Slop (§12):** Run grep patterns from the detection table. Every match = mandatory fix.
122
-
123
- **Kill:** Card grids → varied layouts. Generic heroes → distinctive. Blue-purple gradients → brand colors. Static pages → purposeful motion. Fixed widths → fluid.
124
-
125
- ### 5. Verify
126
-
127
- Parallel batch — run these in a single response turn:
128
-
129
- ```bash
130
- # TypeScript still compiles?
131
- npx tsc --noEmit 2>&1 | head -20
132
-
133
- # Reverted anti-patterns (any match = regression)
134
- grep -rn "outline.*none\|outline-none" --include="*.tsx" --include="*.css" app/ components/ src/ 2>/dev/null | grep -v "focus-visible\|focus:"
135
- grep -rn "font-family.*Inter\|font-family.*Arial\|font-family.*system-ui\|Space Grotesk" --include="*.tsx" --include="*.css" app/ components/ src/ 2>/dev/null
136
- grep -rn "max-w-\[1200\|max-w-\[1280\|max-width.*1200\|max-w-7xl" --include="*.tsx" --include="*.css" app/ components/ src/ 2>/dev/null
137
- grep -rn "<img " --include="*.tsx" app/ components/ src/ 2>/dev/null | grep -v "alt="
138
- grep -rn "from-blue.*to-purple\|from-purple.*to-blue" --include="*.tsx" --include="*.css" app/ components/ src/ 2>/dev/null
139
- ```
140
-
141
- Fix any TypeScript errors before committing. If any anti-pattern grep returned matches, re-fix those files — the transformation is not complete until these greps return empty.
142
-
143
- ### 6. Commit
144
-
145
- ```bash
146
- git add {modified files}
147
- git commit -m "style: design transformation"
148
- ```
149
-
150
- ```
151
- ⬢ Design Transformation Complete
152
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
153
- Files: {N}
154
- Changes:
155
- - {key change 1}
156
- - {key change 2}
157
- - {key change 3}
158
-
159
- Next: /qualia-polish (final pass) · /qualia-review (scored audit)
160
- ```
161
-
162
- ## Rules
163
-
164
- - Read before write — understand every file before changing it
165
- - Don't ask — just fix
166
- - Respect DESIGN.md decisions
167
- - Don't break functionality — only change styling, never logic
168
- - TypeScript must pass after changes
169
- - All anti-pattern greps in step 5 must return empty before commit