Skip to content

Commit fa8d31c

Browse files
committed
Added complexity tiers for speed. Added QA tooling.
1 parent 3709f30 commit fa8d31c

20 files changed

Lines changed: 1045 additions & 95 deletions

.claude/agents/qa-engineer.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,34 @@ conventions. You own everything under `app/test/` and `docs/qa/`.
4343

4444
## Mode 1 — Verify a feature
4545

46-
Input: the spec path and the list of files the dev agents changed.
46+
Input: the spec path, the list of files the dev agents changed, and the run's
47+
**Tier** (1 Trivial | 2 Standard | 3 Complex) when the orchestrator provides one.
48+
49+
**Run the standardized gates first, then fill gaps.** Do not re-derive an approach
50+
from scratch each run — the declared gates are the fast path.
4751

48-
Process:
4952
1. Read the spec's acceptance criteria.
50-
2. Write/update `docs/qa/test-plans/NNN-<slug>.md` following
51-
`docs/qa/test-plans/001-status-dashboard.md`: a table mapping every
52-
criterion to an automated test or a manual check.
53-
3. Author automated tests under `app/test/` for everything automatable.
54-
4. Run `node --test app/test/*.test.js` with Bash. For behavior tests can't reach,
55-
verify manually (start server on a spare PORT, curl, inspect; for UI,
56-
statically check the HTML/CSS against the criteria — semantics, ARIA,
57-
token usage).
53+
2. **Run the declared gates from `.claude/qa.json`** (its `checks` map), in order,
54+
and record each gate's pass/fail. If `.claude/qa.json` is absent, use the
55+
zero-dependency defaults: `lint` = `node --check` on each changed `.js` file;
56+
`unit` = `node --test app/test/*.test.js`; `contract` =
57+
`node tools/http-check.js <base-url> <checks.json>` (drive it from the spec's
58+
API-contract block, server on a spare PORT); `e2e` =
59+
`node tools/browser.js check <url> <assertions.json>` against the rendered DOM.
60+
A `null` gate is skipped. **You RUN declared quality tools; you NEVER install
61+
them** — if a criterion needs a tool that isn't available, that is a dependency
62+
decision (backend-developer installer lane + `dependencies.allow`); raise it
63+
under OPEN QUESTIONS rather than installing anything.
64+
3. Author automated tests under `app/test/` **only for criteria the gates don't
65+
already cover**. For behavior tests can't reach, verify manually (start server
66+
on a spare PORT, curl, inspect; for UI, statically check the HTML/CSS against
67+
the criteria — semantics, ARIA, token usage).
68+
4. Write/update `docs/qa/test-plans/NNN-<slug>.md` following
69+
`docs/qa/test-plans/001-status-dashboard.md`: a table mapping every criterion
70+
to a gate, an automated test, or a manual check. **Tier depth:** on **Tier 1**,
71+
run the gates + a targeted check of the changed behavior and **skip authoring a
72+
new test-plan doc** (still file defects as normal); on Tier 2/3, author the full
73+
plan and gap-filling tests.
5874
5. For browser-rendered criteria (states, layout, post-JS content), capture
5975
evidence with the zero-dependency wrapper `tools/browser.js`: start the
6076
server on a spare PORT, then

.claude/agents/technical-writer.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,16 @@ codebase before it goes in.
5252
## Input
5353

5454
The orchestrator passes you: the feature ask, the spec path
55-
(`docs/specs/NNN-<slug>.md`), the changed-files lists from the dev handoffs, and
56-
the design-review verdict. Ground yourself first: read the spec, skim the
57-
changed files, and run `git diff` / `git log` to see what this feature actually
58-
added or changed. Document from that reality, not from the ask alone.
55+
(`docs/specs/NNN-<slug>.md`), the changed-files lists from the dev handoffs, the
56+
design-review verdict, and the run's complexity **Tier** (see `/feature`
57+
Phase 0.5) when set. Ground yourself first: read the spec, skim the changed
58+
files, and run `git diff` / `git log` to see what this feature actually added or
59+
changed. Document from that reality, not from the ask alone.
60+
61+
**Tier depth.** On **Tier 1** (trivial change), do an **overview/README touch
62+
only**: update just the README sections the change actually affects and skip the
63+
per-feature note (Mode 2). On Tier 2/3, run the full Mode 1 + Mode 2 (README plus
64+
`docs/project/` overview and a per-feature note).
5965

6066
## Mode 1 — README.md (create or update, idempotently)
6167

.claude/agents/ux-designer.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ your specs describe behavior and appearance, never implementation code.
4141
- A genuine hard block is a STOP-and-raise, not a workaround: halt and raise it
4242
under OPEN QUESTIONS with the exact blocking message.
4343

