@ericrisco/rsc 3.7.5 → 4.0.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 (55) hide show
  1. package/README.md +16 -9
  2. package/manifest.json +46 -39
  3. package/package.json +1 -1
  4. package/scripts/lib/domains.js +1 -1
  5. package/scripts/lib/onboarding-apply.js +1 -1
  6. package/scripts/lib/onboarding.js +7 -7
  7. package/scripts/lib/retired-skills.js +4 -0
  8. package/scripts/lib/review-findings.js +3 -0
  9. package/scripts/lib/review-ledger.js +185 -0
  10. package/scripts/lib/risk.js +65 -0
  11. package/scripts/lib/spec-gate.js +10 -1
  12. package/scripts/rsc.js +91 -6
  13. package/skills/analyze/SKILL.md +3 -3
  14. package/skills/asdd/SKILL.md +159 -0
  15. package/skills/{sdd → asdd}/evals/README.md +10 -10
  16. package/skills/{sdd → asdd}/evals/cases.yaml +4 -4
  17. package/skills/{sdd → asdd}/references/model-routing.md +2 -2
  18. package/skills/building-agents/SKILL.md +1 -1
  19. package/skills/clarify/SKILL.md +48 -55
  20. package/skills/clarify/evals/cases.yaml +6 -7
  21. package/skills/constitution/SKILL.md +21 -8
  22. package/skills/constitution/evals/README.md +1 -1
  23. package/skills/debug/SKILL.md +1 -1
  24. package/skills/fastapi/SKILL.md +1 -1
  25. package/skills/flutter/SKILL.md +1 -1
  26. package/skills/ftd/SKILL.md +26 -10
  27. package/skills/ftd/evals/cases.yaml +1 -1
  28. package/skills/ftd/evals/routing.json +4 -4
  29. package/skills/go/SKILL.md +1 -1
  30. package/skills/implement/SKILL.md +126 -113
  31. package/skills/implement/evals/cases.yaml +4 -2
  32. package/skills/implement/references/per-task-review.md +19 -26
  33. package/skills/nextjs/SKILL.md +1 -1
  34. package/skills/parallel/SKILL.md +1 -1
  35. package/skills/plan/SKILL.md +2 -2
  36. package/skills/postgresdb/SKILL.md +1 -1
  37. package/skills/react/SKILL.md +1 -1
  38. package/skills/review/SKILL.md +58 -31
  39. package/skills/sdd-init/SKILL.md +6 -6
  40. package/skills/ship/SKILL.md +38 -18
  41. package/skills/specify/SKILL.md +32 -33
  42. package/skills/specify/evals/cases.yaml +1 -1
  43. package/skills/specify/references/spec-template.md +27 -5
  44. package/skills/suggest/SKILL.md +4 -4
  45. package/skills/tasks/SKILL.md +37 -33
  46. package/skills/tasks/evals/README.md +1 -1
  47. package/skills/tasks/evals/cases.yaml +2 -2
  48. package/skills/verify/SKILL.md +30 -15
  49. package/skills/verify/evals/README.md +2 -2
  50. package/skills/verify/evals/cases.yaml +1 -0
  51. package/skills/worktrees/SKILL.md +1 -1
  52. package/targets/clone-bootstrap.mjs +1 -1
  53. package/targets/hook-once.mjs +2 -2
  54. package/targets/sello.mjs +1 -1
  55. package/skills/sdd/SKILL.md +0 -250
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: implement
3
- description: "Use when an approved plan and task list exist and it is time to turn them into working, tested code — the SDD phase after `analyze` and before `verify`. Enforces TDD: a failing test comes before the code that makes it pass, one task at a time, appended to a progress ledger that survives compaction. Delegates test tooling to the stack skill and fans disjoint tasks out via `parallel`. NOT spec writing (that is `specify`), NOT planning (that is `plan`), NOT the final lint/test/audit gate (that is `verify`)."
4
- tags: [sdd, implement, code]
5
- recommends: [verify]
3
+ description: "Use when an approved plan and task list exist and it is time to turn them into working, reviewed code — ASDD stage 4, the per-task loop after `analyze`: TDD build and self-check, `rsc risk` on the diff, review scaled by tier (0/1/3 reviewers), mandatory controls (tests, build, security, traceability), at most 3 fix rounds, then fix-and-record or park in the decision queue. Progress ledger survives compaction; disjoint tasks fan out via `parallel`. NOT spec writing (that is `specify`), NOT planning (that is `plan`), NOT the closing whole-branch gate (stage 5: `verify` + `review`)."
4
+ tags: [asdd, sdd, implement, code]
5
+ recommends: [verify, review]
6
6
  profiles: [core, full]
7
7
  origin: risco
8
8
  ---
@@ -10,10 +10,11 @@ origin: risco
10
10
  # implement — turn the task list into tested code
11
11
 
12
12
  You have a spec, a plan, and an ordered task list (from `specify` → `plan` → `tasks`), and the
