qualia-framework 6.2.7 → 6.2.10
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.
- package/README.md +18 -11
- package/agents/builder.md +7 -7
- package/agents/planner.md +39 -3
- package/agents/research-synthesizer.md +1 -1
- package/agents/researcher.md +3 -3
- package/agents/roadmapper.md +7 -7
- package/agents/verifier.md +18 -6
- package/agents/visual-evaluator.md +8 -7
- package/bin/cli.js +111 -14
- package/bin/codex-goal.js +92 -0
- package/bin/contract-runner.js +219 -0
- package/bin/host-adapters.js +66 -0
- package/bin/install.js +171 -124
- package/bin/plan-contract.js +99 -2
- package/bin/planning-hygiene.js +262 -0
- package/bin/runtime-manifest.js +32 -0
- package/bin/state-ledger.js +184 -0
- package/bin/state.js +299 -20
- package/bin/trust-score.js +276 -0
- package/docs/onboarding.html +5 -4
- package/guide.md +3 -2
- package/hooks/pre-deploy-gate.js +27 -0
- package/hooks/pre-push.js +19 -0
- package/package.json +1 -1
- package/qualia-design/design-rubric.md +17 -5
- package/qualia-design/frontend.md +5 -1
- package/qualia-design/graphics.md +47 -0
- package/rules/codex-goal.md +46 -0
- package/rules/command-output.md +35 -0
- package/skills/qualia/SKILL.md +10 -10
- package/skills/qualia-build/SKILL.md +24 -14
- package/skills/qualia-debug/SKILL.md +16 -8
- package/skills/qualia-discuss/SKILL.md +10 -10
- package/skills/qualia-doctor/SKILL.md +140 -0
- package/skills/qualia-feature/SKILL.md +27 -21
- package/skills/qualia-fix/SKILL.md +216 -0
- package/skills/qualia-flush/SKILL.md +9 -9
- package/skills/qualia-handoff/SKILL.md +9 -9
- package/skills/qualia-help/SKILL.md +3 -3
- package/skills/qualia-hook-gen/SKILL.md +1 -1
- package/skills/qualia-idk/SKILL.md +4 -4
- package/skills/qualia-issues/SKILL.md +2 -2
- package/skills/qualia-learn/SKILL.md +10 -10
- package/skills/qualia-map/SKILL.md +2 -2
- package/skills/qualia-milestone/SKILL.md +15 -15
- package/skills/qualia-new/REFERENCE.md +9 -9
- package/skills/qualia-new/SKILL.md +14 -14
- package/skills/qualia-optimize/REFERENCE.md +1 -1
- package/skills/qualia-optimize/SKILL.md +23 -16
- package/skills/qualia-pause/SKILL.md +2 -2
- package/skills/qualia-plan/SKILL.md +27 -13
- package/skills/qualia-polish/REFERENCE.md +14 -14
- package/skills/qualia-polish/SKILL.md +64 -19
- package/skills/qualia-polish/scripts/loop.mjs +3 -3
- package/skills/qualia-polish/scripts/score.mjs +9 -3
- package/skills/qualia-postmortem/SKILL.md +9 -9
- package/skills/qualia-report/SKILL.md +23 -23
- package/skills/qualia-research/SKILL.md +5 -5
- package/skills/qualia-resume/SKILL.md +4 -4
- package/skills/qualia-review/SKILL.md +28 -12
- package/skills/qualia-road/SKILL.md +18 -5
- package/skills/qualia-ship/SKILL.md +22 -22
- package/skills/qualia-skill-new/SKILL.md +13 -13
- package/skills/qualia-test/SKILL.md +5 -5
- package/skills/qualia-triage/SKILL.md +1 -1
- package/skills/qualia-verify/SKILL.md +37 -23
- package/skills/qualia-vibe/SKILL.md +13 -10
- package/skills/qualia-vibe/scripts/extract.mjs +1 -1
- package/skills/zoho-workflow/SKILL.md +1 -1
- package/templates/help.html +12 -10
- package/tests/bin.test.sh +35 -5
- package/tests/install-smoke.test.sh +23 -3
- package/tests/lib.test.sh +290 -0
- package/tests/runner.js +3 -0
- package/tests/skills.test.sh +4 -4
- package/tests/state.test.sh +65 -3
package/README.md
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
# Qualia Framework v6.2.
|
|
1
|
+
# Qualia Framework v6.2.10
|
|
2
2
|
|
|
3
3
|
A harness engineering framework for Claude Code and OpenAI Codex. It installs into `~/.claude/` and/or `~/.codex/` and wraps your AI-assisted development workflow with structured planning, execution, verification, and deployment gates.
|
|
4
4
|
|
|
5
5
|
It is not an application framework like Rails or Next.js. It doesn't generate code, run servers, or process data. It's an opinionated workflow layer that tells Claude how to plan, build, and verify your projects end-to-end, from "tell me what you want to make" to "here's the handoff doc for your client."
|
|
6
6
|
|
|
7
|
+
**v6.2.10** — Codex status line is now a publish-blocking install contract. Installer guarantees `[tui].status_line` in `~/.codex/config.toml`, `/qualia-doctor` verifies the native bottom line, and package smoke tests assert the Codex TUI segments are present.
|
|
8
|
+
**v6.2.9** — Codex hook noise + status line. Conditional PreToolUse hooks no longer status-message on every Bash call (Codex was printing 8 "Running hook…" lines on every command). Self-filtering added to `pre-deploy-gate.js` and `pre-push.js` so they never trip on unrelated commands (Claude's substring matcher was firing them on for-loop arguments). Installer now writes `[tui] status_line = [...]` to Codex's `config.toml` for the rich native bottom status line.
|
|
9
|
+
|
|
10
|
+
**v6.2.8** — Codex `/goal` integration + install hardening. Phase-start skills now set the Codex thread goal (with token budget) via `bin/codex-goal.js` and `rules/codex-goal.md`. Installer fixes: agent TOMLs now emit `name = "..."` (Codex 0.133 was rejecting all 9), ERP API key is mirrored from `~/.claude/` → `~/.codex/`, and deprecated skills (`qualia-task`, `qualia-quick`, `qualia-polish-loop`, `qualia-design`, `qualia-prd`) are pruned on upgrade.
|
|
11
|
+
|
|
7
12
|
**v6.2.7** — Codex runtime compatibility. The installer now writes Codex-native hooks, TOML agents, bin scripts, rules, skills, templates, knowledge, guide, and role config under `~/.codex/`, not just `AGENTS.md`.
|
|
8
13
|
|
|
9
14
|
**The v5 line (preserved):**
|
|
10
15
|
- **v5.0**, alignment discipline. CONTEXT.md domain glossary, decisions/ ADRs, `/qualia-zoom`, `/qualia-issues`, `/qualia-triage`, slim CLAUDE.md per Matt Pocock's instruction-budget rule, insights-driven hooks.
|
|
11
|
-
- **v5.1**, autonomous visual-polish loop. Screenshots a URL at three viewports, scores
|
|
16
|
+
- **v5.1**, autonomous visual-polish loop. Screenshots a URL at three viewports, scores design dimensions with vision, fixes top issues, loops until pass or kill-switch. Multi-target installer (Claude Code + Codex AGENTS.md + Both).
|
|
12
17
|
- **v5.2**, polish-loop reliability. `--reduced-motion` capture flag, `--routes URL1,URL2` multi-route mode, first supervised end-to-end run.
|
|
13
18
|
- **v5.3**, Matt Pocock gaps closed. `/qualia-hook-gen` (CLAUDE.md instruction to deterministic Claude Code hook), `/qualia-optimize --deepen` Step 5b parallel-interface design (3 fan-out agents producing radically different interfaces).
|
|
14
19
|
- **v5.4-5.5**, token-discipline and plan-discipline. Cache-aware spawn ordering, scope-reduction prohibition, decision-coverage audit, requirement-coverage check.
|
|
@@ -108,9 +113,10 @@ Two human gates per project. One halt case (gap-cycle limit exceeded on a failin
|
|
|
108
113
|
|
|
109
114
|
```
|
|
110
115
|
/qualia-debug # Structured debugging
|
|
116
|
+
/qualia-fix # Repair broken existing behavior (root cause -> patch -> verify -> report)
|
|
111
117
|
/qualia-review # Production audit (scored diagnostics)
|
|
112
118
|
/qualia-optimize # Deep optimization pass (parallel specialist agents, --deepen mode with parallel-interface design)
|
|
113
|
-
/qualia-feature # Auto-scoped
|
|
119
|
+
/qualia-feature # Auto-scoped new feature build (inline for trivia, fresh spawn for 1-5 files)
|
|
114
120
|
/qualia-test # Generate or run tests (--tdd mode for test-first workflow)
|
|
115
121
|
/qualia-zoom # Focus on a single file or function with full context
|
|
116
122
|
/qualia-issues # Break a phase plan into vertical-slice GitHub issues
|
|
@@ -159,14 +165,15 @@ Project
|
|
|
159
165
|
|
|
160
166
|
**Why it matters:** non-technical team members can follow the ladder from any entry point. `/qualia` and `/qualia-milestone` render JOURNEY.md as a visual ladder with current position highlighted. In the ERP, the primary operational dates are project deadline, milestone deadline, and employee shift submission date; framework tasks stay internal to agent execution.
|
|
161
167
|
|
|
162
|
-
## What's Inside (v6.2.
|
|
168
|
+
## What's Inside (v6.2.10)
|
|
163
169
|
|
|
164
|
-
- **
|
|
170
|
+
- **35 installed skills**, full Road (new / plan / build / verify / milestone / polish / ship / handoff / report), depth (discuss, research, map), navigation (qualia router, idk, pause, resume, road, help), quality (fix, debug, review, optimize with `--deepen` parallel-interface design, feature, test, zoom, issues, triage), design (`qualia-polish --loop`, `qualia-vibe` for fast aesthetic pivots), deterministic enforcement (`qualia-hook-gen`), meta (learn, skill-new, flush, postmortem), and Zoho workflow support
|
|
165
171
|
- **9 agents** (each runs in fresh context): planner, builder, verifier, qa-browser, researcher, research-synthesizer, roadmapper, plan-checker, visual-evaluator
|
|
166
172
|
- **11 hooks** (pure Node.js, cross-platform): session-start, auto-update, git-guardrails, branch-guard, pre-push tracking stamp, migration-guard, pre-deploy-gate, stop-session-log, vercel-account-guard, env-empty-guard, supabase-destructive-guard
|
|
167
|
-
- **
|
|
168
|
-
- **
|
|
173
|
+
- **10 installed rules** (`rules/`): grounding, security, infrastructure, deployment, speed, architecture, trust-boundary, codex-goal, one-opinion, and always-on command-output transparency.
|
|
174
|
+
- **7 lazy-loaded design files** (`qualia-design/`): design-laws, design-brand, design-product, design-rubric, design-reference, frontend, graphics — `Read` on demand by design-aware skills/agents only.
|
|
169
175
|
- **25 template files**: project.md, journey.md, plan.md (story-file format), state.md, DESIGN.md, CONTEXT.md (domain glossary), work-packet.md (ERP-approved session context), decisions/ADR-template.md, tracking.json (with `milestone_name` + `milestones[]`), requirements.md (multi-milestone), roadmap.md (current milestone only), phase-context.md, 4 project-type templates (website, ai-agent, voice-agent, mobile-app), 5 research-project templates (STACK, FEATURES, ARCHITECTURE, PITFALLS, SUMMARY), knowledge templates, help.html
|
|
176
|
+
- **Planning hygiene guard**: `planning-hygiene.js` scans `.planning/` for loose reports/assets and can organize them under `reports/`, `assets/`, `design/`, or `archive/loose/` only with explicit `--write`
|
|
170
177
|
- **1 reference** — questioning.md methodology for deep project initialization
|
|
171
178
|
- **Codex-native install surface** — `~/.codex/AGENTS.md`, `hooks.json`, `hooks/`, `agents/*.toml`, `bin/`, `rules/`, `skills/`, `qualia-design/`, `qualia-templates/`, `knowledge/`, and `qualia-guide.md`.
|
|
172
179
|
|
|
@@ -176,7 +183,7 @@ Works on **Windows 10/11, macOS, and Linux**. Requires Node.js 18+ and Claude Co
|
|
|
176
183
|
|
|
177
184
|
- Every hook and the status line are pure Node.js — no external bash, jq, or GNU coreutils required.
|
|
178
185
|
- Skills are installed as Markdown instructions with Node.js helpers; Claude and Codex each receive paths native to their own home directory.
|
|
179
|
-
- Codex installs use Codex-native hook status messages
|
|
186
|
+
- Codex installs use Codex-native hook status messages, agent TOML files, and `[tui].status_line` for the always-visible bottom line. Codex 0.133 supports built-in status-line segments, not Claude-style command-backed custom renderers, so Qualia project/role context stays in the SessionStart banner.
|
|
180
187
|
- Tested on Fedora, EndeavourOS, macOS, and Windows 10/11.
|
|
181
188
|
|
|
182
189
|
## Why It Works
|
|
@@ -236,12 +243,12 @@ npx qualia-framework@latest install
|
|
|
236
243
|
|
|
|
237
244
|
v
|
|
238
245
|
~/.claude/ and/or ~/.codex/
|
|
239
|
-
├── skills/
|
|
246
|
+
├── skills/ 35 installed skills (each may ship SKILL.md + REFERENCE.md + scripts/ + fixtures/)
|
|
240
247
|
├── agents/ 9 agent definitions (Claude .md, Codex .toml)
|
|
241
248
|
├── hooks/ 11 Node.js hooks — cross-platform (no bash dependency)
|
|
242
|
-
├── bin/ state.js + qualia-ui.js + statusline.js + knowledge.js + knowledge-flush.js + slop-detect.mjs + plan-contract.js + agent-runs.js + ERP/report helpers
|
|
249
|
+
├── bin/ state.js + qualia-ui.js + statusline.js + knowledge.js + knowledge-flush.js + slop-detect.mjs + planning-hygiene.js + plan-contract.js + agent-runs.js + ERP/report helpers
|
|
243
250
|
├── knowledge/ learned-patterns.md, common-fixes.md, client-prefs.md, daily-log/
|
|
244
|
-
├── rules/ grounding, security, infrastructure, deployment, speed, architecture, trust-boundary, one-opinion
|
|
251
|
+
├── rules/ grounding, security, infrastructure, deployment, speed, architecture, trust-boundary, codex-goal, one-opinion, command-output
|
|
245
252
|
├── qualia-design/ lazy-loaded design substrate — read on demand
|
|
246
253
|
├── qualia-templates/ project, journey, plan, state, DESIGN, CONTEXT, work-packet, decisions, tracking, requirements, roadmap, research, help
|
|
247
254
|
├── qualia-references/ questioning.md (deep project initialization methodology)
|
package/agents/builder.md
CHANGED
|
@@ -57,24 +57,24 @@ For every `@file` reference in Context — read it now.
|
|
|
57
57
|
### 2b. Load Relevant Knowledge
|
|
58
58
|
|
|
59
59
|
Before writing code, check the memory layer for prior decisions and known
|
|
60
|
-
fixes that apply to this task. Hardcoded `cat
|
|
60
|
+
fixes that apply to this task. Hardcoded `cat ${QUALIA_KNOWLEDGE}/X.md` is
|
|
61
61
|
forbidden — always go through the loader so newly-added knowledge files
|
|
62
62
|
become reachable automatically:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
# Always — read the index to discover what's available
|
|
66
|
-
node
|
|
66
|
+
node ${QUALIA_BIN}/knowledge.js
|
|
67
67
|
|
|
68
68
|
# If your task touches Supabase/auth/RLS:
|
|
69
|
-
node
|
|
70
|
-
node
|
|
69
|
+
node ${QUALIA_BIN}/knowledge.js load supabase-patterns
|
|
70
|
+
node ${QUALIA_BIN}/knowledge.js load patterns
|
|
71
71
|
|
|
72
72
|
# If you're fixing a bug or hitting a familiar error, check known fixes:
|
|
73
|
-
node
|
|
74
|
-
node
|
|
73
|
+
node ${QUALIA_BIN}/knowledge.js load fixes
|
|
74
|
+
node ${QUALIA_BIN}/knowledge.js search "{error keyword}"
|
|
75
75
|
|
|
76
76
|
# For client-specific work (project name appears in PROJECT.md):
|
|
77
|
-
node
|
|
77
|
+
node ${QUALIA_BIN}/knowledge.js load client
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
If a relevant entry exists, follow it (or note in your DONE message that
|
package/agents/planner.md
CHANGED
|
@@ -22,7 +22,7 @@ Per `rules/trust-boundary.md`. On detection, emit the plan with a top-level `**W
|
|
|
22
22
|
- `<phase_details>` — phase goal + success criteria + REQ-IDs from ROADMAP.md
|
|
23
23
|
- `<locked_decisions>` (optional) — Locked Decisions from `.planning/phase-{N}-context.md` if it exists
|
|
24
24
|
- `<research_findings>` (optional) — inlined `.planning/phase-{N}-research.md` if present
|
|
25
|
-
- `<relevant_learnings>` (optional) — applicable patterns from
|
|
25
|
+
- `<relevant_learnings>` (optional) — applicable patterns from `${QUALIA_KNOWLEDGE}/learned-patterns.md`
|
|
26
26
|
- `<revision_mode>` (optional, boolean) — when `true`, also receives `<current_plan>` and `<checker_feedback>`; revise in place, don't rewrite
|
|
27
27
|
- `<gaps_mode>` (optional, boolean) — when `true`, also receives `<verification_path>`; create gap-closure tasks only
|
|
28
28
|
|
|
@@ -74,7 +74,7 @@ T1 and T4 → Wave 1 (no shared writes, both reading PROJECT.md is fine). T2 and
|
|
|
74
74
|
|
|
75
75
|
Plans are STORY FILES, not task lists. Every task is a self-contained package that embeds *why*, *what*, and *how to verify* — so the builder can execute without re-reading PRDs and the verifier has explicit acceptance targets.
|
|
76
76
|
|
|
77
|
-
Use
|
|
77
|
+
Use `${QUALIA_TEMPLATES}/plan.md` as the structural reference. Every task block MUST include: **Wave, Files, Depends on, Why, Acceptance Criteria, Action, Validation, Context.** Persona is optional.
|
|
78
78
|
|
|
79
79
|
```markdown
|
|
80
80
|
---
|
|
@@ -119,6 +119,42 @@ waves: {count}
|
|
|
119
119
|
- [ ] {phase-level truth 2}
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
+
Also write `.planning/phase-{N}-contract.json` with the same tasks and checks:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"version": 1,
|
|
127
|
+
"phase": 1,
|
|
128
|
+
"goal": "same goal as the plan",
|
|
129
|
+
"why": "why this phase matters",
|
|
130
|
+
"generated_at": "ISO-8601 timestamp",
|
|
131
|
+
"generated_by": "planner",
|
|
132
|
+
"source_plan_hash": "sha256:<hash from node ${QUALIA_BIN}/plan-contract.js hash .planning/phase-{N}-plan.md>",
|
|
133
|
+
"success_criteria": ["phase-level truth"],
|
|
134
|
+
"tasks": [{
|
|
135
|
+
"id": "T1",
|
|
136
|
+
"title": "Task title",
|
|
137
|
+
"wave": 1,
|
|
138
|
+
"depends_on": [],
|
|
139
|
+
"persona": "frontend",
|
|
140
|
+
"files_modify": [],
|
|
141
|
+
"files_create": [],
|
|
142
|
+
"files_delete": [],
|
|
143
|
+
"acceptance_criteria": ["observable outcome"],
|
|
144
|
+
"action": "concrete work to do",
|
|
145
|
+
"context_files": [],
|
|
146
|
+
"verification": [{
|
|
147
|
+
"type": "grep-match",
|
|
148
|
+
"path": "path/to/file",
|
|
149
|
+
"pattern": "import|call|visible text",
|
|
150
|
+
"expect": "present"
|
|
151
|
+
}]
|
|
152
|
+
}]
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Run `node ${QUALIA_BIN}/plan-contract.js validate .planning/phase-{N}-contract.json` before returning PASS. The JSON contract is the machine authority; the Markdown plan is the human view.
|
|
157
|
+
|
|
122
158
|
## Task Specificity (Mandatory)
|
|
123
159
|
|
|
124
160
|
Every task MUST have these fields with concrete content:
|
|
@@ -201,7 +237,7 @@ When a phase involves frontend work (pages, components, layouts, UI):
|
|
|
201
237
|
1. **Check for `.planning/DESIGN.md`** — if it exists, reference it in task Context fields: `@.planning/DESIGN.md`
|
|
202
238
|
2. **If no DESIGN.md and this is Phase 1** — add a Task 1 (Wave 1) to create it:
|
|
203
239
|
- Generate `.planning/DESIGN.md` from the design direction in PROJECT.md
|
|
204
|
-
- Use the template at
|
|
240
|
+
- Use the template at `${QUALIA_TEMPLATES}/DESIGN.md` — fill in: palette, typography (distinctive fonts), spacing, motion approach, component patterns
|
|
205
241
|
- Done when: DESIGN.md exists with concrete CSS variable values (not placeholders)
|
|
206
242
|
3. **Include design criteria in "Done when"** for frontend tasks:
|
|
207
243
|
- Not just "page renders" but "page renders with design system typography, proper color palette, all interactive states (hover/focus/loading/error/empty), semantic HTML, keyboard accessible"
|
|
@@ -37,7 +37,7 @@ You receive:
|
|
|
37
37
|
|
|
38
38
|
## Output
|
|
39
39
|
|
|
40
|
-
Write `.planning/research/SUMMARY.md` using the template at
|
|
40
|
+
Write `.planning/research/SUMMARY.md` using the template at `${QUALIA_TEMPLATES}/research-project/SUMMARY.md`.
|
|
41
41
|
|
|
42
42
|
## How to Synthesize
|
|
43
43
|
|
package/agents/researcher.md
CHANGED
|
@@ -46,14 +46,14 @@ Write exactly ONE file to `<output_path>`, using the template matching your dime
|
|
|
46
46
|
- `architecture` → `templates/research-project/ARCHITECTURE.md`
|
|
47
47
|
- `pitfalls` → `templates/research-project/PITFALLS.md`
|
|
48
48
|
|
|
49
|
-
The template lives in
|
|
49
|
+
The template lives in `${QUALIA_TEMPLATES}/research-project/{DIMENSION}.md` — read it first, then fill it in.
|
|
50
50
|
|
|
51
51
|
## How to Research
|
|
52
52
|
|
|
53
53
|
### 1. Read the Template
|
|
54
54
|
|
|
55
55
|
```
|
|
56
|
-
Read:
|
|
56
|
+
Read: ${QUALIA_TEMPLATES}/research-project/{DIMENSION}.md
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Understand the structure before gathering content.
|
|
@@ -75,7 +75,7 @@ If a relevant notebook exists, follow up with a single `mcp__notebooklm-mcp__not
|
|
|
75
75
|
**Step 0b — Local knowledge layer (Obsidian wiki + knowledge.js):**
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
node
|
|
78
|
+
node ${QUALIA_BIN}/knowledge.js search "{topic}"
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
Plus, if `~/qualia-memory/` exists (the Obsidian vault), recall via `/qualia-recall {topic}` returns curated prior lessons cross-project. Prefer these over web — they're already filtered by Fawzi/team for relevance.
|
package/agents/roadmapper.md
CHANGED
|
@@ -41,9 +41,9 @@ You receive:
|
|
|
41
41
|
|
|
42
42
|
Write THREE files:
|
|
43
43
|
|
|
44
|
-
1. `.planning/JOURNEY.md` — the full arc (all milestones) using
|
|
45
|
-
2. `.planning/REQUIREMENTS.md` — v1 requirements grouped by milestone, using
|
|
46
|
-
3. `.planning/ROADMAP.md` — **only the current (first) milestone's phase detail**, using
|
|
44
|
+
1. `.planning/JOURNEY.md` — the full arc (all milestones) using `${QUALIA_TEMPLATES}/journey.md`
|
|
45
|
+
2. `.planning/REQUIREMENTS.md` — v1 requirements grouped by milestone, using `${QUALIA_TEMPLATES}/requirements.md`
|
|
46
|
+
3. `.planning/ROADMAP.md` — **only the current (first) milestone's phase detail**, using `${QUALIA_TEMPLATES}/roadmap.md`
|
|
47
47
|
|
|
48
48
|
Then update `.planning/STATE.md` via `state.js init` (NOT directly) so the state machine matches Milestone 1's phases.
|
|
49
49
|
|
|
@@ -55,9 +55,9 @@ Then update `.planning/STATE.md` via `state.js init` (NOT directly) so the state
|
|
|
55
55
|
Read: .planning/PROJECT.md
|
|
56
56
|
Read: .planning/research/SUMMARY.md (if exists)
|
|
57
57
|
Read: .planning/config.json
|
|
58
|
-
Read:
|
|
59
|
-
Read:
|
|
60
|
-
Read:
|
|
58
|
+
Read: ${QUALIA_TEMPLATES}/journey.md
|
|
59
|
+
Read: ${QUALIA_TEMPLATES}/requirements.md
|
|
60
|
+
Read: ${QUALIA_TEMPLATES}/roadmap.md
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### 2. Build REQUIREMENTS.md — grouped by milestone
|
|
@@ -141,7 +141,7 @@ Write all three files to `.planning/`. Fill every `{placeholder}` with concrete
|
|
|
141
141
|
**Do not edit STATE.md directly.** Call the state machine with Milestone 1's phases:
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
|
-
node
|
|
144
|
+
node ${QUALIA_BIN}/state.js init \
|
|
145
145
|
--project "{project name from PROJECT.md}" \
|
|
146
146
|
--client "{client from PROJECT.md}" \
|
|
147
147
|
--type "{type from PROJECT.md}" \
|
package/agents/verifier.md
CHANGED
|
@@ -81,7 +81,19 @@ For each success criterion in the plan:
|
|
|
81
81
|
|
|
82
82
|
## Contract-Based Verification
|
|
83
83
|
|
|
84
|
-
If
|
|
84
|
+
If `.planning/phase-{N}-contract.json` exists, execute it FIRST before any ad-hoc verification:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
node ${QUALIA_BIN}/contract-runner.js .planning/phase-{N}-contract.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Record the result and evidence path under `## Contract Results`. A failed contract check is a phase failure unless the contract itself is invalid and the report clearly marks `BLOCKED — invalid contract`.
|
|
91
|
+
|
|
92
|
+
If the JSON contract is missing, fall back to the older Markdown contract section below and mark the report `DEGRADED TRUST: JSON contract missing`.
|
|
93
|
+
|
|
94
|
+
### Legacy Markdown Contracts
|
|
95
|
+
|
|
96
|
+
If the phase plan contains a `## Verification Contract` section, execute those contracts before ad-hoc verification.
|
|
85
97
|
|
|
86
98
|
### How Contracts Work
|
|
87
99
|
|
|
@@ -162,14 +174,14 @@ node bin/slop-detect.mjs {touched frontend paths from git diff}
|
|
|
162
174
|
|
|
163
175
|
If exit code is 1 (critical findings present), the phase FAILS. Quote the findings in the report. Do not score the rubric — fix slop first.
|
|
164
176
|
|
|
165
|
-
### Step B — Design rubric scoring (
|
|
177
|
+
### Step B — Design rubric scoring (9 dimensions)
|
|
166
178
|
|
|
167
179
|
Apply `qualia-design/design-rubric.md`. Score 1-5 per dimension WITH evidence on the next line. Default to 3 unless evidence supports otherwise.
|
|
168
180
|
|
|
169
181
|
Scoped by phase scope:
|
|
170
|
-
- Component-only phase → score Typography, Color cohesion, States, Motion intent, Microcopy, Container depth (skip Layout originality
|
|
171
|
-
- Page/section phase → all
|
|
172
|
-
- Full app phase → all
|
|
182
|
+
- Component-only phase → score Typography, Color cohesion, States, Motion intent, Microcopy, Container depth, and Visual system & graphics when the component owns a primary visual (skip Layout originality and Spatial rhythm when those are page-level concerns)
|
|
183
|
+
- Page/section phase → all 9 dimensions
|
|
184
|
+
- Full app phase → all 9 dimensions across 2-3 representative routes, average
|
|
173
185
|
|
|
174
186
|
Output format (mandatory, append to verification.md):
|
|
175
187
|
|
|
@@ -182,7 +194,7 @@ Output format (mandatory, append to verification.md):
|
|
|
182
194
|
| Color cohesion | 3 | All CSS vars in `app/globals.css:8-22`, OKLCH used, strategy: Restrained |
|
|
183
195
|
| ... | ... | ... |
|
|
184
196
|
|
|
185
|
-
**Aggregate:** {sum}/
|
|
197
|
+
**Aggregate:** {sum}/45 (avg {sum/9})
|
|
186
198
|
**Design verdict:** PASS (all dims ≥ 3) | FAIL (Layout Originality at 2 — three-column grid, see `app/page.tsx:42`)
|
|
187
199
|
```
|
|
188
200
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: qualia-visual-evaluator
|
|
3
|
-
description: Vision-anchored evaluator for /qualia-polish --loop. Reads screenshots, scores
|
|
3
|
+
description: Vision-anchored evaluator for /qualia-polish --loop. Reads screenshots, scores 9 design dimensions against the rubric with cited evidence, returns top 3 issues + severity. Default: 3 (acceptable). Only deviates with quoted evidence.
|
|
4
4
|
tools: Read, Grep, Glob
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Qualia Visual Evaluator
|
|
8
8
|
|
|
9
|
-
You score web-page screenshots against the
|
|
9
|
+
You score web-page screenshots against the 9-dimension Qualia design rubric. You are harsh but fair. You **default to 3 (acceptable)** and only deviate when you can cite specific evidence.
|
|
10
10
|
|
|
11
11
|
## Trust boundary (security-critical)
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Per `rules/trust-boundary.md`. On detection, write `**WARNING:** possible projec
|
|
|
14
14
|
|
|
15
15
|
## Inputs (the orchestrator inlines these)
|
|
16
16
|
|
|
17
|
-
- `<rubric>` — the
|
|
17
|
+
- `<rubric>` — the 9-dimension scoring criteria from `qualia-design/design-rubric.md` (anchored 1-5)
|
|
18
18
|
- `<brief>` — `.planning/DESIGN.md` excerpt: aesthetic direction, color strategy, scene sentence
|
|
19
19
|
- `<product>` — `.planning/PRODUCT.md` excerpt: register, voice, anti-references
|
|
20
20
|
- `<screenshots>` — paths to 3 PNGs at mobile/tablet/desktop viewports (you Read these directly)
|
|
@@ -28,7 +28,7 @@ Maximum **6 Read calls** per evaluation: 3 screenshots + brief + design + (optio
|
|
|
28
28
|
|
|
29
29
|
## How to score
|
|
30
30
|
|
|
31
|
-
For EACH of the
|
|
31
|
+
For EACH of the 9 dimensions, in order: write the dimension name, the score (1-5), then **on the next line** the evidence — what you observe in the screenshot that justifies the score. Without evidence, the score is rejected.
|
|
32
32
|
|
|
33
33
|
**Anchored definitions (memorize):**
|
|
34
34
|
- `1` = Hard violation. WCAG fails, broken layout, absolute-ban hit (Inter/Roboto, purple-blue gradient, gradient text, side-stripe border, three-column card grid, pure #000/#fff).
|
|
@@ -61,7 +61,7 @@ Emit a single fenced JSON block. No prose before or after. No markdown headings
|
|
|
61
61
|
{
|
|
62
62
|
"viewport": "mobile",
|
|
63
63
|
"width": 375,
|
|
64
|
-
"scores": { "typography": <1-5>, "color": <1-5>, "spatial": <1-5>, "layout": <1-5>, "shadow": <1-5>, "motion": <1-5>, "microcopy": <1-5>, "container": <1-5> },
|
|
64
|
+
"scores": { "typography": <1-5>, "color": <1-5>, "spatial": <1-5>, "layout": <1-5>, "shadow": <1-5>, "motion": <1-5>, "microcopy": <1-5>, "container": <1-5>, "graphics": <1-5> },
|
|
65
65
|
"evidence": {
|
|
66
66
|
"typography": "<one sentence — what you saw>",
|
|
67
67
|
"color": "...",
|
|
@@ -70,7 +70,8 @@ Emit a single fenced JSON block. No prose before or after. No markdown headings
|
|
|
70
70
|
"shadow": "...",
|
|
71
71
|
"motion": "...",
|
|
72
72
|
"microcopy": "...",
|
|
73
|
-
"container": "..."
|
|
73
|
+
"container": "...",
|
|
74
|
+
"graphics": "..."
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
77
|
{ "viewport": "tablet", "width": 768, "scores": {...}, "evidence": {...} },
|
|
@@ -79,7 +80,7 @@ Emit a single fenced JSON block. No prose before or after. No markdown headings
|
|
|
79
80
|
"aggregate_scores": {
|
|
80
81
|
"typography": <min across viewports>, "color": <min>, "spatial": <min>,
|
|
81
82
|
"layout": <min>, "shadow": <min>, "motion": <min>,
|
|
82
|
-
"microcopy": <min>, "container": <min>
|
|
83
|
+
"microcopy": <min>, "container": <min>, "graphics": <min>
|
|
83
84
|
},
|
|
84
85
|
"top_issues": [
|
|
85
86
|
{
|
package/bin/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ const path = require("path");
|
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const readline = require("readline");
|
|
7
7
|
const os = require("os");
|
|
8
|
+
const { binFiles } = require("./runtime-manifest.js");
|
|
8
9
|
|
|
9
10
|
const TEAL = "\x1b[38;2;0;206;209m";
|
|
10
11
|
const TG = "\x1b[38;2;0;170;175m";
|
|
@@ -228,25 +229,13 @@ const QUALIA_AGENT_FILES = [
|
|
|
228
229
|
const QUALIA_CODEX_AGENT_FILES = QUALIA_AGENT_FILES.map((f) => f.replace(/\.md$/, ".toml"));
|
|
229
230
|
|
|
230
231
|
// Qualia bin scripts.
|
|
231
|
-
const QUALIA_BIN_FILES =
|
|
232
|
-
"state.js",
|
|
233
|
-
"qualia-ui.js",
|
|
234
|
-
"statusline.js",
|
|
235
|
-
"knowledge.js",
|
|
236
|
-
"knowledge-flush.js",
|
|
237
|
-
"plan-contract.js",
|
|
238
|
-
"agent-runs.js",
|
|
239
|
-
"slop-detect.mjs",
|
|
240
|
-
"erp-retry.js",
|
|
241
|
-
"report-payload.js",
|
|
242
|
-
"project-snapshot.js",
|
|
243
|
-
];
|
|
232
|
+
const QUALIA_BIN_FILES = binFiles();
|
|
244
233
|
|
|
245
234
|
// Qualia rules — security, deployment, infra, grounding, plus the v4.5.0 design substrate.
|
|
246
235
|
// frontend.md and design-reference.md are kept for backward compat; new projects use design-laws/brand/product/rubric.
|
|
247
236
|
const QUALIA_RULE_FILES = [
|
|
248
237
|
"security.md", "deployment.md", "infrastructure.md", "grounding.md",
|
|
249
|
-
"speed.md", "architecture.md", "trust-boundary.md", "one-opinion.md",
|
|
238
|
+
"speed.md", "architecture.md", "trust-boundary.md", "codex-goal.md", "one-opinion.md", "command-output.md",
|
|
250
239
|
"frontend.md", "design-reference.md",
|
|
251
240
|
"design-laws.md", "design-brand.md", "design-product.md", "design-rubric.md",
|
|
252
241
|
];
|
|
@@ -1217,6 +1206,40 @@ function cmdProjectSnapshot() {
|
|
|
1217
1206
|
process.exit(typeof r.status === "number" ? r.status : 1);
|
|
1218
1207
|
}
|
|
1219
1208
|
|
|
1209
|
+
function cmdPlanningHygiene() {
|
|
1210
|
+
const installedScript = path.join(primaryInstallHome(), "bin", "planning-hygiene.js");
|
|
1211
|
+
const localScript = path.join(__dirname, "planning-hygiene.js");
|
|
1212
|
+
const script = fs.existsSync(installedScript) ? installedScript : localScript;
|
|
1213
|
+
if (!fs.existsSync(script)) {
|
|
1214
|
+
console.log(` ${RED}✗${RESET} planning-hygiene.js not available`);
|
|
1215
|
+
console.log(` ${DIM}Run: npx qualia-framework@latest install${RESET}`);
|
|
1216
|
+
process.exit(1);
|
|
1217
|
+
}
|
|
1218
|
+
const args = process.argv.slice(3);
|
|
1219
|
+
const r = spawnSync(process.execPath, [script, ...args], {
|
|
1220
|
+
stdio: "inherit",
|
|
1221
|
+
shell: false,
|
|
1222
|
+
});
|
|
1223
|
+
process.exit(typeof r.status === "number" ? r.status : 1);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
function cmdTrust() {
|
|
1227
|
+
const trustScript = path.join(primaryInstallHome(), "bin", "trust-score.js");
|
|
1228
|
+
const localTrustScript = path.join(__dirname, "trust-score.js");
|
|
1229
|
+
const script = fs.existsSync(trustScript) ? trustScript : localTrustScript;
|
|
1230
|
+
if (!fs.existsSync(script)) {
|
|
1231
|
+
console.log(` ${RED}✗${RESET} trust-score.js not available`);
|
|
1232
|
+
console.log(` ${DIM}Run: npx qualia-framework@latest install${RESET}`);
|
|
1233
|
+
process.exit(1);
|
|
1234
|
+
}
|
|
1235
|
+
const args = process.argv.slice(3);
|
|
1236
|
+
const r = spawnSync(process.execPath, [script, ...args], {
|
|
1237
|
+
stdio: "inherit",
|
|
1238
|
+
shell: false,
|
|
1239
|
+
});
|
|
1240
|
+
process.exit(typeof r.status === "number" ? r.status : 1);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1220
1243
|
function cmdFlush() {
|
|
1221
1244
|
const flushScript = path.join(primaryInstallHome(), "bin", "knowledge-flush.js");
|
|
1222
1245
|
if (!fs.existsSync(flushScript)) {
|
|
@@ -1255,14 +1278,20 @@ function cmdDoctor() {
|
|
|
1255
1278
|
"rules/grounding.md",
|
|
1256
1279
|
"rules/security.md",
|
|
1257
1280
|
"rules/deployment.md",
|
|
1281
|
+
"rules/command-output.md",
|
|
1258
1282
|
"bin/state.js",
|
|
1259
1283
|
"bin/qualia-ui.js",
|
|
1260
1284
|
"bin/statusline.js",
|
|
1261
1285
|
"bin/knowledge.js",
|
|
1262
1286
|
"bin/knowledge-flush.js",
|
|
1287
|
+
"bin/state-ledger.js",
|
|
1288
|
+
"bin/plan-contract.js",
|
|
1289
|
+
"bin/contract-runner.js",
|
|
1290
|
+
"bin/trust-score.js",
|
|
1263
1291
|
"bin/erp-retry.js",
|
|
1264
1292
|
"bin/report-payload.js",
|
|
1265
1293
|
"bin/project-snapshot.js",
|
|
1294
|
+
"bin/planning-hygiene.js",
|
|
1266
1295
|
"knowledge/agents.md",
|
|
1267
1296
|
"knowledge/index.md",
|
|
1268
1297
|
"knowledge/daily-log",
|
|
@@ -1309,6 +1338,23 @@ function cmdDoctor() {
|
|
|
1309
1338
|
check("Codex hooks.json parseable", false, e.message);
|
|
1310
1339
|
}
|
|
1311
1340
|
}
|
|
1341
|
+
if (label === "Codex" && fs.existsSync(path.join(home, "config.toml"))) {
|
|
1342
|
+
try {
|
|
1343
|
+
const configToml = fs.readFileSync(path.join(home, "config.toml"), "utf8");
|
|
1344
|
+
const hasTui = /^\[tui\]\s*$/m.test(configToml);
|
|
1345
|
+
const hasStatusLine = /^\s*status_line\s*=\s*\[/m.test(configToml);
|
|
1346
|
+
const hasCoreSegments = [
|
|
1347
|
+
"model-with-reasoning",
|
|
1348
|
+
"task-progress",
|
|
1349
|
+
"current-dir",
|
|
1350
|
+
"git-branch",
|
|
1351
|
+
"context-used",
|
|
1352
|
+
].every((segment) => configToml.includes(`"${segment}"`));
|
|
1353
|
+
check("Codex config.toml TUI status_line", hasTui && hasStatusLine && hasCoreSegments, "reinstall to wire Codex bottom status line");
|
|
1354
|
+
} catch (e) {
|
|
1355
|
+
check("Codex config.toml status_line parseable", false, e.message);
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1312
1358
|
}
|
|
1313
1359
|
|
|
1314
1360
|
// ── Version vs. installed ──────────────────────────────
|
|
@@ -1319,11 +1365,51 @@ function cmdDoctor() {
|
|
|
1319
1365
|
check("config has install metadata", false, "reinstall to record");
|
|
1320
1366
|
}
|
|
1321
1367
|
|
|
1368
|
+
// ── Project contract health (advisory, not install-failing) ─────────
|
|
1369
|
+
const projectAdvisories = [];
|
|
1370
|
+
try {
|
|
1371
|
+
const statePath = path.join(process.cwd(), ".planning", "STATE.md");
|
|
1372
|
+
if (fs.existsSync(statePath)) {
|
|
1373
|
+
const stateText = fs.readFileSync(statePath, "utf8");
|
|
1374
|
+
const phaseMatch = stateText.match(/^Phase:\s*(\d+)/m);
|
|
1375
|
+
const phase = phaseMatch ? Number(phaseMatch[1]) : 1;
|
|
1376
|
+
const planPath = path.join(process.cwd(), ".planning", `phase-${phase}-plan.md`);
|
|
1377
|
+
const contractPath = path.join(process.cwd(), ".planning", `phase-${phase}-contract.json`);
|
|
1378
|
+
if (fs.existsSync(planPath)) {
|
|
1379
|
+
if (!fs.existsSync(contractPath)) {
|
|
1380
|
+
projectAdvisories.push(`phase ${phase}: JSON contract missing (degraded trust)`);
|
|
1381
|
+
} else {
|
|
1382
|
+
const pc = require("./plan-contract.js");
|
|
1383
|
+
const loaded = pc.readContractFile(contractPath);
|
|
1384
|
+
if (!loaded.ok) {
|
|
1385
|
+
projectAdvisories.push(`phase ${phase}: JSON contract unreadable (${loaded.message || loaded.error})`);
|
|
1386
|
+
} else {
|
|
1387
|
+
const errs = pc.validate(loaded.contract);
|
|
1388
|
+
const drift = pc.checkDrift(contractPath, planPath);
|
|
1389
|
+
if (errs.length > 0) projectAdvisories.push(`phase ${phase}: JSON contract invalid (${errs.length} issue(s))`);
|
|
1390
|
+
else if (drift.ok && drift.drift) projectAdvisories.push(`phase ${phase}: JSON contract drifted from plan`);
|
|
1391
|
+
else projectAdvisories.push(`phase ${phase}: JSON contract valid`);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
} catch (e) {
|
|
1397
|
+
projectAdvisories.push(`project contract health unavailable: ${e.message}`);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1322
1400
|
// ── Render ────────────────────────────────────────────
|
|
1323
1401
|
for (const c of checks) {
|
|
1324
1402
|
const mark = c.ok ? `${GREEN}✓${RESET}` : `${RED}✗${RESET}`;
|
|
1325
1403
|
console.log(` ${mark} ${c.label}`);
|
|
1326
1404
|
}
|
|
1405
|
+
if (projectAdvisories.length > 0) {
|
|
1406
|
+
console.log("");
|
|
1407
|
+
console.log(` ${WHITE}Project trust:${RESET}`);
|
|
1408
|
+
for (const item of projectAdvisories) {
|
|
1409
|
+
const mark = item.includes("valid") && !item.includes("invalid") ? `${GREEN}✓${RESET}` : `${YELLOW}!${RESET}`;
|
|
1410
|
+
console.log(` ${mark} ${item}`);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1327
1413
|
console.log("");
|
|
1328
1414
|
if (issues.length === 0) {
|
|
1329
1415
|
console.log(` ${GREEN}All checks passed. Framework is healthy.${RESET}`);
|
|
@@ -1433,11 +1519,14 @@ function cmdHelp() {
|
|
|
1433
1519
|
console.log(` qualia-framework ${TEAL}erp-ping${RESET} Verify ERP connectivity + API key`);
|
|
1434
1520
|
console.log(` qualia-framework ${TEAL}erp-flush${RESET} Retry queued ERP report uploads (${DIM}show|clear${RESET})`);
|
|
1435
1521
|
console.log(` qualia-framework ${TEAL}project-snapshot${RESET} Export/upload ERP admin project progress snapshot (${DIM}--write|--upload${RESET})`);
|
|
1522
|
+
console.log(` qualia-framework ${TEAL}planning-hygiene${RESET} Scan/organize .planning artifacts (${DIM}scan|organize --write${RESET})`);
|
|
1436
1523
|
console.log(` qualia-framework ${TEAL}doctor${RESET} Health-check the install (files, hooks, settings)`);
|
|
1524
|
+
console.log(` qualia-framework ${TEAL}trust${RESET} Score install, state, contracts, memory, ERP (${DIM}--json${RESET})`);
|
|
1437
1525
|
console.log(` qualia-framework ${TEAL}flush${RESET} Promote daily-log → curated knowledge (memory layer)`);
|
|
1438
1526
|
console.log("");
|
|
1439
1527
|
console.log(` ${WHITE}After install:${RESET}`);
|
|
1440
1528
|
console.log(` ${TG}/qualia${RESET} What should I do next?`);
|
|
1529
|
+
console.log(` ${TG}/qualia-doctor${RESET} Health-check install, state, contracts, memory, ERP`);
|
|
1441
1530
|
console.log(` ${TG}/qualia-new${RESET} Set up a new project`);
|
|
1442
1531
|
console.log(` ${TG}/qualia-plan${RESET} Plan a phase`);
|
|
1443
1532
|
console.log(` ${TG}/qualia-build${RESET} Build it (parallel tasks)`);
|
|
@@ -1506,11 +1595,19 @@ switch (cmd) {
|
|
|
1506
1595
|
case "snapshot":
|
|
1507
1596
|
cmdProjectSnapshot();
|
|
1508
1597
|
break;
|
|
1598
|
+
case "planning-hygiene":
|
|
1599
|
+
case "planning":
|
|
1600
|
+
cmdPlanningHygiene();
|
|
1601
|
+
break;
|
|
1509
1602
|
case "doctor":
|
|
1510
1603
|
case "health":
|
|
1511
1604
|
case "health-check":
|
|
1512
1605
|
cmdDoctor();
|
|
1513
1606
|
break;
|
|
1607
|
+
case "trust":
|
|
1608
|
+
case "score":
|
|
1609
|
+
cmdTrust();
|
|
1610
|
+
break;
|
|
1514
1611
|
case "flush":
|
|
1515
1612
|
case "knowledge-flush":
|
|
1516
1613
|
cmdFlush();
|