Implement-Review
On /vet or $implement-review, run the review loop for the requested target. A subagent of the coordinator, or the coordinator's own checks, cannot fill a reviewer slot. An Auto-terminal round reports the reviewer, its review file, and the Phase 2 health-check result, or says that intake is pending or failed.
Overview
The coordinator sends the changes to one or more reviewers, categorizes the feedback, revises, and iterates. Codex is the default reviewer, through terminal relay (manual copy-paste, default on every platform) or Auto-terminal (opt-in subprocess dispatch), which also drives the Agy, Claude, and Grok backends. A reviewer driven by hand only needs the Review-<AgentName>.md save contract in Phase 1c. Reviewer defaults and coordinator rewrites follow Path selection.
Reference Index
Open a reference only when its condition holds, because reading one never by itself authorizes an action this file withholds: reading failover-and-recovery.md does not authorize failover, a stopped harness or a watcher REAP-UNKNOWN is resolved through await-review.py first, a checkpoint keeps its documented behavior while death is unproven, and Grok keeps its no-failover exception.
| File |
Read when |
| references/review-lenses.md |
every round, to pick the lens for item 4 of section 1b |
| references/plan-review.md |
the user asks for a plan review, or a plan-first signal holds |
| references/codex-backend.md |
before raising CODEX_DISPATCH_REASONING or the timeout, or overriding CODEX_DISPATCH_MODEL, CODEX_DISPATCH_SANDBOX, or CODEX_DISPATCH_ISOLATE_MCP; a Codex probe fails, stderr shows a MODEL-* line, or a fresh Codex review or FAIL check-10 shows it could not run git diff |
| references/agy-backend.md |
before overriding ANTIGRAVITY_DISPATCH_MODEL, ANTIGRAVITY_DISPATCH_EFFORT, or ANTIGRAVITY_PREFLIGHT, or running --print-model; an Agy dispatch exits 2, 70, or 124, stderr shows a MODEL-* line, or Check 8's breakdown= includes recovered: |
| references/claude-backend.md |
before overriding CLAUDE_DISPATCH_BARE or the Claude model or effort; dispatch-claude fails preflight or exits nonzero, stderr shows a MODEL-* line, the dispatcher handle is lost, or the user asks for scheduled heartbeat monitoring |
| references/grok-backend.md |
Grok reviews (/vet grok, /vet all, or a default reviewer that includes Grok), before overriding a GROK_DISPATCH_*, GROK_BIN, or GROK_HOME setting, or when stderr shows a MODEL-* line or dispatch-grok.py exits 70 |
| references/failover-and-recovery.md |
a confirmed failure under Phase 1c, a missing-backend probe, or STREAM-DEAD, TIMEOUT, REAP-UNKNOWN, or a harness-stopped notice |
| references/health-check.md |
health-check prints any FAIL, or a WARN marker the coordinator does not recognize, or a Phase 2.5 claim needs a method |
Round checklist
Two standing rules come first, then the steps of a round in order. Each step states its decision once and links the section with its procedure.
A. Claude slot when Codex coordinates. This rule covers the Claude slot only when Codex coordinates; other pairs keep their usual dispatch, waiting, and failover, and its verdict list serves every await-review.py call (steps 6 and 8). Start dispatch-claude on a resumable exec tool and keep its handle and STATE-DIR. Claude's text can stay empty until its final response, so an empty tail, ALIVE, or a pre-publication STALL leaves the review pending, even after 15 minutes. Before the first wait, run <python> <scripts-dir>/await-review.py --state-dir <abs-path> --round <N> --review-file Review-Claude-Code.md --timeout 0 to establish the original deadline. The script has no shell wrapper, --review-file defaults to Review-Codex.md, <python> comes from <state-dir>/python-interpreter when the dispatcher wrote one (dispatch-claude writes none; then resolve one as section 1c says), and <scripts-dir> follows the lookup order of the other scripts. A custom --round-budget goes on that first call, before the deadline is stamped, and a new deadline is never stamped. Wait on the retained handle with empty-input write_stdin (a confirmed native completion notification also serves), requesting yield_time_ms=180000 when supported, capped by the remaining round budget and any smaller host limit, as a maximum window and not a fixed delay. After each completed wait, and before marking the slot complete, read the dispatcher exit status first: nonzero is a confirmed failure that wins over ALIVE and goes through 1c. Send to reviewer, and exit 0 still needs the report and step 7. While the dispatcher is pending, make one --timeout 0 check for publication or the deadline, then continue the same handle unless a documented checkpoint is reached. Resume an outer execution cell that yields early and never terminate it. If the handle is lost (references/claude-backend.md), run the step 6 command with the original deadline, and never wait only on a long-running resolver, which cannot see a dispatcher exit without publication. A tool yield or an expired wait is not failure. Do not conclude the review, drop the slot, or cancel the dispatcher or reviewer to end the turn (terminate: true, Ctrl-C, or kill): cancellation by the coordinator is not a backend failure and does not allow Single-source completion. Add no fixed sleep, log rereads, or repeated progress messages. Keep the original 60-minute deadline unless the user names another budget, arm no shorter harness kill timer, and keep the deadline across yields and scheduled wakeups. A user-requested stop pauses monitoring and does not make silence a failure. Publication alone is not proof the worker exited, and sequential mode waits on that proof (Path selection). A published report alone is not a conclusion: run step 7, reading a saved stall-warning as the Check 9 inspection, because a pre-publication silence warning is no permission to abandon the reviewer. Verdicts: DONE or REVIEW-READY means read the report and run step 7 (a REVIEW-READY review can still fail Checks 4 to 10); ALIVE means the round is unproven, so check again until a verdict or the deadline; STALL, TIMEOUT, and REAP-UNKNOWN stay checkpoints: STALL surfaces the silence warning and leaves the review pending (step 6), and TIMEOUT and REAP-UNKNOWN report the specific incomplete state and pause monitoring, never killing the reviewer or inventing a deadline; of these verdicts only DEAD and STREAM-DEAD confirm a failure, and they go through section 1c (references/failover-and-recovery.md). Stop monitoring the slot once its result reaches intake.
B. When the loop stops. Stop when the user says the review is done or approved, when the user decides to stop iterating, or when no new or still-open finding meets the Will fix bar. A reviewer that still blocks on a Deferred item does not hold the loop open; name those items in the summary. Then present a short summary: total rounds, key changes made, and unresolved points from the last review. Procedure: Phase 4: Conclude.
Prerequisites. Follow Prerequisites: the usage snapshot, staged changes and drift, and the Review-*.md exclusion. When the user asks for a plan review or a plan-first signal holds, start at When to plan-review first and read references/plan-review.md; only the staged-change and drift checks wait until the plan passes.
Pre-review checks. Run the content-type checks in Pre-Review Checks (optional) before building the request.
Channel and reviewers. Choose both by Path selection. Reasoning effort is a one-way ratchet: the registry's effort is the floor, not a target. The dispatching agent may raise one round above it with a higher CODEX_DISPATCH_REASONING when the change is hard enough to earn deeper reasoning (mirrored copies of one file, caching or state lifetime, or a risk of failing silently rather than loudly), and must never pass a lower one, so the worst case is a round not deepened, never one weakened. A higher tier lengthens wall-clock, so raise the dispatch timeout in the same step or the round is killed before it writes anything. When the budget buys one deeper round or two at the floor, prefer another round while the artifact is still changing (their relative yield is unmeasured, so treat this as a default), and raise the tier for the closing round or when the change is subtle enough that a first read is unlikely to reach it. See references/codex-backend.md before raising the tier or timeout.
Build the request. Assemble it from 1b. Build the review context, choosing the lens with references/review-lenses.md. A snapshot backend such as Agy reviews the exported index, so a gitignored PLAN-*.md, an untracked evidence note, or an untracked local override never reaches it, and its review would be silently ungrounded. Paste each such input into the request once under a --- SUPPLIED INPUT: <path> --- heading (plan-review step 3). The relay tells the reviewer to read those copies and never the original worktree, and supplied policy stays distinct from repository material, which the relay treats as untrusted.
Dispatch. Send the request by 1c. Send to reviewer, which sets up the failure definition and the failover queue at round start. Dispatchers take --expected-review-file Review-<Reviewer>.md, and health-check and await-review.py take --review-file Review-<Reviewer>.md, where <Reviewer> is the backend's own name: Codex, Claude-Code, Antigravity, or Grok.
Watch. Run one watcher per reviewer under 1d. Auto-watch (Terminal-relay and Auto-terminal channels). A STALL exit 3 is not a death: surface the silence warning and inspect or keep monitoring, and do not terminate the dispatch or set sticky downgrade from silence alone. Silence is never terminal: DEAD needs stream-death paired with a completed stream-reap-complete, and neither a quiet tail nor a review published under the wrong round marker is that evidence, so no shorter idle window may be promoted to a death certificate. If a reviewer dies without writing a marker, await-review.py keeps returning ALIVE and the round's own timeout ends it. A harness notice that the dispatch or watcher was stopped (killed in a background-task notification) concerns the harness's task wrapper, not the reviewer, which runs detached: do not conclude failure, redispatch, or set sticky downgrade from it, and a lost watcher is no corroboration. Resolve it in the foreground, since a background probe would be exposed to the same stop, with <python> <scripts-dir>/await-review.py --state-dir <abs-path> --round <N> --review-file Review-<Reviewer>.md (interpreter and <scripts-dir> as in rule A). It replaces the watcher for the rest of the round, and rule A gives its verdicts. A watcher REAP-UNKNOWN is resolved with the same command, and only the resolver's own checkpoint verdicts pause monitoring.
Health check. For Auto-terminal, run health-check --state-dir <abs-path> --round <N> --review-file Review-<Reviewer>.md with the STATE-DIR the dispatcher printed. Read its stdout, never only the exit code: a WARN exits 0, and it exits non-zero only for a FAIL of Checks 1 to 6 or 10 or missing or stale <state-dir>/pre-mtime or <state-dir>/timestamp. Any FAIL refuses that review and routes it through section 1c while the other slots stay active. A WARN from Check 7, 8, or 9 or a Substance heuristic is inspected and is not by itself a refusal: read what the check flags, record the reading in the round summary, and advance. Read for check-7 the lines= it names in Review-<Agent>.md; for check-8 the matching failure lines in <state-dir>/tail and, when present, <state-dir>/tail.stderr-tmp (where the Claude and Agy dispatchers write stderr), and when breakdown= includes recovered: also <state-dir>/backend-failure and whether the review ends cleanly, accepting that review's verdict only after checking it for placeholders, narration, and truncated findings; for check-9 <state-dir>/stall-warning and whether the review ended cleanly; for substance-1 the elapsed= and prompt= pair; for substance-2 the file:line anchors (0-anchors); for substance-3 the scope-challenge axes in missing-axes=. Ask the user only when an inspection finds a defect: a tool failure that blocked verification, a truncated or placeholder review, a missing verification, or WARN check-8 1 missing-dispatch-tail, which leaves dispatch health unconfirmed and is never read as Check 8 hit 0. When the review file is missing, Check 1 hard-fails while Checks 8 and 9 still run on the tail and stall warning. Every saved review needs one standalone Verification status: VERIFIED or UNVERIFIED line: VERIFIED only after at least one relevant verification command completed, with the exact commands and outcomes in Verification notes, and a run with none says UNVERIFIED with Commit verdict: UNVERIFIED and cannot issue PASS or BLOCK. Check 10 rejects an UNVERIFIED status or verdict, a PASS or BLOCK without VERIFIED, conflicting markers, and VERIFIED beside notes that report no execution, so a BLOCK with VERIFIED and concrete outcomes passes, and FAIL check-10 is a hard intake failure. Only after a fresh review says Codex could not run git diff (dispatch exit 0, fresh Review-Codex.md), retry Auto-terminal once with an embedded-diff prompt before the failure is routed through section 1c; with the default --sandbox danger-full-access this should never fire. Its findings are diff-scoped and prone to false positives on claims that depend on non-diff code, so a Medium finding from it needs step 10 before it is applied, and a retry that fails or records only blocked verification is a confirmed failure routed through section 1c. Procedure: Phase 2.0: Health check (Auto-terminal only); see references/health-check.md when its read condition holds.
Intake. For Terminal-relay, auto-watch DONE is enough to start intake. For Auto-terminal it is necessary but not sufficient: advance a reviewer with no inspection only when all eight hold: DONE <path> or a resolver REVIEW-READY <path> for a file with the current round marker; the dispatch subprocess exited 0, or the harness reported the task stopped and await-review.py then returned REVIEW-READY; Checks 1 to 6 pass; Check 10 passes; Check 7 hits 0 phrases; Check 8 hits 0 markers; Check 9 finds no stall-warning file; the Substance heuristics flag 0 signals. If the exit evidence, Checks 1 to 6, or Check 10 fails, refuse that review and route its dispatch through section 1c while the other slots continue. A hit on Check 7, 8, or 9 or a Substance heuristic is inspected under step 7 and is not by itself a refusal. TIMEOUT and REAP-UNKNOWN also stop at a human checkpoint; a STALL leaves the review pending under step 6 and never starts intake by itself. Consolidate only after every expected reviewer has a ready report or a confirmed failure (or the user says the reviewers are done), and keep a slot pending while its dispatch is active. Read only Review-*.md files that are current-round (first line <!-- Round N -->) and from an expected reviewer, and report every ignored file by filename and reason (stale-round, empty, unreadable, unexpected) before presenting findings. Flag a current-round unexpected file to the user before including or excluding it: mtime against the Phase 1c emission time is a noisy secondary signal only, a corroborating signal is required before including it, and it is never included or excluded silently. When the expected set is unknown, use mtime only to rank candidates and ask the user which current-round files belong to this review. For an expected reviewer whose file is missing, stale, or empty with no confirmed dispatch failure, send a follow-up prompt naming that reviewer, then ask the user to paste its feedback directly if the file is still missing, empty, or stale. Procedure: Phase 1d coordination (Auto-terminal-specific silent-intake rule); the partition is in Phase 2.1.
Classify and act. With two or more current-round sources, classify each new finding as Convergent (two or more reviewers raise substantially the same point), Convergent with differences (same problem, different severity, scope, or remedy: keep each reviewer's severity and fix, and use the highest severity until the user or implementer resolves it), Single-source (label the source), or Divergent (opposite positions: flag it, show both positions, and classify it like any other finding). If only one current-round source remains after step 8 although more were expected, label every finding Single-source; a single-reviewer round's one source is complete intake. Acknowledge each point, and check the reviewer's New and Previously raised split, making it yourself from the round history when the reviewer did not. Mark a new finding Will fix (clear, actionable, correct, and worth a revision), Decline (correct but not worth a revision, and never a risk to user data), Needs discussion (ambiguous or potentially wrong), or Disagree (explain why). Mark a previously raised finding Fixed (no action), Still open (the fix did not land or was incomplete: treat as Will fix unless the user overrides), Reopened (flag it to the user: it needs a decision and is never re-argued silently), or Deferred (no action unless the user reconsiders). Fold in the outcomes of step 10 and record the categorized list in the round summary. Do not ask before applying Will fix and Still open items (step 11 applies them after step 10), and record each Decline as Deferred with a one-line reason, also without asking. Ask the user only about Needs discussion, Disagree, and Reopened items, and act on them only after the answer, so a Divergent finding asks only when it lands in Needs discussion or Disagree. If no new or still-open finding meets the Will fix bar, skip step 11 and apply rule B. Procedure: Phase 2.1: Partition and classify (all channels).
Verify claims. After classifying and before applying, verify a finding that makes an objectively checkable factual claim (a citation, code behavior, a link, a count, a compile error) when it is High priority, or Medium and from the embedded-diff retry channel, or the user asks for verification of a Medium or Low one. Skip it when the reviewer's Verification notes already cover that claim with a method that resolves it (trust that check unless contradicting evidence appears), when the fix is trivially correct or the cheapest verification takes longer than the user can wait, and for stylistic, opinion-based, or structural findings. Verified means the Will fix bar decides. Refuted means do not apply the fix whatever its category: push back through a follow-up reviewer prompt that cites the evidence (command run, output, URL fetched, file inspected), which the user may override by asking to apply anyway. Inconclusive means surface the ambiguity and let the user decide. Add each Refuted or Inconclusive finding, with its evidence or reason, to the next round's Prior findings block. Procedure: Phase 2.5: Verify Factual Claims (when triggered); methods are in references/health-check.md.
Revise. Apply Will fix items and the Needs discussion points the user approved in place: rewrite, move, or cut the named passage, and add material only for an identified gap. For a paper, proposal, or plan, record its size each round in the same unit, and after two consecutive rounds of growth with no new result or step, consolidate before the next dispatch. Cut unneeded defenses and move process history that supports no retained claim to the records. Update the round history (Resolved, Still open, Deferred, and the Refuted and Inconclusive findings of step 10), stage the revised changes, and return to Phase 1 with the next round number. Procedure: Phase 3: Revise.
Conclude. Apply standing rule B to decide whether the loop stops; Phase 4: Conclude holds the procedure.
When to plan-review first
Any complex task benefits from a plan review BEFORE execution, because plan-first catches architectural holes while they are still cheap to fix, wherever the shape of the work precedes and constrains the execution: system design, refactors, paper outlines, proposal structure, migration plans, and multi-stage debugging.
Plan-review is a Phase 0 before the staged-change loop below. If the user asks for a plan review, or if the task clearly meets the signals below, do not apply the staged-change and drift checks under Prerequisites yet. Tell the reviewer to read the plan file directly (or paste the plan contents via the terminal path when the reviewer cannot access the file) and critique the design, not git diff --cached. The process is in references/plan-review.md. After the plan has no High findings and no new design blockers, execute the work and resume the normal staged-output review flow at Prerequisites / Phase 1.
When to plan-first
Signals that the round-trip pays off:
- Blast radius is large -- multiple files, cross-cutting concerns, shared state, multiple stakeholders, or the organizing structure of a deliverable.
- Irreversible once executed -- publishes, submissions, deployments, immutable packages, paper submissions, external commitments.
- History shows a pattern -- "got the structure wrong, redo next cycle" has happened on this track before.
- Uncertainty in the approach -- the user is weighing alternatives and wants the design validated, not the execution reviewed.
- Context is unfamiliar -- new codebase, domain, audience, agency, collaborator workflow, or external constraint set, where a wrong assumption can shape the rest of the work.
When to skip plan-first
- Change is small, local, reversible.
- The design is already worked out and only execution feedback is wanted.
- Plan and execution would be the same artifact (three-line bug fix, one-sentence footnote).
Prerequisites
Begin each run by showing the cross-agent usage snapshot, so the quota situation is visible at this run. In Bash, run "$HOME/.claude/hooks/_python" "$HOME/.claude/agent-quota.py", or run the repo copy with the project's Python (scripts/agent-quota.py, or .agent-config/repo/scripts/agent-quota.py in a consumer). Show its Claude, Codex, Agy Gemini, and Agy Claude/GPT rows. Read all percentages as remaining quota (headroom left), not consumed: a high value such as 93% left is not a reason to downgrade the channel or stop the review; only a figure near 0% left signals real quota pressure. If neither the script nor a Python runner is available, skip silently and never block the review on it.
At skill start, check for staged changes (git diff --cached). If nothing is staged but unstaged or untracked changes exist, list them and ask the user whether to stage all (git add -A), stage specific files, or abort. Do not auto-stage without confirmation; untracked files may be sensitive or unrelated. With no changes at all there is nothing to review; inform the user and stop.
Then check the other direction: a path that is staged and changed again since staging. Intersect git diff --cached --name-only --no-renames with what git diff --name-only and git ls-files --others --exclude-standard report together. A non-empty result means the reviewer would receive that path as it stood at git add, so its findings would read as findings about the current file. List those paths and resolve them before dispatching. Paths changed but never staged are ordinary and not this case.
The untracked list catches a staged deletion whose file came back, and --no-renames a path recreated after a staged git mv. dispatch-gemini refuses the drifted case itself, because its reviewer is handed an export of the index and cannot see the drift. IMPLEMENT_REVIEW_ALLOW_STAGED_DRIFT=1 overrides that refusal for a deliberate review of the index as it stands. The other dispatchers do not enforce it yet, so this check is the only cover there. See anywhere-agents#57.
Do not stage, commit, or move Review-*.md files unless the user explicitly asks. Before the first review round, check whether Review-*.md is excluded from git, in .gitignore and .git/info/exclude. If the pattern is not excluded anywhere, append Review-*.md to .git/info/exclude so that git add -A during the revision flow does not accidentally stage scratch files. A committed .gitignore entry for Review-*.md satisfies this without a local edit.
Pre-Review Checks (optional)
Before sending staged changes for review, run automated checks that catch mechanical issues locally. This lets reviewers focus on content and judgment calls instead of issues a script could find. Skip this phase if the user says to proceed directly, or if the project has no relevant tooling.
| Content type |
Checks |
| LaTeX paper or proposal |
Compile. Scan the log for overfull/underfull box warnings and undefined references. Report counts. |
| Anonymized submission |
Grep staged files for author names, GitHub/lab URLs, institutional names, and tool names. Source these from the project's de-anonymization checklist if one exists; otherwise use the git user name, institution domain, and any names in the paper's author metadata or \author{} block. |
| Code |
Run the project linter and type checker if configured. |
Prose (.md / .rst / .txt / .tex, or prose-heavy diff) |
Run <python> <scripts-dir>/style-audit.py --repo <repo>, resolving <scripts-dir> through the same lookup order as the other scripts. It finds the staged prose itself, reports file:line:col RULE detail for each deterministic rule, and names the rules it covers only in part or not at all, so a partial audit does not read as a clean pass. Audit the unreached rules by reading the rule pack (RULE-07 antithesis is one). Read each finding in context and fix the ones that read badly; a departure that reads well can stay. |
Report any findings to the user before Phase 1. Findings here do not go to the reviewer; fix the ones that read badly locally first.
The style audit runs on content, and never gates the round. Run style-audit.py whenever the staged diff carries prose, so skipping it is a decision someone made rather than a default. The script always exits 0, including when it finds violations and when agent_style is absent, so no step in the loop can fail on it. Style findings stay out of the reviewer's prompt, out of the Round history Still open list, and out of the verdict.
Codex Channels
Two paths to Codex are supported. Default is Terminal-relay (manual copy-paste). Auto-terminal (codex exec subprocess) is opt-in via the trigger rules in Path selection below. Phase 1c dispatches it; the Codex mechanics are in references/codex-backend.md, read under its Reference Index condition.
Terminal path (default)
The user has a Codex interactive terminal window open alongside Claude Code. Claude Code prepares a copy-pasteable review prompt (summary, diff, lens, round number) and presents it as a fenced text block. The user copies it into the Codex terminal, then relays the feedback back to Claude Code.
Path selection
- Default: Terminal-relay (manual copy-paste) on every platform. Users who do not opt into another channel get the current Terminal-relay flow without modification.
- User-scoped default override: when the environment variable
IMPLEMENT_REVIEW_DEFAULT_CHANNEL is set (case-insensitive) to auto, cli, or auto-terminal, the synonyms the slash args accept, Auto-terminal becomes that user's default and no per-invocation opt-in token is needed, including beside a reviewer token such as agy or grok. Read the variable once at Phase 1c entry. Claude Code reads it from the env block of ~/.claude/settings.json, and Codex from [shell_environment_policy] set in ~/.codex/config.toml. Agy has no such setting and sees only the environment it was started in.
- When the variable is unset, empty, or holds an unrecognized value, the shipped Terminal-relay default applies, so a typo degrades to today's behavior. Unset and empty also leave the channel line unchanged. An unrecognized value adds one clause to the channel line naming the ignored value and saying the shipped default applied, so the user does not go on believing Auto-terminal is their default.
- User-scoped reviewer default:
IMPLEMENT_REVIEW_DEFAULT_REVIEWER, read and set the same way, supplies the reviewer tokens when the invocation names none: both, all, or any of codex, claude, agy, and grok, space-separated and case-insensitive. The item 2 rules then apply as if it had been typed, so both resolves against the coordinator. A reviewer token in the invocation wins. Unset, empty, or unrecognized keeps Codex, and an unrecognized value adds a clause to the channel line.
- Auto-terminal opt-in triggers, evaluated in detection order at Phase 1c entry:
Mid-flow override toward manual: "back to manual" / "next round manual" / "use terminal-relay" in the user's most recent message forces Terminal-relay.
Mid-flow opt-in toward auto: "next round use cli" / "next round auto codex" forces Auto-terminal.
Slash-arg opt-in: /implement-review cli, /implement-review auto, and /implement-review auto-terminal are equivalent synonyms; auto is the most natural keyword and is accepted.
When .claude/commands/implement-review.md forwards slash arguments through Command arguments from the slash invocation: $ARGUMENTS, evaluate that forwarded argument string the same way as the original slash invocation.
Manual override tokens still win before Auto-terminal opt-in tokens.
Plain-phrase opt-in in the invoking message: case-insensitive substring match on any of cli mode, use cli, auto codex, use codex exec, AND no negation word (do not, don't, no, not, avoid, manual) within 4 words before the matched phrase.
Reviewer-backend selection (Agy, Gemini through Antigravity CLI, opt-in): when the selected channel is Auto-terminal and the slash arguments contain agy, gemini, or antigravity, use dispatch-gemini.py and expect Review-Antigravity.md. The canonical invocation is /vet agy; /vet gemini, /vet antigravity, the compatible /implement-review forms with auto or cli, and plain phrases such as use agy as reviewer, use gemini as reviewer, or review with antigravity are aliases under the same negation guard. If the orchestrator is Agy, Gemini, or Antigravity, rewrite to Codex before dispatch and state why.
Reviewer-backend selection (two reviewers in one invocation): reviewer tokens are a set rather than a single choice. When the invocation names more than one, dispatch each named backend for the same round. both selects the two backends from claude, codex, and agy that are not coordinating. Under Claude Code it is codex agy, under Codex claude agy, and under Agy codex claude. Any other coordinator gets codex agy. Resolve both and all using the coordinator identity passed to dispatchers in Phase 1c step 5. Do this before the self-review rewrites in the other reviewer-backend items. The resolved set excludes the coordinator, so those rewrites leave it unchanged. When the set includes Claude, Auto-terminal requires every staged path to be in scope; see Phase 1b. both means that pair specifically rather than every backend that exists, so Grok is never part of it; name the tokens explicitly for any other combination. all, as a leading reviewer token (/vet all, vet all), selects the three of claude, codex, agy, and grok that are not coordinating. An invocation or plain phrase naming the resolved pair is equivalent to /vet both under the same negation guard. The channel lines name the coordinator and the resolved pair, for example both → claude agy (coordinator: codex). For both, the expected reviewer set is the comma-separated normalized list: Codex,Antigravity under Claude Code, Claude-Code,Antigravity under Codex, and Codex,Claude-Code under Agy. For all, add Grok, or Claude-Code under Grok. Each reviewer gets its own watcher on its exact Review-<Name>.md. With a single reviewer, nothing here changes.
Dispatch them in parallel when memory allows, one after another otherwise. Before each further concurrent dispatch, check available memory. On macOS, multiply the system-wide free percentage from memory_pressure -Q by sysctl -n hw.memsize; Linux reports MemAvailable in /proc/meminfo. With at least 16 GB available, dispatch the reviewers in parallel. Below that, or when the check fails, dispatch them sequentially.
In both modes the watcher is a wait-for-any helper. auto-watch exits as soon as one file matching its glob appears, so a single watcher over Review-*.md would report the round finished while the second reviewer was still working. Run one dispatch, one watcher and one health check per reviewer, each with that reviewer's own STATE-DIR and its exact Review-<Name>.md rather than the wildcard. Where a later step names a single reviewer, a single DONE, or a whole-round fallback, apply it per reviewer in a multi-reviewer round. A failing reviewer other than Grok goes through the failover queue while the other slots continue. In such a round, a Grok slot that is absent or failed is a confirmed failure: no failover and no round downgrade. Consolidation waits for every expected reviewer.
In sequential mode, before launching the next reviewer, require that the previous dispatcher returned, or identity-checked evidence that its worker exited. DONE, REVIEW-READY and a clean health check authorize intake only: all three are computed from the review file's freshness and quietness, and each was reproduced while the worker was still alive, so none of them is a statement about the process. Where the harness has been lost and termination cannot be established, hold the existing bounded checkpoint and ask, rather than reading REVIEW-READY as permission to launch: a file appearing is not proof the previous worker exited, and launching on that signal alone would defeat the memory sequencing this mode exists for.
Keep the full expected set for consolidation, so Phase 2 still classifies findings across reviewers (round checklist, step 9). If a reviewer fails, still run the rest; when every missing expected reviewer is confirmed failed, the healthy current-round reviews are complete intake (Single-source if one remains), and Phase 2's missing-reviewer follow-up and direct-paste steps do not apply. Emit one channel line per reviewer so the user can see which backend each round actually reached.
Reviewer-backend selection (explicit Codex): when the selected channel is Auto-terminal and the invocation contains the reviewer token codex, keep the normal dispatch-codex backend and expect Review-Codex.md. When Codex coordinates this skill, a codex token or the Codex no-token default is rewritten to the Claude backend before dispatch. If the Claude probe fails, try Agy. One user-visible line states why. Phase 1c step 5 then sets IMPLEMENT_REVIEW_ORCHESTRATOR=codex on every dispatcher call, so the script-level guards apply.
Reviewer-backend selection (Grok cross-vendor backend, opt-in): when the selected channel is Auto-terminal and the invocation names Grok, dispatch uses <python> dispatch-grok.py and expects Review-Grok.md. Triggers: slash args /vet grok, /implement-review grok, /implement-review auto grok, or /implement-review grok auto; plain phrases use grok as reviewer, grok as reviewer, auto grok, or review with grok, under the same negation guard. If the orchestrator is Grok (IMPLEMENT_REVIEW_ORCHESTRATOR=grok), rewrite to Codex before dispatch and state why. See references/grok-backend.md for the backend's flags, isolation, supplied-input rules, limits, and launch route.
Reviewer-backend selection (Claude, with mechanical self-review guard): select dispatch-claude only when BOTH of the following hold: (1) the selected channel is Auto-terminal and the slash args include claude (e.g., /implement-review claude, /implement-review auto claude, or /vet claude), OR a plain phrase matches the patterns use claude as reviewer, claude as reviewer, review with claude, or role-reversal wording naming Codex as implementer and Claude as reviewer, all under the same negation guard as the plain-phrase opt-in above; AND (2) the orchestrator running this skill is NOT Claude Code. Orchestrator detection: under Claude Code the orchestrator is claude by definition. When orchestrator is claude and the slash args / phrase ask for the Claude backend, rewrite the selection to Codex (or Agy if Codex is unavailable on PATH) BEFORE any dispatch script is launched, and emit one user-visible line: Claude backend skipped: Claude Code cannot review its own implementation; using <backend> instead. The dispatcher repeats this guard for direct callers (see references/claude-backend.md). Dispatch uses dispatch-claude and the expected review file is Review-Claude-Code.md.
Emit one line at Phase 1c entry stating which channel was picked and why (e.g., Channel: Auto-terminal (triggered by "/implement-review auto"; codex on PATH)), so the user can immediately override if it picked wrong. When the channel came from the user-scoped default rather than a per-invocation token, name the variable as the reason, e.g. Channel: Auto-terminal (IMPLEMENT_REVIEW_DEFAULT_CHANNEL=auto; codex on PATH). Name IMPLEMENT_REVIEW_DEFAULT_REVIEWER the same way, e.g. both → codex agy (coordinator: claude; IMPLEMENT_REVIEW_DEFAULT_REVIEWER=both).
Phase 1: Prepare and Send Review
1a. Detect content type
Inspect the file extensions in the staged diff to classify the change:
| Extensions |
Content type |
.py, .js, .ts, .go, .rs, .java, .c, .cpp, .h, .sh, .yaml, .json, .toml |
code |
.tex, .bib (in a paper or manuscript directory) |
paper |
.tex, .bib (in a proposal or grant directory) |
proposal |
.md, .rst, .txt (in a proposal or grant directory) |
proposal |
| Everything else or mixed |
general |
If the diff spans multiple types, pick the dominant one. The user can override by saying, e.g., "review this as a proposal." For proposals, also ask which agency lens to apply (NSF or NIH) since they use different evaluation frame
…(truncated)
1---2name: implement-review3description: Review loop (/vet) for staged changes or a plan. Detects the content type, sends a review request to Codex, Agy, Claude, or Grok, categorizes the feedback, revises, and iterates. Works for code, papers, proposals, or any text-based output.4metadata:5 source: https://skillmd.com/skills/yzhao062/implement-review6---78# Implement-Review910On `/vet` or `$implement-review`, run the review loop for the requested target. A subagent of the coordinator, or the coordinator's own checks, cannot fill a reviewer slot. An Auto-terminal round reports the reviewer, its review file, and the Phase 2 health-check result, or says that intake is pending or failed.1112## Overview1314The coordinator sends the changes to one or more reviewers, categorizes the feedback, revises, and iterates. Codex is the default reviewer, through terminal relay (manual copy-paste, default on every platform) or Auto-terminal (opt-in subprocess dispatch), which also drives the Agy, Claude, and Grok backends. A reviewer driven by hand only needs the `Review-<AgentName>.md` save contract in Phase 1c. Reviewer defaults and coordinator rewrites follow Path selection.1516## Reference Index1718Open a reference only when its condition holds, because reading one never by itself authorizes an action this file withholds: reading `failover-and-recovery.md` does not authorize failover, a stopped harness or a watcher `REAP-UNKNOWN` is resolved through `await-review.py` first, a checkpoint keeps its documented behavior while death is unproven, and Grok keeps its no-failover exception.1920| File | Read when |21|---|---|22| [references/review-lenses.md](references/review-lenses.md) | every round, to pick the lens for item 4 of section 1b |23| [references/plan-review.md](references/plan-review.md) | the user asks for a plan review, or a plan-first signal holds |24| [references/codex-backend.md](references/codex-backend.md) | before raising `CODEX_DISPATCH_REASONING` or the timeout, or overriding `CODEX_DISPATCH_MODEL`, `CODEX_DISPATCH_SANDBOX`, or `CODEX_DISPATCH_ISOLATE_MCP`; a Codex probe fails, stderr shows a `MODEL-*` line, or a fresh Codex review or `FAIL check-10` shows it could not run `git diff` |25| [references/agy-backend.md](references/agy-backend.md) | before overriding `ANTIGRAVITY_DISPATCH_MODEL`, `ANTIGRAVITY_DISPATCH_EFFORT`, or `ANTIGRAVITY_PREFLIGHT`, or running `--print-model`; an Agy dispatch exits 2, 70, or 124, stderr shows a `MODEL-*` line, or Check 8's `breakdown=` includes `recovered:` |26| [references/claude-backend.md](references/claude-backend.md) | before overriding `CLAUDE_DISPATCH_BARE` or the Claude model or effort; `dispatch-claude` fails preflight or exits nonzero, stderr shows a `MODEL-*` line, the dispatcher handle is lost, or the user asks for scheduled heartbeat monitoring |27| [references/grok-backend.md](references/grok-backend.md) | Grok reviews (`/vet grok`, `/vet all`, or a default reviewer that includes Grok), before overriding a `GROK_DISPATCH_*`, `GROK_BIN`, or `GROK_HOME` setting, or when stderr shows a `MODEL-*` line or `dispatch-grok.py` exits 70 |28| [references/failover-and-recovery.md](references/failover-and-recovery.md) | a confirmed failure under Phase 1c, a missing-backend probe, or `STREAM-DEAD`, `TIMEOUT`, `REAP-UNKNOWN`, or a harness-stopped notice |29| [references/health-check.md](references/health-check.md) | `health-check` prints any `FAIL`, or a `WARN` marker the coordinator does not recognize, or a Phase 2.5 claim needs a method |3031## Round checklist3233Two standing rules come first, then the steps of a round in order. Each step states its decision once and links the section with its procedure.3435A. **Claude slot when Codex coordinates.** This rule covers the Claude slot only when Codex coordinates; other pairs keep their usual dispatch, waiting, and failover, and its verdict list serves every `await-review.py` call (steps 6 and 8). Start `dispatch-claude` on a resumable exec tool and keep its handle and `STATE-DIR`. Claude's text can stay empty until its final response, so an empty tail, `ALIVE`, or a pre-publication `STALL` leaves the review pending, even after 15 minutes. Before the first wait, run `<python> <scripts-dir>/await-review.py --state-dir <abs-path> --round <N> --review-file Review-Claude-Code.md --timeout 0` to establish the original deadline. The script has no shell wrapper, `--review-file` defaults to `Review-Codex.md`, `<python>` comes from `<state-dir>/python-interpreter` when the dispatcher wrote one (`dispatch-claude` writes none; then resolve one as section 1c says), and `<scripts-dir>` follows the lookup order of the other scripts. A custom `--round-budget` goes on that first call, before the deadline is stamped, and a new deadline is never stamped. Wait on the retained handle with empty-input `write_stdin` (a confirmed native completion notification also serves), requesting `yield_time_ms=180000` when supported, capped by the remaining round budget and any smaller host limit, as a maximum window and not a fixed delay. After each completed wait, and before marking the slot complete, read the dispatcher exit status first: nonzero is a confirmed failure that wins over `ALIVE` and goes through [1c. Send to reviewer](#1c-send-to-reviewer), and exit 0 still needs the report and step 7. While the dispatcher is pending, make one `--timeout 0` check for publication or the deadline, then continue the same handle unless a documented checkpoint is reached. Resume an outer execution cell that yields early and never terminate it. If the handle is lost ([references/claude-backend.md](references/claude-backend.md)), run the step 6 command with the original deadline, and never wait only on a long-running resolver, which cannot see a dispatcher exit without publication. A tool yield or an expired wait is not failure. Do not conclude the review, drop the slot, or cancel the dispatcher or reviewer to end the turn (`terminate: true`, Ctrl-C, or `kill`): cancellation by the coordinator is not a backend failure and does not allow Single-source completion. Add no fixed sleep, log rereads, or repeated progress messages. Keep the original 60-minute deadline unless the user names another budget, arm no shorter harness kill timer, and keep the deadline across yields and scheduled wakeups. A user-requested stop pauses monitoring and does not make silence a failure. Publication alone is not proof the worker exited, and sequential mode waits on that proof ([Path selection](#path-selection)). A published report alone is not a conclusion: run step 7, reading a saved `stall-warning` as the Check 9 inspection, because a pre-publication silence warning is no permission to abandon the reviewer. Verdicts: `DONE` or `REVIEW-READY` means read the report and run step 7 (a `REVIEW-READY` review can still fail Checks 4 to 10); `ALIVE` means the round is unproven, so check again until a verdict or the deadline; `STALL`, `TIMEOUT`, and `REAP-UNKNOWN` stay checkpoints: `STALL` surfaces the silence warning and leaves the review pending (step 6), and `TIMEOUT` and `REAP-UNKNOWN` report the specific incomplete state and pause monitoring, never killing the reviewer or inventing a deadline; of these verdicts only `DEAD` and `STREAM-DEAD` confirm a failure, and they go through section 1c ([references/failover-and-recovery.md](references/failover-and-recovery.md)). Stop monitoring the slot once its result reaches intake.3637B. **When the loop stops.** Stop when the user says the review is done or approved, when the user decides to stop iterating, or when no new or still-open finding meets the Will fix bar. A reviewer that still blocks on a `Deferred` item does not hold the loop open; name those items in the summary. Then present a short summary: total rounds, key changes made, and unresolved points from the last review. Procedure: [Phase 4: Conclude](#phase-4-conclude).38391. **Prerequisites.** Follow [Prerequisites](#prerequisites): the usage snapshot, staged changes and drift, and the `Review-*.md` exclusion. When the user asks for a plan review or a plan-first signal holds, start at [When to plan-review first](#when-to-plan-review-first) and read [references/plan-review.md](references/plan-review.md); only the staged-change and drift checks wait until the plan passes.40412. **Pre-review checks.** Run the content-type checks in [Pre-Review Checks (optional)](#pre-review-checks-optional) before building the request.42433. **Channel and reviewers.** Choose both by [Path selection](#path-selection). Reasoning effort is a one-way ratchet: the registry's effort is the floor, not a target. The dispatching agent may raise one round above it with a higher `CODEX_DISPATCH_REASONING` when the change is hard enough to earn deeper reasoning (mirrored copies of one file, caching or state lifetime, or a risk of failing silently rather than loudly), and must never pass a lower one, so the worst case is a round not deepened, never one weakened. A higher tier lengthens wall-clock, so raise the dispatch timeout in the same step or the round is killed before it writes anything. When the budget buys one deeper round or two at the floor, prefer another round while the artifact is still changing (their relative yield is unmeasured, so treat this as a default), and raise the tier for the closing round or when the change is subtle enough that a first read is unlikely to reach it. See [references/codex-backend.md](references/codex-backend.md) before raising the tier or timeout.44454. **Build the request.** Assemble it from [1b. Build the review context](#1b-build-the-review-context), choosing the lens with [references/review-lenses.md](references/review-lenses.md). A snapshot backend such as Agy reviews the exported index, so a gitignored `PLAN-*.md`, an untracked evidence note, or an untracked local override never reaches it, and its review would be silently ungrounded. Paste each such input into the request once under a `--- SUPPLIED INPUT: <path> ---` heading (plan-review step 3). The relay tells the reviewer to read those copies and never the original worktree, and supplied policy stays distinct from repository material, which the relay treats as untrusted.46475. **Dispatch.** Send the request by [1c. Send to reviewer](#1c-send-to-reviewer), which sets up the failure definition and the failover queue at round start. Dispatchers take `--expected-review-file Review-<Reviewer>.md`, and `health-check` and `await-review.py` take `--review-file Review-<Reviewer>.md`, where `<Reviewer>` is the backend's own name: `Codex`, `Claude-Code`, `Antigravity`, or `Grok`.48496. **Watch.** Run one watcher per reviewer under [1d. Auto-watch (Terminal-relay and Auto-terminal channels)](#1d-auto-watch-terminal-relay-and-auto-terminal-channels). A `STALL` exit 3 is not a death: surface the silence warning and inspect or keep monitoring, and do not terminate the dispatch or set sticky downgrade from silence alone. Silence is never terminal: `DEAD` needs `stream-death` paired with a completed `stream-reap-complete`, and neither a quiet tail nor a review published under the wrong round marker is that evidence, so no shorter idle window may be promoted to a death certificate. If a reviewer dies without writing a marker, `await-review.py` keeps returning `ALIVE` and the round's own timeout ends it. A harness notice that the dispatch or watcher was stopped (`killed` in a background-task notification) concerns the harness's task wrapper, not the reviewer, which runs detached: do not conclude failure, redispatch, or set sticky downgrade from it, and a lost watcher is no corroboration. Resolve it in the foreground, since a background probe would be exposed to the same stop, with `<python> <scripts-dir>/await-review.py --state-dir <abs-path> --round <N> --review-file Review-<Reviewer>.md` (interpreter and `<scripts-dir>` as in rule A). It replaces the watcher for the rest of the round, and rule A gives its verdicts. A watcher `REAP-UNKNOWN` is resolved with the same command, and only the resolver's own checkpoint verdicts pause monitoring.50517. **Health check.** For Auto-terminal, run `health-check --state-dir <abs-path> --round <N> --review-file Review-<Reviewer>.md` with the `STATE-DIR` the dispatcher printed. Read its stdout, never only the exit code: a `WARN` exits 0, and it exits non-zero only for a `FAIL` of Checks 1 to 6 or 10 or missing or stale `<state-dir>/pre-mtime` or `<state-dir>/timestamp`. Any `FAIL` refuses that review and routes it through section 1c while the other slots stay active. A `WARN` from Check 7, 8, or 9 or a Substance heuristic is inspected and is not by itself a refusal: read what the check flags, record the reading in the round summary, and advance. Read for `check-7` the `lines=` it names in `Review-<Agent>.md`; for `check-8` the matching failure lines in `<state-dir>/tail` and, when present, `<state-dir>/tail.stderr-tmp` (where the Claude and Agy dispatchers write stderr), and when `breakdown=` includes `recovered:` also `<state-dir>/backend-failure` and whether the review ends cleanly, accepting that review's verdict only after checking it for placeholders, narration, and truncated findings; for `check-9` `<state-dir>/stall-warning` and whether the review ended cleanly; for `substance-1` the `elapsed=` and `prompt=` pair; for `substance-2` the file:line anchors (`0-anchors`); for `substance-3` the scope-challenge axes in `missing-axes=`. Ask the user only when an inspection finds a defect: a tool failure that blocked verification, a truncated or placeholder review, a missing verification, or `WARN check-8 1 missing-dispatch-tail`, which leaves dispatch health unconfirmed and is never read as Check 8 hit 0. When the review file is missing, Check 1 hard-fails while Checks 8 and 9 still run on the tail and stall warning. Every saved review needs one standalone `Verification status: VERIFIED` or `UNVERIFIED` line: `VERIFIED` only after at least one relevant verification command completed, with the exact commands and outcomes in Verification notes, and a run with none says `UNVERIFIED` with `Commit verdict: UNVERIFIED` and cannot issue `PASS` or `BLOCK`. Check 10 rejects an `UNVERIFIED` status or verdict, a `PASS` or `BLOCK` without `VERIFIED`, conflicting markers, and `VERIFIED` beside notes that report no execution, so a `BLOCK` with `VERIFIED` and concrete outcomes passes, and `FAIL check-10` is a hard intake failure. Only after a fresh review says Codex could not run `git diff` (dispatch exit 0, fresh `Review-Codex.md`), retry Auto-terminal once with an embedded-diff prompt before the failure is routed through section 1c; with the default `--sandbox danger-full-access` this should never fire. Its findings are diff-scoped and prone to false positives on claims that depend on non-diff code, so a Medium finding from it needs step 10 before it is applied, and a retry that fails or records only blocked verification is a confirmed failure routed through section 1c. Procedure: [Phase 2.0: Health check (Auto-terminal only)](#phase-20-health-check-auto-terminal-only); see [references/health-check.md](references/health-check.md) when its read condition holds.52538. **Intake.** For Terminal-relay, auto-watch `DONE` is enough to start intake. For Auto-terminal it is necessary but not sufficient: advance a reviewer with no inspection only when all eight hold: `DONE <path>` or a resolver `REVIEW-READY <path>` for a file with the current round marker; the dispatch subprocess exited 0, or the harness reported the task stopped and `await-review.py` then returned `REVIEW-READY`; Checks 1 to 6 pass; Check 10 passes; Check 7 hits 0 phrases; Check 8 hits 0 markers; Check 9 finds no `stall-warning` file; the Substance heuristics flag 0 signals. If the exit evidence, Checks 1 to 6, or Check 10 fails, refuse that review and route its dispatch through section 1c while the other slots continue. A hit on Check 7, 8, or 9 or a Substance heuristic is inspected under step 7 and is not by itself a refusal. `TIMEOUT` and `REAP-UNKNOWN` also stop at a human checkpoint; a `STALL` leaves the review pending under step 6 and never starts intake by itself. Consolidate only after every expected reviewer has a ready report or a confirmed failure (or the user says the reviewers are done), and keep a slot pending while its dispatch is active. Read only `Review-*.md` files that are current-round (first line `<!-- Round N -->`) and from an expected reviewer, and report every ignored file by filename and reason (stale-round, empty, unreadable, unexpected) before presenting findings. Flag a current-round unexpected file to the user before including or excluding it: mtime against the Phase 1c emission time is a noisy secondary signal only, a corroborating signal is required before including it, and it is never included or excluded silently. When the expected set is unknown, use mtime only to rank candidates and ask the user which current-round files belong to this review. For an expected reviewer whose file is missing, stale, or empty with no confirmed dispatch failure, send a follow-up prompt naming that reviewer, then ask the user to paste its feedback directly if the file is still missing, empty, or stale. Procedure: [Phase 1d coordination (Auto-terminal-specific silent-intake rule)](#phase-1d-coordination-auto-terminal-specific-silent-intake-rule); the partition is in Phase 2.1.54559. **Classify and act.** With two or more current-round sources, classify each new finding as Convergent (two or more reviewers raise substantially the same point), Convergent with differences (same problem, different severity, scope, or remedy: keep each reviewer's severity and fix, and use the highest severity until the user or implementer resolves it), Single-source (label the source), or Divergent (opposite positions: flag it, show both positions, and classify it like any other finding). If only one current-round source remains after step 8 although more were expected, label every finding Single-source; a single-reviewer round's one source is complete intake. Acknowledge each point, and check the reviewer's New and Previously raised split, making it yourself from the round history when the reviewer did not. Mark a new finding Will fix (clear, actionable, correct, and worth a revision), Decline (correct but not worth a revision, and never a risk to user data), Needs discussion (ambiguous or potentially wrong), or Disagree (explain why). Mark a previously raised finding Fixed (no action), Still open (the fix did not land or was incomplete: treat as Will fix unless the user overrides), Reopened (flag it to the user: it needs a decision and is never re-argued silently), or Deferred (no action unless the user reconsiders). Fold in the outcomes of step 10 and record the categorized list in the round summary. Do not ask before applying Will fix and Still open items (step 11 applies them after step 10), and record each Decline as Deferred with a one-line reason, also without asking. Ask the user only about Needs discussion, Disagree, and Reopened items, and act on them only after the answer, so a Divergent finding asks only when it lands in Needs discussion or Disagree. If no new or still-open finding meets the Will fix bar, skip step 11 and apply rule B. Procedure: [Phase 2.1: Partition and classify (all channels)](#phase-21-partition-and-classify-all-channels).565710. **Verify claims.** After classifying and before applying, verify a finding that makes an objectively checkable factual claim (a citation, code behavior, a link, a count, a compile error) when it is High priority, or Medium and from the embedded-diff retry channel, or the user asks for verification of a Medium or Low one. Skip it when the reviewer's Verification notes already cover that claim with a method that resolves it (trust that check unless contradicting evidence appears), when the fix is trivially correct or the cheapest verification takes longer than the user can wait, and for stylistic, opinion-based, or structural findings. Verified means the Will fix bar decides. Refuted means do not apply the fix whatever its category: push back through a follow-up reviewer prompt that cites the evidence (command run, output, URL fetched, file inspected), which the user may override by asking to apply anyway. Inconclusive means surface the ambiguity and let the user decide. Add each Refuted or Inconclusive finding, with its evidence or reason, to the next round's `Prior findings` block. Procedure: [Phase 2.5: Verify Factual Claims (when triggered)](#phase-25-verify-factual-claims-when-triggered); methods are in [references/health-check.md](references/health-check.md).585911. **Revise.** Apply Will fix items and the Needs discussion points the user approved in place: rewrite, move, or cut the named passage, and add material only for an identified gap. For a paper, proposal, or plan, record its size each round in the same unit, and after two consecutive rounds of growth with no new result or step, consolidate before the next dispatch. Cut unneeded defenses and move process history that supports no retained claim to the records. Update the round history (Resolved, Still open, Deferred, and the Refuted and Inconclusive findings of step 10), stage the revised changes, and return to Phase 1 with the next round number. Procedure: [Phase 3: Revise](#phase-3-revise).606112. **Conclude.** Apply standing rule B to decide whether the loop stops; [Phase 4: Conclude](#phase-4-conclude) holds the procedure.6263## When to plan-review first6465**Any complex task benefits from a plan review BEFORE execution**, because plan-first catches architectural holes while they are still cheap to fix, wherever the shape of the work precedes and constrains the execution: system design, refactors, paper outlines, proposal structure, migration plans, and multi-stage debugging.6667**Plan-review is a Phase 0 before the staged-change loop below.** If the user asks for a plan review, or if the task clearly meets the signals below, do not apply the staged-change and drift checks under Prerequisites yet. Tell the reviewer to read the plan file directly (or paste the plan contents via the terminal path when the reviewer cannot access the file) and critique the design, not `git diff --cached`. The process is in [references/plan-review.md](references/plan-review.md). After the plan has no High findings and no new design blockers, execute the work and resume the normal staged-output review flow at Prerequisites / Phase 1.6869### When to plan-first7071Signals that the round-trip pays off:7273- **Blast radius is large** -- multiple files, cross-cutting concerns, shared state, multiple stakeholders, or the organizing structure of a deliverable.74- **Irreversible once executed** -- publishes, submissions, deployments, immutable packages, paper submissions, external commitments.75- **History shows a pattern** -- "got the structure wrong, redo next cycle" has happened on this track before.76- **Uncertainty in the approach** -- the user is weighing alternatives and wants the design validated, not the execution reviewed.77- **Context is unfamiliar** -- new codebase, domain, audience, agency, collaborator workflow, or external constraint set, where a wrong assumption can shape the rest of the work.7879### When to skip plan-first8081- Change is small, local, reversible.82- The design is already worked out and only execution feedback is wanted.83- Plan and execution would be the same artifact (three-line bug fix, one-sentence footnote).8485## Prerequisites8687Begin each run by showing the cross-agent usage snapshot, so the quota situation is visible at this run. In Bash, run `"$HOME/.claude/hooks/_python" "$HOME/.claude/agent-quota.py"`, or run the repo copy with the project's Python (`scripts/agent-quota.py`, or `.agent-config/repo/scripts/agent-quota.py` in a consumer). Show its Claude, Codex, Agy Gemini, and Agy Claude/GPT rows. Read all percentages as **remaining** quota (headroom left), not consumed: a high value such as `93% left` is not a reason to downgrade the channel or stop the review; only a figure near `0% left` signals real quota pressure. If neither the script nor a Python runner is available, skip silently and never block the review on it.8889At skill start, check for staged changes (`git diff --cached`). If nothing is staged but unstaged or untracked changes exist, list them and ask the user whether to stage all (`git add -A`), stage specific files, or abort. Do not auto-stage without confirmation; untracked files may be sensitive or unrelated. With no changes at all there is nothing to review; inform the user and stop.9091Then check the other direction: a path that is staged **and** changed again since staging. Intersect `git diff --cached --name-only --no-renames` with what `git diff --name-only` and `git ls-files --others --exclude-standard` report together. A non-empty result means the reviewer would receive that path as it stood at `git add`, so its findings would read as findings about the current file. List those paths and resolve them before dispatching. Paths changed but never staged are ordinary and not this case.9293The untracked list catches a staged deletion whose file came back, and `--no-renames` a path recreated after a staged `git mv`. `dispatch-gemini` refuses the drifted case itself, because its reviewer is handed an export of the index and cannot see the drift. `IMPLEMENT_REVIEW_ALLOW_STAGED_DRIFT=1` overrides that refusal for a deliberate review of the index as it stands. The other dispatchers do not enforce it yet, so this check is the only cover there. See anywhere-agents#57.9495Do not stage, commit, or move `Review-*.md` files unless the user explicitly asks. Before the first review round, check whether `Review-*.md` is excluded from git, in `.gitignore` and `.git/info/exclude`. If the pattern is not excluded anywhere, append `Review-*.md` to `.git/info/exclude` so that `git add -A` during the revision flow does not accidentally stage scratch files. A committed `.gitignore` entry for `Review-*.md` satisfies this without a local edit.9697## Pre-Review Checks (optional)9899Before sending staged changes for review, run automated checks that catch mechanical issues locally. This lets reviewers focus on content and judgment calls instead of issues a script could find. Skip this phase if the user says to proceed directly, or if the project has no relevant tooling.100101| Content type | Checks |102|---|---|103| LaTeX paper or proposal | Compile. Scan the log for overfull/underfull box warnings and undefined references. Report counts. |104| Anonymized submission | Grep staged files for author names, GitHub/lab URLs, institutional names, and tool names. Source these from the project's de-anonymization checklist if one exists; otherwise use the git user name, institution domain, and any names in the paper's author metadata or `\author{}` block. |105| Code | Run the project linter and type checker if configured. |106| Prose (`.md` / `.rst` / `.txt` / `.tex`, or prose-heavy diff) | Run `<python> <scripts-dir>/style-audit.py --repo <repo>`, resolving `<scripts-dir>` through the same lookup order as the other scripts. It finds the staged prose itself, reports `file:line:col RULE detail` for each deterministic rule, and names the rules it covers only in part or not at all, so a partial audit does not read as a clean pass. Audit the unreached rules by reading the rule pack (RULE-07 antithesis is one). Read each finding in context and fix the ones that read badly; a departure that reads well can stay. |107108Report any findings to the user before Phase 1. Findings here do not go to the reviewer; fix the ones that read badly locally first.109110**The style audit runs on content, and never gates the round.** Run `style-audit.py` whenever the staged diff carries prose, so skipping it is a decision someone made rather than a default. The script always exits 0, including when it finds violations and when `agent_style` is absent, so no step in the loop can fail on it. Style findings stay out of the reviewer's prompt, out of the Round history `Still open` list, and out of the verdict.111112## Codex Channels113114Two paths to Codex are supported. Default is Terminal-relay (manual copy-paste). Auto-terminal (`codex exec` subprocess) is opt-in via the trigger rules in Path selection below. Phase 1c dispatches it; the Codex mechanics are in [references/codex-backend.md](references/codex-backend.md), read under its Reference Index condition.115116### Terminal path (default)117118The user has a Codex interactive terminal window open alongside Claude Code. Claude Code prepares a copy-pasteable review prompt (summary, diff, lens, round number) and presents it as a fenced text block. The user copies it into the Codex terminal, then relays the feedback back to Claude Code.119120### Path selection1211221. **Default**: Terminal-relay (manual copy-paste) on every platform. Users who do not opt into another channel get the current Terminal-relay flow without modification.123 - **User-scoped default override**: when the environment variable `IMPLEMENT_REVIEW_DEFAULT_CHANNEL` is set (case-insensitive) to `auto`, `cli`, or `auto-terminal`, the synonyms the slash args accept, Auto-terminal becomes that user's default and no per-invocation opt-in token is needed, including beside a reviewer token such as `agy` or `grok`. Read the variable once at Phase 1c entry. Claude Code reads it from the `env` block of `~/.claude/settings.json`, and Codex from `[shell_environment_policy] set` in `~/.codex/config.toml`. Agy has no such setting and sees only the environment it was started in.124 - When the variable is unset, empty, or holds an unrecognized value, the shipped Terminal-relay default applies, so a typo degrades to today's behavior. Unset and empty also leave the channel line unchanged. An unrecognized value adds one clause to the channel line naming the ignored value and saying the shipped default applied, so the user does not go on believing Auto-terminal is their default.125 - **User-scoped reviewer default**: `IMPLEMENT_REVIEW_DEFAULT_REVIEWER`, read and set the same way, supplies the reviewer tokens when the invocation names none: `both`, `all`, or any of `codex`, `claude`, `agy`, and `grok`, space-separated and case-insensitive. The item 2 rules then apply as if it had been typed, so `both` resolves against the coordinator. A reviewer token in the invocation wins. Unset, empty, or unrecognized keeps Codex, and an unrecognized value adds a clause to the channel line.1262. **Auto-terminal opt-in triggers**, evaluated in detection order at Phase 1c entry:127 - Mid-flow override toward manual: "back to manual" / "next round manual" / "use terminal-relay" in the user's most recent message forces Terminal-relay.128 - Mid-flow opt-in toward auto: "next round use cli" / "next round auto codex" forces Auto-terminal.129 - Slash-arg opt-in: `/implement-review cli`, `/implement-review auto`, and `/implement-review auto-terminal` are equivalent synonyms; `auto` is the most natural keyword and is accepted.130 When `.claude/commands/implement-review.md` forwards slash arguments through `Command arguments from the slash invocation: $ARGUMENTS`, evaluate that forwarded argument string the same way as the original slash invocation.131 Manual override tokens still win before Auto-terminal opt-in tokens.132 - Plain-phrase opt-in in the invoking message: case-insensitive substring match on any of `cli mode`, `use cli`, `auto codex`, `use codex exec`, AND no negation word (`do not`, `don't`, `no`, `not`, `avoid`, `manual`) within 4 words before the matched phrase.133 - **Reviewer-backend selection (Agy, Gemini through Antigravity CLI, opt-in)**: when the selected channel is Auto-terminal and the slash arguments contain `agy`, `gemini`, or `antigravity`, use `dispatch-gemini.py` and expect `Review-Antigravity.md`. The canonical invocation is `/vet agy`; `/vet gemini`, `/vet antigravity`, the compatible `/implement-review` forms with `auto` or `cli`, and plain phrases such as `use agy as reviewer`, `use gemini as reviewer`, or `review with antigravity` are aliases under the same negation guard. If the orchestrator is Agy, Gemini, or Antigravity, rewrite to Codex before dispatch and state why.134 - **Reviewer-backend selection (two reviewers in one invocation)**: reviewer tokens are a set rather than a single choice. When the invocation names more than one, dispatch each named backend for the same round. `both` selects the two backends from `claude`, `codex`, and `agy` that are not coordinating. Under Claude Code it is `codex agy`, under Codex `claude agy`, and under Agy `codex claude`. Any other coordinator gets `codex agy`. Resolve `both` and `all` using the coordinator identity passed to dispatchers in Phase 1c step 5. Do this before the self-review rewrites in the other reviewer-backend items. The resolved set excludes the coordinator, so those rewrites leave it unchanged. When the set includes Claude, Auto-terminal requires every staged path to be in scope; see Phase 1b. `both` means that pair specifically rather than every backend that exists, so Grok is never part of it; name the tokens explicitly for any other combination. `all`, as a leading reviewer token (`/vet all`, `vet all`), selects the three of `claude`, `codex`, `agy`, and `grok` that are not coordinating. An invocation or plain phrase naming the resolved pair is equivalent to `/vet both` under the same negation guard. The channel lines name the coordinator and the resolved pair, for example `both → claude agy (coordinator: codex)`. For `both`, the expected reviewer set is the comma-separated normalized list: `Codex,Antigravity` under Claude Code, `Claude-Code,Antigravity` under Codex, and `Codex,Claude-Code` under Agy. For `all`, add `Grok`, or `Claude-Code` under Grok. Each reviewer gets its own watcher on its exact `Review-<Name>.md`. With a single reviewer, nothing here changes.135136 **Dispatch them in parallel when memory allows, one after another otherwise.** Before each further concurrent dispatch, check available memory. On macOS, multiply the system-wide free percentage from `memory_pressure -Q` by `sysctl -n hw.memsize`; Linux reports `MemAvailable` in `/proc/meminfo`. With at least 16 GB available, dispatch the reviewers in parallel. Below that, or when the check fails, dispatch them sequentially.137138 In both modes the watcher is a wait-for-any helper. `auto-watch` exits as soon as one file matching its glob appears, so a single watcher over `Review-*.md` would report the round finished while the second reviewer was still working. Run **one dispatch, one watcher and one health check per reviewer**, each with that reviewer's own `STATE-DIR` and its exact `Review-<Name>.md` rather than the wildcard. Where a later step names a single reviewer, a single `DONE`, or a whole-round fallback, apply it per reviewer in a multi-reviewer round. A failing reviewer other than Grok goes through the failover queue while the other slots continue. In such a round, a Grok slot that is absent or failed is a confirmed failure: no failover and no round downgrade. Consolidation waits for every expected reviewer.139140 In sequential mode, before launching the next reviewer, require that the previous dispatcher returned, or identity-checked evidence that its worker exited. `DONE`, `REVIEW-READY` and a clean health check authorize **intake only**: all three are computed from the review file's freshness and quietness, and each was reproduced while the worker was still alive, so none of them is a statement about the process. Where the harness has been lost and termination cannot be established, hold the existing bounded checkpoint and ask, rather than reading `REVIEW-READY` as permission to launch: a file appearing is not proof the previous worker exited, and launching on that signal alone would defeat the memory sequencing this mode exists for.141142 Keep the full expected set for consolidation, so Phase 2 still classifies findings across reviewers (round checklist, step 9). If a reviewer fails, still run the rest; when every missing expected reviewer is confirmed failed, the healthy current-round reviews are complete intake (Single-source if one remains), and Phase 2's missing-reviewer follow-up and direct-paste steps do not apply. Emit one channel line per reviewer so the user can see which backend each round actually reached.143144 - **Reviewer-backend selection (explicit Codex)**: when the selected channel is Auto-terminal and the invocation contains the reviewer token `codex`, keep the normal `dispatch-codex` backend and expect `Review-Codex.md`. When Codex coordinates this skill, a `codex` token or the Codex no-token default is rewritten to the Claude backend before dispatch. If the Claude probe fails, try Agy. One user-visible line states why. Phase 1c step 5 then sets `IMPLEMENT_REVIEW_ORCHESTRATOR=codex` on every dispatcher call, so the script-level guards apply.145 - **Reviewer-backend selection (Grok cross-vendor backend, opt-in)**: when the selected channel is Auto-terminal and the invocation names Grok, dispatch uses `<python> dispatch-grok.py` and expects `Review-Grok.md`. Triggers: slash args `/vet grok`, `/implement-review grok`, `/implement-review auto grok`, or `/implement-review grok auto`; plain phrases `use grok as reviewer`, `grok as reviewer`, `auto grok`, or `review with grok`, under the same negation guard. If the orchestrator is Grok (`IMPLEMENT_REVIEW_ORCHESTRATOR=grok`), rewrite to Codex before dispatch and state why. See [references/grok-backend.md](references/grok-backend.md) for the backend's flags, isolation, supplied-input rules, limits, and launch route.146 - **Reviewer-backend selection (Claude, with mechanical self-review guard)**: select `dispatch-claude` only when BOTH of the following hold: (1) the selected channel is Auto-terminal and the slash args include `claude` (e.g., `/implement-review claude`, `/implement-review auto claude`, or `/vet claude`), OR a plain phrase matches the patterns `use claude as reviewer`, `claude as reviewer`, `review with claude`, or role-reversal wording naming Codex as implementer and Claude as reviewer, all under the same negation guard as the plain-phrase opt-in above; AND (2) the orchestrator running this skill is NOT Claude Code. **Orchestrator detection**: under Claude Code the orchestrator is `claude` by definition. When orchestrator is `claude` and the slash args / phrase ask for the Claude backend, rewrite the selection to Codex (or Agy if Codex is unavailable on PATH) BEFORE any dispatch script is launched, and emit one user-visible line: `Claude backend skipped: Claude Code cannot review its own implementation; using <backend> instead.` The dispatcher repeats this guard for direct callers (see [references/claude-backend.md](references/claude-backend.md)). Dispatch uses `dispatch-claude` and the expected review file is `Review-Claude-Code.md`.147148Emit one line at Phase 1c entry stating which channel was picked and why (e.g., `Channel: Auto-terminal (triggered by "/implement-review auto"; codex on PATH)`), so the user can immediately override if it picked wrong. When the channel came from the user-scoped default rather than a per-invocation token, name the variable as the reason, e.g. `Channel: Auto-terminal (IMPLEMENT_REVIEW_DEFAULT_CHANNEL=auto; codex on PATH)`. Name `IMPLEMENT_REVIEW_DEFAULT_REVIEWER` the same way, e.g. `both → codex agy (coordinator: claude; IMPLEMENT_REVIEW_DEFAULT_REVIEWER=both)`.149150## Phase 1: Prepare and Send Review151152### 1a. Detect content type153154Inspect the file extensions in the staged diff to classify the change:155156| Extensions | Content type |157|---|---|158| `.py`, `.js`, `.ts`, `.go`, `.rs`, `.java`, `.c`, `.cpp`, `.h`, `.sh`, `.yaml`, `.json`, `.toml` | `code` |159| `.tex`, `.bib` (in a paper or manuscript directory) | `paper` |160| `.tex`, `.bib` (in a proposal or grant directory) | `proposal` |161| `.md`, `.rst`, `.txt` (in a proposal or grant directory) | `proposal` |162| Everything else or mixed | `general` |163164If the diff spans multiple types, pick the dominant one. The user can override by saying, e.g., "review this as a proposal." For proposals, also ask which agency lens to apply (NSF or NIH) since they use different evaluation frame165166…(truncated)