qualia-framework 5.4.0 → 5.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.
@@ -1,199 +0,0 @@
1
- # Session Report — 2026-04-18
2
-
3
- **Project:** qualia-framework
4
- **Branch:** feature/full-journey (local, not pushed)
5
- **Released:** v3.7.0 (staged on feature/story-file-plans) and **v4.0.0** (staged on feature/full-journey)
6
- **Owner:** Fawzi Goussous
7
- **Duration:** ~4 hours
8
-
9
- ## What this session shipped
10
-
11
- Two releases staged on separate feature branches, ready for push + merge + `npm publish`.
12
-
13
- | Tag | Branch | Commits | Theme |
14
- |---|---|---|---|
15
- | **v3.7.0** | feature/story-file-plans | 1 commit (8ae5b0e) | Story-file plan format — every phase plan task carries inline Why, Acceptance Criteria, Validation, explicit Depends on |
16
- | **v4.0.0** | feature/full-journey | 8 commits total (includes v3.7.0) | Full Journey release — /qualia-new maps the entire arc to handoff, --auto chains the Road end-to-end, milestone hierarchy locked, /qualia-idk rebuilt as diagnostician |
17
-
18
- **Test suite:** 150 → 156 green (+6 v4 coverage, 0 regressions).
19
- **Package:** version bumped 3.6.0 → 4.0.0.
20
- **Release candidate:** v4.0.0 commit is `f790554` on feature/full-journey.
21
-
22
- ## Background & trigger
23
-
24
- Fawzi came in with three pain points from Sakani's ERP view:
25
- 1. "Unphased Tasks" and "Phase 0: Central Bank Demo" rendering at the same tree level as "Milestone 1", "Milestone 2", etc. — milestones collapsed into single phases, numbering skipped (missing M5).
26
- 2. `/qualia-new` stops at v1 — team improvises subsequent milestones, no clear path to handoff.
27
- 3. Team members don't understand the framework's dev cycle. Need something a non-technical person can follow without getting lost.
28
-
29
- Plus: "make it sexier," personalize the Qualia experience, enhance every command for best practices, ship a stable v4.0.
30
-
31
- ## The approach
32
-
33
- Split the work into labeled phases on a feature branch so commits tell the story:
34
-
35
- ### v3.7.0 prerequisite — story-file plans
36
- - `templates/plan.md` rewritten to 7-field story-file format (Wave, Files, Depends on, Why, Acceptance Criteria, Action, Validation, Context + optional Persona)
37
- - `agents/planner.md` generates the new format
38
- - `agents/plan-checker.md` validates the 7 fields and cross-checks wave↔deps consistency
39
- - `agents/builder.md` reads rationale, respects Depends on, runs Validation before commit
40
- - `agents/verifier.md` adds 3-layer check (phase Success Criteria + per-task AC + Verification Contract)
41
- - `bin/qualia-ui.js` adds `plan-summary` command — terminal dashboard with colored persona chips, dependency arrows, AC/check counts per task
42
- - `bin/state.js` accepts both legacy `Done when:` and new `Acceptance Criteria:` anchors (backward-compatible)
43
-
44
- Committed on `feature/story-file-plans` as v3.7.0 (`8ae5b0e`). Standalone useful release; branched v4 off of it.
45
-
46
- ### v4.0.0 — Full Journey, phased
47
-
48
- **Phase A — Model foundation** (`2e371c2`)
49
- - `templates/journey.md` — new JOURNEY.md schema (hard ceiling 5 milestones, hard floor 2, final milestone always Handoff with 4 fixed phases)
50
- - `tracking.json` gains `milestone_name`, `milestones[]` (array of closed milestone summaries)
51
- - `state.js close-milestone` readiness guards: MILESTONE_NOT_READY, MILESTONE_TOO_SMALL (both bypassable with --force)
52
- - `state.js init` accepts `--milestone_name` and preserves milestones[] across re-init
53
- - Tests: +4
54
-
55
- **Phase B — Roadmapper + /qualia-new full-journey output** (`87af253`)
56
- - `agents/roadmapper.md` rewritten: now produces JOURNEY.md (all milestones) + REQUIREMENTS.md (grouped by milestone) + ROADMAP.md (Milestone 1's phase detail only)
57
- - **Dropped** the old "no review/deploy/handoff phases" rule. **Replaced** with: final milestone is always literally named "Handoff" with fixed 4 phases.
58
- - `skills/qualia-new/SKILL.md` rewritten: always runs research (no more `workflow.research` gate), single approval on the whole journey, new `--auto` flag
59
- - `agents/research-synthesizer.md` thinks across all milestones
60
- - `skills/qualia-milestone/SKILL.md` reads next milestone from JOURNEY.md (no longer asks user)
61
- - `templates/requirements.md` multi-milestone format with standard Handoff section (HAND-01..HAND-15)
62
- - `templates/roadmap.md` scoped to current milestone only
63
-
64
- **Phase C — Auto-chain wiring** (`400cd17`)
65
- - `--auto` flag added to `/qualia-plan`, `/qualia-build`, `/qualia-verify`, `/qualia-milestone`
66
- - Auto-chain decision table in `/qualia-verify`: PASS → next phase OR milestone close OR ship+handoff; FAIL → gap closure OR halt at limit
67
- - Two human gates total per project: journey approval + each milestone boundary
68
-
69
- **Phase D+E — Builder pre-inline + journey visualization** (`74dd26e`)
70
- - Builder pre-inlines PROJECT.md + DESIGN.md + Context files into agent prompt BEFORE spawning (GSD-pattern borrowing, saves 3-5 Read calls per task)
71
- - `qualia-ui.js journey-tree` renders JOURNEY.md as ASCII ladder (green shipped, teal current, dim future, [FINAL] tag for Handoff)
72
- - `qualia-ui.js milestone-complete` celebration banner
73
- - 5 new banner actions: milestone ◆, journey ◯, auto ⚡, research ◱, roadmap ◐
74
- - `/qualia` router renders journey-tree for "you are here" orientation
75
- - `/qualia-milestone` renders journey-tree + milestone-complete
76
-
77
- **Phase F — Ship-side fields + handoff deliverables** (`b41a52d`)
78
- - `state.js` bumps `build_count` on each 'built' transition, `deploy_count` on each 'shipped' (previously never incremented)
79
- - `qualia-report` ERP payload now includes all v4 fields (project_id, team_id, git_remote, milestone_name, milestones[], build_count, deploy_count, session_started_at, last_pushed_at)
80
- - `/qualia-handoff` rewritten: explicit 4 mandatory deliverables — production URL verified (HTTP + latency + auth), docs updated, `.planning/archive/` check, final ERP report
81
-
82
- **Phase G — Smoke test fix + coverage** (`f62e753`)
83
- - Bug fix: close-milestone summary was recording current phase's tasks, not cumulative milestone total. Fixed via `lifetime.tasks_completed − sum(prior milestones[].tasks_completed)`
84
- - Tests: +2 (cumulative task count, build_count bump)
85
-
86
- **Release (`f790554`)**
87
- - Single unified v4.0.0 release commit
88
- - Package bumped 3.7.0 → 4.0.0
89
- - CHANGELOG.md v4.0.0 entry with full feature list + migration notes
90
- - `/qualia-idk` rebuilt as real diagnostician (was briefly v4.0.1 in the branch history, folded into v4.0.0 per owner request)
91
-
92
- ### The `/qualia-idk` rebuild (folded into v4.0.0)
93
-
94
- Before: thin one-line alias to `/qualia`.
95
-
96
- Now: interpretive diagnostic. When user says "I don't know what's going on" / "something feels off":
97
- 1. Spawns **Plan view** Explore subagent — reads only `.planning/*`, reports what plan says
98
- 2. Spawns **Code view** Explore subagent in parallel — reads only source code, reports what's actually built, cites file:line
99
- 3. Synthesizes: structured "What I see / The mismatch / What I think is happening / What to do next" in plain language
100
- 4. Maps recommendations to existing commands where applicable
101
-
102
- `/qualia` description scoped back to mechanical state routing — no longer claims "idk/stuck/lost/confused" triggers (those route to `/qualia-idk` now).
103
-
104
- ## Competitive research completed
105
-
106
- During the session, ran deep research on competing Claude Code frameworks:
107
- - **Superpowers** (Jesse Vincent) — 93K stars — rigid 5-phase gates, Visual Companion, cross-agent portability
108
- - **BMAD-METHOD** — 43K stars — 12-19 named role agents, story files, expansion packs
109
- - **gstack** (Garry Tan) — 74K stars — 23-role team, persistent browser daemon, /codex cross-model review
110
- - **GSD** (Get Shit Done, v1+v2) — 54K + 6K stars — state-machine auto-advance, pre-inlined dispatch, adaptive replanning
111
- - **SuperClaude, Agent OS, Context Engineering/PRP, Claude-Flow, Cursor 2.0, Windsurf** — broader landscape
112
-
113
- Patterns borrowed in v4.0.0:
114
- - **Story-file plan format** (BMAD) — inline rationale + acceptance criteria
115
- - **State-machine auto-advance** (GSD v2) — the --auto chain
116
- - **Pre-inline context at dispatch** (GSD v2) — builder's <pre-loaded-context> block
117
- - **Journey-as-first-class-artifact** (NotebookLM synthesis of Qualia's own docs)
118
-
119
- Patterns deferred to v4.1+:
120
- - Visual/mockup generation (gstack design-shotgun, Superpowers Visual Companion)
121
- - Cross-model review (gstack /codex)
122
- - Cross-project vector memory (claude-mem, Claude-Flow)
123
- - IDE integration
124
- - Token-budget compression
125
-
126
- ## Verification at checkpoint
127
-
128
- ```
129
- ✅ Git 8 commits clean on feature/full-journey
130
- ✅ Tests 156/156 pass
131
- ✅ Smoke state transitions + close-milestone + milestones[] summary verified on scratch project
132
- ✅ UI journey-tree + milestone-complete render correctly with real fixtures
133
- ✅ Backward compat older tracking.json without milestones[]/milestone_name still passes state.js check
134
- ✅ No regressions Vs v3.6 baseline — all 150 existing tests still pass
135
- ✅ Package version 4.0.0, ready for `npm publish`
136
- ✅ Handoff V4_REVIEW.md written for next agent
137
- ```
138
-
139
- ## Pending (not done by this session)
140
-
141
- - **Git push** — both branches are local only
142
- - **Merge to main** — owner decides merge strategy (recommend v3.7.0 tag then v4.0.0 tag)
143
- - **`npm publish`** — requires owner auth
144
- - **Tag creation** — after merge
145
- - **Live auto-chain verification** — smoke tests covered state machine; the --auto chain (which spawns planner→builder→verifier subagents in sequence) wasn't exercised end-to-end. Recommended first real test is on a throwaway project post-publish.
146
- - **ERP-side updates** — v4 tracking.json fields are additive; ERP should accept them via its existing Zod strip-unknowns pattern, but worth verifying on deploy.
147
-
148
- ## Files the next reviewer should eyeball
149
-
150
- Priority order (highest leverage first):
151
-
152
- 1. `V4_REVIEW.md` — this file lives in repo root, written as the handoff doc
153
- 2. `CHANGELOG.md` [4.0.0] section — full feature list
154
- 3. `templates/journey.md` — new artifact schema
155
- 4. `agents/roadmapper.md` — biggest agent rewrite
156
- 5. `skills/qualia-new/SKILL.md` — core flow, 14 steps
157
- 6. `skills/qualia-idk/SKILL.md` — new diagnostic
158
- 7. `skills/qualia-verify/SKILL.md` — auto-chain decision table
159
- 8. `skills/qualia-handoff/SKILL.md` — 4 deliverables enforcement
160
- 9. `bin/state.js` close-milestone (~975-1050) — readiness guards + summary append
161
- 10. `bin/qualia-ui.js` journey-tree + milestone-complete functions
162
-
163
- ## Recommended publish sequence
164
-
165
- ```bash
166
- # Push both branches
167
- git push -u origin feature/story-file-plans
168
- git push -u origin feature/full-journey
169
-
170
- # Merge v3.7.0 to main, tag, push
171
- git checkout main
172
- git merge --ff-only feature/story-file-plans
173
- git tag v3.7.0
174
- git push origin main --tags
175
-
176
- # Merge v4.0.0 to main, tag, push
177
- git merge --ff-only feature/full-journey
178
- git tag v4.0.0
179
- git push origin main --tags
180
-
181
- # Publish
182
- npm publish
183
- npm view qualia-framework version # should return 4.0.0
184
- ```
185
-
186
- ## Known limitations / open questions
187
-
188
- 1. **Auto-chain not live-tested.** Unit tests cover state transitions; subagent chaining is covered by the skill prompt text but not exercised. First real project run will reveal edge cases.
189
- 2. **Milestone-summary `tasks_completed` accuracy** depends on lifetime counter deltas. Works if close-milestone is the only consumer — verified in test suite.
190
- 3. **/qualia-idk two-pass isolation** depends on Explore subagent respecting the "do not read .planning/" and "do not read source code" instructions. Prompt-level enforcement, not hard boundary.
191
- 4. **Builder pre-inline** inflates prompt size for monorepos with large DESIGN.md + multiple context files. Acceptable for most projects; could be optimized in v4.1.
192
-
193
- ## For questions
194
-
195
- Contact: Fawzi Goussous — fawzi@qualiasolutions.net
196
-
197
- ---
198
-
199
- *Written 2026-04-18 at release-candidate time. Supersedes the 2026-04-17 session report covering v3.4.2 / v3.5.0 / v3.6.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.