diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md
index 9f3f986..1f299ed 100644
--- a/skills/code-review/SKILL.md
+++ b/skills/code-review/SKILL.md
@@ -1,46 +1,78 @@
---
name: code-review
description: >-
- Inspects git diffs, pull requests, and commit ranges across four independent
- axes: Spec & Scope, Standards & Smells, Seam & Test Integrity, and Defensive
- Invariants. Use when reviewing code changes before merge or verifying diff
- quality. Not for live runtime QA: use verify-slice.
+ Inspects git diffs, GitHub pull requests, and commit ranges across four
+ independent axes: Spec & Scope, Standards & Smells, Seam & Test Integrity,
+ and Defensive Invariants. Use when reviewing code changes before merge or
+ verifying diff quality. Not for live runtime QA: use verify.
---
# Code Review
## Use when
-- Reviewing a branch, pull request, work-in-progress diff, or commit range before merge.
-- Evaluating code structure, defensive invariants, and test seam integrity.
-- Not for live runtime browser or deployment testing: use `verify-slice`.
+- Reviewing a branch, open GitHub PR, work-in-progress diff, or commit range.
+- Evaluating code structure, hygiene, defensive invariants, and test seams.
+- Not for live runtime QA, CI promotion, or merge: use `verify`.
- Not for debugging an unknown symptom: use `diagnose`.
## Steps
-1. **Pin the fixed point and scope.** Resolve the base ref and record exact base and head commit SHAs (`git rev-parse HEAD`). Inspect working-tree state (`git status --short`, unstaged `git diff`, staged `git diff --cached`, and relevant untracked files) alongside committed history (`git diff ...HEAD` and `git log ..HEAD --oneline`). Record the covered revisions and working-tree diff state (for example, clean tree or diff fingerprint) so downstream tools can verify whether the reviewed diff remained unchanged, and distinguish findings across committed, staged, and unstaged changes.
-2. **Select execution tier.** Match the change to the risk tiers from [axes](references/axes.md) (`Lightweight`, `Standard`, or `High-Assurance`). Single-agent sequential pass for `Lightweight`; independent review passes for `Standard`; for `High-Assurance`, never run `Sequential` or a single combined subagent: spawn a dedicated isolated Axis 3 (`Seam & Test Integrity`) subagent separate from Axes 1/2/4 and record both subagent IDs in `Execution Mode`.
-3. **Inspect the four axes.** Evaluate the diff against each axis independently using [axes](references/axes.md):
- - **Spec & Scope**: originating requirements satisfied, aligned with canonical project direction (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs, active milestone) when present, minimal shared-file footprint, zero scope creep.
- - **Standards & Smells**: repository rules and Fowler smell diagnostics from [smell-heuristics](references/smell-heuristics.md) (evaluated as confirmed violations, potential smells, or contextual trade-offs).
- - **Seam & Test Integrity**: audit test diffs against [seams-and-mocking](../tdd/references/seams-and-mocking.md) and [test-quality](../tdd/references/test-quality.md) (public seams, injected timing callables, deterministic waits/teardown, non-tautological literals, boundary coverage, single-behavior naming).
- - **Defensive Invariants**: system properties from [defensive-invariants](references/defensive-invariants.md) (trust boundaries, authority, consistency, failure semantics, resource limits).
-4. **Record structured findings.** Record every finding using the schema in [finding-schema](references/finding-schema.md) (`ID`, `Axis`, `Severity`, `Evidence`, `Invariant`, `Impact`, `Disposition`). Never self-assign `Accepted Trade-off` on a review pass: all valid findings start as `Confirmed` (or `Unresolved`); only the human owner may grant `Accepted Trade-off`. A strong pass on one axis never compensates for a failure on another.
-5. **Aggregate without silent resolution.** When multiple reviewers or passes disagree, keep the disagreement visible under `Unresolved` until evidence settles it.
-6. **Emit executable runtime checks.** For stateful or high-risk paths that static inspection cannot prove, emit runnable fenced shell commands for `verify-slice` following the Step 6 contract in [finding-schema](references/finding-schema.md) (stating purpose, `local` vs. `live-infra` scope classification, explicit pass condition, and explicit failure signal).
-7. **Present the review summary.** Group findings by axis and apply the decision matrix from [axes](references/axes.md): `Needs Rework` (confirmed defects require changes), `Blocked` (unresolved Critical/High risks or unestablished scope), `Pending Triage` (only untriaged Medium/Low findings remain; never recommend merging until each takes one of the 3 triage exits in [finding-schema](references/finding-schema.md)), or `Ready` (all four axes completed and zero untriaged findings remain). Static review establishes static provenance for that diff only; never authorize release.
-8. **Auto-publish the PR review block (standalone open PR only).** Keep the codebase strictly read-only (never edit repo files or mutate project boards). When invoked standalone on an open PR, draft `review-body.md` (and `inline-comments.json` when inline findings exist) per section 4 of [finding-schema](references/finding-schema.md), including the compact 4-axis pass block on clean `Ready` reviews, verify `head_sha` and duplicate/pending guards, and automatically publish one `--comment` review pinned with `--commit ` in the same turn. Skip PR publishing when delegated inside `implement-slice`.
+Keep the codebase strictly read-only: never edit repository files, create
+commits, or mutate GitHub Projects v2 board cards.
+
+1. **Pin the fixed point and scope.** Resolve `` and `HEAD` SHAs
+ (`git rev-parse HEAD`). Inspect working-tree state (`git status --short`,
+ unstaged `git diff`, staged `git diff --cached`, relevant untracked files)
+ and committed history (`git diff ...HEAD`, `git log ..HEAD --oneline`).
+2. **Select execution tier.** Before inspecting, read [axes](references/axes.md)
+ and assign `Lightweight`, `Standard`, or `High-Assurance`. For `High-Assurance`,
+ never run `Sequential` or a single combined subagent: spawn a dedicated isolated
+ Axis 3 (`Seam & Test Integrity`) subagent separate from Axes 1/2/4 and record
+ both subagent IDs in `Execution Mode`.
+3. **Inspect the four axes independently.**
+ - **Spec & Scope**: issue/spec satisfaction, alignment with canonical docs
+ (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs), minimal shared-file footprint,
+ and affected local markdown accuracy.
+ - **Standards & Smells**: repo rules, [smell-heuristics](references/smell-heuristics.md),
+ missing docstrings on new/modified public symbols, stale inline comments,
+ and lint/format regressions.
+ - **Seam & Test Integrity**: audit test diffs against
+ [seams-and-mocking](../tdd/references/seams-and-mocking.md) and
+ [test-quality](../tdd/references/test-quality.md).
+ - **Defensive Invariants**: [defensive-invariants](references/defensive-invariants.md)
+ (trust boundaries, authority, consistency, failure semantics, resource limits).
+4. **Record findings and executable runtime checks.** Before formatting output
+ or publishing, read [finding-schema](references/finding-schema.md). Valid
+ findings start in `Pending Triage` (never self-dismiss). Keep disagreements
+ under `Unresolved`. Emit runnable `RV-*` checks (`local` vs. `live-infra`,
+ explicit `FAIL if ...` signals) for stateful or high-risk paths.
+5. **Determine verdict and publish on open GitHub PRs.** Apply [axes](references/axes.md)
+ (`Needs Rework`, `Blocked`, `Pending Triage`, `Ready`). Verify GitHub repo via
+ `gh repo view --json url` and check for an open PR on `HEAD`. Whenever an open
+ GitHub PR exists (standalone or delegated), build the payload via
+ `skills/code-review/scripts/build_review.py --input ... --diff ... --reviews ... --comments ... --head-sha --verdict `
+ and pipe stdout to `gh api repos/{owner}/{repo}/pulls/{n}/reviews --input -`.
+ Handle exit `2` (duplicate `(head_sha, verdict)` skip) and exit `1`
+ (`3-rework-cycle cap` escalation). When no open PR exists or in local-only mode,
+ skip publishing and explicitly state in output that no open PR was found and
+ findings are reported locally.
## Your call
-- **Triaging findings (3 exits before merge)**: for each `Confirmed` or `Unresolved` finding, decide whether to (A) fix in-branch now, (B) promote to a live tracker (append/create Gitea issue or `todo.txt` via `tuxedo add`), or (C) grant permanent `Accepted Trade-off` (`record`).
-- **Adjudicating unresolved disagreements**: resolve conflicting reviewer perspectives.
-- **Authorizing release**: verification and review evidence inform decisions, but the human owner remains the sole release authority.
+- **Triaging findings (3 exits before `Ready`)**: choose Exit A (fix in-branch),
+ Exit B (promote to a GitHub Issue), or Exit C (dismiss as invalid/false positive).
+- **Escalations and disagreements**: adjudicate `Unresolved` findings or a
+ `3-rework-cycle cap` halt.
+- **Release authority**: static provenance never authorizes merge or release.
## Done when
-- All four axes have been inspected across working-tree and committed changes, every finding is recorded with evidence and disposition, executable Step 6 runtime checks are emitted for `verify-slice` if needed, and the human owner has reviewed the findings.
+- All four axes are inspected, findings and `RV-*` checks are recorded, and the
+ review is published to the open GitHub PR (or explicitly reported locally when
+ no open PR exists).
## Hands off to
-- `tdd`: when Axis 3 fails (`Suggested Next Step: /tdd `) or production rework needs test-first fixes (`Suggested Next Step: /tdd `).
+- `implement`: on `Needs Rework` (`<= 2`-file localized fixes take the fast path;
+ complex rework enters Step 1; `Suggested Next Step: /implement #`).
+- `verify`: on `Ready` (`Suggested Next Step: /verify`).
+- `tdd`: when Axis 3 fails (`Suggested Next Step: /tdd `).
- `diagnose`: when a finding exposes an unknown root cause (`Suggested Next Step: /diagnose`).
-- `verify-slice`: when `Ready` and runtime/`RV-*` checks are needed (`Suggested Next Step: /verify-slice`).
-- `git-manager`: when branching, committing review fixes, or rebasing.
-- `gitea-pr`: when `Ready` on an open PR with clean runtime checks (`Suggested Next Step: /gitea-pr `).
-- Emit one outcome-matched `Suggested Next Step` on standalone turns; suppress when delegated (per [skeleton](../build-skill/references/skeleton.md)).
+- Emit one outcome-matched `Suggested Next Step:` on standalone turns; suppress
+ when delegated per [skeleton](../build-skill/references/skeleton.md).
diff --git a/skills/code-review/references/axes.md b/skills/code-review/references/axes.md
index f7027c7..68b37ac 100644
--- a/skills/code-review/references/axes.md
+++ b/skills/code-review/references/axes.md
@@ -8,47 +8,47 @@ Derived and adapted from Matt Pocock's skills repository (github.com/mattpocock/
| Axis | Primary Question | Failure Mode Caught | Core Inspection Questions |
| :--- | :--- | :--- | :--- |
-| **Spec & Scope** | Did we build what was requested, aligned with project direction, and only that? | Scope creep, missing requirements, architectural or roadmap drift, leaky abstractions | 1. Does the diff satisfy the originating issue or specification contract?
2. When canonical direction docs exist (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs, or active milestone scope), does the change align with long-term boundaries and trajectory?
3. Is there unrequested functionality or premature generalization?
4. Are changes to shared entrypoints (e.g., routers, base config) minimal and additive? |
-| **Standards & Smells** | Is the implementation maintainable and consistent? | Structural debt, friction with conventions | 1. Does the code adhere to repo standards (`CODING_STANDARDS.md`, linter configs)?
2. Are code smells present that warrant refactoring? (See [smell-heuristics](smell-heuristics.md)).
3. Is naming clear and aligned with domain vocabulary? |
-| **Seam & Test Integrity** | Do tests prove actual contracts at public interfaces? | Tautological tests, implementation coupling, boundary gaps, flaky waits | Audit against [seams-and-mocking](../../tdd/references/seams-and-mocking.md) and [test-quality](../../tdd/references/test-quality.md):
1. Public seams only; boundary mocks only; injected timing/clock callables instead of global runtime monkeypatching; deterministic waits and guaranteed teardown.
2. Non-tautological assertions with independent literals (no imported production value constants), exact+neighbor boundary points (`[min-1, min, max, max+1]`), and single-behavior test names (no vague buckets or `_and_` chains). |
+| **Spec & Scope** | Did we build what was requested, aligned with project direction, and only that? | Scope creep, missing requirements, architectural or roadmap drift, stale local docs | 1. Does the diff satisfy the originating GitHub issue or specification contract?
2. When canonical direction docs exist (`ARCHITECTURE.md`, `ROADMAP.md`, ADRs, or active milestone scope), does the change align with long-term boundaries and trajectory?
3. Is there unrequested functionality or premature generalization?
4. Are changes to shared entrypoints minimal and additive, and are affected local markdown files updated when behavior or interfaces change? |
+| **Standards & Smells** | Is the implementation maintainable, hygienic, and consistent? | Structural debt, missing docstrings, stale comments, lint/format regressions | 1. Does the code adhere to repo standards (`CODING_STANDARDS.md`, linter and formatter configs) with zero lint/format regressions?
2. Are new or modified public symbols documented with clear docstrings, and are inline comments accurate (no stale comments contradicting the new code)?
3. Are code smells present that warrant refactoring? (See [smell-heuristics](smell-heuristics.md)).
4. Is naming clear and aligned with domain vocabulary? |
+| **Seam & Test Integrity** | Do tests prove actual contracts at public interfaces? | Tautological tests, implementation coupling, boundary gaps, flaky waits | Audit against [seams-and-mocking](../../tdd/references/seams-and-mocking.md) and [test-quality](../../tdd/references/test-quality.md):
1. Public seams only; boundary mocks only; injected timing/clock callables instead of global runtime monkeypatching; deterministic waits and guaranteed teardown.
2. Non-tautological assertions with independent literals (no imported production value constants), exact+neighbor boundary points (`[min - 1, min, max, max + 1]`), and single-behavior test names (no vague buckets or `_and_` chains). |
| **Defensive Invariants** | Does the code preserve critical system properties under stress? | Injection, state desync, unhandled crashes | 1. Are untrusted inputs sanitized before reaching sinks? (See [defensive-invariants](defensive-invariants.md)).
2. Does state reconcile against authoritative sources rather than local heuristic drift?
3. Are failure semantics, timeouts, and resource limits explicit? |
### Non-Compensation Invariant
A strong pass on one axis never excuses a failure on another:
- Clean abstractions and zero code smells cannot excuse an unescaped HTML sink or an unhandled conflict.
- 100% test coverage cannot excuse unrequested feature drift, architectural direction drift, or broken domain invariants.
-- Strict spec compliance cannot excuse fragile code structure that breaks repository conventions.
+- Strict spec compliance cannot excuse fragile code structure, missing public docstrings, or lint regressions that break repository conventions.
## 2. Review Recommendations Matrix
The distinction between recommendations is clear: `Needs Rework` means an established defect requires implementation or test changes; `Blocked` means the review cannot establish sufficient confidence or scope to proceed safely.
-| Condition Observed | Final Recommendation | Action Required |
-| :--- | :--- | :--- |
-| **Confirmed Critical or High** | `Needs Rework` | Fix confirmed defects on the branch before release review. |
-| **Confirmed or Unresolved Medium or Low (untriaged)** | `Pending Triage` | Do not recommend merge. Human owner chooses 1 of 3 exits per finding: (A) fix in-branch, (B) promote to live tracker (Gitea issue or `todo.txt`), or (C) grant permanent `Accepted Trade-off`. |
-| **Unresolved Critical or High** | `Blocked` | Resolve missing evidence or escalate to human owner before proceeding. |
-| **Scope Inability or Missing Base Ref** | `Blocked` | Establish base commit and diff boundaries before reviewing. |
-| **Zero Untriaged Findings** | `Ready` | All findings resolved, tracked in a live tracker, or explicitly granted `Accepted Trade-off` by the owner. |
+| Condition Observed | Final Recommendation | Published `verdict` | Action Required |
+| :--- | :--- | :--- | :--- |
+| **Confirmed Critical or High** | `Needs Rework` | `needs_rework` | Fix confirmed defects on the branch via `implement` before `verify`. |
+| **Confirmed or Unresolved Medium or Low (untriaged)** | `Pending Triage` | `needs_rework` | Do not promote or merge. Human owner chooses 1 of 3 exits per finding: Exit A (fix in-branch), Exit B (promote to a GitHub Issue), or Exit C (dismiss as invalid/false positive). |
+| **Unresolved Critical or High** | `Blocked` | `needs_rework` | Resolve missing evidence or escalate to human owner before proceeding. |
+| **Scope Inability or Missing Base Ref** | `Blocked` | (local halt) | Establish base commit and diff boundaries before reviewing. |
+| **Zero Untriaged Findings** | `Ready` | `ready` | All findings resolved in-branch, promoted to a GitHub Issue (Exit B), or dismissed as invalid/false positive (Exit C). Route to `verify`. |
### `Ready` vs. `Pending Triage` Semantics and Downstream Reuse
-- **No agent self-adjudication**: Reviewer agents must never self-assign `Accepted Trade-off` on a review pass. Every valid observation (including `Low` nits) starts as `Confirmed` (or `Unresolved`), producing `Pending Triage` (or `Needs Rework`) rather than `Ready`.
-- **`Pending Triage` blocks merge recommendations**: A review in `Pending Triage` qualifies as `Ready` for `gitea-pr` merge readiness only after every finding has taken one of the three explicit exits: (A) fixed in a new commit on the branch, (B) recorded in a live tracker that future agents read (an open Gitea issue or `todo.txt` via `tuxedo add`), or (C) explicitly approved by the human owner as a permanent `Accepted Trade-off` (no future action needed).
-- A `Ready` review establishes static provenance for that exact diff; it does not substitute for runtime verification or authorize release.
+- **No agent self-dismissal**: Every valid finding (including `Low` severity) starts in `Pending Triage` as `Confirmed` (or `Unresolved`), producing `Pending Triage` or `Needs Rework` (`verdict=needs_rework`) rather than `Ready`.
+- **`Pending Triage` blocks `verify` promotion**: A review qualifies as `Ready` (`verdict=ready`) for `verify` only after every finding has taken one of the three explicit exits: Exit A (fixed in a new commit on the branch), Exit B (promoted to a GitHub Issue and recorded as `Promoted to #` in the superseding `Ready` review's triage summary), or Exit C (dismissed as invalid/false positive and recorded as `Dismissed: ` in the superseding `Ready` review's triage summary).
+- A `Ready` review establishes static provenance for that exact `head_sha`; it does not substitute for runtime verification in `verify` or authorize release.
## 3. Risk-Scaled Execution Tiers
-To keep review overhead proportional to risk, execution mode reuses the tiers established in `verify-slice`:
+To keep review overhead proportional to risk, execution mode aligns with the risk tiers used in `verify`:
| Review Risk Tier | Typical Change | Review Execution Strategy |
| :--- | :--- | :--- |
-| **Lightweight** | Copy updates, styling adjustments, isolated bugfixes with no new state or untrusted data. | Single-agent sequential pass inspecting all 4 axes in order. |
-| **Standard** | New UI components, regular API endpoints, database queries, or schema additions. | Independent review passes over the diff. Subagents may be used when helpful to prevent bias. |
-| **High-Assurance** | Auth, permissions, payments, concurrent state reconciliation, destructive actions, or core shared libraries. | Assign a dedicated isolated reviewer to **Seam & Test Integrity** (Axis 3, auditing test diffs against `tdd/references/`), separate from `Spec & Scope` + `Defensive Invariants` and `Standards & Smells`, followed by independent aggregation. |
+| **Lightweight** | Small localized diffs, copy updates, styling adjustments, isolated bugfixes with no new state or untrusted data. | Single-agent sequential pass inspecting all 4 axes in order. |
+| **Standard** | Multi-file feature slices, new UI components, regular API endpoints, database queries, or schema additions. | Independent review passes over the diff. Subagents may be used when helpful to prevent bias. |
+| **High-Assurance** | Security, auth, permissions, payments, schema migrations, concurrent state reconciliation, destructive actions, core shared libraries, or >500-line diffs. | Assign a dedicated isolated reviewer to **Seam & Test Integrity** (Axis 3, auditing test diffs against `tdd/references/`), separate from `Spec & Scope` + `Defensive Invariants` and `Standards & Smells`, followed by independent aggregation. |
## 4. Aggregation and Anti-Silence Rules
When multiple passes or subagents inspect a change:
1. **Never silently resolve disagreements**: If Reviewer A flags a pattern as a defect and Reviewer B considers it acceptable, record the finding under `Unresolved` with both perspectives cited. The human owner adjudicates.
2. **Preserve exact evidence**: Every finding must include exact file paths, line numbers, and code snippets demonstrating the condition.
-3. **Emit executable runtime checks**: Where static analysis cannot verify dynamic timing, rendering, or network failure modes, formulate runnable Step 6 checks formatted per [finding-schema](finding-schema.md) and pass them to `verify-slice`.
+3. **Emit executable runtime checks**: Where static analysis cannot verify dynamic timing, rendering, or network failure modes, formulate runnable `RV-*` checks formatted per [finding-schema](finding-schema.md) so `verify` can execute them from the published PR review body.
diff --git a/skills/code-review/references/finding-schema.md b/skills/code-review/references/finding-schema.md
index 3155f2b..0584f0f 100644
--- a/skills/code-review/references/finding-schema.md
+++ b/skills/code-review/references/finding-schema.md
@@ -1,6 +1,6 @@
-# Finding Schema and Review Output
+# Finding Schema and GitHub PR Review Output
-Reference for `code-review`. Defines the required structure for reporting findings, ensuring every note is actionable, evidence-backed, and auditable.
+Reference for `code-review`. Sole owner of the `CR-XX` finding lifecycle, the `build_review.py` payload contract, and GitHub PR review publishing.
Derived and adapted from Matt Pocock's review principles (github.com/mattpocock/skills), combining side-by-side axis reporting with strict defect provenance and disposition contracts.
@@ -10,45 +10,45 @@ Every reported finding must populate all seven fields:
| Field | Description | Allowed Values / Format |
| :--- | :--- | :--- |
-| **ID** | Stable identifier within this review. | `CR-01`, `CR-02`, etc. |
+| **ID** | Monotonic per-PR identifier across all review passes. | `CR-01`..`CR-99`, `CR-100`, etc. (assigned deterministically by `build_review.py`). |
| **Axis** | The review axis that uncovered the finding. | `Spec & Scope`, `Standards & Smells`, `Seam & Test Integrity`, `Defensive Invariants`. |
-| **Severity** | Potential failure consequence if the defect occurs. Describes impact, not reviewer confidence. | `Critical` (system security breach, data loss, fatal crash), `High` (broken invariant, missing spec requirement), `Medium` (code smell, fragile logic, missing edge test), `Low` (minor style inconsistency, naming). |
-| **Evidence** | Exact location, change category, and reproducible behavior. | Distinguishes whether the code is committed, staged, or unstaged: e.g. `src/view.ts:L45 (unstaged)` with excerpt. |
+| **Severity** | Potential failure consequence if the defect occurs. Describes impact, not reviewer confidence. | `Critical` (security breach, data loss, fatal crash), `High` (broken invariant, missing spec requirement), `Medium` (code smell, fragile logic, missing edge test), `Low` (minor style, docstring, or naming issue). |
+| **Evidence** | Exact location, change category, and reproducible behavior. | Distinguishes committed, staged, or unstaged state: e.g. `src/view.ts:L45 (committed)` with excerpt. |
| **Invariant** | The requirement, contract, or system property violated. | Clear statement of expectation (e.g., "Untrusted DOM values must be escaped before interpolation"). |
| **Impact** | Concrete failure consequence if left unaddressed. | What breaks in production, concurrency, or maintenance (e.g., "Stored XSS when name contains `