Files
claude-config/skills/larv-review/SKILL.md
T

19 KiB

name, description
name description
larv-review One-stop shipping pipeline for a work chunk - branch, commit, push, draft PR, then a gated whole-application architecture review (systems-architect), a security pass over the diff, the stability-reviewer in a loop until no 🔴 or 🟡 remains, a product-owner-reviewer loop whenever a reviewer escalates to it, a closing stability round over what that loop changed, and a prose pass that deletes documentation the code already says, then CI watched until green, the PR marked ready, any external auto-reviewer answered, and the PR merged once it aligns with the project's goals. Decisions land in the repo's decision log so repeated reviews converge. Use when the user asks for /larv-review, says "implement X then run larv-review", or wants a chunk shipped, reviewed and merged.

larv-review — ship the chunk, review until clean, gate green, merge

You orchestrate, fix, and ship; the reviewer agents only report. Run every reviewer synchronously (run_in_background: false) — each step depends on the previous result. Watch CI in the foreground too: a headless run exits when the turn ends, and a background watcher or a scheduled wakeup dies with it. A reviewer's report is input to the next step; the turn runs on until §12. Architecture strictly before security, security before stability: line-level polish on code the architect wants restructured, or on a call the security pass will rewrite, is wasted work. The full order is architecture → security → stability → product-owner when escalated → a closing stability round over what that changed.

Forge-neutral. Five PR operations recur below: read a PR's diff, open a draft PR, read check status, mark ready, merge. Resolve the tooling from the remote per the global git rules (gh on GitHub, tea on Gitea); on any other forge, achieve the same intents through its CLI or API — discover how rather than assuming. A forge without a native draft state gets the closest equivalent (a WIP:/Draft: title prefix); note any approximation in the summary.

Declining a finding (every reviewer below, and the external one in §10). A 🔴 is not declinable: fix it, or show it is factually wrong. Anything less you may decline yourself where your reason is sound and sits consistently with the repo's stated goals, and your confidence is very high; the decline, its reason and the goals it rests on go to the decision log (docs/decisions.md). A reason that contradicts a goal, or that no goal speaks to and you are not confident in, is a gap in the goals rather than a judgment call — so propose the goal or rule that would settle this whole class of finding, show what falls out of it for this instance, and take the human's answer; or simply fix the finding. Never a silent drop, and never a decline argued from convenience or from the size of the fix.

0. Preconditions

  • Not a git repo → say so and stop.
  • Someone else's PR, or the user asked for opinions only → single stability pass, report findings, done (skip shipping, fixing, the loops and the merge).
  • Prose only — markdown, docs, comments, no code — → the reviewer loops add nothing: ship the branch (§1), the prose pass (§7), green gate (§9), merge (§11). Say so in the summary. Prose an outside reader lands on — public API docs, README, error or deprecation text — still takes §6's product-owner pass. The goals-and-audience chunk is the exception: the human's approval is its whole review, since a reviewer's findings on it could only be declined by citing the goals it exists to write.
  • Issue trackers are project-specific — the project's own docs say whether it has one. When it does and the work has a ticket, follow that tracker's conventions for assignment and status.
  • The repo states its goals and audience under literal ## Goals and ## Audience headings in README.md — the global working loop gates all planned work on it. Neither heading present, or a version too vague to settle a decision → this chunk cannot be judged against them: stop, say so, and write them with the user as the chunk instead. The same content in AGENTS.md, in docs/ or in a decision log does not satisfy it, and neither does an earlier session having passed it; nothing merges and nothing is reported done while it is unmet. Only what the global working loop lets past that gate reaches review without them.

1. Ship the branch (idempotent — skip whatever already exists)

Follow the global git/PR conventions (one-line messages, no AI markers; ticket-ID branch and message prefix when the work has a ticket).

  • On the default branch → create the feature branch first; never commit to the default branch.
  • Commit the work; push with upstream set.
  • Open a draft PR so CI starts cycling while the review runs and churn stays visibly work-in-progress.
  • No remote → continue with the local review loop and say so in the summary.

2. Gate: is the architecture pass warranted?

