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
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
- # Qualia Framework v5.3
1
+ # Qualia Framework v5.8
2
2
 
3
3
  A harness engineering framework for [Claude Code](https://claude.ai/code). It installs into `~/.claude/` and wraps your AI-assisted development workflow with structured planning, execution, verification, and deployment gates.
4
4
 
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."
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
- **The v5 line in three releases:**
8
- - **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 (Vercel account, empty env-var, Supabase destructive guards).
9
- - **v5.1** — `/qualia-polish-loop` (autonomous visual-polish loop: screenshots a URL at three viewports, scores 8 design dimensions with vision, fixes top issues, loops until pass or kill-switch); multi-target installer (Claude Code + Codex AGENTS.md + Both); live-progress install UI.
10
- - **v5.2** polish-loop reliability. `--reduced-motion` capture flag, `--routes URL1,URL2` multi-route mode, first supervised end-to-end run.
11
- - **v5.3** Matt Pocock gaps closed. `/qualia-prd` (synthesize conversation → durable PRD), `/qualia-hook-gen` (CLAUDE.md instruction deterministic Claude Code hook), `/qualia-optimize --deepen` Step 5b parallel-interface design (3 fan-out agents producing radically different interfaces).
7
+ **The v5 line:**
8
+ - **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.
9
+ - **v5.1**, autonomous visual-polish loop. Screenshots a URL at three viewports, scores 8 design dimensions with vision, fixes top issues, loops until pass or kill-switch. Multi-target installer (Claude Code + Codex AGENTS.md + Both).
10
+ - **v5.2**, polish-loop reliability. `--reduced-motion` capture flag, `--routes URL1,URL2` multi-route mode, first supervised end-to-end run.
11
+ - **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).
12
+ - **v5.4-5.5**, token-discipline and plan-discipline. Cache-aware spawn ordering, scope-reduction prohibition, decision-coverage audit, requirement-coverage check.
13
+ - **v5.6**, Demo vs Full Project gate at kickoff. Mandatory discovery interview via `/qualia-discuss` in PROJECT MODE (8 questions for demos, 14 for full projects). Demo-extension branch in `/qualia-milestone` for client-signs-after-demo conversion.
14
+ - **v5.7**, `/qualia-feature` consolidates `/qualia-quick` + `/qualia-task` into one auto-scoped command.
15
+ - **v5.8**, surface cleanup. `/qualia-polish --loop` replaces `/qualia-polish-loop`. `/qualia-quick`, `/qualia-task`, and `/qualia-prd` removed (deprecated in v5.7).
12
16
 
13
17
  The Full Journey architecture carries forward: `/qualia-new` maps the entire project arc from kickoff to client handoff upfront, and the Road chains end-to-end in `--auto` mode with only two human gates per project.
14
18
 
@@ -40,6 +44,8 @@ npx qualia-framework@latest traces # View recent hook telemetry
40
44
 
41
45
  Open Claude Code in any project directory.
42
46
 
47
+ > **New to Qualia?** Open [`docs/onboarding.html`](docs/onboarding.html) in a browser for a one-page roadmap of the golden path. Best file to send a new hire.
48
+
43
49
  ### The Road — guided mode (default)
44
50
 
45
51
  ```
@@ -53,7 +59,7 @@ Open Claude Code in any project directory.
53
59
  /qualia-polish # Design pass — flexible scope: component, route, app, redesign, critique, quick
54
60
  /qualia-ship # Deploy to production
55
61
  /qualia-handoff # Enforce the 4 mandatory handoff deliverables
56
- /qualia-report # Mandatory end-of-session report + ERP upload
62
+ /qualia-report # Mandatory shift report + ERP upload before clock-out
57
63
  ```
58
64
 
59
65
  ### The Road — auto mode
