qualia-framework 5.4.0 → 5.8.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 (50) hide show
  1. package/README.md +21 -17
  2. package/agents/builder.md +25 -8
  3. package/agents/plan-checker.md +50 -2
  4. package/agents/planner.md +25 -1
  5. package/agents/research-synthesizer.md +4 -1
  6. package/agents/researcher.md +6 -1
  7. package/agents/visual-evaluator.md +1 -1
  8. package/bin/install.js +8 -8
  9. package/bin/plan-contract.js +32 -1
  10. package/bin/slop-detect.mjs +1 -1
  11. package/docs/erp-contract.md +11 -0
  12. package/docs/onboarding.html +623 -0
  13. package/guide.md +8 -9
  14. package/hooks/session-start.js +1 -1
  15. package/package.json +1 -1
  16. package/skills/qualia-discuss/SKILL.md +123 -9
  17. package/skills/qualia-feature/SKILL.md +216 -0
  18. package/skills/qualia-milestone/SKILL.md +73 -1
  19. package/skills/qualia-new/SKILL.md +52 -25
  20. package/skills/qualia-optimize/SKILL.md +1 -1
  21. package/skills/{qualia-polish-loop → qualia-polish}/REFERENCE.md +5 -5
  22. package/skills/qualia-polish/SKILL.md +13 -4
  23. package/skills/{qualia-polish-loop → qualia-polish}/scripts/loop.mjs +2 -2
  24. package/skills/{qualia-polish-loop → qualia-polish}/scripts/playwright-capture.mjs +1 -1
  25. package/skills/qualia-report/SKILL.md +8 -6
  26. package/skills/qualia-road/SKILL.md +10 -11
  27. package/templates/CONTEXT.md +3 -2
  28. package/templates/help.html +1 -1
  29. package/templates/phase-context.md +5 -4
  30. package/templates/project-discovery.md +83 -0
  31. package/templates/project.md +7 -0
  32. package/tests/bin.test.sh +104 -62
  33. package/tests/lib.test.sh +21 -0
  34. package/tests/slop-detect.test.sh +2 -2
  35. package/docs/archive/session-report-2026-04-18.md +0 -199
  36. package/docs/install-redesign-builder-prompt.md +0 -290
  37. package/docs/install-redesign-pilot.md +0 -234
  38. package/docs/instruction-budget-audit.md +0 -113
  39. package/docs/journey-demo.html +0 -1008
  40. package/docs/playwright-loop-builder-prompt.md +0 -185
  41. package/docs/playwright-loop-design-notes.md +0 -108
  42. package/docs/playwright-loop-tester-prompt.md +0 -213
  43. package/docs/polish-loop-supervised-run.md +0 -111
  44. package/skills/qualia-polish-loop/SKILL.md +0 -201
  45. package/skills/qualia-prd/SKILL.md +0 -199
  46. package/skills/qualia-quick/SKILL.md +0 -44
  47. package/skills/qualia-task/SKILL.md +0 -98
  48. /package/skills/{qualia-polish-loop → qualia-polish}/fixtures/broken.html +0 -0
  49. /package/skills/{qualia-polish-loop → qualia-polish}/fixtures/clean.html +0 -0
  50. /package/skills/{qualia-polish-loop → qualia-polish}/scripts/score.mjs +0 -0
