Track authored Claude Code configuration

This commit is contained in:
2026-09-20 18:00:44 +02:00
commit 990a7ac9b9
21 changed files with 1657 additions and 0 deletions
+241
View File
@@ -0,0 +1,241 @@
---
name: comprehension-panel
description: Judge how hard a project is to understand by running a panel of nine independent simulated readers — juniors, mid-levels, seniors and architects taking a helicopter view — each reporting what defeated them, then comparing their consensus against whatever metric, guardrail or claim is being weighed. Use when asked to evaluate readability, maintainability or "is this code hard to understand", when choosing a complexity or size threshold, when a metric-driven refactor is proposed, or when the user asks for a comprehension panel, a reader panel or architect review of a whole project.
---
# comprehension-panel — what readers find hard, versus what a metric says
A metric ranks functions; readers rank understanding. The panel exists because those rankings
diverge, and when they do the readers win — a number that flags code seven readers call clear,
and misses the one they all call hardest, is measuring something else.
Nine seats, one panel, launched together. Seven read at the level of a single unit and answer
"which places defeated me"; two read at the level of the whole and answer "can I hold this
project's shape in my head". Every seat scores on the same scale, and every seat's report counts —
the two halves fail independently, and a project can pass one and fail the other.
## What makes the result trustworthy
Hold all of these or the comparison proves nothing.
- **One variable.** Every panelist runs the same model with the same brief and the same report
shape. Only the persona differs. A cheaper model for the juniors turns persona into a confound.
- **One depth.** Pick a reading depth below, name it in every brief, and give every seat the same
one. Seats that read different amounts produce numbers nothing can compare.
- **Blind.** Deny the project's own conclusions — `todo.md`, a decision log, a plan, prior review
output — and never show a panelist the metric under test. An anchored reader is a wasted one.
- **Check what the harness pre-loads, before launching.** `CLAUDE.md` may be nothing but
`@AGENTS.md`, and an `@file` import lands in a subagent's context ahead of its first tool call.
That is harmless for a reader who was going to read the charter anyway, and fatal to the
architects' README-and-tree-only step. Read the project's `CLAUDE.md` and resolve its imports
first; name every pre-loaded file in the architects' brief and require them to mark each map
entry that file could have fed, so the contaminated entries are discountable instead of
invisible.
- **Isolated and read-only.** Launch each with `isolation: "worktree"`, and forbid edits, test
runs and builds. Entering a worktree yourself mid-run strands a non-isolated subagent.
- **Parallel.** Launch them in one message. Nine agents reading a few thousand lines is minutes,
not hours; a full sweep is not, which is what the depths below are for.
- **Forced choices.** Each panelist ranks, names one single worst thing, and lists what they
expected to be hard and found easy. The negative control is where the sharpest evidence comes
from: a unit the metric flags that readers volunteer as clear.
- **Addressable findings.** Every place is named as the smallest unit the language addresses —
function, method, closure, component — with `path/to/file:line`. Never a bare file.
## How much they read
**1. The whole project.** Every non-test source file, plus the templates, migrations, schema and
configuration that carry behaviour. The default wherever the project still fits one sitting.
**2. Sampled, where it does not fit.** Not fitting is itself the first finding, recorded before any
seat opens a file: nobody working here reads the project whole either, so the layout is the only
map anyone gets, and what Navigation and Shape report decides the number. Size adds no penalty of
its own; it removes the excuse for a structure that has to be learned from a person. A sample still
indicates soundly — the README and charter, the entry points, and from every top-level area a
handful of units with the files around them.
- Draw by rule, not by taste, so the panel can be accused neither of touring the worst parts nor of
avoiding them: per area the largest unit, the most-churned by `git log`, and one taken blind.
- Fix the sample before launching and hand it to every seat verbatim.
- Every report says it sampled and lists what it opened. What the seats found is real; a place
nobody opened is not evidence that it is clear.
**3. Full sweep, on request.** Every line, tests included, in as many passes as it takes. Slow and
expensive, and the only depth that can say a place is clear because somebody read it. Reserve it
for a deliberate in-depth audit — a number about to be published, a handover being priced, a
sampled score under dispute. A review gate never runs it: gates run depth 1 or 2.
## The seats
Nine by default. Add a seat where it would see something these cannot — a UI, an operator-facing
CLI, a schema other teams write against.
| Seat | Brief the background as |
| --- | --- |
| Junior A | ~2 years in the project's mainstream language, first codebase of this kind; no domain exposure at all |
| Junior B | ~18 months, arriving from a different language; the project's type discipline, or its absence, is new to them; the domain is a half-remembered course |
| Mid A | ~5 years, fluent in the idioms, no experience of the problem domain and has never read its specification |
| Mid B | ~5 years, has used systems of this kind from the outside — as a consumer, an API client or an operator — and never seen the internals |
| Senior, domain native | ~12 years including having built this kind of thing; knows the reference algorithm, standard or business rules; reading to judge whether they could take over maintaining it |
| Senior, maintainability | ~12 years in a neighbouring discipline, reviews others' code daily, no experience of this domain; cares whether the next person can change it safely |
| Senior, extender | ~12 years, new to the project, handed its actual next milestone; reading what exists as the template to mirror and partly reuse |
| Architect, greenfield | ~15 years laying systems out from scratch; asks what they would build today for these requirements, and what this layout costs everyone who comes after |
| Architect, inherited | ~15 years taking over other people's systems; has been paged at 3am about something like this, and asks where it rots first |
The domain-native seat and the extender seat earn their places for opposite reasons: the first
tells you what an expert still pays for, the second is the only one reading with a task in hand.
Shared brief: read the README, the agent/contributor charter, the spec where there is one, and
whatever the chosen depth prescribes; no plan documents; no running anything; no edits. May open a
test or fixture when the code does not answer a question, and must say when they did.
Tell the seniors and the architects that understanding most of it is expected, and that the value
of their report is precision about where the reading cost was highest even where they got there in
the end. Tell everyone not to manufacture confusion.
A **findings run** uses all nine. A **scoring run** needs four — one junior, one mid, the
maintainability senior and the inherited architect, whose 3am question is the scoring scenario
itself — plus the calibration seat when more than one project is in play. Use the same four for
every project, or the scores are not comparable.
## What the seven report
Identical shape for all seven:
1. Ranked 5–8 hardest places, hardest first. Each gives `path:line` and the unit's name, one to
three sentences on what *specifically* defeated them — branches to hold at once, length, a
misleading name, an algorithm they had no context for, state mutated out of sight, a rule they
had to hunt for elsewhere — and whether anything resolved it (a comment, the charter, the spec,
a test) or it stayed opaque.
2. The single unit they would least want to be asked to modify, and why.
3. What they expected to be hard and found easy.
4. Prose debt: which documentation they needed, what it cost to find, and — separately — which
prose they read that told them nothing the code was not already saying. Both halves matter.
Panels reliably find that the answers exist and are unfindable, which is a different defect
from prose that should not exist at all, and the fixes are opposite: index the first, delete
the second.
5. The four dimension scores, the overall, and one sentence per number naming the anchor it sits
against and the concrete thing that holds it there. A score with no named cause is discarded.
Vary only the extender's ranking: *hardest to understand well enough to mirror, extend or reuse*,
and the unit they would least want to have to mirror.
## What the two architects report
The standard is *Code That Fits in Your Head*: at the top level a bounded number of areas, few
enough to hold at once; pick one, descend, find again a bounded number. Guidelines, not rules —
an architect who says a break is justified is giving you a finding too.
The method is what makes these seats work, so enforce the order:
1. **README and the file tree only.** No source file yet. Write down the top-level areas they
believe exist and what each does, what they expect inside each source directory, anything whose
purpose the name does not give, and anything the README led them to expect and does not hold.
That map goes in the report verbatim, before they learn how right it was.
2. **Descend breadth-first**, one level at a time, forming an expectation before opening each
directory, recording how many distinct things each level demanded.
3. **Read enough implementation to check the map** — not to understand every unit. Under a sampled
depth that is the sample; under a full sweep it is still "enough to check the map", because
these two seats judge shape.
Report: the verbatim map; where it was wrong and how costly each correction was; level-by-level
fan-out with the worst level named; names that mislead, concepts with two names, one name over two
concepts, areas they could not name; what they would restructure, ranked, with files and costs;
what the structure gets right. Give the greenfield seat a week-one question (could a new senior
ship in a week, what would they break first, would the structure have warned them) and the
inherited seat a 3am question (a real bug shape from this project — walking in cold, how long to
the right file) plus where it rots first and where the next two features would land. Both close
with the same four dimensions and overall as the other seven.
## The score
Every panelist ends with a comprehension score, 1 to 10, for the project as a whole. The scale is
absolute, so two panels run on two projects produce comparable numbers — a panelist scoring against
their own expectations of *this* codebase has produced a number that means nothing next to
another. Put these anchors in every brief, verbatim.
- **1 — Spaghetti.** No boundary holds. Finding where a behaviour lives is grep archaeology;
changing it safely is guesswork, and the reliable technique is to change it and see what breaks.
No map the reader builds survives contact with the code.
- **3 — Navigable only by the initiated.** The map lives in people's heads, not in the layout. A
newcomer needs a guide and a wrong guess is normal. Weeks to a first safe change.
- **5 — Honest middle.** Legible where somebody cared, absent where nobody did. A competent reader
takes an area in a day or two with rereads and some wrong turns. Some names lie; some state is
shared and unowned.
- **7 — Predictable.** The layout answers "where does this live" without asking a human. The hard
parts are hard because the problem is hard, and they are few, localized and marked. A cold
senior is productive in a week and knows which corners to fear.
- **9 — Near duress-proof.** Symptom to file to unit with no detour. Each piece states or
enforces its own invariants; nothing needs a second document open beside it. What remains is the
problem's own difficulty.
- **10 — Duress-proof.** Hungover, stressed, production down, gun to your head: you land in the
right place first try, and the code tells you what it guarantees before you have finished
reading it. Reserve it; few real codebases earn it.
Even numbers mean between the neighbours. Alongside the overall, each panelist scores four
dimensions on the same scale:
- **Navigation** — from a symptom to the right file and unit, cold.
- **Locality** — understanding and changing one piece without holding the rest: hidden state,
order dependence, action at a distance.
- **Shape** — bounded fan-out level by level, and names that tell the truth.
- **Self-sufficiency** — whether the code stands without a document open beside it.
**The worst dimension caps the overall**: the overall may not exceed the lowest dimension plus
one. A single catastrophic dimension is not averaged away, because that is the one that bites at
3am.
Score the reading experience, not the ambition — a hard problem earns no bonus, or the gate
becomes unfalsifiable ("our domain is hard"). Panelists note the problem's intrinsic difficulty
separately: it changes what floor is fair to demand, never the score.
**Comparing projects needs a calibration seat.** Independent panels drift, however absolute the
anchors. When scoring more than one project, run one extra panelist who reads *all* of them —
shallowly, because its job is ranking and gap size, not depth — and reports the order and how far
apart they sit. Where it disagrees with the per-project panels' ordering, its ordering wins and the
absolute numbers shift to match, because a rank across three projects read by one reader is more
reliable than three absolutes read by different ones.
**But weight the calibrator's ordering below the deep panels, and expect its error to grow with
project size.** Across two runs it missed its panels by up to 1.6 points in both directions: it
over-scored the best-laid-out project each time (a shallow read sees Navigation and Shape, which
good layout advertises, and never reaches the Locality cost), and under-scored the largest, because
spending equal time on unequal codebases means the biggest one gets the shallowest read. Use the
calibrator to align two runs onto one scale; use the four-seat panels for each project's number.
Where they disagree, say so and give both.
**Tying two runs together: give the calibrator the anchor project, never the anchor's score.** A
second run needs one project the first run already scored, read by the new calibrator so the two
scales can be aligned. Hand it that project as an ordinary target and compute the offset yourself
by comparing its number to the old one. Telling it "the previous run scored this 7.5" destroys the
measurement — it is a stronger contaminant than reading order, tool access or persona, and the one
calibrator who was told it said so unprompted and could not undo it.
## The comparison
Aggregate first, then compare. Never present a single reader as the finding.
- Consensus table: each place, how many readers named it and at what ranks, and the metric's
numbers for it beside them.
- The metric's own worst, and what the panel said about each — including silence, which is a
result.
- The forced-choice tally for "least want to modify".
- Look hardest for **contradiction**: something the metric ranks worst that readers call clear is
worth more than any agreement. Look also for a **pair the metric cannot separate** — two units
with identical numbers, one unanimously hard and one named clearest, ends the argument on its
own.
- Name the hardness drivers the readers used in their own words. Expect them to be things no
per-unit metric sees: state shared across unit boundaries, order dependence between steps,
correctness whose proof lives in another file or in what a downstream reader does to this unit's
output, a rule recorded only in an unindexed wall of prose, and a silent failure mode. That last
one is usually why a small unit outranks a large one.
State the honest limit: a panel measures what is hard *now*, while a gate ratchets what gets
written *next*. Their verdict refutes using a metric to rank existing code or to justify breaking
it apart; it does not by itself prove a ceiling worthless against future drift.
## After
Panelists also surface real defects in passing — dead values, unstated invariants, doc gaps.
Verify each in the code yourself before reporting it; a panelist's incidental claim is a lead, not
a finding. Everything that survives lands where the project's own working loop puts findings — a
plan item under a release, a decision entry — never in chat alone.
+149
View File
@@ -0,0 +1,149 @@
---
name: larv-review
description: 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. 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.