13
- `analyze` gate has cleared. This skill does the building: it walks the tasks in order, writes each
14
- one **test-first**, stops to show its work after every task, and records the decisions it makes
15
- along the way. It is the *intent → shipped code* engine's hands — `verify` is the gate that comes
16
- after, not part of this skill.
13
+ `analyze` gate has cleared. This skill is **ASDD stage 4**: it walks the tasks in order and runs each
14
+ one through a build → risk → review → controls → fix → decide loop before the next starts. Review
15
+ lives *inside* the task, not after the branch: tests prove the code works, not that it is what was
16
+ asked, and an unrequested feature caught at one commit is cheap — caught under thousands of green
17
+ tests at the end, it is not.
17
18
 
18
19
  This is a **process skill**. It owns the discipline (red → green → refactor, checkpoints, decision
19
20
  logging, constitution adherence). It does **not** own the test tooling — pytest fixtures, `go test`
@@ -51,9 +52,11 @@ back — you do not write feature code anyway.
51
52
  6. **Scan the tasks for independence.** Mark which tasks share files/state and which are disjoint.
52
53
  Disjoint clusters are candidates for `parallel`; everything else runs in order.
53
54
 
54
- ## The loop — one task at a time
55
+ ## The loop — seven steps per task
55
56
 
56
- For **each task** in the list, in order (or dispatched per the parallel rule below):
57
+ For **each task** in the list, in order (or dispatched per the parallel rule below), run a → g.
58
+
59
+ ### a) Build and self-check (TDD)
57
60
 
58
61
  ```text
59
62
  RED → write the smallest failing test that encodes the task's done-check. Run it. Watch it FAIL
@@ -63,24 +66,15 @@ GREEN → write the least code that makes that test pass. No extra features,
63
66
  TRIANGULATE → add the smallest edge-case test that proves the behavior is not hard-coded
64
67
  (only when config.testing.strict_tdd is true and the task has meaningful edge cases).
65
68
  REFACTOR → with the test green, clean up names/duplication/shape. Re-run; still green. Only now.
66
- CHECK → re-read the task's done-check. Met? Constitution still honored? Decision worth logging?
67
- PROGRESS → append task/test/blocker/decision state to 02-DOCS/wiki/sdd/progress/<slug>.md.
68
69
  COMMIT → commit this task as one logical unit (authorship = Eric; see ship for the rule).
69
- REVIEW → dispatch a fresh reviewer subagent over THIS task's commits (see "Per-task review gate").
70
- Fold its Critical/Important findings back in before you move on; Minor can wait.
71
- CHECKPOINT → stop and show: what changed, test output, review verdict, the next task. Wait for the user.
72
70
  ```
73
71
 
74
72
  The order is load-bearing. **Red before green** is not a suggestion — a test you write *after* the
75
73
  code tells you nothing about whether it can fail. **Refactor only on green** keeps every cleanup
76
- reversible against a passing bar. **Checkpoint after each task** is what makes this resumable and
77
- reviewable instead of a 2000-line surprise diff.
74
+ reversible against a passing bar. Self-check means evidence: the test output you saw, not "I tested it".
78
75
 
79
76
  ### Four things you may never do to reach green
80
77
 
81
- The loop only means anything if green cannot be manufactured. These are absolute, and each one is a
82
- way people reach green without fixing anything:
83
-
84
78
  1. **Never weaken a test to make it pass.** Not broadening an assertion, not adding a skip, not
85
79
  raising a tolerance, not deleting it. A test that looks wrong is a **spec conversation** — surface
86
80
  it, don't bury it.
@@ -94,12 +88,82 @@ way people reach green without fixing anything:
94
88
  added to touch lines, with no meaningful assertion, is gaming — and mutation testing exists
95
89
  precisely to catch it (`../testing-py/SKILL.md`, `../testing-web/SKILL.md`, `../testing-go/SKILL.md`).
96
90
 
97
- ### The done-check is the contract
91
+ **The done-check is the contract.** The task's done-check **is** your first failing test. Never
92
+ invent a looser one; done means that test is green and the traced acceptance criterion holds.
93
+
94
+ ### b) Risk — computed, never chosen
95
+
96
+ ```bash
97
+ npx @ericrisco/rsc risk --base <task base sha> --json
98
+ ```
99
+
100
+ It reads the task's **actual** diff through the sello's path table (sello on or off) and prints the
101
+ tier, the touched classes, `reviewers: 0|1|3` and `human approval: required|not required`. Tier 2 =
102
+ auth, billing, CI workflows, migrations, secrets, harness config. The computed tier wins over the
103
+ task's risk forecast. **The agent never picks or argues down its own tier.**
104
+
105
+ ### c) Review scaled by tier — fresh context
106
+
107
+ | Tier | Review |
108
+ | --- | --- |
109
+ | 0 | none — the controls (e) still run |
110
+ | 1 | one fresh-context reviewer; frozen brief in `references/per-task-review.md` |
111
+ | 2 | the three refuters (`refuter-correctness` · `refuter-security` · `refuter-tests`) in parallel, as `../review/SKILL.md` runs them |
112
+
113
+ Every reviewer gets the **spec**, the **diff as a file** (`scripts/review-package <BASE> <HEAD>`, BASE
114
+ = the task's *recorded* base sha, never `HEAD~1`), the **surrounding code** at that sha (not just the
115
+ hunk), the task's done-check, its **Interfaces → Produces** and the plan's **§0 Global Constraints**.
116
+ Never your session reasoning. **Anti-pre-judging (hard rule):** the dispatch never says what not to
117
+ flag, pre-rates a severity, or explains why a choice is fine — a stated rationale never downgrades a
118
+ finding.
119
+
120
+ ### d) Consolidate, verify, record
121
+
122
+ Exactly as `../review/SKILL.md` → *Consolidate, then verify*: `npx @ericrisco/rsc review consolidate
123
+ <reports…>`, then `finding-verifier` on every finding it marks `verify` (tier 1: on every blocker).
124
+ Then `npx @ericrisco/rsc review ledger record <findings.json>`. A finding the ledger already holds
125
+ comes back `repeat`: **never raise it again**. When a finding closes, record its outcome:
126
+ `review ledger outcome <id> fixed|false|intentional|irrelevant`.
127
+
128
+ ### e) Mandatory controls — every tier
129
+
130
+ These are `verify`'s per-task mode (`../verify/SKILL.md`):
131
+
132
+ - **Tests** — the affected suite, not just the new test (`testing.commands.apply`).
133
+ - **Build** — the project compiles and type-checks.
134
+ - **Security** — the stack's audit; `../secure-coding/SKILL.md` when input, authz or secrets are touched.
135
+ - **Traceability** — every new behaviour in the diff traces to a spec acceptance criterion.
136
+ **Untraced behaviour is a finding.** This is the control that catches the unrequested feature: a
137
+ QR nobody asked for passes every test.
138
+
139
+ A control that did not run is reported as **not run**, never as passed — and the task is not done.
140
+
141
+ ### f) Fix loop — at most 3 rounds
98
142
 
99
- Each task carries a done-check from the `tasks` phase ("returns 409 on duplicate email", "list
100
- renders empty state when zero items"). That sentence **is** your first failing test. Do not invent a
101
- looser check, and do not mark a task done because the code "looks right" — done means the done-check's
102
- test is green and the relevant acceptance criterion in the spec is satisfied.
143
+ Each round opens with `npx @ericrisco/rsc review ledger round <slug>/<task>`. It exits non-zero on the 4th
144
+ round with the action to take; obey it (step g).
145
+
146
+ - **From round 2, re-review only the new diff** (BASE = the previous round's head).
147
+ - **Fix the bug class, not the line**: name the class and fix every instance in the task's scope.
148
+ - **Never repeat a finding** — the ledger marks repeats; drop them.
149
+ - Re-run the controls (e) before the next round.
150
+
151
+ ### g) Decide
152
+
153
+ | Situation | Action |
154
+ | --- | --- |
155
+ | Trivial, or no business weight | Fix it and record it in `decisions.md` with the task id |
156
+ | Tier 2, contradicts a decision in `decisions.md`, or no convergence in 3 rounds | Park the task in the **decision queue** and continue with independent tasks |
157
+
158
+ The **decision queue** is a `## Decision queue` section in `02-DOCS/wiki/sdd/progress/<slug>.md`, one
159
+ entry per parked task: task id, tier, the question, the options, your recommendation, the evidence
160
+ path. Tasks that depend on a parked task wait; the rest continue. Only a human empties the queue — an
161
+ agent's approval never counts as human.
162
+
163
+ Then append the progress entry and show the checkpoint (below).
164
+
165
+ **`verify` and `review` run twice.** Per task, inside this loop (steps c–e); and once more at
166
+ **closing** (stage 5), over the whole branch against main.
103
167
 
104
168
  ## Delegating the test tooling (do not reinvent it)
105
169
 
@@ -118,27 +182,10 @@ stack and pulls that stack's testing reference — you do not mix idioms inside
118
182
 
119
183
  ## Skill digestion and resolution
120
184
 
121
- When a task or subagent needs skill context, use the registry path from config:
122
-
123
- ```text
124
- .rsc/skill-registry.json
125
- ```
126
-
127
- Select the smallest set of skills that match the task. Digest each selected skill into 4-5 compact rules that affect this task. A task brief or checkpoint includes:
128
-
129
- ```text
130
- Selected skills: fastapi, postgresdb, implement
131
- Compact rules:
132
- - Use the configured apply command from config.yaml.
133
- - Red test first; verify it fails for the right reason.
134
- - Keep DB migrations expand-contract when touching production tables.
135
- Skill resolution:
136
- - used: [...]
137
- - missing: [...]
138
- - fallback: [...]
139
- ```
140
-
141
- If a skill is referenced but unavailable, say so and record the fallback. Do not silently pretend it was used.
185
+ Select the smallest set of skills from `.rsc/skill-registry.json` that match the task and digest
186
+ each into 4-5 compact rules. Every task brief or checkpoint carries `Selected skills`, `Compact
187
+ rules` and `Skill resolution` (`used` / `missing` / `fallback`). A referenced skill that is
188
+ unavailable is named with its fallback — never silently pretended.
142
189
 
143
190
  ## Apply progress
144
191
 
@@ -157,8 +204,10 @@ Entry shape:
157
204
  - green: same test passed
158
205
  - triangulation: blank title returns 422
159
206
  - files: app/auth.py, tests/auth/test_login.py
160
- - decision: none
161
- - blocker: none
207
+ - risk: tier 2 (auth) — 3 refuters
208
+ - review: 5 reported → 2 unique → 1 confirmed (fixed, round 2)
209
+ - controls: tests ✅ build ✅ security ✅ traceability ✅ (AC3)
210
+ - decision: parked in decision queue (tier 2)
162
211
  ```
163
212
 
164
213
  This file is what makes resumes and archive reliable. Never rewrite old entries; append corrections as new entries.
@@ -194,7 +243,7 @@ discipline inside each branch.
194
243
  pinned to the balanced tier (Sonnet by default, chosen at onboarding, never `light`). When you
195
244
  delegate a task or fan out via `parallel`, dispatch it to that agent (e.g. Claude Code
196
245
  `subagent_type: developer`) so the bulk of TDD execution runs on the cheaper-but-capable model
197
- while you stay on the session model to orchestrate. Full rationale: `../sdd/references/model-routing.md`.
246
+ while you stay on the session model to orchestrate. Full rationale: `../asdd/references/model-routing.md`.
198
247
 
199
248
  ### The dispatch contract (carriers, statuses, escalation)
200
249
 
@@ -220,51 +269,19 @@ each dispatch self-sufficient and make its return machine-checkable:
220
269
  escalate the tier (balanced → heavy) for a genuinely hard sub-problem. Re-running an identical
221
270
  prompt on an identical model is how a loop burns budget without progress.
222
271
 
223
- ## Per-task review gate
224
-
225
- After a task is committed and before its checkpoint, run a **small, fresh-eyes review of that task
226
- alone** — catching over-/under-building while it is one commit cheap to fix, instead of waiting for
227
- the whole-branch review when it is buried in a large diff. It is a mid-build gate, not the finish
228
- line (see the boundary below).
229
-
230
- How to run it:
231
-
232
- 1. **Package the diff as a file, not a paste.** `scripts/review-package <BASE> <HEAD>` where `BASE`
233
- is the task's *recorded* base sha (never `HEAD~1` — that drops every commit but the last of a
234
- multi-commit task). It writes the commit list + `--stat` + full diff to one file.
235
- 2. **Dispatch a fresh reviewer subagent** (context-isolated — it must NOT inherit your session
236
- reasoning). Hand it: the review-package *path*, the task's **done-check**, the task's
237
- **Interfaces → Produces** contract, and the plan's **§0 Global Constraints**. With routing on,
238
- balanced is the floor; escalate to heavy for a risky/security-touching task. The frozen brief
239
- lives in `references/per-task-review.md`.
240
- 3. **It returns two verdicts in one pass:** *spec compliance* (missing / extra / misunderstood vs the
241
- done-check + Produces) and *code quality* — every finding tagged severity
242
- (`Critical`/`Important`/`Minor`) with `file:line` evidence.
243
- 4. **Fold `Critical`/`Important` back in now**; `Minor` may wait for the end-of-branch review.
244
-
245
- **Anti-pre-judging (hard rule).** The dispatch must never tell the reviewer what *not* to flag,
246
- pre-rate a finding's severity, or explain why a choice is fine ("the plan chose X, treat as Minor").
247
- A stated rationale never downgrades a finding — that is laundering your own bias through the reviewer.
248
- Hand it the evidence and the contract; let it judge.
249
-
250
- **Boundary — this does not replace the end gates.** `verify` still runs the *whole* suite and the
251
- acceptance criteria once at the end, and `review` still reads the *whole* diff adversarially once
252
- before `ship`. The per-task gate is the cheap early pass; the broad reviews remain. Skip the per-task
253
- gate on a genuinely trivial task (a one-line change), like the rest of the chain.
254
-
255
272
  ## Model tier — `balanced` (opt-in routing)
256
273
 
257
- This phase's default model tier is **`balanced`** — it is the bulk of TDD execution: cost-sensitive, with quality balanced handles well. Routing is **off** unless `models.enabled: true` in `02-DOCS/wiki/sdd/config.yaml`. When on: resolve this phase's tier (`models.overrides` wins over `models.phases`), map it to a model via `models.tiers`, and apply per `../sdd/references/model-routing.md` — announce the switch in one line when it differs from the session model, and dispatch any `Task`/`parallel` subagents on that model (this is where routing pays off most — fan-out runs on `balanced` while a hard sub-problem can be escalated to `heavy`). Routing off or no profile → honor the session model silently. Never fake a switch a tool can't make; skip routing on a one-line change.
274
+ Default tier **`balanced`** — the bulk of TDD execution. Routing is **off** unless `models.enabled:
275
+ true` in `02-DOCS/wiki/sdd/config.yaml`; when on, resolve and apply it per
276
+ `../asdd/references/model-routing.md` (fan-out on `balanced`, a hard sub-problem escalated to
277
+ `heavy`). Routing off → honor the session model silently.
258
278
 
259
279
  ## Checkpoints — what to say
260
280
 
261
- Speak in the `orient` voice, in the register `technical_level` sets. At each checkpoint show: the
262
- task, tests green or red, the one *why* behind any non-obvious choice, and the next task. Ask only
263
- where the plan genuinely forked, and confirm before deviating from the plan or doing anything
264
- irreversible.
265
-
266
- How short you are **never** changes the engineering. TDD, the done-checks, the constitution and
267
- decision logging hold for every reader.
281
+ In the `orient` voice and the `technical_level` register, show: the task, tier, review verdict
282
+ (reported → unique → confirmed), controls (passed / **not run**), rounds, the *why* of any
283
+ non-obvious choice, and the next task. Ask only where the plan forked; confirm before deviating or
284
+ anything irreversible. In autopilot, log it and continue. Brevity never changes the engineering.
268
285
 
269
286
  ## Logging decisions (the 02-DOCS trail)
270
287
 
@@ -299,13 +316,14 @@ outranks the plan, and the plan outranks your in-the-moment preference.
299
316
  | "I'll write the tests after, once the code settles" | Then the test only confirms what you built, not what was asked. Red first, always. |
300
317
  | "This task is trivial, skip the failing test" | Trivial code breaks too, and the next task may lean on it. Smallest red test still goes first. |
301
318
  | "I'm here anyway, I'll also fix that other thing" | Scope creep buries the diff and breaks the done-check contract. One task, one commit. |
302
- | "The test passed first try without ever being red" | It tests nothing. Make it fail on purpose, then make it pass. |
303
319
  | "I'll batch ten tasks into one big commit to save time" | You just made the work unreviewable and un-resumable. One logical unit per task. |
304
320
  | "The constitution's rule doesn't fit here, I'll bend it" | The constitution outranks you. Surface the conflict; don't bend it silently. |
305
321
  | "These two tasks touch the same file but I'll parallelize anyway" | Shared file = shared state = merge pain and lost work. Serialize them. |
306
- | "Refactor now, the test is still red" | Never refactor on red — you can't tell a cleanup from a regression. Get green first. |
307
322
  | "I'll mark it done, the code looks correct" | Done = the done-check's test is green and the acceptance criterion holds. Looks ≠ green. |
308
323
  | "I'll just write the .env so the integration test runs" | Never. Secrets are the user's; mock/stub the boundary or use a test fixture. |
324
+ | "This diff is obviously low-risk, skip the review" | The tier is `rsc risk`'s, not yours. Run it and obey it. |
325
+ | "The security scan didn't run, but nothing changed there" | Report it **not run**. The task is not done. |
326
+ | "Round 4 will crack it" | The ledger stops at 3. Park the task; continue with independent ones. |
309
327
 
310
328
  ## Red flags — stop and re-route
311
329
 
@@ -324,16 +342,14 @@ outranks the plan, and the plan outranks your in-the-moment preference.
324
342
  ## Checklist (copy per task)
325
343
 
326
344
  ```text
327
- - [ ] Read the task's done-check; it is my first test's assertion
328
- - [ ] RED: smallest test written, run, fails for the RIGHT reason
329
- - [ ] GREEN: least code to pass; test now green
330
- - [ ] REFACTOR: cleaned up on green; still green
331
- - [ ] Constitution honored; no banned pattern introduced
332
- - [ ] Non-obvious decision (if any) logged to 02-DOCS/wiki/sdd/decisions.md
333
- - [ ] Apply progress appended to 02-DOCS/wiki/sdd/progress/<slug>.md
334
- - [ ] Skill resolution recorded (used/missing/fallback/compact rules)
335
- - [ ] Committed as one logical unit (authorship = Eric)
336
- - [ ] Checkpoint shown in the orient voice; next task named
345
+ - [ ] a) RED for the right reason → GREEN → REFACTOR; committed as one unit (authorship = Eric)
346
+ - [ ] b) `rsc risk` on the task diff; tier recorded
347
+ - [ ] c) review by tier, fresh context, spec + diff + surrounding code, no pre-judging
348
+ - [ ] d) `review consolidate` + `finding-verifier`; `review ledger record`
349
+ - [ ] e) tests, build, security, traceability — each passed or **not run**
350
+ - [ ] f) `review ledger round <slug>/<task>` each round; ≤ 3; class fixed, no repeats
351
+ - [ ] g) fixed + logged in decisions.md, or parked in the decision queue
352
+ - [ ] Progress entry appended; skill resolution recorded; checkpoint shown
337
353
  ```
338
354
 
339
355
  ## Result envelope
@@ -343,7 +359,7 @@ End every implementation checkpoint or completed batch with:
343
359
  ```json result-envelope