@@ -89,15 +95,13 @@ Two human gates per project. One halt case (gap-cycle limit exceeded on a failin
89
95
  /qualia-debug # Structured debugging
90
96
  /qualia-review # Production audit (scored diagnostics)
91
97
  /qualia-optimize # Deep optimization pass (parallel specialist agents, --deepen mode with parallel-interface design)
92
- /qualia-quick # Fast path for trivial fixes (skips planning)
93
- /qualia-task # Build one thing properly (fresh builder, atomic commit, no phase plan)
98
+ /qualia-feature # Auto-scoped single-feature build (inline for trivia, fresh spawn for 1-5 files)
94
99
  /qualia-test # Generate or run tests (--tdd mode for test-first workflow)
95
100
  /qualia-zoom # Focus on a single file or function with full context
96
101
  /qualia-issues # Break a phase plan into vertical-slice GitHub issues
97
102
  /qualia-triage # Triage open issues through the ready-for-agent state machine
98
103
  /qualia-road # View and navigate the project road (journey/milestone/phase status)
99
- /qualia-polish-loop # Autonomous visual-polish loop: screenshot vision-eval fix repeat (v5.1+)
100
- /qualia-prd # Synthesize current conversation into a durable feature spec (v5.3+)
104
+ /qualia-polish --loop # Autonomous visual-polish loop: screenshot, vision-eval, fix, repeat
101
105
  /qualia-hook-gen # Convert a CLAUDE.md/rules instruction into a deterministic hook (v5.3+)
102
106
  ```
103
107
 
@@ -127,8 +131,8 @@ Every project has a `.planning/JOURNEY.md` — the North Star document that maps
127
131
  Project
128
132
  └─ Journey (all milestones defined upfront)
129
133
  └─ Milestone (a release — 2-5 total, Handoff is always last)
130
- └─ Phase (a feature-sized deliverable, 2-5 tasks)
131
- └─ Task (atomic unit, one commit, one verification contract)
134
+ └─ Phase (a feature-sized deliverable, 2-5 internal tasks)
135
+ └─ Task (framework-internal unit, one commit, one verification contract)
132
136
  ```
133
137
 
134
138
  **Hard rules:**
@@ -137,11 +141,11 @@ Project
137
141
  - Every non-Handoff milestone needs **≥ 2 phases** (enforced by `state.js close-milestone`).
138
142
  - Milestone numbering is contiguous.
139
143
 
140
- **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.
144
+ **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.
141
145
 
142
- ## What's Inside (v5.3.0)
146
+ ## What's Inside (v5.8.0)
143
147
 
144
- - **35 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 (debug, review, optimize with `--deepen` parallel-interface design, quick, task, test, zoom, issues, triage), v5 flagships (`qualia-polish-loop`, `qualia-prd`, `qualia-hook-gen`), and meta (learn, skill-new, flush, postmortem)
148
+ - **32 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 (debug, review, optimize with `--deepen` parallel-interface design, feature, test, zoom, issues, triage), v5 flagships (`qualia-polish --loop`, `qualia-hook-gen`), and meta (learn, skill-new, flush, postmortem)
145
149
  - **9 agents** (each runs in fresh context): planner, builder, verifier, qa-browser, researcher, research-synthesizer, roadmapper, plan-checker, visual-evaluator
146
150
  - **12 hooks** (pure Node.js, cross-platform): session-start, auto-update, git-guardrails, branch-guard, pre-push tracking sync, migration-guard, pre-deploy-gate, pre-compact state save, stop-session-log, vercel-account-guard, env-empty-guard, supabase-destructive-guard
147
151
  - **6 always-loaded rules** (`rules/`): grounding, security, infrastructure, deployment, speed (CLI-first / MCP tier-list), architecture (deep modules / scout-for-shallow-code)
package/agents/builder.md CHANGED
@@ -93,18 +93,26 @@ which is fine and means there is nothing to apply yet.
93
93
  - If the plan says "use library X" — use library X
94
94
  - If something in the plan seems wrong, flag it but still follow the plan
95
95
 
96
- ### 4. Self-Verify Your Work
96
+ ### 4. Self-Verify Your Work (Auto-Heal Loop)
97
97
 
98
- Before committing:
98
+ Before committing, run the checks below. If any fail, **fix and retry up to 2 times** before giving up. This is a tight self-heal loop — moving correctness checks here saves a verifier round.
99
99
 
100
- 1. Run every command in **Validation:** — they must pass
100
+ 1. Run every command in **Validation:** — they must pass.
101
101
  2. Mentally walk through each **Acceptance Criterion** — does the code actually produce that observable behavior?
102
- 3. Run `npx tsc --noEmit` if you touched TypeScript files
103
- 4. **If you touched any `.tsx/.jsx/.css/.scss/.html` file: run `node bin/slop-detect.mjs {touched paths}`. Exit 1 (critical findings) BLOCKS the commit.** Fix the findings (apply the rewrite recipe in the script's output), re-run, repeat until exit 0.
104
- 5. No `// TODO`, no placeholder text, no stub functions
105
- 6. Imports are wired — not just declared but actually used
102
+ 3. Run `npx tsc --noEmit` if you touched TypeScript files. On failure, capture the first 50 lines of error output, fix the offending file(s), re-run. Cap at 2 retries.
103
+ 4. **If you touched any `.tsx/.jsx/.css/.scss/.html` file: run `node bin/slop-detect.mjs {touched paths}`. Exit 1 (critical findings) BLOCKS the commit.** Fix the findings (apply the rewrite recipe in the script's output), re-run, repeat until exit 0 (also capped at 2 retries before BLOCKED).
104
+ 5. No `// TODO`, no placeholder text, no stub functions.
105
+ 6. Imports are wired — not just declared but actually used.
106
106
 
107
- If any Validation command fails, slop-detect returns 1, or any AC is not met, fix before committing. Do not commit and hope the verifier catches it.
107
+ **Auto-heal protocol:**
108
+
109
+ ```
110
+ attempt 1: run validation → fix what failed → run again
111
+ attempt 2: run validation → fix what failed → run again
112
+ attempt 3: if still failing, return BLOCKED — do not commit broken code
113
+ ```
114
+
115
+ If any Validation command fails after 2 retries, slop-detect returns 1 after 2 retries, or any AC is not met after a fix attempt, return `BLOCKED — {validation failure}: {first 20 lines of last error output}`. Do not commit and hope the verifier catches it.
108
116
 
109
117
  ### 5. Commit
110
118
  One atomic commit per task:
@@ -115,6 +123,15 @@ git commit -m "{concise description of what was built}"
115
123
 
116
124
  Stage specific files — never `git add .` or `git add -A`.
117
125
 
126
+ ## Scope Reduction Prohibition
127
+
128
+ The plan was written with the full spec in mind. Don't simplify it. If a task says "validate with Zod schema X covering 6 fields" don't ship 3 fields. If it says "redirect on success" don't ship a console.log placeholder.
129
+
130
+ **Banned phrases in code, comments, and commit messages:**
131
+ `v1`, `// for now`, `// TODO: wire this up later`, `// hardcoded for now`, `// stub`, `// placeholder`, `// minimal version`, `// will improve later`, `mock for now` (in production code paths).
132
+
133
+ If you cannot deliver the full spec because a dependency is genuinely missing, return `BLOCKED — dependency missing: {what}` per the deviation table. Do NOT ship a watered-down version with a TODO note.
134
+
118
135
  ## Scope Discipline
119
136
 
120
137
  Before writing or editing any file, check: Is this file listed in the task's **Files** section?
@@ -132,6 +132,54 @@ Every frontend task MUST include a `**Design:**` field with:
132
132
 
133
133
  Non-frontend tasks (backend, migrations, API routes without UI) MUST NOT have a `**Design:**` field. Warn but don't fail if one is mistakenly added.
134
134
 
135
+ ### Rule 11: Requirement Coverage (when ROADMAP.md lists REQ-IDs)
136
+
137
+ If `.planning/ROADMAP.md` exists and the current phase's section lists `Requirements covered:` with `REQ-ID`s (format `[A-Z]+-\d+`, e.g. `AUTH-01`, `BILLING-03`), every REQ-ID must be covered by at least one task. Coverage = the task's `**Why:**`, `**Acceptance Criteria:**`, or `**Action:**` field references the REQ-ID, OR the task's content directly implements that requirement (read the requirement description from `.planning/REQUIREMENTS.md` and confirm).
138
+
139
+ **FAIL if:**
140
+ - A REQ-ID listed for the current phase appears nowhere in the plan.
141
+ - A task claims a REQ-ID but its Action/AC obviously doesn't implement it.
142
+
143
+ **How to detect:**
144
+ ```bash
145
+ # Extract REQ-IDs for this phase from ROADMAP.md
146
+ awk '/^### Phase {N}:/,/^---|^### Phase/' .planning/ROADMAP.md | grep -oE '[A-Z]+-[0-9]+' | sort -u
147
+ # Check each appears in the plan
148
+ grep -oE '[A-Z]+-[0-9]+' .planning/phase-{N}-plan.md | sort -u
149
+ ```
150
+
151
+ The set difference (REQ-IDs in roadmap minus REQ-IDs in plan) must be empty.
152
+
153
+ If a REQ-ID is missing from the plan, REVISE: "REQ AUTH-03 is in scope for this phase per ROADMAP.md but no task implements it." Plan-wide, not task-specific.
154
+
155
+ ### Rule 9: Decision Coverage (when phase-context.md exists)
156
+
157
+ If `.planning/phase-{N}-context.md` exists with a `## Locked Decisions` section, every `D-NN` row must be covered by at least one task. Coverage = the task references the ID in its `**Why:**` or `**Action:**` field, OR the task's Action implements the decision content directly (read the task and confirm).
158
+
159
+ **FAIL if:**
160
+ - A `D-NN` row exists in phase-context.md but no task in the plan references it or implements it.
161
+ - A row from `## Deferred Ideas` is being implemented by a task (deferred = explicitly out-of-scope).
162
+
163
+ **How to detect:**
164
+ ```bash
165
+ grep -E '^\| D-[0-9]+' .planning/phase-{N}-context.md # extract decision IDs
166
+ grep -E 'D-[0-9]+' .planning/phase-{N}-plan.md # check IDs appear in plan
167
+ ```
168
+
169
+ If a decision ID appears in phase-context.md but not the plan, REVISE: "D-03 is locked but no task implements it." Plus the deferred check: if a task's Action matches a Deferred-Ideas row, REVISE.
170
+
171
+ ### Rule 10: Scope Reduction Detection
172
+
173
+ LLMs systematically simplify specs. Scan the plan for banned phrases that signal scope reduction:
174
+
175
+ ```bash
176
+ grep -niE '\b(v1|v2|simplified version|static for now|hardcoded for now|placeholder|basic version|minimal implementation|will be wired later|dynamic in future phase|skip for now|stub|mock for now|we can improve this later|quick win for now)\b' .planning/phase-{N}-plan.md
177
+ ```
178
+
179
+ **FAIL if:** any match. Quote the offending line in the issue. The planner must rewrite the task to deliver the actual thing, OR explicitly justify the split using one of the three legitimate reasons (context cost > 50%, missing info, dependency conflict).
180
+
181
+ Exception: `v1` / `v2` is fine when referring to the project's actual versioning (e.g., `migrate to API v2`). Distinguish by context.
182
+
135
183
  ### Rule 8: Validation commands test behavior, not just existence
136
184
 
137
185
  Each task's `**Validation:**` list must contain at least one `grep-match` or `command-exit` check — a command that proves the code DOES something. A task whose ONLY validation is `test -f {file}` will pass even if the file contains only `// TODO`.
@@ -152,7 +200,7 @@ Each task's `**Validation:**` list must contain at least one `grep-match` or `co
152
200
 
153
201
  ## Tool Budget
154
202
 
155
- Read the plan file once. Grep the codebase only to validate Rule 7 (locked decisions). Do NOT speculatively check whether files listed in the plan already exist — that's the builder's job. Max 10 tool calls per invocation.
203
+ Read the plan file once. Read `.planning/phase-{N}-context.md` once if it exists (Rules 7 + 9). Read `.planning/ROADMAP.md` once if it exists (Rules 4 + 11). Grep the plan for scope-reduction phrases (Rule 10), decision IDs (Rule 9), and REQ-IDs (Rule 11). Do NOT speculatively check whether files listed in the plan already exist — that's the builder's job. Max 14 tool calls per invocation.
156
204
 
157
205
  ## Output Format
158
206
 
@@ -215,6 +263,6 @@ Before returning, self-check:
215
263
  - [ ] Every issue has a specific task reference
216
264
  - [ ] Every issue has a concrete fix instruction
217
265
  - [ ] No issue is "make it better" or "be more specific" without saying how
218
- - [ ] If plan passes, you actually verified all 7 rules (not just 1-2)
266
+ - [ ] If plan passes, you actually verified all 11 rules (not just 1-2)
219
267
 
220
268
  Don't pass a plan you didn't fully check. Don't fail a plan for style preferences.
package/agents/planner.md CHANGED
@@ -212,12 +212,36 @@ When a phase involves frontend work (pages, components, layouts, UI):
212
212
  - Include responsive: "works on 375px mobile and 1440px desktop"
213
213
  4. **Reference `@.planning/DESIGN.md`** in the Context field of every frontend task so builders read it before coding
214
214
 
215
+ ## Scope Reduction Prohibition
216
+
217
+ LLMs systematically simplify specs. You will not. If a locked decision or success criterion says X, the plan delivers X — not a watered-down version that "we can extend later."
218
+
219
+ **Banned phrases in task Action / Acceptance Criteria / Why fields:**
220
+ `v1`, `v2`, `simplified version`, `static for now`, `hardcoded for now`, `placeholder`, `basic version`, `minimal implementation`, `will be wired later`, `dynamic in future phase`, `skip for now`, `stub`, `mock for now`, `we can improve this later`, `quick win for now`.
221
+
222
+ **The only legitimate reasons to split scope across phases:**
223
+ 1. Implementing it would force a single task above ~50% builder context.
224
+ 2. Required information genuinely does not exist (data shape unknown, external API not yet specified).
225
+ 3. A dependency is owned by a future phase and the wave-graph cannot resolve it.
226
+
227
+ If none of these apply, deliver the full spec. A self-check before returning the plan: grep your draft for the banned phrases. If you find one, rewrite the task to deliver the actual thing.
228
+
229
+ ## Decision Coverage Audit
230
+
231
+ If `.planning/phase-{N}-context.md` exists with a `## Locked Decisions` section, every decision row carries an ID (e.g., `D-01`, `D-02`). Before returning the plan, confirm:
232
+
233
+ - Every `D-XX` is covered by at least one task whose Action implements it. Reference the ID in that task's Why or Action (e.g., `Why: D-03 requires session tokens stored database-side, not in JWT`).
234
+ - No `Deferred Ideas` row appears in any task. Deferred = out-of-scope for this phase.
235
+ - `Discretion` items are the planner's call — no audit needed.
236
+
237
+ If a locked decision has no covering task, add one. If you genuinely cannot, the phase scope is wrong and the plan-checker will block — STOP and surface the gap to the user.
238
+
215
239
  ## Rules
216
240
 
217
241
  1. **Plans complete within ~50% context.** More plans with smaller scope = consistent quality. 2-3 tasks per plan is ideal.
218
242
  2. **Tasks are atomic.** Each task = one commit. If a task touches 10+ files, split it.
219
243
  3. **"Done when" must be testable.** Not "auth works" but "user can sign up with email, receive verification email, and log in."
220
- 4. **Honor locked decisions.** If PROJECT.md says "use library X" — the plan uses library X.
244
+ 4. **Honor locked decisions.** If PROJECT.md or phase-context.md says "use library X" — the plan uses library X.
221
245
  5. **No enterprise patterns.** No RACI, no stakeholder management, no sprint ceremonies. One person + Claude.
222
246
  6. **Context references are explicit.** Use `@filepath` so the builder knows exactly what to read.
223
247
 
@@ -33,6 +33,7 @@ You receive:
33
33
  - `.planning/research/ARCHITECTURE.md`
34
34
  - `.planning/research/PITFALLS.md`
35
35
  - Project context (PROJECT.md summary)
36
+ - `<scope>` — optional: `quick` for demo projects, `standard` (default) for full projects
36
37
 
37
38
  ## Output
38
39
 
@@ -72,7 +73,9 @@ Based on:
72
73
  - ARCHITECTURE.md build order → what depends on what, which foundation must land in Milestone 1 to support final-milestone requirements
73
74
  - PITFALLS.md → which risks stall later milestones and need to be addressed in Milestone 1 foundations
74
75
 
75
- Suggest a **2-5 milestone arc ending in Handoff**:
76
+ **Quick scope (`<scope>quick</scope>`, demo projects):** Suggest a **single milestone** (no Handoff, no multi-milestone arc). The milestone is the demo itself — 2 to 4 phases that ship a real working surface end-to-end. Skip the "Handoff implications" section. The demo extends into a full project later via `/qualia-milestone` if the client signs; that conversion is handled there, not here.
77
+
78
+ **Standard scope (default):** Suggest a **2-5 milestone arc ending in Handoff**:
76
79
 
77
80
  - **Milestone 1 · Foundation** — almost always. DB, auth, base layout, deploy pipeline.
78
81
  - **Milestone 2-{N-1} · Core + Expansion** — the value-delivering capabilities, ordered by dependency.
@@ -25,11 +25,16 @@ You receive from the orchestrator:
25
25
  - `<domain>` — the project domain (e.g., "legal case management", "dental clinic booking", "voice agent for restaurants")
26
26
  - `<project_context>` — summary of PROJECT.md (core value, constraints, what they're building)
27
27
  - `<milestone_context>` — greenfield or subsequent
28
+ - `<scope>` — optional: `quick` for demo projects, `standard` (default) for full projects
28
29
  - `<output_path>` — absolute path where you write your research file
29
30
 
30
31
  ## Tool Budget
31
32
 
32
- Maximum 8 external calls total per invocation: 3 Context7 queries + 3 WebFetch calls + 2 WebSearch queries. If you exhaust this budget, write what you have and mark remaining sections as `confidence: LOW`. Research is time-boxed, not exhaustive — a 10-minute deep dive with concrete sources beats a 30-minute wander.
33
+ **Standard scope (default):** Maximum 8 external calls total per invocation 3 Context7 queries + 3 WebFetch calls + 2 WebSearch queries.
34
+
35
+ **Quick scope (`<scope>quick</scope>`, used by demo projects):** Maximum 3 external calls total — 1 Context7 query + 1 WebFetch + 1 WebSearch. The demo only needs enough research to validate the stack and surface the top pitfall — depth is wasted when there's a single milestone to ship. Drain local sources first (Steps 0a + 0b below); if local sources cover the dimension, skip external calls entirely.
36
+
37
+ If you exhaust the budget, write what you have and mark remaining sections as `confidence: LOW`. Research is time-boxed, not exhaustive — a 10-minute deep dive with concrete sources beats a 30-minute wander.
33
38
 
34
39
  **Local-first.** Before any external call, exhaust local sources (Steps 0a + 0b in *How to Research* below). Most domains have already been researched and the answers live in NotebookLM notebooks or `~/qualia-memory`. Hitting the web for content we already have is silent token waste — and the local source is usually higher-quality (curated synthesis vs raw search results).
35
40
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: qualia-visual-evaluator
3
- description: Vision-anchored evaluator for /qualia-polish-loop. Reads screenshots, scores 8 design dimensions against the rubric with cited evidence, returns top 3 issues + severity. Default: 3 (acceptable). Only deviates with quoted evidence.
3
+ description: Vision-anchored evaluator for /qualia-polish --loop. Reads screenshots, scores 8 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
 
package/bin/install.js CHANGED
@@ -390,10 +390,10 @@ async function main() {
390
390
  if (fs.existsSync(refSrc)) {
391
391
  copy(refSrc, path.join(CLAUDE_DIR, "skills", skill, "REFERENCE.md"));
392
392
  }
393
- // v5.1: Copy scripts/ subfolder if present (e.g. qualia-polish-loop ships
394
- // playwright-capture.mjs, loop.mjs, score.mjs that the skill invokes at
395
- // runtime). Recursive preserves nested files. fixtures/ also copied
396
- // for self-test scenarios.
393
+ // v5.1: Copy scripts/ subfolder if present (e.g. qualia-polish ships
394
+ // playwright-capture.mjs, loop.mjs, score.mjs that the --loop mode
395
+ // invokes at runtime). Recursive, preserves nested files. fixtures/
396
+ // also copied for self-test scenarios.
397
397
  for (const sub of ["scripts", "fixtures"]) {
398
398
  const subSrc = path.join(skillsDir, skill, sub);
399
399
  if (fs.existsSync(subSrc) && fs.statSync(subSrc).isDirectory()) {
@@ -893,8 +893,8 @@ Client-specific preferences, design choices, and requirements. Loaded by \`/qual
893
893
  excludeDefault: true,
894
894
  tips: [
895
895
  "⬢ Lost? Type /qualia for the next step",
896
- "⬢ Small fix? Use /qualia-quick to skip planning",
897
- "⬢ End of day? /qualia-report before you clock out",
896
+ "⬢ Single feature? Use /qualia-feature, it auto-scopes",
897
+ "⬢ End of day? /qualia-report submits your shift before clock-out",
898
898
  "⬢ Context isolation: every task gets a fresh AI brain",
899
899
  "⬢ The verifier doesn't trust claims — it greps the code",
900
900
  "⬢ Plans are prompts — the plan IS what the builder reads",
@@ -1104,8 +1104,8 @@ function printSummary({ member, target, claudeInstalled }) {
1104
1104
  }
1105
1105
  console.log("");
1106
1106
  console.log(` ${DIM}New project?${RESET} ${TEAL}/qualia-new${RESET}`);
1107
- console.log(` ${DIM}Quick fix?${RESET} ${TEAL}/qualia-quick${RESET}`);
1108
- console.log(` ${DIM}End of day?${RESET} ${TEAL}/qualia-report${RESET} ${DIM}(mandatory)${RESET}`);
1107
+ console.log(` ${DIM}Single feature?${RESET} ${TEAL}/qualia-feature${RESET}`);
1108
+ console.log(` ${DIM}End of day?${RESET} ${TEAL}/qualia-report${RESET} ${DIM}(shift submission)${RESET}`);
1109
1109
  console.log(` ${DIM}Stuck?${RESET} ${TEAL}/qualia${RESET}`);
1110
1110
  console.log("");
1111
1111
  console.log(` ${DIM2}${RULE}${RESET}`);
@@ -21,6 +21,28 @@ const CHECK_TYPES = new Set([
21
21
  "file-exists", "grep-match", "command-exit", "behavioral",
22
22
  ]);
23
23
 
24
+ // Scope-reduction detection — phrases that signal an LLM has watered down the
25
+ // spec. The plan-checker agent does the same scan on the markdown plan; this
26
+ // function does it on the JSON contract's free-text fields (action +
27
+ // acceptance_criteria) so both paths catch the same failure mode.
28
+ const SCOPE_REDUCTION_PHRASES = [
29
+ /\bv1\b/i, /\bv2\b/i, /simplified version/i, /static for now/i,
30
+ /hardcoded for now/i, /\bplaceholder\b/i, /basic version/i,
31
+ /minimal implementation/i, /will be wired later/i,
32
+ /dynamic in future phase/i, /skip for now/i, /\bstub\b/i,
33
+ /mock for now/i, /we can improve this later/i, /quick win for now/i,
34
+ ];
35
+
36
+ function findScopeReductionPhrases(text) {
37
+ if (typeof text !== "string") return [];
38
+ const hits = [];
39
+ for (const re of SCOPE_REDUCTION_PHRASES) {
40
+ const m = text.match(re);
41
+ if (m) hits.push(m[0]);
42
+ }
43
+ return hits;
44
+ }
45
+
24
46
  function isStringArray(v) {
25
47
  return Array.isArray(v) && v.every((x) => typeof x === "string");
26
48
  }
@@ -98,7 +120,15 @@ function validateTask(task, idx, allIds) {
98
120
  errs.push(`${where}.acceptance_criteria: must be a non-empty string[]`);
99
121
  }
100
122
  if (typeof task.action !== "string") errs.push(`${where}.action: required string`);
101
- else if (task.action.length > 500) errs.push(`${where}.action: must be ≤ 500 characters (got ${task.action.length})`);
123
+ else {
124
+ if (task.action.length > 500) errs.push(`${where}.action: must be ≤ 500 characters (got ${task.action.length})`);
125
+ const actionHits = findScopeReductionPhrases(task.action);
126
+ if (actionHits.length) errs.push(`${where}.action: scope-reduction phrase(s) detected: ${actionHits.join(", ")} — rewrite to deliver the actual spec, or split via locked-decision channel`);
127
+ }
128
+ for (let i = 0; i < (task.acceptance_criteria || []).length; i++) {
129
+ const acHits = findScopeReductionPhrases(task.acceptance_criteria[i]);
130
+ if (acHits.length) errs.push(`${where}.acceptance_criteria[${i}]: scope-reduction phrase(s) detected: ${acHits.join(", ")}`);
131
+ }
102
132
  if (!isStringArray(task.context_files || [])) errs.push(`${where}.context_files: must be string[]`);
103
133
  if (!Array.isArray(task.verification) || task.verification.length === 0) {
104
134
  errs.push(`${where}.verification: must be a non-empty array`);
@@ -217,4 +247,5 @@ module.exports = {
217
247
  parseSafely,
218
248
  hashPlan,
219
249
  checkDrift,
250
+ findScopeReductionPhrases,
220
251
  };
@@ -187,7 +187,7 @@ const SKIP_DIRS = new Set([
187
187
  "coverage", ".cache", "out", ".vercel", ".vscode", ".idea",
188
188
  ".planning", ".qa-screenshots",
189
189
  // v5.1: skip test fixtures by convention. Fixtures used as regression
190
- // targets (e.g. /qualia-polish-loop's broken.html) intentionally violate
190
+ // targets (e.g. /qualia-polish --loop's broken.html) intentionally violate
191
191
  // the rules slop-detect enforces; scanning them flags real fixture bugs
192
192
  // as production slop.
193
193
  "fixtures", "__fixtures__",
@@ -2,6 +2,17 @@
2
2
 
3
3
  The Qualia Framework optionally uploads session reports to the company ERP at `https://portal.qualiasolutions.net`. This document specifies the API shape.
4
4
 
5
+ ## Operating Model
6
+
7
+ The ERP treats `/qualia-report` as an employee shift submission, not proof that an assigned task was finished. Employees clock out after their fixed daily hours and submit what happened during the shift: shipped work, partial progress, blockers, investigation, meetings, or no-code work.
8
+
9
+ Primary ERP planning dates are:
10
+ - Project deadline
11
+ - Milestone deadline
12
+ - Employee submission date from the uploaded report
13
+
14
+ Phase and task counters remain framework telemetry. They help agents plan/build/verify, but they should not become the ERP's primary navigation, deadline model, or employee-performance label.
15
+
5
16
  ## Configuration
6
17
 
7
18
  Stored in `~/.claude/.qualia-config.json`: