qualia-framework 5.5.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.
- package/README.md +17 -13
- package/agents/research-synthesizer.md +4 -1
- package/agents/researcher.md +6 -1
- package/agents/visual-evaluator.md +1 -1
- package/bin/install.js +6 -6
- package/bin/slop-detect.mjs +1 -1
- package/docs/onboarding.html +623 -0
- package/guide.md +5 -6
- package/hooks/session-start.js +1 -1
- package/package.json +1 -1
- package/skills/qualia-discuss/SKILL.md +106 -6
- package/skills/qualia-feature/SKILL.md +216 -0
- package/skills/qualia-milestone/SKILL.md +73 -1
- package/skills/qualia-new/SKILL.md +52 -25
- package/skills/qualia-optimize/SKILL.md +1 -1
- package/skills/{qualia-polish-loop → qualia-polish}/REFERENCE.md +5 -5
- package/skills/qualia-polish/SKILL.md +13 -4
- package/skills/{qualia-polish-loop → qualia-polish}/scripts/loop.mjs +2 -2
- package/skills/{qualia-polish-loop → qualia-polish}/scripts/playwright-capture.mjs +1 -1
- package/skills/qualia-road/SKILL.md +10 -11
- package/templates/project-discovery.md +83 -0
- package/templates/project.md +7 -0
- package/tests/bin.test.sh +74 -62
- package/tests/slop-detect.test.sh +2 -2
- package/skills/qualia-polish-loop/SKILL.md +0 -201
- package/skills/qualia-prd/SKILL.md +0 -199
- package/skills/qualia-quick/SKILL.md +0 -44
- package/skills/qualia-task/SKILL.md +0 -98
- /package/skills/{qualia-polish-loop → qualia-polish}/fixtures/broken.html +0 -0
- /package/skills/{qualia-polish-loop → qualia-polish}/fixtures/clean.html +0 -0
- /package/skills/{qualia-polish-loop → qualia-polish}/scripts/score.mjs +0 -0
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qualia-polish-loop
|
|
3
|
-
description: "Autonomous visual-polish loop — screenshots a live URL at three viewports, scores 8 design dimensions against the rubric using vision, fixes issues in the codebase, re-screenshots, loops until every dimension scores ≥ 3 or the kill-switch fires. Trigger on 'polish loop', 'visual loop', 'screenshot polish', 'visual QA loop', 'fix what I see', 'make it look right', 'iterate on the design until it's correct'. v5.1 flagship — closes the design-iteration churn friction."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Grep
|
|
10
|
-
- Glob
|
|
11
|
-
- Agent
|
|
12
|
-
argument-hint: "{url} [--brief PATH] [--max 8] [--viewports 375,768,1440] [--ref PATH] [--budget 100000]"
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# /qualia-polish-loop — Autonomous Visual-Polish Loop
|
|
16
|
-
|
|
17
|
-
See its own work. Fix its own work. Stop only when correct.
|
|
18
|
-
|
|
19
|
-
## What it does
|
|
20
|
-
|
|
21
|
-
Takes a URL + design brief. Screenshots at 3 viewports (mobile / tablet / desktop). Spawns a vision evaluator that scores 8 dimensions of `qualia-design/design-rubric.md` against the brief with cited evidence. Spawns up to 3 fix-builders in parallel for the top issues. Re-screenshots. Loops until all dimensions ≥ 3 or the kill-switch trips (regression, budget, or max iterations).
|
|
22
|
-
|
|
23
|
-
Different from `/qualia-polish`: that one is read+edit+slop-detect, single pass. This one is **see+edit+verify+repeat** with a real loop and real screenshots.
|
|
24
|
-
|
|
25
|
-
## When to use
|
|
26
|
-
|
|
27
|
-
- After `/qualia-build` or `/qualia-verify` when visual issues remain that text-based slop-detect can't catch (mobile-only breakage, motion missing, hero-video framing)
|
|
28
|
-
- When the user says "it doesn't look right" / "fix what I see" / "the mobile version is broken"
|
|
29
|
-
- As an opt-in upgrade to `/qualia-polish --redesign` Stage 4 (vision loop)
|
|
30
|
-
- Before `/qualia-ship` for a final visual QA pass
|
|
31
|
-
|
|
32
|
-
## Pre-flight (sequential, every invocation)
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
node ~/.claude/bin/qualia-ui.js banner polish
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Run these in order. Halt on the first failure.
|
|
39
|
-
|
|
40
|
-
| Gate | Check | If fail |
|
|
41
|
-
|---|---|---|
|
|
42
|
-
| Substrate | `qualia-design/design-rubric.md`, `qualia-design/design-laws.md` exist | Run `npx qualia install` |
|
|
43
|
-
| Brief | `--brief` PATH if provided, else `.planning/DESIGN.md`, else PRODUCT.md | If none, HALT: "No design brief found. Pass --brief or run /qualia-new." |
|
|
44
|
-
| Browser | `node ~/.claude/skills/qualia-polish-loop/scripts/playwright-capture.mjs --url about:blank --out /tmp/qpl-preflight` exits 0 | HALT with the script's setup hint |
|
|
45
|
-
| URL reachable | `curl -fsS -o /dev/null -w '%{http_code}' "$URL"` returns 2xx/3xx | HALT — start the dev server first |
|
|
46
|
-
| Working tree | `git status --porcelain` is empty | HALT — "Loop commits per iteration. Stash or commit pending changes first." |
|
|
47
|
-
| Budget | Estimate iters × ~14.5K tokens; warn if > 100K | If `--budget` not set, default 100K. Surface estimate to user. |
|
|
48
|
-
|
|
49
|
-
State the preflight explicitly:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
QPL_PREFLIGHT: substrate=pass brief={path} browser=pass url=200 git=clean budget=100K
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Loop (max 8 iterations, default 6)
|
|
56
|
-
|
|
57
|
-
Single state file at `/tmp/qpl-{timestamp}/state.json` keeps the deterministic counters (iteration, fingerprints, fixes, verdict) out of the LLM context.
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
RUN_ID="qpl-$(date +%s)"
|
|
61
|
-
STATE="/tmp/${RUN_ID}/state.json"
|
|
62
|
-
node ~/.claude/skills/qualia-polish-loop/scripts/loop.mjs init \
|
|
63
|
-
--state "$STATE" --url "$URL" --brief "$BRIEF" \
|
|
64
|
-
--max "${MAX:-8}" --budget "${BUDGET:-100000}"
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Each iteration:
|
|
68
|
-
|
|
69
|
-
### 1. Capture (deterministic, ~3-5s)
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
ITER_DIR="/tmp/${RUN_ID}/iter-${N}"
|
|
73
|
-
node ~/.claude/skills/qualia-polish-loop/scripts/playwright-capture.mjs \
|
|
74
|
-
--url "$URL" --out "$ITER_DIR" --viewports 375,768,1440 --wait 1500
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Three PNGs land in `$ITER_DIR/{mobile,tablet,desktop}-*.png`. The capture script auto-selects a backend: Playwright if `import('playwright')` resolves, else the cached `~/.cache/ms-playwright/chromium-*` binary, else `google-chrome` / `chromium` on PATH.
|
|
78
|
-
|
|
79
|
-
### 2. Evaluate (vision — single Agent spawn per iteration)
|
|
80
|
-
|
|
81
|
-
Spawn `Agent` with `subagent_type="qualia-visual-evaluator"`. Inline the rubric, the brief, the screenshots paths, the viewport meta, and the previous iteration's issues (if any). The agent reads the screenshots itself and returns a single JSON envelope per the contract in `agents/visual-evaluator.md`.
|
|
82
|
-
|
|
83
|
-
Save the agent's JSON to `$ITER_DIR/eval.json`. The exact spawn template lives in REFERENCE.md (so the SKILL.md stays under 250 lines per progressive-disclosure discipline).
|
|
84
|
-
|
|
85
|
-
### 3. Decide (deterministic)
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
node ~/.claude/skills/qualia-polish-loop/scripts/loop.mjs record \
|
|
89
|
-
--state "$STATE" --eval "$ITER_DIR/eval.json"
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Exit codes: `0` = SUCCESS (all dims ≥ 3), `1` = CONTINUE (more iterations), `3` = KILLED (regression / budget / max).
|
|
93
|
-
|
|
94
|
-
The orchestrator computes the verdict per `qualia-design/design-rubric.md`:
|
|
95
|
-
|
|
96
|
-
- **all aggregate scores ≥ 3 AND no critical issues remain** → SUCCESS, exit loop
|
|
97
|
-
- **same issue fingerprint recurred 3 consecutive iterations** → KILL, `LOOP_REGRESSION_DETECTED`
|
|
98
|
-
- **tokens used exceeds budget** → KILL, `OUT_OF_BUDGET`
|
|
99
|
-
- **iteration count = max** → KILL, `MAX_ITERATIONS_REACHED`
|
|
100
|
-
- **else** → CONTINUE
|
|
101
|
-
|
|
102
|
-
### 4. Fix (parallel, up to 3 builders)
|
|
103
|
-
|
|
104
|
-
For the top 3 issues from `eval.json.top_issues`, spawn `qualia-builder` agents IN THE SAME RESPONSE TURN (parallel). Each builder receives the issue, the design tokens from DESIGN.md, and explicit "fix only this dimension, do not refactor" rules. Template in REFERENCE.md.
|
|
105
|
-
|
|
106
|
-
Each builder commits its fix via the orchestrator's slop-detect-gated commit:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
node ~/.claude/skills/qualia-polish-loop/scripts/loop.mjs commit-fix \
|
|
110
|
-
--state "$STATE" --file "$AFFECTED_FILE" --slug "{issue-slug}"
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
This stages the file, runs `slop-detect` first (critical findings BLOCK and the builder must retry), then commits with `qpl-{N}: {slug}`. Every fix is a real revertable git commit. Failed fixes leave the working tree clean — no half-edits.
|
|
114
|
-
|
|
115
|
-
### 5. Redeploy (default: dev-localhost)
|
|
116
|
-
|
|
117
|
-
Default mode does NOT redeploy. The loop assumes the dev server is running with HMR; the next capture re-screenshots the changed page. Verify the dev server is still up:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
curl -fsS -o /dev/null "$URL" || HALT "dev server died at iteration $N"
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
For Vercel-preview mode (opt-in via `--deploy preview`), run `vercel deploy` (NOT `--prod`) and update `URL` to the deploy URL before the next capture. Slower (~30-60s/iter), but works against a fully-built environment when HMR isn't reliable.
|
|
124
|
-
|
|
125
|
-
### 6. Loop back to Capture, increment N
|
|
126
|
-
|
|
127
|
-
## Post-loop
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
node ~/.claude/skills/qualia-polish-loop/scripts/loop.mjs report --state "$STATE" \
|
|
131
|
-
> .planning/visual-polish-loop.md
|
|
132
|
-
git add .planning/visual-polish-loop.md
|
|
133
|
-
git -c user.name="Qualia Solutions" -c user.email="info@qualiasolutions.net" \
|
|
134
|
-
commit -m "qpl-final: visual-polish-loop report"
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Then a closing card via `qualia-ui`:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
node ~/.claude/bin/qualia-ui.js divider
|
|
141
|
-
node ~/.claude/bin/qualia-ui.js ok "Iterations: {N}/{max}"
|
|
142
|
-
node ~/.claude/bin/qualia-ui.js ok "Final aggregate: {sum}/40 (avg {avg})"
|
|
143
|
-
node ~/.claude/bin/qualia-ui.js ok "Fixes committed: {count}"
|
|
144
|
-
node ~/.claude/bin/qualia-ui.js ok "Tokens used: {N}K of {budget}K"
|
|
145
|
-
node ~/.claude/bin/qualia-ui.js end "VISUAL POLISH LOOP — {SUCCESS|KILLED-AT-N|OUT-OF-BUDGET}" "/qualia-verify or /qualia-ship"
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Hard rules
|
|
149
|
-
|
|
150
|
-
1. **Vision-eval is anchored.** The rubric criteria are inlined in the eval prompt verbatim. Never spawn the evaluator with "tell me what you think" — that's how you get "looks great!" hallucinations. The verbatim contract is in REFERENCE.md.
|
|
151
|
-
2. **Per-iteration commits.** Every fix gets `qpl-{N}: {slug}` prefix so the user can `git revert` any iteration cleanly. The orchestrator enforces this via `loop.mjs commit-fix`.
|
|
152
|
-
3. **Slop-detect gate.** Critical findings BLOCK the commit. The fix-builder must retry (or the loop kills if the same fingerprint recurs 3x).
|
|
153
|
-
4. **No silent destruction.** All edits go through git. Failed iterations leave clear `qpl-N:` commit trail. No working-tree side effects.
|
|
154
|
-
5. **`prefers-reduced-motion` honored.** If reduced motion is set, the evaluator scores motion on CSS-declaration quality, not visible animation. Don't penalize "no motion" when reduced motion is on.
|
|
155
|
-
6. **Budget discipline.** Token usage is tracked in state. KILL at cap. Surface partial progress.
|
|
156
|
-
7. **Cleanup on exit.** No orphan browser processes (the capture script spawns short-lived headless processes, but verify nothing lingers via `pgrep -f chrome --headless`). Temp dirs left for forensic debugging until the next run.
|
|
157
|
-
|
|
158
|
-
## Failure modes
|
|
159
|
-
|
|
160
|
-
| Symptom | Likely cause | Action |
|
|
161
|
-
|---|---|---|
|
|
162
|
-
| `playwright-capture.mjs` exits 2 with `no_browser_backend` | No Chrome/Chromium found anywhere | `npx playwright install chromium` or install Google Chrome |
|
|
163
|
-
| Screenshot is blank | Page not done rendering | Increase `--wait` to 3000ms; retry once |
|
|
164
|
-
| Vision agent says "looks great!" to everything | Rubric not inlined / prompt drift | Verify REFERENCE.md prompt is being used verbatim. Check `agents/visual-evaluator.md` is on disk. |
|
|
165
|
-
| Same issue every iteration | Fix-builder not addressing root cause | Kill at 3 recurrences (automatic). Read `state.json.fingerprints[*]` for diagnosis. Hand-fix and resume. |
|
|
166
|
-
| Dev server died mid-loop | Port conflict / crash | Detect via curl heartbeat in step 5. HALT — restart server, run loop with `--resume STATE`. |
|
|
167
|
-
| Token budget blown | Too many iterations needed | KILL at cap (automatic). Report partial progress. Consider tightening DESIGN.md or pre-running `/qualia-polish` once first. |
|
|
168
|
-
|
|
169
|
-
## Setup notes for users
|
|
170
|
-
|
|
171
|
-
The loop requires headless Chrome/Chromium. Two ways to get it:
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# A. Playwright (recommended — best stability + waiting semantics)
|
|
175
|
-
npx playwright install chromium
|
|
176
|
-
|
|
177
|
-
# B. System Chrome (fallback — works if google-chrome or chromium is on PATH)
|
|
178
|
-
# Already installed on most dev machines; nothing to do.
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
The capture script tries Playwright first, then the cached chromium binary, then PATH lookups. No npm dependency on Playwright is added to your project — it's optional.
|
|
182
|
-
|
|
183
|
-
## Self-tests (the spec mandates 3 scenarios)
|
|
184
|
-
|
|
185
|
-
`docs/playwright-loop-pilot-results.md` records the outcome of running the loop against:
|
|
186
|
-
1. `fixtures/clean.html` (well-designed page) — expect SUCCESS in 1-2 iterations
|
|
187
|
-
2. `fixtures/broken.html` (deliberately bad page) — expect SUCCESS in 4-6 iterations after fixes
|
|
188
|
-
3. Synthetic kill-switch test — verify regression detection fires at iteration 4
|
|
189
|
-
|
|
190
|
-
Run them with `bash skills/qualia-polish-loop/scripts/_self-tests.sh` (if present) or follow the manual instructions in REFERENCE.md.
|
|
191
|
-
|
|
192
|
-
## Token-budget discipline
|
|
193
|
-
|
|
194
|
-
| Max iterations | Estimated tokens | Notes |
|
|
195
|
-
|---|---|---|
|
|
196
|
-
| 2 | ~30K | tight — only for known-clean pages |
|
|
197
|
-
| 4 | ~60K | standard |
|
|
198
|
-
| 6 | ~90K | default |
|
|
199
|
-
| 8 | ~120K | maximum — set `--budget 150000` to allow |
|
|
200
|
-
|
|
201
|
-
Each iteration costs roughly: 3 PNG vision reads (~9K), rubric prompt (~2K), 3 fix-builder spawns with file reads (~3.5K). Plus the orchestrator's deterministic CLI calls (~negligible). The state file persists outside Claude's context entirely — only the per-iteration eval JSON and fix outcomes flow back in.
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qualia-prd
|
|
3
|
-
description: "Synthesize the current conversation into a durable Product Requirements Document (PRD) at .planning/PRD-{slug}.md. Optionally opens a parent GitHub issue. No interview — synthesizes what's already been discussed. Trigger on 'qualia-prd', 'turn this into a PRD', 'write this up as a feature spec', 'make a spec from this discussion', 'PRD this', 'externalize this idea', 'capture this as a spec'. Pairs with /qualia-issues to break the PRD into vertical-slice issues. Distinct from /qualia-plan (phase-operational) — /qualia-prd is feature-durable. v5.3 flagship from Matt Pocock's /to-prd pattern."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Grep
|
|
10
|
-
- Glob
|
|
11
|
-
- Agent
|
|
12
|
-
argument-hint: "[slug] [--issue] [--no-issue] [--update PATH]"
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# /qualia-prd — Conversation → durable feature spec
|
|
16
|
-
|
|
17
|
-
You've been discussing a feature in chat. `/qualia-prd` synthesizes that conversation into a durable PRD on disk so the spec lives outside the chat context. From there, `/qualia-issues` can split it into vertical-slice GH issues, and `/qualia-plan` can plan a phase against it.
|
|
18
|
-
|
|
19
|
-
**Distinct from `/qualia-new`:** `/qualia-new` is project setup (one-shot — JOURNEY.md, PRODUCT.md, CONTEXT.md). `/qualia-prd` is mid-project feature spec capture. You'll run it dozens of times across a project's life; you run `/qualia-new` once.
|
|
20
|
-
|
|
21
|
-
## When to use
|
|
22
|
-
|
|
23
|
-
- Mid-project, when a feature has been discussed enough that you want it durable
|
|
24
|
-
- Before `/qualia-issues` so the issues link back to a real spec
|
|
25
|
-
- Before `/qualia-plan` if the phase needs a feature spec upstream of it
|
|
26
|
-
- When the conversation is about to compact and the PRD context would be lost
|
|
27
|
-
|
|
28
|
-
## Pre-flight
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
node ~/.claude/bin/qualia-ui.js banner plan
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
| Gate | Check | If fail |
|
|
35
|
-
|---|---|---|
|
|
36
|
-
| In a project | `.planning/` exists | HALT — "Run `/qualia-new` first or use `/qualia-quick` for one-off work" |
|
|
37
|
-
| PRODUCT.md present | `.planning/PRODUCT.md` readable | NUDGE — proceed but recommend running `/qualia-new` to seed PRODUCT.md |
|
|
38
|
-
| CONTEXT.md present | `.planning/CONTEXT.md` readable | NUDGE — PRD will use ad-hoc terminology instead of the glossary |
|
|
39
|
-
| Working tree | `git status --porcelain` empty | OK to be dirty — PRD is additive, no logic changes |
|
|
40
|
-
| Slug | First arg or auto-derive from first heading | Auto-derive: kebab-case the conversation's main feature topic |
|
|
41
|
-
|
|
42
|
-
## Process
|
|
43
|
-
|
|
44
|
-
### 1. Slug + path
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
SLUG="${1:-$(date +%Y%m%d)-feature}" # or auto-derive from conversation
|
|
48
|
-
PRD_PATH=".planning/PRD-${SLUG}.md"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
If `--update PATH` is provided, update an existing PRD instead of writing a new one. The synthesis preserves existing sections that haven't been touched in conversation; only changed sections get rewritten.
|
|
52
|
-
|
|
53
|
-
### 2. Spawn synthesizer (forked subagent — preserves taste, cheap on context)
|
|
54
|
-
|
|
55
|
-
The synthesis runs in a **forked subagent**. Forks inherit the full conversation history + share the prompt cache, so the agent can pull the design discussion, decisions, ADR-worthy moments, and user voice without re-loading anything. The fork writes the PRD file and returns just the path + 1-line summary — keeps the parent session lean.
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
Agent(
|
|
59
|
-
subagent_type="general-purpose",
|
|
60
|
-
description="Synthesize conversation → PRD",
|
|
61
|
-
prompt=`
|
|
62
|
-
You are synthesizing this conversation's feature discussion into a durable PRD.
|
|
63
|
-
|
|
64
|
-
# Output location
|
|
65
|
-
Write to: ${PRD_PATH}
|
|
66
|
-
|
|
67
|
-
# Inputs you have (from forked context)
|
|
68
|
-
- The full conversation up to this point
|
|
69
|
-
- @.planning/PRODUCT.md (project register, voice, anti-references)
|
|
70
|
-
- @.planning/CONTEXT.md (domain glossary — USE these terms, do not invent synonyms)
|
|
71
|
-
- @.planning/decisions/*.md (ADRs constraining the design space)
|
|
72
|
-
|
|
73
|
-
# PRD structure (copy this skeleton; fill from conversation)
|
|
74
|
-
|
|
75
|
-
\`\`\`markdown
|
|
76
|
-
---
|
|
77
|
-
name: {feature name}
|
|
78
|
-
slug: ${SLUG}
|
|
79
|
-
created: ${date}
|
|
80
|
-
status: draft | accepted | shipped | abandoned
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
# {Feature name}
|
|
84
|
-
|
|
85
|
-
## Why this exists
|
|
86
|
-
{1-3 sentences: what problem does this solve, for whom, why now}
|
|
87
|
-
|
|
88
|
-
## User stories
|
|
89
|
-
- As a {persona}, I want to {do X} so that {outcome}.
|
|
90
|
-
- ...
|
|
91
|
-
|
|
92
|
-
## Acceptance criteria
|
|
93
|
-
Observable, testable behaviors. Each must be verifiable post-build.
|
|
94
|
-
- [ ] {criterion 1}
|
|
95
|
-
- [ ] {criterion 2}
|
|
96
|
-
|
|
97
|
-
## Out of scope (mandatory)
|
|
98
|
-
What this feature is NOT. Pin this down so scope creep is detectable.
|
|
99
|
-
- {explicit non-goal 1}
|
|
100
|
-
- {explicit non-goal 2}
|
|
101
|
-
|
|
102
|
-
## Modules touched
|
|
103
|
-
List the deep modules / files / packages this PRD will modify or create.
|
|
104
|
-
Use CONTEXT.md domain language. Surface interface changes explicitly.
|
|
105
|
-
|
|
106
|
-
| Module | Interface change | Rationale |
|
|
107
|
-
|---|---|---|
|
|
108
|
-
| {module} | {new method / removed export / signature change} | {why} |
|
|
109
|
-
|
|
110
|
-
## Testing decisions
|
|
111
|
-
Which behaviors get tests, what kind (unit / integration / e2e), where the
|
|
112
|
-
seams are. /qualia-test --tdd will read this.
|
|
113
|
-
|
|
114
|
-
## Open questions
|
|
115
|
-
Things the conversation flagged but didn't resolve. /qualia-discuss can
|
|
116
|
-
walk these down before /qualia-plan.
|
|
117
|
-
|
|
118
|
-
## References
|
|
119
|
-
- Conversation timestamp: {ISO}
|
|
120
|
-
- Related ADRs: docs/adr/...
|
|
121
|
-
- Related PRDs: .planning/PRD-...
|
|
122
|
-
\`\`\`
|
|
123
|
-
|
|
124
|
-
# Discipline
|
|
125
|
-
- NO interview. Synthesize what was DISCUSSED. If a section has nothing in
|
|
126
|
-
the conversation, leave a TODO marker — do NOT invent.
|
|
127
|
-
- Use CONTEXT.md domain terms. If the user said "lesson" but CONTEXT.md says
|
|
128
|
-
"module", normalize to "module" and note the alias.
|
|
129
|
-
- Voice = PRODUCT.md voice. No "Welcome to" / "Get Started" / em-dashes in
|
|
130
|
-
user-facing copy snippets.
|
|
131
|
-
- Output: write the file, then return ONLY \`{ "path": "...", "summary": "1 sentence" }\`.
|
|
132
|
-
`
|
|
133
|
-
)
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### 3. Optional GH issue
|
|
137
|
-
|
|
138
|
-
If `--issue` (or default when `gh` is configured AND `.planning/agents/tracker.md` exists), open a parent issue linking to the PRD path:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
PRD_BODY=$(cat "${PRD_PATH}")
|
|
142
|
-
gh issue create \
|
|
143
|
-
--title "PRD: {feature name}" \
|
|
144
|
-
--body-file "${PRD_PATH}" \
|
|
145
|
-
--label "prd,needs-triage"
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Pass `--no-issue` to skip. The PRD itself is the source of truth — the GH issue is a notification surface.
|
|
149
|
-
|
|
150
|
-
### 4. Commit
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
git add "${PRD_PATH}"
|
|
154
|
-
git -c user.name="Qualia Solutions" -c user.email="info@qualiasolutions.net" \
|
|
155
|
-
commit -m "prd(${SLUG}): {feature name}"
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### 5. End-card + next-command hint
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
node ~/.claude/bin/qualia-ui.js divider
|
|
162
|
-
node ~/.claude/bin/qualia-ui.js ok "PRD: ${PRD_PATH}"
|
|
163
|
-
node ~/.claude/bin/qualia-ui.js ok "Issue: {url or 'skipped'}"
|
|
164
|
-
node ~/.claude/bin/qualia-ui.js end "PRD CAPTURED" "/qualia-issues # break into vertical slices"
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## Token discipline (mandatory)
|
|
168
|
-
|
|
169
|
-
This skill is the v5.3 reply to Matt's instruction-budget thesis. Three rules:
|
|
170
|
-
|
|
171
|
-
1. **Forked subagent, file output.** The synthesis runs in a fork; main session never sees the full PRD body. Only `{path, summary}` flows back.
|
|
172
|
-
2. **No re-summarization.** When the parent session needs the PRD later, it Reads the file (or a later skill does). Never paste the PRD body into chat to "confirm."
|
|
173
|
-
3. **Fork prefix is stable.** Role + PRD skeleton are stable across spawns — Anthropic prompt caching applies. Per-invocation cost is ~5K tokens for the fork + ~2K for the synthesis output.
|
|
174
|
-
|
|
175
|
-
## Failure modes
|
|
176
|
-
|
|
177
|
-
| Symptom | Cause | Action |
|
|
178
|
-
|---|---|---|
|
|
179
|
-
| `.planning/ not found` | Not in a Qualia project | HALT; recommend `/qualia-new` or `/qualia-quick` |
|
|
180
|
-
| Conversation has no clear feature topic | Skill invoked too early | NUDGE — ask the user "what feature are we PRD-ing? Pick a slug or paste a 1-line summary" |
|
|
181
|
-
| `gh` not configured | No GitHub auth | Skip issue creation silently; print PRD path |
|
|
182
|
-
| PRD path collision | Slug already exists | Append `-2`, `-3` to slug; surface to user |
|
|
183
|
-
| Empty conversation context | Fresh session | HALT — "/qualia-prd needs a discussion to synthesize. Discuss first, then run." |
|
|
184
|
-
|
|
185
|
-
## Rules
|
|
186
|
-
|
|
187
|
-
1. **Don't interview.** This is synthesis, not a deep-dive. If gaps exist, mark TODO and recommend `/qualia-discuss`.
|
|
188
|
-
2. **CONTEXT.md is law.** Use the project's terms. Don't invent.
|
|
189
|
-
3. **One PRD per feature.** If two features got conflated in conversation, write two PRDs and link them.
|
|
190
|
-
4. **Voice match.** PRODUCT.md voice. No generic SaaS copy.
|
|
191
|
-
5. **Forked context, file output.** Token discipline above.
|
|
192
|
-
6. **Commit immediately.** PRDs are durable artifacts — they ship in git.
|
|
193
|
-
|
|
194
|
-
## Pairs with
|
|
195
|
-
|
|
196
|
-
- `/qualia-discuss` — run BEFORE if the conversation has open questions
|
|
197
|
-
- `/qualia-issues` — run AFTER to break PRD into vertical-slice GH issues
|
|
198
|
-
- `/qualia-plan` — run AFTER `/qualia-issues` if you want a phase plan
|
|
199
|
-
- `/qualia-new` — runs ONCE at project setup; `/qualia-prd` is the per-feature equivalent
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qualia-quick
|
|
3
|
-
description: "Fast inline path for trivial fixes — ≤1 hour, typically 1 file, no plan, NO subagent spawn. The current Claude does the work directly. For a 1-5 file change that justifies a fresh builder context, use /qualia-task instead. Trigger on 'quick fix', 'small change', 'tweak', 'hot fix', 'one-line fix', 'typo', 'config tweak'."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Grep
|
|
10
|
-
- Glob
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# /qualia-quick — Quick Task
|
|
14
|
-
|
|
15
|
-
For tasks under 1 hour that don't need full phase planning. Single file changes, bug fixes, config tweaks, typo fixes.
|
|
16
|
-
|
|
17
|
-
## Process
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
node ~/.claude/bin/qualia-ui.js banner quick
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
1. **Understand:** Ask what needs to be done (or read the instruction)
|
|
24
|
-
2. **Build:** Do it directly — read before write, MVP only
|
|
25
|
-
3. **Verify:** Run `npx tsc --noEmit`, test locally
|
|
26
|
-
4. **Commit:** Atomic commit with clear message
|
|
27
|
-
5. **Update:** Record the work through `state.js`
|
|
28
|
-
|
|
29
|
-
End with:
|
|
30
|
-
```bash
|
|
31
|
-
node ~/.claude/bin/qualia-ui.js end "QUICK FIX DONE"
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
git add {specific files}
|
|
36
|
-
git commit -m "fix: {description}"
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
No plan file. No subagents. Just build and ship.
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
node ~/.claude/bin/state.js transition --to note --notes "{brief description of what was done}" --tasks-done 1
|
|
43
|
-
```
|
|
44
|
-
Do NOT manually edit STATE.md or tracking.json — state.js handles both.
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: qualia-task
|
|
3
|
-
description: "Single focused task with a FRESH builder subagent spawn — 1-3 hours, 1-5 files, atomic commit, validation contract. Heavier than /qualia-quick (which runs inline with no spawn) but lighter than /qualia-build (which needs a phase plan). Use when the user says 'build this one thing', 'add a component', 'implement this feature', 'qualia-task', or for any 1-5 file feature outside a full phase."
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Agent
|
|
10
|
-
- AskUserQuestion
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# /qualia-task — Single Task Builder
|
|
14
|
-
|
|
15
|
-
Build one thing properly. Fresh builder context, atomic commit, but no phase plan needed.
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
`/qualia-task` — describe what to build interactively
|
|
19
|
-
`/qualia-task {description}` — build it directly
|
|
20
|
-
|
|
21
|
-
## When to Use
|
|
22
|
-
- One feature, 1-5 files, clear scope, 1-3 hours of work
|
|
23
|
-
- Adding a single feature, component, API route, or integration
|
|
24
|
-
- Refactoring one module
|
|
25
|
-
- Building something specific someone asked for
|
|
26
|
-
|
|
27
|
-
## Process
|
|
28
|
-
|
|
29
|
-
### 1. Clarify
|
|
30
|
-
|
|
31
|
-
If no description provided, ask: **"What do you want to build?"**
|
|
32
|
-
|
|
33
|
-
Then use AskUserQuestion:
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
question: "How complex is this task?"
|
|
37
|
-
header: "Scope"
|
|
38
|
-
options:
|
|
39
|
-
- label: "Small (1-2hrs)"
|
|
40
|
-
description: "Single file or component, straightforward implementation"
|
|
41
|
-
- label: "Medium (2-3hrs)"
|
|
42
|
-
description: "Multiple files, some integration work, needs testing"
|
|
43
|
-
- label: "Large (3hrs+)"
|
|
44
|
-
description: "Significant feature, multiple components — use /qualia-plan instead"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
If "Large" — suggest `/qualia-plan` instead. Ask if they want to proceed anyway.
|
|
48
|
-
|
|
49
|
-
### 2. Task Spec
|
|
50
|
-
|
|
51
|
-
Write a quick task spec (don't save to file, just confirm with user):
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
node ~/.claude/bin/qualia-ui.js banner task
|
|
55
|
-
node ~/.claude/bin/qualia-ui.js info "What: {what to build}"
|
|
56
|
-
node ~/.claude/bin/qualia-ui.js info "Files: {files to create/modify}"
|
|
57
|
-
node ~/.claude/bin/qualia-ui.js info "Done: {what done looks like}"
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Ask: **"Good to build?"**
|
|
61
|
-
|
|
62
|
-
### 3. Build
|
|
63
|
-
|
|
64
|
-
Spawn a builder agent with the task:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
Agent(subagent_type: "qualia-builder")
|
|
68
|
-
|
|
69
|
-
Task: {task description}
|
|
70
|
-
Files: {files to create/modify}
|
|
71
|
-
Acceptance Criteria: {observable completion criteria, 1-3 bullet points}
|
|
72
|
-
|
|
73
|
-
Context: Read PROJECT.md if it exists. Follow all rules (security, frontend, deployment).
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
The builder runs in fresh context — reads before writing, follows rules, commits atomically.
|
|
77
|
-
|
|
78
|
-
### 4. Verify
|
|
79
|
-
|
|
80
|
-
After the builder finishes:
|
|
81
|
-
- Run `npx tsc --noEmit` if TypeScript
|
|
82
|
-
- Quick smoke test if applicable
|
|
83
|
-
- Review what was built
|
|
84
|
-
|
|
85
|
-
### 5. Report
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
node ~/.claude/bin/qualia-ui.js divider
|
|
89
|
-
node ~/.claude/bin/qualia-ui.js ok "Task: {description}"
|
|
90
|
-
node ~/.claude/bin/qualia-ui.js ok "Files: {files changed}"
|
|
91
|
-
node ~/.claude/bin/qualia-ui.js ok "Commit: {commit hash}"
|
|
92
|
-
node ~/.claude/bin/qualia-ui.js end "TASK COMPLETE"
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
node ~/.claude/bin/state.js transition --to note --notes "{task description}" --tasks-done 1
|
|
97
|
-
```
|
|
98
|
-
Do NOT manually edit STATE.md or tracking.json — state.js handles both.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|