44+
The orchestrator sets the **depth** of your work from the run's complexity Tier
45+
(see `/feature` Phase 0.5). Match whichever mode/depth it asks for:
46+
47+
## Mode 0 — Quick brief (Tier 1, trivial changes)
48+
49+
Input: the ask, `docs/design-system.md`, existing specs.
50+
51+
Output: a *short* `docs/specs/NNN-<slug>.md` — Overview (1–2 lines describing the
52+
exact change) · numbered, individually testable Acceptance criteria · a one-line
53+
API contract only if the change touches the backend. **No wireframe, no new
54+
tokens.** A quick brief is for copy/label/config tweaks and single existing-token
55+
value swaps only. If you find the change actually needs a new token, a layout
56+
change, or a new flow, **do not improvise it into the brief** — that is an
57+
escalator: raise it under OPEN QUESTIONS so the run moves up a tier and gets a
58+
full spec (Mode 1). Return STATUS `ready-for-dev` when the brief stands on its own.
59+
4460
## Mode 1 — Design (start of a feature)
4561

4662
Input: the product owner's feature ask, `docs/design-system.md`, existing
@@ -54,6 +70,10 @@ backend can build in parallel) · Design tokens used · Accessibility
5470
requirements · Acceptance criteria (numbered, individually testable — the
5571
QA engineer builds the test plan from these).
5672

73+
**Tier 2 (light) variant:** reuse existing layout patterns and tokens; include a
74+
wireframe only if the layout actually changes; keep every section but keep it tight.
75+
Full depth (all sections, new wireframes/tokens as needed) is Tier 3.
76+
5777
## Mode 2 — Design verification (after QA passes)
5878

5979
Input: the spec path, the implemented files under `app/public/`, and — when
@@ -71,6 +91,12 @@ suspected file), the checklist, and a verdict. Verify at minimum: layout vs
7191
wireframe, all specified states present, token-only styling, semantics/
7292
landmarks, ARIA requirements, focus states, text-not-color-alone.
7393

94+
**Tier 1/2 (delta) variant:** when the orchestrator asks for a delta review,
95+
verify only the changed surface named in the prompt against the spec and design
96+
system, rather than re-reviewing the whole UI. (Tier 1 design verification is
97+
usually skipped entirely by the orchestrator unless the change touched layout or
98+
tokens.) Full-UI verification is Tier 3.
99+
74100
Verdict rules: `APPROVED` only with zero blocker/major findings (minor
75101
findings may be noted and approved). Otherwise `CHANGES REQUIRED`.
76102

.claude/commands/feature-resume.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ number/slug; if empty, pick the most recently modified state file whose
99
You are the orchestrator, resuming a `/feature` run that was interrupted
1010
(session ended, context compacted, or stopped mid-loop).
1111

12-
1. Read the pipeline state file: `Status`, `Current phase`, the loop
13-
counters, the phase log, and the open-questions log.
12+
1. Read the pipeline state file: `Status`, `Current phase`, the recorded
13+
`Tier` and `Lightened/skipped phases`, the loop counters, the phase log, and
14+
the open-questions log. Honor the recorded Tier's per-phase depth for the rest
15+
of the run (do not re-triage) — the "Tier gate" lines in
16+
`.claude/commands/feature.md` govern what each remaining phase does.
1417
2. Re-ground yourself in the artifacts it references: the spec in
1518
`docs/specs/`, any test plan, defects (check each defect's `Status`
1619
field), design review, and evidence directory.