344
360
  {
345
361
  "status": "complete",
346
- "executive_summary": "Implemented task(s) with red/green/triangulate/refactor evidence.",
362
+ "executive_summary": "Implemented task(s): red/green evidence, tier, review, controls, decision-queue state.",
347
363
  "artifact": "02-DOCS/wiki/sdd/progress/<slug>.md",
348
364
  "next_recommended": "implement|verify",
349
365
  "risk": "low|medium|high",
@@ -351,31 +367,28 @@ End every implementation checkpoint or completed batch with:
351
367
  "used": ["implement"],
352
368
  "missing": [],
353
369
  "fallback": [],
354
- "compact_rules": ["Use config testing commands.", "Append progress after every task."]
370
+ "compact_rules": ["Tier comes from rsc risk, never the agent.", "Max 3 fix rounds; park, don't loop."]
355
371
  },
356
- "evidence": ["red test output", "green test output", "progress entry path"]
372
+ "evidence": ["red/green output", "rsc risk output", "ledger record", "controls", "progress entry path"]
357
373
  }
358
374
  ```
359
375
 
360
376
  ## What this skill is NOT
361
377
 
362
- - **Not the lint/type/audit gate.** Per-task tests prove the task; the *whole-suite* run plus
363
- lint/type/security audit and acceptance-criteria sign-off is `verify`'s job. Don't claim the
364
- feature is done here — that claim belongs to `verify`, on evidence.
378
+ - **Not the closing gate.** The per-task controls prove each task; the whole branch against main,
379
+ the rollback plan and the human explanation are stage 5 (`verify` closing mode, `review`, `ship`).
365
380
  - **Not spec or plan writing.** If you find the plan is wrong mid-build, stop and amend it via
366
381
  `plan`; don't silently re-architect inside a commit.
367
382
  - **Not the deep-debug protocol.** When a test fails for a reason you don't understand, switch to
368
383
  `debug` (reproduce → isolate → hypothesize → fix → verify) instead of guessing.
369
384
 
370
- ## Where you are in the chain
385
+ ## Where you are in ASDD
371
386
 
372
- `constitution` → `specify` → `clarify` → `plan` → `tasks` → `analyze` → **implement** → `verify` →
373
- `review` → `ship`. On-demand from here: `debug` (a test fails mysteriously), `worktrees` (need
374
- isolation), `parallel` (independent tasks to fan out).
387
+ Base → Spec → Plan (`plan` · `tasks` · `analyze`) → **Build loop (this skill)** → Close (`verify` ·
388
+ `review` · `ship`) → Learn. On demand: `debug`, `worktrees`, `parallel`. Front door: `../asdd/SKILL.md`.
375
389
 
376
- **Next:** when every task's done-check is green and committed, go to `verify` — run the stack skill's
377
- `scripts/verify.sh`, confirm the spec's acceptance criteria, and let evidence (not assertion) declare
378
- the feature done.
390
+ **Next:** when every task is done or parked, go to stage 5 — `verify` in closing mode over the whole
391
+ branch. Parked tasks travel in the decision queue for the human.
379
392
 
380
393
  ## Orientación (siempre)
381
394
 
@@ -12,7 +12,7 @@ should_trigger:
12
12
  - prompt: "Take the approved spec and turn it into working, tested code. I want a checkpoint after every task and the design choices written down somewhere."
13
13
  why: "Execute spec→code with per-task checkpoints and decision logging to 02-DOCS — exactly this skill's loop and its decisions.md trail."
14
14
  - prompt: "The analyze gate passed. Build it. Write each piece test-first and don't let it drift from the plan."
15
- why: "Post-analyze, pre-verify execution with TDD and plan-adherence — the precise slot this skill fills in the SDD chain."
15
+ why: "Post-analyze, pre-verify execution with TDD and plan-adherence — the precise slot this skill fills in ASDD (stage 4)."
16
16
 
17
17
  should_not_trigger:
18
18
  - prompt: "The feature's all coded and committed. Run the full lint, type-check, test suite and security audit and tell me if it's actually done."
@@ -40,4 +40,6 @@ capability:
40
40
  - "Delegates the test mechanics to the FastAPI testing reference (ASGITransport in-process client + dependency_overrides + transactional rollback fixture) rather than hand-rolling a runner"
41
41
  - "Stops at a checkpoint after the task (does not barrel into the next task) and reports the checkpoint briefly (task, tests, next task) in the register from technical_level in 02-DOCS/wiki/harness/user-profile.md"
42
42
  - "Commits the task as one logical unit and notes authorship is Eric (no Co-Authored-By Claude)"
43
- - "Logs any non-obvious choice (e.g. error envelope shape) to 02-DOCS/wiki/sdd/decisions.md, and ties done to the done-check + spec acceptance criterion (not 'looks right'), pointing to verify for the final whole-suite gate"
43
+ - "Logs any non-obvious choice (e.g. error envelope shape) to 02-DOCS/wiki/sdd/decisions.md, and ties done to the done-check + spec acceptance criterion (not 'looks right'), pointing to verify closing mode for the whole-branch gate"
44
+ - "Runs `npx @ericrisco/rsc risk` on the task's actual diff instead of choosing a tier itself, and scales review by the printed tier (0 none, 1 one fresh-context reviewer, 2 the three refuters), handing reviewers spec + diff + surrounding code"
45
+ - "Runs the mandatory controls (tests, build, security, traceability to a spec criterion), reports any that did not execute as 'not run' rather than passed, and caps fixing at 3 rounds via `review ledger round`, parking the task in the decision queue instead of a 4th round"
@@ -1,46 +1,39 @@
1
- # Per-task review — the reviewer's brief
1
+ # Per-task review — the tier-1 reviewer's brief
2
2
 
3
- The frozen brief handed to the fresh-eyes reviewer subagent after a task is committed, during
4
- `implement`'s per-task review gate. Hand the reviewer **only** the inputs below — never your session
5
- reasoning. Re-express it in your own words at dispatch; keep the contract identical.
3
+ The frozen brief handed to the one fresh-context reviewer when `rsc risk` puts a task at **tier 1**
4
+ (step c of `implement`'s loop). Tier 2 uses the three refuters as `../../review/SKILL.md` runs them.
5
+ Hand the reviewer **only** the inputs below — never your session reasoning. Re-express it in your own
6
+ words at dispatch; keep the contract identical.
6
7
 
7
8
  ## Inputs to hand the reviewer (paths/values, not prose)
8
9
 
10
+ - **The approved spec** (`02-DOCS/wiki/sdd/specs/<slug>.md`) — what was asked, and what was not.
9
11
  - **The diff**, as a file: the path printed by `scripts/review-package <BASE> <HEAD>` (BASE = the
10
- task's recorded base sha). The reviewer reads the file; the diff never enters the orchestrator's
11
- context.
12
- - **The done-check** for this task (the literal command/observation that proves it complete).
13
- - **The task's Interfaces → `Produces`** contract (exact signatures/shapes it must honor).
14
- - **The plan's §0 Global Constraints** (verbatim project-wide rules).
12
+ task's recorded base sha; from fix round 2, the previous round's head). The diff never enters the
13
+ orchestrator's context.
14
+ - **The surrounding code** at HEAD — the reviewer reads the files the diff touches, not just the hunk.
15
+ - **The done-check**, the task's **Interfaces → `Produces`**, and the plan's **§0 Global Constraints**.
15
16
 
16
17
  ## What the reviewer returns (two verdicts, one pass)
17
18
 
18
- 1. **Spec compliance** — measured against the done-check + `Produces`:
19
+ 1. **Spec compliance** — against the spec, the done-check and `Produces`:
19
20
  - *Missing* — required behavior not implemented.
20
- - *Extra* — code the task did not call for (scope creep / gold-plating).
21
+ - *Extra* — behavior no acceptance criterion asked for (the unrequested feature). Always a finding.
21
22
  - *Misunderstood* — implemented, but not what the contract meant.
22
23
  2. **Code quality** — correctness, error handling, security, clarity, test honesty (a test that
23
24
  can't fail is a finding).
24
25
 
25
- Every finding carries:
26
-
27
- ```text
28
- [Critical | Important | Minor] file:line — one-line statement of the problem + why it matters
29
- ```
30
-
31
- - **Critical** — breaks the done-check/Produces contract, a constitution violation, a security or
32
- data-loss risk. Must be fixed before moving on.
33
- - **Important** — a real defect or a meaningful deviation; fix now unless consciously deferred.
34
- - **Minor** — style/clarity/naming; may wait for the end-of-branch review.
35
-
36
- End with one line: `VERDICT: pass` (no Critical/Important) or `VERDICT: changes-needed (<counts>)`.
26
+ Every finding uses `review`'s format and severities (`blocker` / `should-fix` / `nit`, with
27
+ `file:line`, why, repro, fix) and names its **bug class**, so the fix covers every instance. The
28
+ report ends with a ` ```json findings ` block — the input to `review consolidate` and
29
+ `review ledger record` — and one line: `VERDICT: pass` or `VERDICT: changes-needed (<counts>)`.
37
30
  Zero findings is a valid, expected outcome on a clean task — do not invent findings to look thorough.