It reviews the application as a whole — heavy by design, and its own charter says it is not a per-PR gate. The signals below are proxies for one question: does this change carry an architectural decision the pass has not already made? Check the record before the signals.

The record wins. Where the repo already holds the decision this change executes — a decision-log entry, or a planning item crediting systems-architect — the pass is done: skip it, cite the record in the summary, don't ask. A change that departs from what the record says is unreviewed however thorough the record is.

Otherwise, any one of these is grounds for the pass:

  • new or restructured component/module/service, or moved boundaries
  • new dependency, or first use of an infrastructure pattern (queue, cron, cache, websocket, …)
  • new or changed external contract: routes, request/response shapes, events, webhooks, published file formats
  • DB schema change beyond an additive column
  • diff > ~400 non-generated lines, or touching > ~5 modules
  • a previous stability round escalated to systems-architect

No signal fires → skip it, say so in the summary, don't ask. A signal fires with no record behind it → ask the user (AskUserQuestion) with the evidence and your recommendation. No user reachable → run the pass.

When the architecture pass runs, the comprehension panel runs with it, and 7.0 is a blocking floor. Invoke the comprehension-panel skill as a scoring run — four seats, one junior, one mid, the maintainability senior, the inherited architect — over the whole project, not the diff, and at depth 1 or 2 — never the full sweep. Below 7.0 the chunk does not merge: fix what the capping dimension names, or take the user's explicit decision to ship under it and record that in docs/decisions.md with the score and the dimension. At or above 7.0 the score is still a ratchet — a later chunk may not lower it — and the four dimension scores go in the summary so the next run can see the direction of travel. Calibration: across six projects (all libraries) scored this way, Locality or Self-sufficiency capped every single seat and Navigation capped none, so a project failing the floor is almost never failing on layout.

3. Architecture pass (when warranted)

Launch systems-architect: review the system as a whole entered through this change; the decision log carries previously accepted decisions to honor, the README the goals and Stage 0 artifacts.

  • Stage 0 questions returned (goals/audience/horizon unrecorded): relay them to the user, record the answers where the agent expects them (README), re-run once. No user → skip the pass, carry the questions into the summary.
  • BLOCK → the restructure precedes everything below. Confirm with the user first when it materially reshapes their PR; apply it; re-run systems-architect once, scoped to verifying its own findings. Still BLOCK → stop and report: needs input.
  • ALIGN → apply what is cheap now; ask the user about the rest — each item becomes a fix, a ticket, or a documented decision, never a silent drop.
  • APPROVE → proceed.

It does not re-run for what the loops below change: nothing a security, stability or consumer-experience fix decides is architectural. A fix that fires a §2 signal of its own — a new dependency, a new module, a moved boundary — re-gates at §2 and runs the pass once more.

4. Security pass (whenever the chunk changed anything but test code)