@@ -1,290 +0,0 @@
1
- # Qualia Framework — Install Redesign (v5.1.0 candidate)
2
- ## Builder Agent Prompt
3
-
4
- **Hand this entire file to a fresh Claude Code session.** Self-contained — no context from the originating session is needed. Same pattern as `docs/playwright-loop-builder-prompt.md` which produced v5.0's polish-loop work.
5
-
6
- ---
7
-
8
- ## What you are building
9
-
10
- A redesigned installer for the Qualia Framework that:
11
-
12
- 1. **Asks the user where to install** — Claude Code (`~/.claude/`), OpenAI Codex (`~/.codex/`), or both — and adapts the install per target
13
- 2. **Shows real-time visual progress** during the install — what file is being read, what's being copied, what's being configured — not silent then suddenly done
14
- 3. **Has top-notch cosmetics** throughout — every line of output is intentional and beautiful
15
-
16
- The current installer (`bin/install.js`, ~830 lines) is functional but minimal. It copies files in batches and prints section headers ("Skills", "Templates", "Hooks") with terse `✓ {name}` lines. Fawzi wants the install to FEEL like a polished product — like the framework is announcing itself with care, not just dumping files.
17
-
18
- ## Why this matters
19
-
20
- - **First impression is the install.** Every Qualia user (Fawzi, Hasan, Moayad, Rama, Sally, future hires) experiences the framework first through `npx qualia-framework install`. A boring install signals a boring framework.
21
- - **Cross-tool reach.** v5.0.0 already produces `AGENTS.md` (the cross-vendor open standard adopted by Codex, Cursor, Aider, Continue). Codex users could already use the framework today — they just don't know it because the installer only writes to `~/.claude/`. Multi-target makes that explicit.
22
- - **Visual feedback is trust.** When the installer is silent for 5 seconds while it copies 32 skills + 12 hooks + 24 templates, the user wonders if it hung. Live progress makes the framework feel alive.
23
-
24
- ## The repository you're working in
25
-
26
- `/home/qualia-new/qualia-framework` — the Qualia Framework npm package, currently at v5.0.0 on branch `feat/env-empty-guard` (locally, not yet pushed). 274 tests pass. v5.0.0 release is queued for tomorrow morning publish to npm.
27
-
28
- **Your work goes ON TOP of v5.0.0, as v5.1.0.** You'll bump version, add CHANGELOG entry, modify `bin/install.js`, possibly add `bin/install-cosmetics.js` helper, update tests.
29
-
30
- ## Files to study before writing code
31
-
32
- 1. `/home/qualia-new/qualia-framework/bin/install.js` — the current installer (~830 lines). Read it fully to understand the install phases (cleanup → CLAUDE.md/AGENTS.md → skills → agents → rules → hooks → settings.json → MCP → templates → knowledge layer → bin scripts → ERP config → final banner).
33
- 2. `/home/qualia-new/qualia-framework/bin/qualia-ui.js` — the existing cosmetics helper (banners, dividers, end-cards, status). Reuse and extend; don't duplicate.
34
- 3. `/home/qualia-new/qualia-framework/CLAUDE.md` and `AGENTS.md` — to understand what gets templated with `{{ROLE}}` for each install target
35
- 4. `/home/qualia-new/qualia-framework/CHANGELOG.md` v5.0.0 entry — to match the writing style for v5.1.0
36
- 5. `/home/qualia-new/qualia-framework/tests/bin.test.sh` — the install test patterns (lines ~440 onward have the install assertions you'll mirror)
37
-
38
- ## The 3 deliverables
39
-
40
- ### Deliverable 1 — Multi-target install (Claude Code / Codex / Both)
41
-
42
- **Behavior:**
43
-
44
- After the user enters their team code (existing flow), the installer asks:
45
-
46
- ```
47
- Where would you like to install Qualia?
48
-
49
- [1] Claude Code only (recommended — full feature set)
50
- [2] OpenAI Codex only (AGENTS.md + project-level rules)
51
- [3] Both (max compatibility)
52
-
53
- Choice [1]:
54
- ```
55
-
56
- Default is `1` (Claude Code only) for backward-compat. The user types `1`/`2`/`3` and Enter.
57
-
58
- **Per-target install paths:**
59
-
60
- | Target | Directory | What gets installed |
61
- |---|---|---|
62
- | Claude Code | `~/.claude/` | Everything as today (skills/, agents/, hooks/, rules/, qualia-templates/, knowledge/, settings.json, CLAUDE.md, AGENTS.md, bin/, .qualia-config.json) |
63
- | Codex | `~/.codex/` (or wherever Codex config lives — research this) | A subset that Codex actually uses: `AGENTS.md` (the framework conventions), `instructions.md` if Codex uses one, possibly mirrored skills/ and templates/ if Codex's runtime supports skills (research this — it might not; in that case skip those) |
64
- | Both | both directories | Run the Claude Code install first, then the Codex install |
65
-
66
- **Critical research step you MUST do FIRST:**
67
-
68
- Use `WebFetch` or `Bash` to research Codex CLI's actual configuration layout:
69
-
70
- ```bash
71
- # Check if user has codex installed
72
- which codex 2>/dev/null
73
- codex --version 2>/dev/null
74
-
75
- # Look for documented config paths
76
- ls ~/.codex/ 2>/dev/null
77
- ls ~/.config/codex/ 2>/dev/null
78
- ```
79
-
80
- Search for: "OpenAI Codex CLI configuration directory", "Codex AGENTS.md", "Codex skills system" (if any).
81
-
82
- If Codex CLI is too thin to support a meaningful framework install (e.g., it only reads AGENTS.md and that's it), say so explicitly in your output — don't pretend to install more than makes sense. Write a clear note in the CHANGELOG entry: "Codex install writes AGENTS.md only — Codex's runtime does not currently support skills/hooks/agents on disk."
83
-
84
- **If Codex is not installed locally:**
85
-
86
- Don't crash. Show a soft warning:
87
-
88
- ```
89
- ⚠ Codex CLI not detected on this system.
90
- Installing AGENTS.md to ~/.codex/AGENTS.md anyway — Codex will pick it up
91
- when you install via `npm install -g @openai/codex`.
92
- ```
93
-
94
- Then proceed with the Codex-side install (just the file writes).
95
-
96
- ### Deliverable 2 — Real-time visual progress
97
-
98
- **Current installer:** prints section headers, then a batch of `✓ {name}` lines all at once when each section completes. Looks like nothing → nothing → blast of green checkmarks.
99
-
100
- **Redesigned installer:** every meaningful operation prints a "doing" line before, then updates to "done" after. Like a live activity log.
101
-
102
- **Pattern (use Unicode box-drawing for the progression):**
103
-
104
- ```
105
- ▸ Skills (32)
106
- ─────────────────────────────────────────
107
- ⏳ Reading skills/ from framework...
108
- ✓ Reading skills/ from framework
109
- ⏳ Copying qualia-build...
110
- ✓ qualia-build (3 files)
111
- ⏳ Copying qualia-discuss...
112
- ✓ qualia-discuss (1 file)
113
- ⏳ Copying qualia-issues...
114
- ✓ qualia-issues (1 file)
115
- ...
116
- ✓ Skills installed (32 total)
117
- ```
118
-
119
- Use ANSI escape sequences to OVERWRITE the `⏳` line with the `✓` line in place (cursor-up + clear-line) — so the output reads as a steadily-completing list, not a doubled set of lines.
120
-
121
- **For long ops (template recursive copy, knowledge layer init, settings.json merge):**
122
-
123
- Show a spinner that ticks every 100ms:
124
-
125
- ```
126
- ⠋ Merging settings.json (preserving 14 user keys)
127
- ```
128
-
129
- Implement as a tiny helper `startSpinner(text)` returning `stop({ status: "ok" | "warn" | "error", message?: string })`. Don't pull in `ora` or any external dep — write ~30 lines of vanilla Node using `process.stdout.write` + an interval.
130
-
131
- **For each skill/agent/hook/rule/template copied:**
132
-
133
- The current `ok({name})` print becomes a 2-line lifecycle:
134
-
135
- 1. Before copy: `⏳ {name}` (dim, with a working glyph)
136
- 2. After copy: `✓ {name}` (green, replacing the line above)
137
-
138
- For very fast ops (single file, < 50ms) you can skip the "doing" state and go straight to ✓.
139
-
140
- **Enhancements to existing `bin/qualia-ui.js`:**
141
-
142
- Add these new helpers and export them:
143
-
144
- - `spinner(text)` → `{ stop(result) }` — animated spinner with cursor-hide/show
145
- - `step(text)` → returns a step-handle with `.ok(suffix?)`, `.warn(msg)`, `.fail(msg)` that overwrite the line
146
- - `progress(current, total, label)` — render a bar like `[████████░░] 8/10 — Skills`
147
- - `divider(width)` — variable-width dim divider
148
- - `box({title, lines, color})` — boxed section like the welcome banner
149
- - `kv(label, value, options?)` — left-padded label, right-aligned value, dim/highlight options
150
-
151
- Preserve all existing `qualia-ui.js` exports — additive only.
152
-
153
- ### Deliverable 3 — Top-notch cosmetics throughout
154
-
155
- The full install output, end-to-end, should feel like a single intentional document. Specific things to fix:
156
-
157
- **The current install banner** (the welcome card at the top with `⬢ Q U A L I A`) is good. Keep its bones, but consider:
158
- - Subtle 2-color gradient on the title (teal → cyan) using truecolor escape
159
- - A breath of vertical space (one blank line above and below)
160
- - Version + framework subtitle aligned right of the hex glyph
161
-
162
- **Section separators** between phases (Skills, Agents, Rules, Hooks, Templates, etc.):
163
- - Currently: bold teal triangle + section name + dim divider
164
- - Upgrade: add a 2-letter status indicator at the right margin showing pass count, like `▸ Skills 32 ✓`
165
- - After each section completes, show a one-line "section summary" with the count and elapsed time: ` └─ 32 skills · 0.3s`
166
-
167
- **Final summary card** (the "INSTALLED" banner at the end):
168
- - Currently: name + role + version + 7 metric kv lines + Quick Start
169
- - Upgrade: add a "Targets" row showing where you installed (`Claude Code · Codex · Both`)
170
- - Add a "Time" row showing total install duration
171
- - Add a contextual "First command to try" line based on whether the user has a `.planning/` already (suggest `/qualia` if they do, `/qualia-new` if not)
172
-
173
- **Color palette discipline:**
174
- - Match the existing OKLCH-tinted neutrals in `bin/qualia-ui.js`
175
- - Don't introduce new colors — extend the existing teal/green/dim/white system
176
- - Errors stay red (#ef4444), warns stay yellow (#eab308) — don't change these (muscle memory)
177
-
178
- **Glyph rules:**
179
- - ⬢ = brand mark, only for the welcome banner and final card
180
- - ▸ = section header
181
- - ✓ = success
182
- - ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ = spinner frames (Braille pattern dots)
183
- - ⏳ = pending/in-flight
184
- - ⚠ = warning
185
- - ✗ = error
186
- - └─ = section close
187
- - · = inline separator
188
-
189
- Don't introduce other glyphs without strong reason.
190
-
191
- ## Hard constraints (non-negotiable)
192
-
193
- 1. **Backward compatibility.** A user typing only their team code with no target choice (legacy stdin pipe `echo "QS-FAWZI-01" | npx qualia-framework install`) MUST still work — default to Claude Code only. Don't break the existing `bin.test.sh` install assertions.
194
-
195
- 2. **No new external dependencies.** No `ora`, no `chalk`, no `ink`. Vanilla Node + ANSI escapes. The current installer is dependency-free; preserve that.
196
-
197
- 3. **Cross-platform (Windows + macOS + Linux).** ANSI escapes work on modern Windows 10+ but verify the spinner doesn't break on `cmd.exe`. If `process.stdout.isTTY` is false (piped install), degrade gracefully — print plain `→ {name}` and `✓ {name}` lines instead of overwriting.
198
-
199
- 4. **Atomic writes for new target paths.** When installing to `~/.codex/`, follow the same atomic-write (tmp + rename) pattern that v5.0 added for `settings.json` and CLAUDE.md.
200
-
201
- 5. **Backups before overwrite** — same as v5.0's CLAUDE.md/settings.json discipline. If `~/.codex/AGENTS.md` exists with a different content hash than what we'd write, back it up to `~/.codex/AGENTS.md.bak.{ISO-timestamp}` before overwriting.
202
-
203
- 6. **No surprise side effects.** Installing to Codex doesn't auto-install Codex CLI itself. If it's not present, write the files and tell the user to install Codex separately.
204
-
205
- 7. **Slop-detect clean.** Run `node bin/slop-detect.mjs` on every modified `.md` file. The CHANGELOG and any new docs you write must pass.
206
-
207
- 8. **Tests pass.** All 274 existing tests must continue to pass. Add new tests for: target selection (1/2/3 input), Codex install path creation, AGENTS.md backup-before-overwrite, spinner degradation when non-TTY, multi-target ("Both") flow.
208
-
209
- ## Deliverables (the DONE definition)
210
-
211
- Return DONE only when all of these are true:
212
-
213
- 1. ✅ `bin/install.js` modified to ask the install-target question after the team code prompt
214
- 2. ✅ Codex-target install actually writes to `~/.codex/` (or whatever the research found is correct)
215
- 3. ✅ All file copies have a "before/after" 2-line lifecycle (or single-line for sub-50ms ops)
216
- 4. ✅ `bin/qualia-ui.js` extended with `spinner()`, `step()`, `progress()`, `box()`, `kv()` helpers
217
- 5. ✅ Final summary card shows install targets, total time, and contextual first-command suggestion
218
- 6. ✅ TTY-degraded mode works (test: `echo QS-FAWZI-01 | node bin/install.js > /tmp/log.txt`; the log should be readable, no orphaned escape codes)
219
- 7. ✅ Backups for existing AGENTS.md / instructions.md in Codex target dir
220
- 8. ✅ All 274 v5.0 tests still pass + at least 5 new tests for v5.1 multi-target
221
- 9. ✅ `node bin/slop-detect.mjs` clean on all modified .md files
222
- 10. ✅ `package.json` bumped to 5.1.0
223
- 11. ✅ CHANGELOG.md has a v5.1.0 entry with the same writing style as the v5.0.0 entry, including:
224
- - The "why this matters" framing (first impression, cross-tool reach, visual trust)
225
- - The 3 deliverables
226
- - The Codex install scope (whatever the research determined)
227
- - Honest caveats (what doesn't work, what's deferred)
228
- 12. ✅ `docs/install-redesign-pilot.md` documenting:
229
- - The full install output captured for each target choice (1, 2, 3)
230
- - Screenshots or terminal-recording converted to ANSI text
231
- - Timing measurements
232
- - Any TTY-degradation issues found
233
-
234
- ## Self-test scenarios (run all 3 before declaring DONE)
235
-
236
- **Scenario 1 — Claude Code only.**
237
- ```bash
238
- TMP=$(mktemp -d)
239
- echo -e "QS-FAWZI-01\n1\n" | HOME="$TMP" node bin/install.js > "$TMP/log.txt" 2>&1
240
- ```
241
- - Verify: `~/.claude/` populated as today. `~/.codex/` does not exist or is empty.
242
- - Verify: `$TMP/log.txt` shows the new visual progress (every section has live updates).
243
- - Verify: total install time is ≤ 2× the current install time (live updates shouldn't more than double cost).
244
-
245
- **Scenario 2 — Codex only.**
246
- ```bash
247
- TMP=$(mktemp -d)
248
- echo -e "QS-FAWZI-01\n2\n" | HOME="$TMP" node bin/install.js > "$TMP/log.txt" 2>&1
249
- ```
250
- - Verify: `~/.codex/AGENTS.md` exists with `Role: OWNER` substituted.
251
- - Verify: `~/.claude/` is NOT populated (we picked target 2 only).
252
- - Verify: log shows "Codex CLI not detected — file written anyway" if `which codex` fails.
253
-
254
- **Scenario 3 — Both.**
255
- ```bash
256
- TMP=$(mktemp -d)
257
- echo -e "QS-FAWZI-01\n3\n" | HOME="$TMP" node bin/install.js > "$TMP/log.txt" 2>&1
258
- ```
259
- - Verify: both `~/.claude/` and `~/.codex/` populated correctly.
260
- - Verify: final summary card shows "Targets: Claude Code · Codex".
261
-
262
- ## Things you MUST NOT do
263
-
264
- - Don't change the team-code prompt itself (existing format works, has tests, don't break them).
265
- - Don't add interactive yes/no prompts beyond the target-selection question — the install should still complete via stdin pipe with no extra input needed.
266
- - Don't change `~/.claude/` install behavior beyond cosmetics. The semantic install logic (which files go where) stays exactly as v5.0.
267
- - Don't wire Codex to any external API or auto-install. File copies only.
268
- - Don't bump major version (still 5.x). This is a minor (5.1.0).
269
- - Don't break the ERP API key save/load flow — `~/.claude/.erp-api-key` stays where it is.
270
- - Don't drop the EXPERIMENTAL Playwright caveat in the v5.0.0 CHANGELOG — preserve it as historical context.
271
-
272
- ## Reference: where v5.0's similar work happened
273
-
274
- Look at how the polish-loop builder agent (commit `907312c`) handled a similar scope — building a flagship feature with self-tests, CHANGELOG, install assertions. Match its discipline:
275
- - Per-iteration commits during pilot scenarios (`qpl-N:` prefix style — yours could be `install-redesign-N:`)
276
- - Honest caveats in CHANGELOG (don't oversell)
277
- - Pilot results doc with concrete measurements
278
- - Trust-boundary comment in any new agent role file (none expected here, but if you create one, copy the pattern from `agents/builder.md` lines 11-17)
279
-
280
- ## When you encounter unknowns
281
-
282
- - **Codex config layout** — the most likely unknown. If web search + local probing don't give a clear answer, write the simplest version (just `~/.codex/AGENTS.md`) and document it explicitly: "Codex install scope: AGENTS.md only. If Codex's runtime later supports skills/hooks on disk, the framework can extend this."
283
- - **TTY degradation edge cases** — if cmd.exe on Windows has issues, document and gate the spinner behind `process.platform !== "win32"` for the spinner specifically. The 2-line copy/✓ pattern should work everywhere.
284
- - **Existing install test breakage** — if you can't avoid breaking a test, the test was overspecified. Update the test, but document WHY in the commit message.
285
-
286
- ## One last thing
287
-
288
- Fawzi (the framework owner, OWNER role) will read your output as the FIRST install he runs. He's tired tonight and trusting you to deliver. Honest reporting beats good-news theater. If something doesn't work cleanly, mark it experimental and say so — same discipline as the polish-loop EXPERIMENTAL Playwright caveat.
289
-
290
- When you finish, write your DONE report at `docs/install-redesign-pilot.md` (file already mentioned above) and return a tight summary: targets working, lines of code added/changed, test count, slop-detect status, any BLOCKED items.
@@ -1,234 +0,0 @@
1
- # Install Redesign — Pilot Results (v5.1.0)
2
-
3
- Captured output and timing measurements for the three install-target
4
- scenarios, run on Linux 6.19 / Node 22 / non-TTY (piped stdin).
5
-
6
- All three scenarios pass cleanly. Total installer wall-clock cost
7
- remains under 200ms; the live-progress lifecycle adds negligible
8
- overhead because most file copies finish under 50ms (sub-50ms ops skip
9
- the "doing" state and go straight to `✓`).
10
-
11
- ## Method
12
-
13
- ```bash
14
- TMP=$(mktemp -d)
15
- START=$(date +%s%N)
16
- printf 'QS-FAWZI-01\n<CHOICE>\n' | HOME="$TMP" node bin/install.js > log.txt 2>&1
17
- END=$(date +%s%N)
18
- echo "wall-clock: $(( (END-START)/1000000 ))ms"
19
- ```
20
-
21
- ANSI codes stripped from the captured logs below for readability. The
22
- real install renders the same lines with OKLCH-tinted teal / dim white
23
- / green / yellow per `bin/qualia-ui.js`.
24
-
25
- ## Scenario 1 — Claude Code only (target=1, the default)
26
-
27
- **Wall-clock:** 99ms · **Lines:** 202 · **Result:** `~/.claude/` populated
28
- (11 entries: agents, bin, CLAUDE.md, hooks, knowledge, qualia-guide.md,
29
- qualia-references, qualia-templates, rules, settings.json, skills),
30
- `~/.codex/` not created.
31
-
32
- ```
33
- ⬢ Q U A L I A
34
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
35
- Framework v5.1.0 · Qualia Solutions
36
- Plan → Build → Verify → Ship
37
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
-
39
- Enter install code: QS-FAWZI-01
40
-
41
- ✓ Welcome, Fawzi Goussous
42
- Role: OWNER
43
-
44
- Where would you like to install Qualia?
45
-
46
- [1] Claude Code only — recommended, full feature set
47
- [2] OpenAI Codex only — AGENTS.md (Codex's open standard)
48
- [3] Both — max compatibility
49
-
50
- Choice [1]: 1
51
-
52
- Target: Claude Code
53
-
54
- ▸ Skills
55
- ────────────────────────────────────────
56
- ✓ qualia
57
- ✓ qualia-build
58
- ✓ qualia-debug
59
- ... (33 skills total) ...
60
- ✓ zoho-workflow
61
- └─ 33 skills · 4ms
62
-
63
- ▸ Agents
64
- ────────────────────────────────────────
65
- ✓ builder.md
66
- ... (9 agents total) ...
67
- ✓ visual-evaluator.md
68
- └─ 9 agents · 0ms
69
-
70
- ▸ Rules
71
- ────────────────────────────────────────
72
- ... (10 rules) ...
73
- └─ 10 rules · 0ms
74
-
75
- ▸ Hooks (12 wired)
76
- ▸ Templates (16 entries, recursive)
77
- ▸ Knowledge layer (initialized on first install)
78
- ▸ References (methodology docs)
79
- ▸ Configuration (CLAUDE.md role substituted)
80
- ▸ Scripts (state.js, qualia-ui.js, etc.)
81
- ▸ Knowledge Base (learned-patterns / common-fixes / client-prefs)
82
- ▸ ERP Integration (key opt-in)
83
-
84
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
85
- ⬢ INSTALLED
86
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
87
-
88
- Fawzi Goussous · OWNER · v5.1.0
89
-
90
- Targets Claude Code
91
- Time 99ms
92
-
93
- Skills 33 Agents 9 Hooks 12
94
- Rules 10 Scripts 7 Templates 16
95
-
96
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
97
- Quick Start
98
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
-
100
- 1. Restart Claude Code (loads new settings)
101
- 2. cd into any project and run claude
102
- 3. Try /qualia-new — kickoff a new project
103
-
104
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
- Welcome to the future with Qualia.
106
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
- ```
108
-
109
- ## Scenario 2 — Codex only (target=2)
110
-
111
- **Wall-clock:** 183ms (extra cost is the `which codex` probe via
112
- `spawnSync`) · **Lines:** 56 · **Result:** `~/.codex/AGENTS.md` written
113
- with `Role: OWNER` substituted, `~/.claude/` not touched.
114
-
115
- ```
116
- ⬢ Q U A L I A
117
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
- Framework v5.1.0 · Qualia Solutions
119
- ...
120
-
121
- Choice [1]: 2
122
-
123
- Target: Codex
124
-
125
- ▸ Codex
126
- ────────────────────────────────────────
127
- ✓ AGENTS.md (configured as OWNER)
128
- └─ Codex install scope: AGENTS.md only — Codex's runtime does not currently
129
- consume the framework's skills/hooks/agents on disk. AGENTS.md carries
130
- the rules; commands route through Claude Code.
131
-
132
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
- ⬢ INSTALLED
134
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
135
-
136
- Fawzi Goussous · OWNER · v5.1.0
137
-
138
- Targets Codex
139
- Time 183ms
140
-
141
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
142
- Quick Start
143
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
144
-
145
- 1. Open Codex in any project
146
- 2. Codex picks up ~/.codex/AGENTS.md automatically
147
- 3. Ask Codex about Qualia rules — they're in AGENTS.md
148
- ```
149
-
150
- If `which codex` fails (CLI not installed), the section prints a soft
151
- warning before the file write; the AGENTS.md is still written so the
152
- user is set up for when they install Codex via
153
- `npm install -g @openai/codex`.
154
-
155
- ## Scenario 3 — Both (target=3)
156
-
157
- **Wall-clock:** 193ms · **Lines:** 209 · **Result:** Both `~/.claude/`
158
- and `~/.codex/AGENTS.md` populated. Final summary shows
159
- `Targets Claude Code · Codex`.
160
-
161
- The Claude install runs first (identical to Scenario 1), then the Codex
162
- section appends:
163
-
164
- ```
165
- ▸ Codex
166
- ────────────────────────────────────────
167
- ✓ AGENTS.md (configured as OWNER)
168
- └─ Codex install scope: AGENTS.md only — ...
169
- ```
170
-
171
- Final card:
172
-
173
- ```
174
- Targets Claude Code · Codex
175
- Time 193ms
176
- ```
177
-
178
- ## Backward compatibility — legacy single-line piped install
179
-
180
- ```bash
181
- echo "QS-FAWZI-01" | npx qualia-framework install
182
- ```
183
-
184
- still works untouched. The target prompt sees EOF on stdin, normalizes
185
- to `1` (Claude only). Confirmed by test 121 in `tests/bin.test.sh`.
186
-
187
- ## TTY-degradation verification
188
-
189
- In non-TTY mode (output piped to a file), the live-progress primitives
190
- in `bin/qualia-ui.js` skip:
191
-
192
- - The Braille spinner (`spinner()`) — prints a one-shot `→ text` /
193
- `✓ text` instead of an animated frame loop.
194
- - The cursor-up / clear-line overwrites (`step()`) — skips the
195
- `⏳ doing` line and prints the result line directly when finalized.
196
- - Cursor hide/show escapes — never emitted.
197
-
198
- Verified by test 124: `grep` for bare `\r`, `?25` (hide-cursor), and
199
- `\[2K` (clear-line) on a piped install log returns nothing.
200
-
201
- ## Timing budget
202
-
203
- | Scenario | Wall-clock | Lines emitted | Notes |
204
- |----------|------------|---------------|-------|
205
- | 1 — Claude only | 99ms | 202 | Baseline |
206
- | 2 — Codex only | 183ms | 56 | + `which codex` probe (~80ms on Node 22 / Linux) |
207
- | 3 — Both | 193ms | 209 | Claude + Codex back-to-back |
208
-
209
- The spec budget was "≤ 2× the current install time." v5.1 stays comfortably
210
- under it — the live updates and section timing add only the cost of the
211
- extra console.log calls (negligible) and a couple of `Date.now()` calls
212
- per section.
213
-
214
- ## Known limitations / deferred to v5.2
215
-
216
- - **Codex skills/hooks/agents not mirrored.** Codex uses `.toml` agent
217
- format and a different hook schema. AGENTS.md is the rule layer they
218
- share; the rest stays Claude-only until Codex's on-disk surface
219
- stabilizes for cross-mapping.
220
- - **Spinner cosmetics on `cmd.exe`.** Braille frames may render as
221
- boxes on legacy `cmd.exe`. Modern Windows Terminal handles them. The
222
- install completes correctly either way; this is purely cosmetic.
223
- - **`Time` row precision.** Sub-second installs show `Xms`; ≥1s installs
224
- show `X.Ys`. Either format is grep-friendly (regex
225
- `Time *[0-9]+(\.[0-9]+)?(ms|s)`).
226
-
227
- ## What this enables
228
-
229
- A user piping `npx qualia-framework install` from a fresh box now has
230
- a one-keystroke choice between Claude-only (the recommended default)
231
- and shipping Qualia's rule layer to OpenAI Codex via the open AGENTS.md
232
- standard. The live-progress redesign means even a 5-second install
233
- feels like an intentional product, not a hung process. First impression
234
- matches the rest of the framework's polish.
@@ -1,113 +0,0 @@
1
- # Instruction-Budget Audit
2
-
3
- > **Date:** 2026-05-06
4
- > **Trigger:** Re-study of *Skills and Strategies for Real Engineering with Claude Code* (Matt Pocock) and *Context and Tools: Mastering the AI Engineering Lifecycle* (Patrick Debois, Karpathy, Pocock, Mario Zechner).
5
- > **Question:** Does Qualia Framework actually honor the "load on demand, not always" promise written in `CLAUDE.md`?
6
-
7
- ## Finding 1 — `~/.claude/rules/*.md` is loaded eagerly by Claude Code
8
-
9
- Claude Code auto-discovers and injects every Markdown file under `~/.claude/rules/` into the system prompt of every session. This is **harness behavior**, not framework behavior — there is no `@-import` declaration in `~/.claude/CLAUDE.md`, yet the rules appear in the system reminder verbatim.
10
-
11
- **Measured cost (2026-05-06 install):**
12
-
13
- | File | Lines | Notes |
14
- |---|---|---|
15
- | `design-reference.md` | 179 | Motion specs, WCAG checklist, breakpoints |
16
- | `design-rubric.md` | 157 | 8-dimension verifier rubric |
17
- | `design-laws.md` | 148 | OKLCH, color strategy, typography |
18
- | `frontend.md` | 118 | Brand standards |
19
- | `design-brand.md` | 114 | Brand register |
20
- | `design-product.md` | 114 | Product register |
21
- | `grounding.md` | 114 | Severity rubric, citation format |
22
- | `infrastructure.md` | 87 | Stack, MCP servers, CLIs |
23
- | `deployment.md` | 30 | Post-deploy checklist |
24
- | `speed.md` | 23 | Speed rules |
25
- | `context7.md` | 14 | Context7 trigger rule |
26
- | `security.md` | 12 | RLS, auth, secrets |
27
- | **Total** | **1110** | |
28
-
29
- At ~4 chars/line average that is **~28 KB injected on every session**, regardless of whether the user is touching frontend, backend, infra, or nothing.
30
-
31
- The rule files themselves are written under the assumption that a skill or agent will read them on demand (e.g., `agents/builder.md` line 139 says *"Security, design, and performance rules auto-load from `rules/*.md` based on the files you touch"*) — which is correct **inside subagent fork prompts** but **wrong for the user's main session**, where the harness loads them all preemptively.
32
-
33
- ## Finding 2 — `CLAUDE.md` template is already disciplined
34
-
35
- The framework `CLAUDE.md` template is 24 lines and ends with the right note:
36
-
37
- > *"this file stays under 25 lines. Steering rules go into discoverable skills, not into the global system prompt. CLI preferences go into hooks. Stack/architecture details are trivially discoverable in package.json/config."*
38
-
39
- This part is healthy. The leak is in `rules/`, not `CLAUDE.md`.
40
-
41
- ## Finding 3 — Skill dedup hypothesis was wrong
42
-
43
- A first pass suggested deleting `qualia-quick`, `qualia-road`, `qualia-help`, `qualia-handoff` as duplicates. Cross-reference check showed:
44
-
45
- - `qualia-quick` is referenced from `bin/install.js`, `hooks/session-start.js`, `templates/help.html`, `README.md`, `guide.md`, `skills/qualia-prd/SKILL.md`, `skills/qualia-task/SKILL.md` — load-bearing.
46
- - `qualia-road` is referenced from `CLAUDE.md`, `AGENTS.md`, `README.md`, `guide.md`, `skills/qualia-help/SKILL.md` description — load-bearing.
47
- - `qualia-help` opens an HTML reference — distinct purpose from `qualia-road` (terminal map).
48
- - `qualia-handoff` is the final delivery skill, referenced from `bin/state.js:490`, ship/verify, journey-demo — load-bearing.
49
-
50
- **Each skill has a job.** No deletion is safe in this PR. The right fix is *boundary clarity in descriptions* (so the LLM picks correctly), not deletion.
51
-
52
- ## Recommended follow-ups (deferred to separate PRs)
53
-
54
- ### R1 — Move design rules to a lazy folder *(big, risky)*
55
-
56
- ```
57
- ~/.claude/rules/ # always-loaded (HARNESS)
58
- ├── grounding.md (114) # KEEP — universal
59
- ├── security.md (12) # KEEP — universal
60
- ├── speed.md (23) # KEEP — universal
61
- ├── context7.md (14) # KEEP — universal
62
- └── infrastructure.md (87) # KEEP — universal stack
63
- # total: ~250 lines
64
-
65
- ~/.claude/qualia-design/ # explicit-load only
66
- ├── design-laws.md (148)
67
- ├── design-brand.md (114)
68
- ├── design-product.md (114)
69
- ├── design-reference.md (179)
70
- ├── design-rubric.md (157)
71
- ├── frontend.md (118)
72
- └── deployment.md (30) # post-deploy checklist; loaded by /qualia-ship
73
- # total: 860 lines, NOT auto-loaded
74
- ```
75
-
76
- Skills/agents that need design rules `Read` them on demand (already the pattern in `agents/builder.md` and `agents/verifier.md`). The save: **~28 KB → ~6 KB injected per session, ~22 KB recovered.**
77
-
78
- Required changes:
79
- 1. `bin/install.js` — install design rules to `~/.claude/qualia-design/` instead of `~/.claude/rules/`.
80
- 2. Every skill/agent reference path `rules/design-*.md` → `qualia-design/design-*.md` or use `~/.claude/qualia-design/design-*.md` absolute.
81
- 3. Update `hooks/session-start.js` `CRITICAL_FILES` health check.
82
- 4. Migration step in `bin/install.js` to clean up old `~/.claude/rules/design-*.md` for existing installs.
83
-
84
- **Effort:** M-L. **Impact:** ~80% reduction in always-loaded substrate.
85
-
86
- ### R2 — Skill description sharpening *(small, safe)*
87
-
88
- `qualia-quick` and `qualia-task` overlap in description. Tighten:
89
- - `qualia-quick`: "≤1 hour, 1 file, no plan, no spawn — just do it."
90
- - `qualia-task`: "1–3 hours, 1–5 files, fresh builder spawn, atomic commit, no phase plan."
91
-
92
- `qualia-road` and `qualia-help` overlap. Clarify:
93
- - `qualia-road`: "Terminal-rendered workflow map. Use over SSH or when no browser."
94
- - `qualia-help`: "Browser-rendered HTML reference. Default."
95
-
96
- ### R3 — Per-skill versioning + eval harness *(carry-over from notebook 1, source 6 — Debois)*
97
-
98
- Each skill carries its own `version:` in frontmatter and a `tests/skills/{skill-name}.spec.sh` fixture. CI runs the fixture against the skill spec. Catches silent skill rot when CC behavior changes underneath.
99
-
100
- ### R4 — MCP tier-list rule in `rules/speed.md` *(carry-over from notebook 1, source 5 — CLI vs MCP)*
101
-
102
- Codify the "CLI-first" principle. Reference the existing `/supabase` skill replacing 32 supabase MCP tools as the canonical example.
103
-
104
- ## What changed in *this* PR
105
-
106
- This PR ships the changes that don't require user-state migration:
107
-
108
- 1. **Citation enforcement preamble** in `agents/builder.md` and `agents/verifier.md` — closes notebook 2, source #9 (*Never Trust an LLM*). Builders and verifiers must cite `file:line — "quoted"` or write `INSUFFICIENT EVIDENCE`. No hedging, no narration.
109
- 2. **`rules/architecture.md`** — net-new, deep-modules + scout-for-shallow-code from notebook 2 sources #5 + #12 (Pocock de-slop, codebase-not-ready-for-AI). Skill `/qualia-optimize --deepen` already exists; this rule formalizes the architectural taste it scouts for.
110
- 3. **README warning** — "Never run Claude's `/init`" — direct users to `/qualia-new` or `/qualia-map`. Per notebook 2 sources #3 + #8.
111
- 4. **This audit document** — anchors the deferred follow-ups so they don't get lost.
112
-
113
- The relocation in R1 is the biggest single win available; it is intentionally deferred so this PR stays small and reversible.