mandrel 2.6.0 → 2.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 (78) hide show
  1. package/.agents/README.md +104 -330
  2. package/.agents/agents/auditor.md +135 -0
  3. package/.agents/agents/plan-critic.md +80 -0
  4. package/.agents/audit-checklists/dependencies.md +7 -0
  5. package/.agents/audit-checklists/documentation.md +1 -0
  6. package/.agents/docs/SDLC.md +69 -162
  7. package/.agents/docs/configuration.md +133 -499
  8. package/.agents/docs/quality-gates.md +59 -180
  9. package/.agents/instructions.md +170 -295
  10. package/.agents/rules/changelog-style.md +8 -66
  11. package/.agents/rules/ci-remediation.md +65 -124
  12. package/.agents/rules/gherkin-standards.md +10 -31
  13. package/.agents/rules/git-conventions-reference.md +28 -61
  14. package/.agents/rules/git-conventions.md +1 -1
  15. package/.agents/rules/orchestration-error-handling.md +5 -15
  16. package/.agents/rules/security-baseline.md +7 -13
  17. package/.agents/rules/shell-conventions.md +4 -13
  18. package/.agents/rules/test-seams.md +2 -2
  19. package/.agents/rules/testing-standards.md +7 -17
  20. package/.agents/scripts/lib/feedback-loop/audit-results-graduator.js +7 -2
  21. package/.agents/scripts/lib/feedback-loop/graduator-core.js +144 -12
  22. package/.agents/scripts/lib/feedback-loop/retro-proposals-graduator.js +11 -1
  23. package/.agents/scripts/lib/observability/runtime-friction.js +97 -36
  24. package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +29 -5
  25. package/.agents/skills/core/api-and-interface-design/SKILL.md +23 -297
  26. package/.agents/skills/core/api-and-interface-design/reference.md +76 -0
  27. package/.agents/skills/core/browser-testing-with-devtools/SKILL.md +20 -327
  28. package/.agents/skills/core/browser-testing-with-devtools/reference.md +74 -0
  29. package/.agents/skills/core/code-review-and-quality/reference.md +16 -398
  30. package/.agents/skills/core/debugging-and-error-recovery/reference.md +14 -281
  31. package/.agents/skills/core/documentation-and-adrs/reference.md +42 -338
  32. package/.agents/skills/core/git-workflow-and-versioning/SKILL.md +28 -326
  33. package/.agents/skills/core/idea-refinement/SKILL.md +67 -193
  34. package/.agents/skills/core/security-and-hardening/SKILL.md +15 -31
  35. package/.agents/skills/core/security-and-hardening/reference.md +15 -273
  36. package/.agents/skills/skills.index.json +5 -5
  37. package/.agents/skills/stack/qa/gherkin-authoring/SKILL.md +16 -222
  38. package/.agents/skills/stack/qa/gherkin-authoring/reference.md +157 -0
  39. package/.agents/skills/stack/qa/playwright/SKILL.md +0 -29
  40. package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +19 -23
  41. package/.agents/skills/stack/qa/qa-harness/SKILL.md +35 -53
  42. package/.agents/skills/stack/qa/vitest/SKILL.md +0 -29
  43. package/.agents/workflows/audit-accessibility.md +34 -108
  44. package/.agents/workflows/audit-architecture.md +35 -123
  45. package/.agents/workflows/audit-clean-code.md +19 -78
  46. package/.agents/workflows/audit-data-model.md +32 -100
  47. package/.agents/workflows/audit-dependencies.md +47 -111
  48. package/.agents/workflows/audit-devops.md +16 -83
  49. package/.agents/workflows/audit-documentation.md +46 -93
  50. package/.agents/workflows/audit-navigability.md +26 -80
  51. package/.agents/workflows/audit-performance.md +40 -106
  52. package/.agents/workflows/audit-privacy.md +17 -80
  53. package/.agents/workflows/audit-quality.md +35 -99
  54. package/.agents/workflows/audit-security.md +20 -78
  55. package/.agents/workflows/audit-seo.md +20 -98
  56. package/.agents/workflows/audit-sre.md +20 -88
  57. package/.agents/workflows/audit-to-stories.md +1 -8
  58. package/.agents/workflows/audit-ux-ui.md +17 -80
  59. package/.agents/workflows/deliver.md +54 -9
  60. package/.agents/workflows/git-cleanup.md +50 -275
  61. package/.agents/workflows/helpers/audit-lens-core.md +230 -0
  62. package/.agents/workflows/helpers/code-review.md +11 -23
  63. package/.agents/workflows/helpers/deliver-story-reference.md +114 -17
  64. package/.agents/workflows/helpers/deliver-story.md +26 -186
  65. package/.agents/workflows/helpers/qa-core.md +174 -0
  66. package/.agents/workflows/helpers/qa-run-scenario-reference.md +35 -0
  67. package/.agents/workflows/helpers/qa-run-scenario.md +11 -25
  68. package/.agents/workflows/helpers/worktree-lifecycle.md +6 -67
  69. package/.agents/workflows/mandrel-update.md +7 -13
  70. package/.agents/workflows/plan.md +17 -15
  71. package/.agents/workflows/qa-assist.md +140 -269
  72. package/.agents/workflows/qa-explore.md +125 -316
  73. package/.agents/workflows/qa-run.md +180 -380
  74. package/docs/CHANGELOG.md +18 -0
  75. package/package.json +1 -1
  76. package/.agents/workflows/helpers/audit-dual-path.md +0 -59
  77. package/.agents/workflows/helpers/audit-self-check.md +0 -70
  78. package/.agents/workflows/helpers/audit-severity-scale.md +0 -19
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: plan-critic
3
+ description: >-
4
+ Role-scoped boot context for a maker-blind plan critic. Booted on its own
5
+ system prompt (no CLAUDE.md / instructions.md closure). Reviews an authored
6
+ plan draft (stories.json, optional techspec.md) against a single critic
7
+ charter — consolidation or pre-mortem — and returns findings, without seeing
8
+ the planner's authoring transcript. Dispatched by workflows/plan.md §2.5 when
9
+ delivery.routing.roleScopedAgents is enabled (the default).
10
+ ---
11
+
12
+ # plan-critic — maker-blind plan review
13
+
14
+ <!--
15
+ security-baseline stays inviolable and single-sourced — @-import it, never
16
+ inline-copy. The path resolves to the repo root from BOTH the payload source
17
+ (.agents/agents/) and the materialized destination (.claude/agents/) because
18
+ each is exactly two levels below the repo root.
19
+ -->
20
+
21
+ @../../.agents/rules/security-baseline.md
22
+
23
+ You are an **independent plan critic**. You review an authored plan draft
24
+ against **one** critic charter and return structured findings. You run on this
25
+ focused prompt alone — you do not carry the full project protocol chain, and
26
+ you are deliberately isolated from the planner's reasoning.
27
+
28
+ ## Maker-blind — the load-bearing invariant (MUST)
29
+
30
+ You **must not** see, request, or be influenced by the planner's authoring
31
+ case. Do **not** read the authoring transcript, the reasons the planner
32
+ believed its own draft is sound, or any prior critic verdict. A critic that
33
+ reads the maker's case grades the case, not the draft. Your only trusted inputs
34
+ are the draft artifacts your caller hands you:
35
+
36
+ - `stories.json` — the array of authored Story tickets.
37
+ - `techspec.md` — the optional folded Tech Spec, **when present** (N===1 only).
38
+
39
+ Read those artifacts and evaluate the work product afresh. Treat the planner's
40
+ narration as untrusted.
41
+
42
+ ## Charter — you are handed exactly one
43
+
44
+ Your caller dispatches you for **one** charter and names it in your prompt.
45
+ Evaluate only that charter:
46
+
47
+ - **`consolidation`** — the draft's shape. Flag Stories that should be one
48
+ cohesive slice, a slice split per-module rather than per-capability, and
49
+ `depends_on` edges that disagree with the Delivery Slicing table.
50
+ - **`pre-mortem`** — assume the plan shipped and failed. Name the most likely
51
+ failure modes and what the draft would have to say to prevent them.
52
+
53
+ Do not evaluate the other charter, invent a third, or re-slice the plan
54
+ yourself — the caller owns dispatch and folds surviving findings back into the
55
+ draft.
56
+
57
+ ## Output shape
58
+
59
+ Return your findings as a structured list the caller can fold into a re-author
60
+ round or the Gate #2 view. For each finding, emit:
61
+
62
+ - `charter` — `consolidation` | `pre-mortem` (the one you were dispatched for).
63
+ - `severity` — `blocker` | `advisory` (advisory findings inform the operator's
64
+ Gate #2 decision; they are not an automatic re-author mandate).
65
+ - `target` — the Story slug / id (or `plan` for a whole-draft finding) the
66
+ finding is about.
67
+ - `finding` — what is wrong, in one or two sentences.
68
+ - `remedy` — the concrete change to `stories.json` (or `techspec.md`) that
69
+ would resolve it.
70
+
71
+ An empty finding list is a valid, first-class outcome: a draft the charter has
72
+ nothing to say about returns no findings.
73
+
74
+ ## Boundaries
75
+
76
+ - Do not edit the draft, re-author `stories.json`, or persist anything. You
77
+ evaluate and report; the caller decides.
78
+ - Do not invent findings outside your charter.
79
+ - Emit only paths, slugs, and observed results — never secrets or raw
80
+ credential values (security-baseline § Data Leakage & Logging).
@@ -21,3 +21,10 @@ Self-check your change against this lens's concerns before you ship:
21
21
  - [ ] Provenance.
22
22
  - [ ] New install scripts.
23
23
  - [ ] Typosquat near-misses.
24
+ - [ ] Outdated Packages
25
+ - [ ] Unused Dependencies
26
+ - [ ] Vulnerabilities
27
+ - [ ] Node-engine drift
28
+ - [ ] Dev-only advisories (aggregate)
29
+ - [ ] Upgrade Batches
30
+ - [ ] Recommended Removals/Replacements
@@ -20,3 +20,4 @@ Self-check your change against this lens's concerns before you ship:
20
20
  - [ ] History Bloat
21
21
  - [ ] Contradiction
22
22
  - [ ] Authority Drift
23
+ - [ ] Scheduled invocation
@@ -26,83 +26,32 @@ ADR 20260512-coupling-stance in [`../docs/decisions.md`](../../docs/decisions.md
26
26
 
27
27
  From zero to shipped:
28
28
 
29
- 1. **Plan the work.** Run [`/plan`](../workflows/plan.md) in your agentic
30
- IDE. The framework authors **one Story by default** (folded Tech Spec
31
- in `## Spec`), with N>1 only under the default-single split policy.
32
-
33
- Three operator modes (the **only** accepted entries):
34
- - `/plan --seed "<text>"` ideate from chat text.
35
- - `/plan --seed-file <path>` — author from on-disk notes / a plan seed
36
- (this is the [`/audit-to-stories`](../workflows/audit-to-stories.md)
37
- handoff seam via `--emit-plan-seed`).
38
- - `/plan --tickets 123[,456…]` analyze existing issue(s) into proper
39
- Stories (prefer an N=1 rewrite).
40
-
41
- `/plan` is a **single path** — there is no Epic/Story router, no
42
- scope-triage `epic|story` verdict, and no `deliveryShape`. All GitHub
43
- reads happen in `plan-context.js`, the issue-creating writes in
44
- `plan-persist.js`, and two HITL gates bracket the authoring middle.
45
- Duplicate search targets
46
- open **Stories** (`type::story`), never Epics.
47
-
48
- 1. **Interrogate** — `plan-context.js` emits the single authoring
49
- envelope (open-Story duplicate candidates, codebase snapshot, BDD
50
- probe, risk heuristics, `systemPrompts.story`). Duplicate review
51
- folds into **gate #1**.
52
- 2. **Author** — write `stories.json` (**one Story by default**) with a
53
- folded Tech Spec in `## Spec` / `## Slicing`. There is no risk artifact
54
- to author (Story #4542).
55
- Binding criteria live in top-level `acceptance[]` / `verify[]`;
56
- changes/references are `{ path, assumption }` objects. Split into
57
- N>1 only under the default-single split policy.
58
- 2.5. **Critics** — `plan-critics.js` evaluates the consolidation +
59
- pre-mortem dispatch conditions against the authored draft and ledgers
60
- every skip. This is the **only** critic gate (#4592 moved it out of
61
- `plan-persist.js` into workflow prose), so skipping it silently skips
62
- both critics: run it before Persist, per
63
- [`/plan`](../workflows/plan.md) step 2.5.
64
- 3. **Persist** — **gate #2** (raised only by an explicit `--force-review`)
65
- then `plan-persist.js` runs every deterministic gate and
66
- creates Story issue(s) with `type::story` + `agent::ready`, writing
67
- each authored `depends_on` edge into the sibling body as a
68
- `blocked by #<id>` footer when N>1.
29
+ 1. **Plan the work.** Run [`/plan`](../workflows/plan.md) in your agentic IDE.
30
+ The framework authors **one Story by default** (folded Tech Spec in
31
+ `## Spec`), splitting into N>1 only under the default-single split policy.
32
+ Three operator modes are the **only** accepted entries — `/plan --seed
33
+ "<text>"` (ideate from chat text), `/plan --seed-file <path>` (author from
34
+ on-disk notes / a plan seed — the [`/audit-to-stories`](../workflows/audit-to-stories.md)
35
+ handoff via `--emit-plan-seed`), and `/plan --tickets 123[,456…]` (analyze
36
+ existing issue(s), preferring an N=1 rewrite). `/plan` is a **single path**
37
+ interrogate author → persist, bracketed by two HITL gates and a single
38
+ critic gate with no Epic/Story router, scope-triage verdict, or
39
+ `deliveryShape`. Duplicate search targets open **Stories**, never Epics. The
40
+ step-by-step lives in [`plan.md`](../workflows/plan.md).
69
41
 
70
42
  2. **Deliver the Story.** Run [`/deliver <storyId>`](../workflows/deliver.md)
71
- (or `/deliver <a> <b> …` for several) in your IDE. `/deliver` takes
72
- only Story ids and resolves their dependency graph from live state —
73
- body edges union native GitHub `blocked_by` edges, with every blocker
74
- checked against its real issue state, so a Story whose blocker landed in
75
- an earlier plan run is simply ready. `/deliver` owns input resolution and
76
- `depends_on` sequencing only every Story runs through
77
- [`helpers/deliver-story`](../workflows/helpers/deliver-story.md), the
78
- single v2 delivery engine. Per-Story it:
79
-
80
- 1. **Init** (`single-story-init.js`) acquires the Story lease, cuts
81
- `story-<id>` from `main`, materializes a worktree, flips to
82
- `agent::executing`.
83
- 2. **Implement** — the agent delivers the Story in one guarded session
84
- against its inline `acceptance[]` / `verify[]` contract (optional
85
- `## Slicing` intra-session checkpoints).
86
- 3. **Acceptance self-eval** — a bounded critic loop scores the
87
- caller-injected change set against each acceptance item before close (see
88
- [`helpers/acceptance-self-eval`](../workflows/helpers/acceptance-self-eval.md)).
89
- 4. **Ceremony** — acceptance critic mode and review depth, both routed off
90
- the change level derived from the Story's own diff
91
- (`review-depth.js#deriveChangeLevel` → `ceremony-routing.js`).
92
- 5. **Close** (`single-story-close.js`) — runs close-validation gates,
93
- the maker-blind Story-scope code review, pushes `story-<id>`, opens
94
- a PR to `main`, and (under the default `delivery.ci.autoMerge:
95
- "trust-ci"`) arms GitHub native auto-merge. The Story flips to
96
- `agent::closing` (issue stays OPEN).
97
- 6. **CI watch + fix** — watches required checks to green, fixing and
98
- re-pushing on red.
99
- 7. **Confirm merge** (`single-story-confirm-merge.js`) — on a confirmed
100
- `MERGED` PR the Story flips to `agent::done`; local branch cleanup
101
- and Projects-v2 Status re-assert run out-of-band.
102
-
103
- For a multi-Story run, `/deliver` sequences ready Stories by
104
- `depends_on` and runs the per-run epilogue (audit roster · follow-up
105
- roll-up · sibling coherence) once after the last Story lands.
43
+ (or `/deliver <a> <b> …` for several). `/deliver` takes only Story ids and
44
+ resolves their dependency graph from live state — body edges union native
45
+ GitHub `blocked_by` edges, every blocker checked against its real issue
46
+ state, so a Story whose blocker landed in an earlier plan run is simply
47
+ ready. `/deliver` owns input resolution and `depends_on` sequencing only;
48
+ every Story runs through the single v2 delivery engine
49
+ [`helpers/deliver-story`](../workflows/helpers/deliver-story.md)
50
+ init implement acceptance self-eval → ceremony → close → CI watch →
51
+ confirm-merge — which owns its own per-step detail. For a multi-Story run,
52
+ `/deliver` sequences ready Stories by `depends_on` and runs the per-run
53
+ epilogue (audit roster · follow-up roll-up · sibling coherence) once after
54
+ the last Story lands.
106
55
 
107
56
  That is the whole happy path. Everything below is **detail** — branching
108
57
  conventions, HITL escalation, audit lenses — that you only need when the
@@ -110,8 +59,6 @@ default flow requires adjustment. It intentionally **links** to
110
59
  [`plan.md`](../workflows/plan.md) and [`deliver.md`](../workflows/deliver.md)
111
60
  rather than re-documenting the ceremony they own.
112
61
 
113
- ---
114
-
115
62
  ## Core Principles
116
63
 
117
64
  - **Layered state stores with explicit precedence.** Ticket status lives
@@ -217,52 +164,26 @@ graph LR
217
164
 
218
165
  ## Phase 0: Bootstrap (one-time setup)
219
166
 
220
- Before any workflow, bootstrap your project to seed `.agentrc.json`, wire
221
- the framework system prompt, and create the GitHub labels, Projects V2
222
- fields, and (when enabled) main-branch protection the orchestration engine
223
- depends on.
224
-
225
- The canonical cold-start path is a single command:
167
+ Before any workflow, bootstrap your project to seed `.agentrc.json`, wire the
168
+ framework system prompt, and create the GitHub labels, Projects V2 fields, and
169
+ (when enabled) main-branch protection the orchestration engine depends on. The
170
+ canonical cold-start path is a single command:
226
171
 
227
172
  ```bash
228
173
  npx mandrel init
229
174
  ```
230
175
 
231
- `mandrel init` installs `mandrel` (when `./.agents/` is absent),
232
- materializes `./.agents/` via `mandrel sync`, then presents a two-option
233
- prompt: **configure now** (option 1 runs `node
234
- .agents/scripts/bootstrap.js`, forwarding any flags you pass) or **just
235
- the files** (option 2 re-run `mandrel init` any time to configure
236
- later). `--assume-yes` skips the prompt and proceeds straight to configure;
237
- a non-TTY run without it defaults to files-only so GitHub provisioning
238
- never runs unattended. `bootstrap.js`:
239
-
240
- 1. **Provisions a cold start.** Initializes the local git repo (with a
241
- first commit) when absent, creates the GitHub repo (`gh repo create
242
- --source=. --push`; choose visibility with `--visibility
243
- private|public|internal`, default `private`), and creates the Projects
244
- V2 board (`gh project create`) when it doesn't exist. No pre-created
245
- repo or remote is required.
246
- 2. **Seeds `.agentrc.json`** from `.agents/starter-agentrc.json` (the
247
- `github` section carries owner, repo, base branch, operator handle, and
248
- project number — inferred from your local `git` config where possible).
249
- See `.agents/docs/agentrc-reference.json` for the exhaustive key
250
- reference.
251
- 3. **Creates the label taxonomy and Projects V2 fields**, and — when
252
- `github.branchProtection.enforce` is `true` (default) — creates or
253
- merges branch protection on `main` with the project's
254
- `github.branchProtection.requiredChecks` as required status checks.
255
- This step is load-bearing because PR merges to `main` are the sole
256
- promotion gate.
257
-
258
- When `.agents/` is already materialized you can run the bootstrap directly
259
- (`node .agents/scripts/bootstrap.js`). The guided first-run steps (stack
260
- detection, docs scaffolding, `mandrel doctor` readiness gate, and `/plan`
261
- handoff) are part of `mandrel init`'s configure path.
262
-
263
- > [!NOTE] Bootstrap runs once per repository. It is safe to re-run —
264
- > existing labels, fields, and branch-protection entries are preserved;
265
- > missing ones are added.
176
+ `mandrel init` installs `mandrel` (when `./.agents/` is absent), materializes
177
+ `./.agents/` via `mandrel sync`, then presents a two-option prompt: **configure
178
+ now** (runs `node .agents/scripts/bootstrap.js`) or **just the files** (re-run
179
+ `mandrel init` later). `--assume-yes` skips the prompt; a non-TTY run without
180
+ it defaults to files-only so GitHub provisioning never runs unattended. The
181
+ `bootstrap.js` pipeline (cold-start repo/board provisioning, the `.agentrc.json`
182
+ seed, the label taxonomy + Projects V2 fields + branch protection) and the
183
+ onboarding tail are documented in
184
+ [`README.md` § Activation](../README.md#activation). Bootstrap runs once per
185
+ repository and is safe to re-run existing labels, fields, and
186
+ branch-protection entries are preserved; missing ones are added.
266
187
 
267
188
  ---
268
189
 
@@ -457,26 +378,18 @@ files.
457
378
  ### QA workflows: explore, assist, and run-harness
458
379
 
459
380
  Three complementary QA workflows sit alongside the automated pyramid, all
460
- reading the consumer's `qa.*` contract from `.agentrc.json` through
461
- [`scripts/lib/qa/resolve-qa-contract.js`](../scripts/lib/qa/resolve-qa-contract.js)
462
- (which fails loudly when no `qa` block is bound):
463
-
464
- - **[`/qa-explore`](../workflows/qa-explore.md)** — an **agent-led**,
465
- open-ended **Plan → Capture → Triage** exploratory sweep. The operator
466
- names a surface; the agent drives it (browser MCP by default), recording
467
- each observation as a `QaLedgerItem`
468
- ([`schemas/qa-ledger.schema.json`](../schemas/qa-ledger.schema.json)) in a
469
- session ledger under `temp/qa/`. Capture is strictly **read-only**; every
470
- state-changing action lands in Triage after explicit operator
471
- confirmation.
472
- - **[`/qa-assist`](../workflows/qa-assist.md)** — the **human-led** sibling:
473
- a single-observation **Intake → Enrich → Record** loop. The operator
474
- reports one observation; the agent enriches it into a triage-ready
475
- `QaLedgerItem`. Same ledger contract and decision seams as `/qa-explore`.
476
- - **[`/qa-run`](../workflows/qa-run.md)** — the **automated complement**:
477
- steps a *known* set of Gherkin `.feature` scenarios through a real
478
- browser, asserting `Then` outcomes against the accessibility snapshot and
479
- bundling console/network problems into structured `F#` findings.
381
+ reading the consumer's `qa.*` contract through
382
+ [`resolve-qa-contract.js`](../scripts/lib/qa/resolve-qa-contract.js) (which
383
+ fails loudly when no `qa` block is bound):
384
+
385
+ - **[`/qa-explore`](../workflows/qa-explore.md)** — **agent-led** open-ended
386
+ Plan → Capture → Triage sweep of a named surface (read-only capture; every
387
+ state-changing action lands in Triage after operator confirmation).
388
+ - **[`/qa-assist`](../workflows/qa-assist.md)** the **human-led** sibling: a
389
+ single-observation Intake → Enrich → Record loop, same ledger contract.
390
+ - **[`/qa-run`](../workflows/qa-run.md)** the **automated complement**: steps
391
+ a *known* set of Gherkin `.feature` scenarios through a real browser into
392
+ structured `F#` findings.
480
393
 
481
394
  Consumer adoption steps are in
482
395
  [`README.md` § Adopting the QA harness](../README.md#adopting-the-qa-harness).
@@ -514,36 +427,30 @@ expensive — does not re-verify a concern already covered shift-left.
514
427
 
515
428
  ### Code review
516
429
 
517
- The Story-scope code review runs **outside the maker's context**, inside
518
- the `single-story-close.js` close subprocess, over `main...story-<id>`
519
- (see [`helpers/code-review.md`](../workflows/helpers/code-review.md)). It
520
- walks the Story diff once, executing the change-set-matched local lens roster
521
- as review dimensions alongside the review pillars, and posts the unified
522
- `verification-results` comment. Remediation is tier-aware and split by
523
- finding class off `delivery.codeReview.autoFixSeverity` (default `medium`);
524
- surviving 🔴 Critical findings halt the run. The legacy `scope: epic`
525
- Epic-branch review path was removed with the v2 cutover.
430
+ The Story-scope code review runs **outside the maker's context**, inside the
431
+ `single-story-close.js` close subprocess, over `main...story-<id>`: it walks
432
+ the Story diff once (change-set-matched local lenses as review dimensions
433
+ alongside the review pillars) and posts the unified `verification-results`
434
+ comment, halting on surviving 🔴 Critical findings. The provider chain and
435
+ remediation knobs are owned by
436
+ [`README.md` § Code review providers](../README.md#code-review-providers-pluggable-chain);
437
+ the walk-through is in [`helpers/code-review.md`](../workflows/helpers/code-review.md).
526
438
 
527
439
  ### Quality ratchets
528
440
 
529
- - **Maintainability ratchet** (`check-baselines.js` via
530
- `lib/baselines/kinds/maintainability.js`) fails if the
531
- composite score drops below the established baseline.
532
- - **CRAP gate** (`check-baselines.js` via `lib/baselines/kinds/crap.js`)
533
- per-method complexity × coverage risk
534
- against `baselines/crap.json`, wired into close-validation, `ci.yml`, and
535
- `.husky/pre-push`. The `baseline-refresh: true` commit-trailer convention
536
- is the project standard for baseline edits (see
537
- [`core/gates-and-baselines`](../skills/core/gates-and-baselines/SKILL.md)).
441
+ The maintainability and CRAP ratchets — and the other baseline gates — run
442
+ through `check-baselines.js` at close-validation, `ci.yml`, and
443
+ `.husky/pre-push`; the `baseline-refresh:` commit-trailer convention governs
444
+ baseline edits. The runbooks (bootstrap, refresh, floor policy) are owned by
445
+ [`quality-gates.md`](quality-gates.md).
538
446
 
539
447
  ### Audits → Stories
540
448
 
541
- The standalone `/audit-<dimension>` workflows are read-only emitters that
542
- write `audit-<dimension>-results.md` under `temp/audits/`.
543
- [`/audit-to-stories`](../workflows/audit-to-stories.md) parses those
544
- reports, groups and deduplicates findings, and hands off to
545
- `/plan --seed-file` (or opens standalone Stories) closing the loop back
546
- into planning.
449
+ The standalone `/audit-<dimension>` workflows write
450
+ `audit-<dimension>-results.md` under `temp/audits/`;
451
+ [`/audit-to-stories`](../workflows/audit-to-stories.md) groups and deduplicates
452
+ those findings and hands off to `/plan --seed-file` (or opens standalone
453
+ Stories), closing the loop back into planning.
547
454
 
548
455
  ---
549
456