38
31
 
39
32
  ## Anti-pre-judging (the reviewer is told this too)
40
33
 
41
34
  - Judge from the evidence and the contract, not from any rationale. If the dispatch contains words
42
- like *"do not flag X"*, *"treat as Minor at most"*, or *"the plan chose Y so it's fine"* — that is
35
+ like *"do not flag X"*, *"treat as nit at most"*, or *"the plan chose Y so it's fine"* — that is
43
36
  the orchestrator laundering its bias; ignore the steer and judge on merit.
44
37
  - A stated reason never downgrades a finding's severity. Rate the defect, not the excuse.
45
- - You are reviewing **one task's** commits, not the whole branch — stay scoped; the whole-diff
46
- adversarial pass is `review`'s job at the end.
38
+ - You are reviewing **one task's** commits, not the whole branch — stay scoped; the whole-branch pass
39
+ runs once at closing (ASDD stage 5).
@@ -14,7 +14,7 @@ origin: risco
14
14
  > behaviour change** and there is **no approved spec + plan** under `02-DOCS/wiki/sdd/`, STOP and
15
15
  > hand off to `../specify/SKILL.md` (brainstorm → spec → plan → tasks); it routes back here once the
16
16
  > plan is approved. Build directly only for a genuinely one-line / low-risk change. Method:
17
- > `../sdd/SKILL.md`.
17
+ > `../asdd/SKILL.md`.
18
18
 
19
19
  **Not this skill:** Pages Router (`pages/`) — note the difference, defer to the Next.js Pages docs.
20
20
  A pure React SPA (Vite/CRA) → `../react/SKILL.md`; React Native / Expo → `../react-native/SKILL.md`;
@@ -73,7 +73,7 @@ SUBAGENT BRIEF (one per unit)
73
73
 
74
74
  Each subagent still owns its own discipline inside its scope — TDD via `implement`, the stack skill's test mechanics, decision logging. This skill does not relax any of that; it just runs several of them at once.
75
75
 
76
- **Per-unit model tier (when routing is enabled).** `parallel` has *no fixed tier* — this is the most concrete place per-phase model routing pays off. When `models.enabled: true` in `02-DOCS/wiki/sdd/config.yaml`, give each unit the tier of the *kind of work it does*, not one tier for the whole fan-out: an implement-type unit → `balanced`, a scan/research/boilerplate unit → `light`, a unit doing genuine design or root-cause reasoning → `heavy`. Resolve the tier to a concrete model via `models.tiers` and **dispatch that subagent on that model** (e.g. Claude Code's `model` field on the Task/subagent) — real routing, independent of the session model. If routing is off or no profile exists, dispatch on the session model and say nothing. Full protocol: `../sdd/references/model-routing.md`.
76
+ **Per-unit model tier (when routing is enabled).** `parallel` has *no fixed tier* — this is the most concrete place per-phase model routing pays off. When `models.enabled: true` in `02-DOCS/wiki/sdd/config.yaml`, give each unit the tier of the *kind of work it does*, not one tier for the whole fan-out: an implement-type unit → `balanced`, a scan/research/boilerplate unit → `light`, a unit doing genuine design or root-cause reasoning → `heavy`. Resolve the tier to a concrete model via `models.tiers` and **dispatch that subagent on that model** (e.g. Claude Code's `model` field on the Task/subagent) — real routing, independent of the session model. If routing is off or no profile exists, dispatch on the session model and say nothing. Full protocol: `../asdd/references/model-routing.md`.
77
77
 
78
78
  **Set the model on every dispatch — an omitted model silently inherits the session's, usually the most expensive one, and that is how a fan-out's cost quietly explodes.** rsc installs a `developer` subagent pinned to the **balanced** tier (Sonnet by default; the user's onboarding choice in `.rsc/developer.json`, never `light`). For implement-type units, **dispatch to the `developer` agent** (e.g. Claude Code `subagent_type: developer`) — that's the deliberate cost cap the user asked for. Only escalate a genuinely heavy unit (real design / root-cause) to a heavy model, and only when routing is enabled; otherwise balanced is the floor and the ceiling. If you dispatch a raw subagent instead, name its tier explicitly.
79
79
 
@@ -93,7 +93,7 @@ this slug already exists, update it in place and note what changed — never for
93
93
  Architecture, interfaces, data flow and risk are the heaviest reasoning in the chain, so this
94
94
  phase's default tier is **`heavy`**. Routing is off unless `models.enabled: true` in
95
95
  `02-DOCS/wiki/sdd/config.yaml`; the resolution order, the announce rule and the model table live in
96
- `../sdd/references/model-routing.md`. Routing off or no profile → session model, silently.
96
+ `../asdd/references/model-routing.md`. Routing off or no profile → session model, silently.
97
97
 
98
98
  ## Talking about the plan
99
99
 
@@ -140,7 +140,7 @@ regardless. (`implement` re-checks this as a hard gate before its first commit.)
140
140
  ## Result envelope
141
141
 
142
142
  End with the parseable block every SDD phase shares, so the dispatcher can chain without
143
- interpreting prose (contract: `../sdd/SKILL.md`):
143
+ interpreting prose (contract: `../asdd/SKILL.md`):
144
144
 
145
145
  ```json result-envelope
146
146
  {
@@ -13,7 +13,7 @@ fix slow SQL, run zero-downtime migrations, and operate/secure the database. Too
13
13
  example is runnable.
14
14
 
15
15
  New, non-trivial feature with no approved spec + plan under `02-DOCS/wiki/sdd/`? Hand off to
16
- [`specify`](../specify/SKILL.md) before writing feature code (method: [`sdd`](../sdd/SKILL.md)); build
16
+ [`specify`](../specify/SKILL.md) before writing feature code (method: [`asdd`](../asdd/SKILL.md)); build
17
17
  straight from here only for a genuinely one-line, low-risk change.
18
18
 
19
19
  Deep dives: [schema-and-indexing](references/schema-and-indexing.md) (types, constraints, every index
@@ -17,7 +17,7 @@ or screen, and its motion layer, is `../design/SKILL.md`'s.
17
17
 
18
18
  > Build or review a fast, typed, correctly-architected **client-side** React single-page app bundled by Vite. No server runtime, no RSC tree, no framework router. Server-rendered React (App Router, server actions, SSR/SSG) is not this skill — that is `../nextjs/SKILL.md`.
19
19
 
20
- **SDD gate — before writing feature code.** If this skill fired on a **new, non-trivial feature or behaviour change** and there is **no approved spec + plan** under `02-DOCS/wiki/sdd/`, stop and hand off to `../specify/SKILL.md`: it runs brainstorm → spec → plan → tasks, then routes back here once the plan is approved. Build directly only for a genuinely one-line / low-risk change. Method: `../sdd/SKILL.md`.
20
+ **SDD gate — before writing feature code.** If this skill fired on a **new, non-trivial feature or behaviour change** and there is **no approved spec + plan** under `02-DOCS/wiki/sdd/`, stop and hand off to `../specify/SKILL.md`: it runs brainstorm → spec → plan → tasks, then routes back here once the plan is approved. Build directly only for a genuinely one-line / low-risk change. Method: `../asdd/SKILL.md`.
21
21
 
22
22
  ## First: confirm it's a Vite SPA, not a framework
23
23