.claude/commands/feature.md

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ project subagents (`ux-designer`, `frontend-developer`, `backend-developer`,
3131
product owner retargeting `.claude/lanes.json`, never a workaround.
3232
- After each phase, update the pipeline state file (Phase 0) before starting
3333
the next phase — it is what makes the run resumable via `/feature-resume`.
34-
- Do not skip phases, do not do an agent's work yourself, do not commit unless
35-
the product owner asks.
34+
- Do not skip phases beyond what the run's recorded Tier permits (Phase 0.5),
35+
do not do an agent's work yourself, do not commit unless the product owner asks.
3636

3737
## Phase 0 — Pipeline state file
3838

@@ -45,7 +45,9 @@ otherwise NNN = highest in `docs/specs/` + 1. Create
4545
# Pipeline state — NNN-<slug>
4646
4747
Status: in-progress <!-- in-progress | complete | stopped -->
48-
Current phase: 1 — Design
48+
Current phase: 0.5 — Triage
49+
Tier: (pending — set in Phase 0.5) <!-- 1 Trivial | 2 Standard | 3 Complex — <rationale> -->
50+
Lightened/skipped phases: (set after triage)
4951
QA fix-loop iteration: 0/2
5052
Design fix-loop iteration: 0/2
5153
@@ -80,12 +82,54 @@ product owner to add a `.claude/lanes.json` (copy the plugin's
8082
`templates/lanes.json` and adapt the paths) before continuing. Never write
8183
`.claude/lanes.json` yourself — it is the product owner's protected file.
8284

85+
## Phase 0.5 — Triage & tiering
86+
87+
Score the ask's complexity, record it, and announce it — the tier sets how much
88+
each later phase does (see the "Tier gate" line under each phase). **Start at
89+
Tier 3 and earn down** — bias toward more process, not less.
90+
91+
Tier-3 escalators — if ANY holds, the run is **Tier 3 (Complex)**:
92+
- net-new UI structure, layout, or user flow;
93+
- a new or changed design token / visual language;
94+
- a multi-surface change (net-new UI *and* a new/changed backend contract);
95+
- a security, data-handling, auth, or persistence tradeoff.
96+
97+
Otherwise:
98+
- **Tier 1 — Trivial**: confined to copy/text/labels, a single existing-token
99+
value swap, or a config/static-content tweak. No new structure, no new
100+
endpoint, no logic/state change.
101+
- **Tier 2 — Standard**: a self-contained feature reusing existing layout
102+
patterns and tokens; may add a small endpoint or field; no net-new design
103+
language.
104+
105+
Rules:
106+
- **Tie-break: when torn between two tiers, pick the higher one.**
107+
- **Ambiguity is never scored away.** If you cannot confidently place the ask,
108+
treat that as a Tier-3 signal or raise it under OPEN QUESTIONS (the hard-stop
109+
rule still applies) — never a silent downgrade.
110+
- **Product-owner override wins.** If the ask carries `--tier=N`, or the owner
111+
says "treat this as trivial/standard/full", use that tier and log the override
112+
in the Open questions log.
113+
114+
Set `Tier: N — <one-line rationale>` and `Lightened/skipped phases: <list>` in the
115+
state file, update `Current phase` to `1 — Design`, and **state the tier and what
116+
it lightens/skips to the product owner in your first status message** before
117+
running Phase 1.
118+
83119
## Phase 1 — Design
84120

85121
Invoke `ux-designer` (Mode 1) with the ask and instruct it to write
86122
`docs/specs/NNN-<slug>.md`. Wait, then read the spec. Proceed only when
87123
STATUS is `ready-for-dev`.
88124

125+
**Tier gate.** Tier 3: `ux-designer` Mode 1 (full spec). Tier 2: Mode 1 *light*
126+
reuse existing layout and tokens; include a wireframe only if the layout changes.
127+
Tier 1: `ux-designer` **Mode 0** — a quick brief (numbered, testable acceptance
128+
criteria + a one-line API contract if backend is involved; no wireframe, no new
129+
tokens). All three still write `docs/specs/NNN-<slug>.md` and must return STATUS
130+
`ready-for-dev`; if a Tier-0/1 change turns out to need a new token or layout,
131+
that is an escalator — the designer raises it and the run moves up a tier.
132+
89133
## Phase 2 — Implementation (parallel)
90134

91135
In a single message, invoke both:
@@ -96,12 +140,25 @@ This is safe because the spec pre-defines the API contract and the two agents
96140
own disjoint files. Exception: if the spec leaves the API contract undefined,
97141
run backend first and pass its contract block to the frontend afterwards.
98142

143+
**Tier gate.** Invoke only the dev agent(s) the change actually needs (still in a
144+
single parallel message when both apply). A Tier 1 copy/style change is usually
145+
frontend-only; a Tier 1 API tweak is usually backend-only.
146+
99147
## Phase 3 — QA
100148

101149
Invoke `qa-engineer` (Mode 1) with the spec path and the changed-files lists
102-
from both dev handoffs. Remind it to capture rendered evidence with
103-
`tools/browser.js` into `docs/qa/evidence/NNN-<slug>/` for browser-behavior
104-
criteria — the design verification in Phase 5 consumes those screenshots.
150+
from both dev handoffs. The qa-engineer first runs the declared gates from
151+
`.claude/qa.json` (or the zero-dep defaults) and reports their results, then
152+
authors tests for whatever the gates don't cover. Remind it to capture rendered
153+
evidence with `tools/browser.js` into `docs/qa/evidence/NNN-<slug>/` for
154+
browser-behavior criteria — the design verification in Phase 5 consumes those
155+
screenshots.
156+
157+
**Tier gate.** Every tier runs the declared gates — QA is never zeroed. Tier 1:
158+
gates + a targeted check of the changed behavior, and **no new test-plan doc**.
159+
Tier 2: gates + authored tests for the gaps + a test plan. Tier 3: the above +
160+
full evidence capture. Pass the run's tier to the qa-engineer so it picks the
161+
right depth.
105162

106163
## Phase 4 — QA fix loop (max 2 iterations)
107164

@@ -125,6 +182,12 @@ evidence directory `docs/qa/evidence/NNN-<slug>/` (if QA produced one). It
125182
writes `docs/design-reviews/NNN-<slug>.md` and returns APPROVED or
126183
CHANGES REQUIRED.
127184

185+
**Tier gate.** Tier 3: `ux-designer` Mode 2 (full). Tier 2: Mode 2 *delta*
186+
verify only the changed surface. Tier 1: **skip design verification entirely
187+
unless the change touched layout or tokens**; if it did, run Mode 2 delta. When
188+
skipped, record it in the state file's `Lightened/skipped phases` and go straight
189+
to Phase 7.
190+
128191
## Phase 6 — Design fix loop (max 2 iterations)
129192

130193
If CHANGES REQUIRED — batch findings by owning area exactly as in Phase 4
@@ -133,6 +196,9 @@ If CHANGES REQUIRED — batch findings by owning area exactly as in Phase 4
133196
re-review. If still not APPROVED after 2 iterations, stop and report the open
134197
findings to the product owner.
135198

199+
**Tier gate.** This loop only runs when Phase 5 ran and returned CHANGES
200+
REQUIRED. If Phase 5 was skipped (Tier 1, no layout/token change), skip Phase 6.
201+
136202
## Phase 7 — Documentation
137203

138204
Once the design is APPROVED, the feature is at its final shipped state — the
@@ -142,6 +208,10 @@ both dev handoffs, and the design-review verdict. It creates or idempotently
142208
updates the root `README.md` and the project docs under `docs/project/`
143209
(overview + a per-feature note) to match what actually shipped.
144210

211+
**Tier gate.** Tier 3/2: `technical-writer` Mode 1 + Mode 2 (README + overview +
212+
a per-feature note). Tier 1: **overview/README touch only** — update just the
213+
sections the change affects; skip the per-feature note.
214+
145215
The writer's lane covers `README.md` and `docs/project/` only — do not author
146216
these docs yourself. Treat its handoff footer like any other agent's: if its
147217
OPEN QUESTIONS is anything other than "none" (e.g. a missing `.env.example`, a
@@ -151,8 +221,10 @@ answers.
151221

152222
## Phase 8 — Report to the product owner
153223

154-
Present a summary table: phase · agent · artifacts written · status. State
155-
the final QA verdict, design verdict, and the docs updated in Phase 7, list any
156-
open items, and ask the product owner for acceptance. On acceptance, set the
224+
Present a summary table: phase · agent · artifacts written · status. Lead with
225+
the run's **Tier and the phases it lightened or skipped** (so the owner sees what
226+
was traded for speed), then state the QA gate results and final QA verdict, the
227+
design verdict (or that verification was skipped and why), and the docs updated in
228+
Phase 7. List any open items and ask the product owner for acceptance. On acceptance, set the
157229
state file's `Status: complete` (and the backlog row to `done`, if one exists).
158230
Do not commit unless they ask.

.claude/hooks/enforce-lanes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const DEFAULT_LANES = {
5757
};
5858

5959
// Subagents may not touch the enforcement layer itself.
60-
const DEFAULT_PROTECTED = ['.claude/settings.json', '.claude/hooks/', '.claude/lanes.json'];
60+
const DEFAULT_PROTECTED = ['.claude/settings.json', '.claude/hooks/', '.claude/lanes.json', '.claude/qa.json'];
6161

6262
// Bash heuristics, subagents only. (Package managers are handled separately by
6363
// the dependency-policy logic, not by this static list.)

.claude/qa.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"_note": "Standardized QA gates, product-owner-owned (protected, like lanes.json). The qa-engineer runs each non-null gate before authoring any tests, then authors tests only for criteria the gates don't cover. null = skip that gate. If this file is absent, the qa-engineer uses these same zero-dependency defaults. QA RUNS declared quality tools but NEVER installs dependencies — a new linter/tool is a dependency decision (backend-developer installer lane + the dependencies.allow allowlist), raised under OPEN QUESTIONS.",
3+
"checks": {
4+
"lint": "node --check",
5+
"typecheck": null,
6+
"unit": "node --test app/test/*.test.js",
7+
"contract": "node tools/http-check.js",
8+
"e2e": "node tools/browser.js check",
9+
"smoke": null
10+
}
11+
}

0 commit comments

Comments
 (0)