14 KiB
name, description
| name | description |
|---|---|
| larv-review | Ship a work chunk through review to a merged PR; 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 §11. 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. A fix made in any pass is a change the passes before it in this order never saw; a pass it re-enters says so.
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 ~/.claude/CLAUDE.md → "Git, commits, and PRs"; 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.
Words: ~/.claude/CLAUDE.md → "Vocabulary". Severities, verdicts, rounds, the round cap and declining, for every reviewer: ~/.claude/principles/review-findings.md.
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 (§8), merge (§10). Say so in the summary. Prose an outside reader lands on — public API docs, README, CHANGELOG, error or deprecation text — still takes §6's product-owner pass.
- 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.
- Premises first, per
~/.claude/CLAUDE.md→ "Working loop". Missing, or too vague to settle a decision → this chunk cannot be judged: stop, say so, and write them with the user as the chunk instead. That chunk's whole review is the human's approval, since a reviewer's findings on it could only be declined by citing the goals it exists to write; a later change to a goal takes the full review. Only what that section lets through without them reaches review.
1. Ship the branch (idempotent — skip whatever already exists)
Follow ~/.claude/CLAUDE.md → "Git, commits, and PRs".
- 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. Trigger: is the architecture pass warranted?
It reviews the application as a whole — heavy by design, and its own description says it is not a per-PR reviewer. 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. A fix made in any pass after §3 takes this trigger again on what it changed.
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 scoped to verifying its own findings, under the round cap.
- APPROVE / APPROVE WITH NITS → proceed; nits per the findings document's rounds.
Comprehension floor (with every architecture pass)
Invoke the comprehension-panel skill's scoring run (~/.claude/skills/comprehension-panel/SKILL.md → "The scoring run") over the whole project, not the diff. With any dimension or the overall below 7.0 the chunk does not merge: fix the places the seats name under the capping dimension, or take the user's explicit decision to ship under the floor, record it in docs/decisions.md with the scores, and file the places in todo.md. At the floor or above, the scores are still a ratchet — a later chunk may not lower any — and the four dimension scores and the overall go in the summary so the next run can see the direction of travel.
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. A fix made in any pass after it re-enters it only where it opens a new untrusted-input boundary or touches authn/authz, secrets or crypto.
- 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.
- A MEDIUM or LOW outside this chunk's scope → a
todo.mditem per~/.claude/CLAUDE.md→ "Todo items"; filing it is not fixing it.
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 trigger: 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 ~/.claude/CLAUDE.md → "Working with the codebase". 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
A fix sent back here opens its loop with a round prompted with the fix's scope and why it changed.
- Launch stability-reviewer, prompted per the findings document's rounds.
- Fix every 🔴 and every 🟡, or decline it, along its Fix guidance (delete > simplify > modify > add). Keep test changes and implementation changes separately reviewable.
- Commit and push each round's fixes so CI feedback accumulates while the loop runs.
- Carry any 🔀 product-owner escalation into §6.
6. Product-owner loop (when escalated to, or an external surface changed)
A 🔀 product-owner-reviewer escalation from any pass runs it, and so does a change to an external surface, a fix from any pass after it included. Neither → skip it, say so in the summary.
- 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 — prompted per the findings document's rounds.
- Apply what it asks for, under the findings document's Declining section. 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.
- Commit and push each round; it exits and caps per the findings document.
- Approved having changed nothing → you are done here; there is nothing to re-verify.
- Otherwise re-enter §5 over what this loop changed.
7. Prose pass (every chunk)
Two scopes:
- What the diff touched — every markdown line and every comment it adds or changes. Judge these yourself; they are fresh in your hands.
- 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.
The bar is ~/.claude/CLAUDE.md → "Comments and documentation"; per paragraph the default verdict is delete.
- Delete — a type, a test name, a spec or the code already says it. In this chunk.
- Move — a decision goes to
docs/decisions.mdwith 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 pointer standing where a definition belongs ("A pointer is not a definition", same section). 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.mditem naming the section and what the hunt costs.
When §2's trigger 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. 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) re-enters §5.
- 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.
9. External auto-reviewer (when the repo has one)
Marking the PR ready is what summons CodeRabbit and its kind, so this follows §8.
- Detect one from the repo — a reviewer's config file (
.coderabbit.yamland 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 findings document like every reviewer above — no more authority, and no less. Fix → commit → push; a fix that changes behavior re-enters §5, then §8. Then wait up to 5 minutes for its re-review of the new commit.
10. Goal alignment, then merge
- Read the finished PR against the README goals: does anything in it work against one? Misaligned → do not merge; ask the human, stating the conflict.
- The item ships into a release later than one that is finished and uncut → leave the PR ready and unmerged; tell the human that release is ready to cut.
- 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 itsAGENTS.md→ leave the PR ready and unmerged, and say which line withheld it. - Merged → tick the item off
todo.mdper~/.claude/CLAUDE.md→ "Working loop". Ticking it off emptied its release → the summary says the release is ready to cut. - Stop. The next chunk gets a fresh session. A release is the human's — prepare it, never cut it.
11. Wrap up
Summarize: PR URL and final state, every reviewer's verdict, 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.