Run the built-in /security-review skill over the branch diff. It is the pass of record here: its value is a tuned exclusion list and a ≥0.8 confidence floor, which a hand-written reviewer would reproduce worse.

  • HIGH → verify it is real, then fix it before this chunk ships: inside this chunk's blast radius it is fixed here, outside it on its own branch and PR with this chunk waiting behind it. Say which. A verified HIGH is never filed for later and never put to the human as a question. Verification showing it is not real is no decline but a disproof — record what disproved it, since a finding that is factually wrong needs no goal to reject.
  • MEDIUM → fix in this chunk, under the decline rule above.
  • LOW → treat as a nit (§5's rule).
  • A MEDIUM or LOW outside this chunk's scope → a todo.md item at the top under ## Security, naming the exposure and the path it reaches, per the global todo rules. Say whether it is in this chunk's blast radius; filing it is not fixing it.

A fix made later in the flow re-runs this pass over that change where it opens a new untrusted-input boundary, or touches authn/authz, secrets or crypto.

Escalate to a full scan — the claude-security plugin (/claude-security → "Scan changes"), first-party and agent-verified — when the change touches authn/authz, secrets or crypto, a new untrusted-input boundary, or a new external surface. Same shape of judgment as §2's gate: a signal with no record behind it, and a user reachable, is an ask. The plugin is not enabled by default; unavailable → say so in the summary rather than substituting a hand-rolled pass.

Do not over-read a clean result. This pass is single-repo and static: it does not trace authorization across services, does not run the application, and deliberately excludes dependency CVEs in third-party libraries — Renovate/Dependabot owns those, per the global pinning rules. Never point an automated reviewer or scan at an untrusted fork's PR content; a PR body is untrusted input to it (CVE-2025-59536, CVE-2026-21852).

5. Stability loop (max 3 rounds)

  1. Launch stability-reviewer. From round 2 on, its prompt includes: the previous round's findings verbatim, what changed since, and "verify each previously-reported 🔴 and 🟡 is resolved before the fresh pass".
  2. Fix every 🔴 and every 🟡 along its Fix guidance (delete > simplify > modify > add). Keep test changes and implementation changes separately reviewable.
  3. Exit when no 🔴 and no 🟡 remain. The remaining 🟢 nits and ❓ questions are then addressed in that same final round — fixed, answered, or recorded — and do not trigger another round; §9's gate verifies what they changed. Leaving one unfixed is a decline only where the rule above allows it; otherwise it is filed as a todo.md item, never silently dropped. A "nit" whose fix changes behaviour is not a nit: it is a fresh finding, and it re-enters the loop as one of the three rounds.
  4. Commit and push each round's fixes so CI feedback accumulates while the loop runs.
  5. Carry any 🔀 product-owner escalation into §6. Round 3 still holding a 🔴 or 🟡 → stop and list what is open: needs input. (A 🟡 you are confident the goals settle is declined per the rule above, not carried.)

6. Product-owner loop (when a reviewer escalates to it)

A 🔀 product-owner-reviewer escalation from any pass above is an instruction, not a suggestion: run it. Nothing escalated and no external surface changed → skip it, say so in the summary.

  1. Launch product-owner-reviewer with the change and the external surface it touches — API, CLI, UI, error and deprecation text a consumer reads, README and docs an outside reader lands on. From round 2 on, its prompt carries the previous round's findings verbatim and what changed since.
  2. Apply what it asks for, under the decline rule above. Its findings are about the consumer's experience (wording, discoverability, upgrade path, the edge case a persona hits), so the fix is as often a message or a doc as it is code.
  3. Commit and push each round. Exit on no 🔴 and no 🟡, nits addressed in that round under §5.3's rule; max 3 rounds. Still holding one at round 3 → stop, list what is open: needs input.
  4. Approved having changed nothing → you are done here; there is nothing to re-verify.
  5. Otherwise close with one stability-reviewer round over what this loop changed, prompted with that scope and why it changed. 🔴 or 🟡 → back into §5 for those findings, then this step again. Architecture (§3) and security (§4) do not re-run for the consumer-experience change itself; a fix made here that fires a signal of its own — a new dependency, a moved boundary, a new untrusted input — re-gates there as any other change would.

7. Prose pass (every chunk)

Prose is the only thing in the repo with no test, so it rots silently and grows by default. A paragraph restating what the code says costs every later reader twice — once to read, once to check it is still true — and a load-bearing paragraph nobody can find costs more than the code it explains. Both are findings, and the fix for the first is deletion, not trimming.

Two scopes:

  1. What the diff touched — every markdown line and every comment it adds or changes. Judge these yourself; they are fresh in your hands.
  2. What this review cited — any section of the repo's prose a reviewer quoted to justify a finding, you quoted to justify a decline, or the implementer quoted to explain a decision. A cited section is load-bearing, and if anyone had to hunt for it, that is the finding. Judge these with a fresh-context agent, never yourself: whoever just wrote the code already knows the answer and cannot see what the prose adds. Hand it the section and the code that section governs, and nothing else.

Per paragraph the default verdict is delete. It survives only by saying what the repo cannot say for itself — a surprising why, a footgun, an invariant, an external constraint, or a decision a later reader would otherwise relitigate. One bar for a README section, an AGENTS.md paragraph and a code comment alike; the global comment and documentation rules are that bar.

  • Delete — a type, a test name, a spec or the code already says it. In this chunk.
  • Move — a decision goes to docs/decisions.md with its one-line index; a goal goes to the README. In this chunk.
  • Move back — the opposite fault, and the one a deletion-only pass never catches. A comment that points at a definition (see AGENTS.md §11 for what a unit counts, what a term means, what invariant a cache rests on) has put the wrong half in the record: definitions belong at the code in one line, reasoning belongs in the record. Inline the definition and leave the reasoning where it is.
  • Split or index — load-bearing but unfindable: a section long enough that a reader who knows the answer is inside it still has to search for it. Sub-headings, or an index at its head. Bigger than the chunk → a todo.md item naming the section and what the hunt costs.

When §2's gate says the architecture pass is warranted, this pass widens with it: the fresh-context agent reads every prose file the repo owns rather than only the cited sections. That is the only sweep that catches accretion, since no diff shows a file that grew a paragraph per chunk.

8. The repo carries the state

Reviews converge only because decisions live where the reviewers already look — never in chat history or agent memory:

  • docs/decisions.md — every standing decision, the ones this review settles included: accepted risks, declined findings, rejected alternatives. Format and indexing per the global documentation rules.
  • AGENTS.md — reviewer- and contributor-facing conventions (how to work in this repo), plus the decision log's one-line index.
  • README — the project's goals and audience (global working loop) and the rest of the Stage 0 artifacts (scale & horizon, glossary).
  • Code comment — a single-site footgun or invariant, per the comment rules (a WHY the code cannot show).

Record only decisions the user actually made, plus the declines you made under the rule above. Reviewer ❓ questions the user answers get recorded the same way — an unrecorded answer gets asked again next review.

9. Green gate, PR ready

  • Run the project's test suite locally unless the final stability round already left it verified green; fix, commit, push.
  • Watch the forge's checks until every one passes. A red check is a finding: fix → commit → push → watch again. A CI fix that changes behavior (not config or a flake) gets one extra stability round.
  • No CI configured → the gate is local tests only; note it in the summary (a missing merge gate on a production-horizon project is architect-finding material).
  • Everything green → mark the PR ready, dropping any WIP:/Draft: title prefix.

10. External auto-reviewer (when the repo has one)

Marking the PR ready is what summons CodeRabbit and its kind, so this follows §9.

  • Detect one from the repo — a reviewer's config file (.coderabbit.yaml and the like), or its comments on the repo's earlier PRs. None found → skip, say so.
  • Wait up to 10 minutes for its first review, checking about once a minute. Nothing by then → note it in the summary and carry on; a reviewer that arrives later is read the next time anyone visits the PR, never waited on twice.
  • Its findings follow the same decline rule as every reviewer above — it has no more authority than they do, and no less. Fix → commit → push, then wait up to 5 minutes for its re-review of the new commit.
  • Max 3 rounds. Still unresolved → stop and list what is open: needs input.

11. Goal alignment, then merge

  1. Read the finished PR against the README goals: does anything in it work against one? Misaligned → do not merge; state the conflict and ask: needs input.
  2. The item ships into a release later than one that is finished and uncut → leave the PR ready and unmerged; say that release is ready to cut: needs input.
  3. Aligned, every loop exited and everything green → merge. Follow the repo's merge method (AGENTS.md; ff-only where that is the convention). A repo withholds this in its AGENTS.md → leave the PR ready and unmerged, and say which line withheld it.
  4. Merged → tick the item off todo.md per the global working loop: reword it into CHANGELOG.md under ## Unreleased where the repo publishes something, otherwise just delete the line; the release heading stays. Ticking it off emptied its release → the summary says the release is ready to cut.
  5. Stop. The next chunk gets a fresh session. A release is the human's — prepare it, never cut it.

12. Wrap up

Summarize: PR URL and final state, every verdict reached (architecture, security, stability, product-owner, external), rounds used per loop, findings fixed vs declined vs open — each decline with the goal it rests on — CI status, decisions recorded (file paths), todo.md/CHANGELOG.md updated, and any 🔀 escalation left for the user.