Validates review findings and runs automated Git review-fix-re-review loops, DecisionConsult, or DDD/cohesion review. Requires Git and review/consult intent.
Ships in adonis-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use direct Grok CLI calls only when the user asks Grok (or a grok00x account) for an ordinary consult or one-shot review. Use the persistent packet/auto-loop protocol when explicitly requested or when continuing an existing packet; its Reviewer comes from the user's saved preference, Claude first by default (see Reviewer selection).
Choose a route before loading references:
architecture-hardening-loop or a diagnose-only architecture scan; the user asked only for a copy-ready review prompt; or they named only /codex:review / Grok /review.grok00x account) → Direct Grok below. Without Grok named, use review-loop consult with the default peer. Explicit CLI commands (including review-loop consult), auto-loop, packet, and continuation requests take precedence. Do not start a protocol loop merely because Grok is involved.review-loop run; the verified implementer context permits the default # Review Handoff origin.review-loop run --intake; the script starts truthfully from # Review Intake while retaining the auto lifecycle.review-loop consult; session recovery → review-loop sessions. This file is sufficient; load no references. agy (Antigravity) is an optional consult peer only when the user names it: never pick it automatically, by default or as a recommendation. review-loop consult has no agy peer, so call it as agent-dispatch references/accounts.md § Antigravity (agy) says.intake; ambiguity defaults to Intake.intake / feedback_validation / manual_continuation) → read references/packet-anatomy.md and references/packet-addressing.md. Add references/source-prompt-addressing.md only when source-prompt provenance exists, references/review-contract.md only for deep review, and references/example-packet.md only when diagnosing packet shape against a populated example.references/protocol-evolution-gate.md. Ordinary runs do not load it (SoT: skills/agentic-review-handoff/; sync via pnpm skills:install:local -- --skill agentic-review-handoff).open / bind / …): the CLI returns a migration error → use run / fix-completion / close / consultUse the user's existing grok or named grok00x command. Keep account selection
in that launcher; do not recreate account configuration, copy credentials, or
cycle through accounts. grok00x is a naming pattern, not a literal command.
Discover the actual command in the user's shell. If it is a shell function, invoke
it in that shell (for example zsh -ic), passing the prompt file as an argument;
never interpolate prompt text into shell code.
Keep the launcher's existing sandbox configuration; do not force an OS profile or turn an explicitly configured sandbox off. The tool allowlist permits file reads and search; remove the deferred MCP bridge tools as well as denying MCP calls. This is tool-level restriction, not OS isolation.
From the subject repository, prepare one prompt file containing the question or review scope, relevant diff/context, and required output. Request evidence-backed findings with file locations and severity; for consultation request reasons and risks. Instruct Grok to read only and return its answer without implementing.
grok --prompt-file "$PROMPT_FILE" --output-format json \
--tools read_file,grep,list_dir --disallowed-tools search_tool,use_tool --deny MCPTool --permission-mode dontAsk \
--no-subagents --disable-web-search
# For an existing account function, pass its discovered name and prompt path as
# environment values (GROK_COMMAND is a bare command name, not a command string):
GROK_COMMAND="<discovered-name>" PROMPT_FILE="$PROMPT_FILE" zsh -ic '"$GROK_COMMAND" --prompt-file "$PROMPT_FILE" --output-format json --tools read_file,grep,list_dir --disallowed-tools search_tool,use_tool --deny MCPTool --permission-mode dontAsk --no-subagents --disable-web-search'
Prefer an existing executable launcher when available. A defining shell may emit startup text; distinguish that from the CLI result instead of assuming its entire stdout is one JSON object. Do not rewrite the user's shell startup to silence it.
Use the selected command consistently, including -r <session-id> for follow-up.
The visible agent verifies findings and makes authorized fixes. Do not create a
packet, ledger, or extra orchestration script for this route. Record the selected
command and returned session ID when available; direct sessions are not listed by
review-loop sessions. Do not claim frozen-evidence or automatic-loop guarantees.
On failure follow the short startup-failure rule below; do not repair Docker.
review-loop run) — explicit automationExplicit invocation starts immediately once the Reviewer is known. Human intervenes only at: initiate (including the one Reviewer question below), terminal report, or an unresolved exception (ambiguous delivery / hash mismatch / budget / deadlock / scope or external-action decision). Ordinary findings and safely recoverable local startup faults are not confirmation gates. An unattended run defers an exhausted budget instead of asking (see Budget exhausted).
run)A fresh run has no default Reviewer; omitting --reviewer fails with REVIEWER_REQUIRED before any external call. Resolve it in this order and never ask again for the same packet:
grok, grok002, codex003, cc002, ...) → use it. An account name maps to its product (grok00x→grok, codex00x→codex, cc00x→claude) plus --reviewer-command=<name>.run --continue → inherits the stored Reviewer, launcher and --fallback list; pass nothing.--host=<visible host product> (claude / codex / grok / agy / cursor / pi; antigravity normalizes to agy, cursor-cli to cursor) instead of --reviewer (consult: instead of --peer). The script reads the user's saved Reviewer preference and uses its first product as Reviewer and the rest as --fallback. Default: claude,codex,grok, host kept (skipHost: false), so a Claude host is reviewed by a fresh read-only Claude session. Host-only values (agy, cursor, pi) do not appear in the preference order, so they always pick order[0] and order.slice(1) even when skipHost is true, and agy stays strictly opt-in-only as a consult peer (never picked automatically or added to default preference). The result's reviewerFrom says what was picked and why; state it in the start line and the terminal report. Parent workflows (architecture-hardening-loop, task-completion-loop) use this same preference.Reviewer preference. Saved per user in ${XDG_CONFIG_HOME:-~/.config}/agentic-review-handoff/config.json as { "order": [...], "skipHost": bool }. When the user states a lasting preference ("prefer codex", "以后先用 claude", "不要让宿主审自己"), save it: node "$RL" prefs --order=codex,claude,grok, --skip-host=true, or --reset for the default; node "$RL" prefs shows it (activeOrder excludes subscription families paused in sideby, e.g., sideby disable claude / sideby enable claude, and unconfigured --peer=claude / --reviewer=claude refuses paused subscriptions while explicit API launchers such as --peer-command=cc-ds remain usable). REVIEW_LOOP_REVIEWERS=codex,claude overrides the order for one shell. A one-off request ("review this one with grok") is step 1, not a preference change.
Fallback on timeout. When a Reviewer or consult peer times out, the script hands the same round to the next product in a new session (Reviewers are read-only, so the timed-out one left nothing behind), records it as fallbacks: [{ from, to, reason }] and keeps the new Reviewer for --continue. Only a timeout moves on; a user stop or any other failure stays DELIVERY_UNKNOWN. A user who named one product gets no fallback unless they asked for one; with --host, the preference supplies it. Report every fallback in the terminal report.
--reviewer-command takes a bare launcher name that starts with its product (grok*, codex*, cc*/claude*) and is a zsh/bash function defined in the rc file (.zshrc / .bashrc, not a profile file) or a PATH executable; aliases and fish functions do not resolve. The adapter runs it through an interactive shell and appends the product's read-only argv; a launcher from another family (cc002 with --reviewer=grok) or with no product prefix is rejected because those flags would not restrict it. The launcher's own flags still apply, so it must not add permission-widening flags. Never copy credentials or rotate accounts. Consult uses the same rule with --peer / --peer-command.
RL="<skill-dir>/scripts/review-loop.mjs"
REPO="$(git rev-parse --show-toplevel)"
# Start after this session implemented the change (default Review Handoff origin)
node "$RL" run --repo "$REPO" --host=claude|codex|grok|agy|cursor|pi [--base <sha>] [--rounds 3] # Reviewer + fallbacks from the preference
node "$RL" run --repo "$REPO" --reviewer=codex|grok|claude [--reviewer-command=grok002] [--fallback=grok] [--base <sha>] [--rounds 3]
# Start an explicit auto loop without verified implementer context (Review Intake origin)
node "$RL" run --intake --repo "$REPO" --reviewer=codex|grok|claude [--reviewer-command=grok002] [--fallback=grok] [--base <sha>] [--rounds 3]
# After BLOCKED or concerns_require_fix: Fixer edits code, records completion, then continues
node "$RL" fix-completion --repo "$REPO" --packet "$PACKET" --body-file /tmp/fix.md
node "$RL" run --continue --repo "$REPO" --packet "$PACKET"
# Optional review-only mode: park PASS_WITH_CONCERNS for an explicit accept/continue decision
node "$RL" run --repo "$REPO" --reviewer=codex --completion=review
node "$RL" close --repo "$REPO" --packet "$PACKET" --reason accept-concerns
# Recompute current worktree identity before an outer workflow reuses a verdict
node "$RL" evidence --repo "$REPO" --base "$BASE_SHA" [--paths=a,b]
# Advisory decision consult (not part of Verdict machine)
node "$RL" consult --repo "$REPO" --host=claude|codex|grok|agy|cursor|pi [--skip-host] --question-file /tmp/q.md # peer from the preference
node "$RL" consult --repo "$REPO" --peer=codex [--peer-command=codex002] [--fallback=grok] --question-file /tmp/q.md
# Multi-round: continue the same peer session; the follow-up is appended to the same record.
# --web adds search/fetch only (pi has none); --raw sends the file without the advisory framing.
node "$RL" consult --repo "$REPO" --resume <recordPath from the last result> [--web] [--raw] --question-file /tmp/q2.md
# Reviewer preference: show / save / reset
node "$RL" prefs [--order=claude,codex,grok] [--skip-host=true|false] [--reset]
# List recorded reviewer and consult sessions + copy-ready resume commands
# (Codex Desktop's list hides codex_exec sessions — this is the way back in)
node "$RL" sessions --repo "$REPO" [--product=codex|grok|claude|pi]
| Concept | Rule |
|---|---|
| Fixer | Visible session — sole worktree + packet writer |
| Reviewer | Headless; required on a fresh run (see Reviewer selection); optional account launcher; read-only + dontAsk |
| Origin | First H1 only: default Review Handoff; explicit --intake uses Review Intake; later rounds inherit it |
| Evidence | Per-round frozen diff under .review-handoff/runtime/<packet>/evidence/round-N.diff (tracked + untracked) |
| Rounds | Default budget 3; early stop on PASS; budget exhaust → structured report (not a Protocol Gate) |
| Timeout | 20 minutes per Reviewer invocation; advanced override: REVIEW_LOOP_TIMEOUT_MS |
| Progress | Immediate liveness line, then every 30 seconds while the Reviewer process is alive |
| STOP | Global .review-handoff/STOP or per-packet runtime/<id>/STOP |
| Sandbox | Codex OS sandbox; Grok read-only tool allowlist + MCP deny; Claude tool restrictions; no permission prompt |
Budget exhausted (budget_exhausted). Only the user adds rounds: the report's recommendation is addressed to them, so never pass --rounds on --continue yourself. Probe for an unattended run at that point: sideby is on PATH and sideby unattended status --json reports "on": true, or the host has stated that nobody is present and questions are refused (including non-interactive agy -p / run_workflow runs where the host states questions are refused). A missing or failing sideby settles nothing; without that host statement the user is present.
sideby unattended defer "<N> review findings open on <branch> after <rounds> rounds, packet <packet_id>" (N = the report's unresolved count; the short SHA on a detached HEAD; no finding text); without sideby the terminal report carries it alone. Do not commit or merge code with open findings, continue only with task parts that do not depend on it, and list the item in the terminal report.Run review-fix-re-review through review-loop run: calling a review CLI repeatedly outside this skill loses the round budget.
consult used as a code review (a diff range or worktree path plus a review word) is held to the same 3-round budget per review target: round 4+ is refused before the peer runs, with the same present/unattended next steps as above. Only the user grants more, with REVIEW_EXTRA_ROUNDS_GRANTED_BY_USER=<n>. Without --raw the peer gets a BLOCKED / PASS_WITH_CONCERNS / PASS rubric; only P0/P1 or a reproduced, diff-introduced P2 on a real user path blocks. From round 2 a Codex peer runs at high reasoning effort (REVIEW_REREVIEW_EFFORT=<level> picks another, default keeps the configured one). Prefer review-loop run for reviews.
Default completion=pass treats PASS_WITH_CONCERNS as more work: the visible Fixer repairs each actionable in-scope concern, appends Fix Completion, and re-reviews within budget. It never asks the user whether to continue. Only explicit --completion=review parks concerns in awaiting_user_decision; this is the opt-in escape hatch for review-only judgment, not the loop default.
A quiet Reviewer is not a failed Reviewer. Product CLIs commonly return
structured stdout only when the model finishes. While the child process is
alive, do not kill it, retry it, or start a second Reviewer because stdout is
silent. Trust the adapter's progress line and deadline; use STOP only when the
user intentionally cancels. A real timeout must not trigger resubmission to the
same product. Only the script may advance through the configured fallback list
as described above; without a remaining fallback, report DELIVERY_UNKNOWN.
Fallback does not prove that the timed-out invocation was never delivered.
Keep startup failures local. Report the concrete failure once; do not turn a
review into Docker/service repair. Never move or delete sockets, start shared
services, or alter account configuration as part of this skill. A failed optional
consult does not block independent work; mark that peer's opinion unavailable.
A required review remains blocked, not passed. Do not silently switch accounts or
reviewers. The script's configured timeout fallback is the sole automatic
product-switch path; report every switch. For other ambiguous delivery, or after
fallback is unavailable or exhausted, inspect the existing session rather than
resubmitting. See references/environment-recovery.md only if needed.
Contract details: references/auto-loop-contract.md.
Successful parsed rounds return evidence = { baseSha, pathFilter, digest, coveredPaths, sourceRound }. Equality uses only baseSha + pathFilter + digest; coveredPaths is audit metadata. Outer workflows must run review-loop evidence with the returned base/filter before reusing a verdict. A mismatch, missing legacy identity, or non-success status makes the review non-reusable and requires a new review or UNVERIFIED report.
Tests:
# from repo root
node --test skills/agentic-review-handoff/scripts/test/adapters.test.mjs \
skills/agentic-review-handoff/scripts/test/auto-run.test.mjs \
skills/agentic-review-handoff/scripts/test/auto-run-negatives.test.mjs \
skills/agentic-review-handoff/scripts/test/intake-run.test.mjs \
skills/agentic-review-handoff/scripts/test/consult.test.mjs \
skills/agentic-review-handoff/scripts/test/sessions.test.mjs
Review and re-review never modify the subject of review (source / docs / product / tests / configs being reviewed). Writing the packet artifact itself is part of the protocol, not an edit to that subject:
mv-ing files under $repo_root/.review-handoff/** is exactly what makes the cross-agent loop work. Treat these writes the same way you treat printing findings to the terminal.$GIT_COMMON_DIR with git rev-parse --git-common-dir and ensure its info/exclude contains /.review-handoff/ (the canonical root-anchored form). Treat the historical .review-handoff/ form as already configured. Auto-loop scripts already bootstrap this line; classic writers who need the snippet load packet-addressing.md § Git common-dir info/exclude.These survive every path (auto loop and classic):
$repo_root/.review-handoff/ — never cwd-relative. Violation → monorepo subdirectories create a second inbox or miss the root packet.# Review Handoff without implementer context — reviewers use # Review Intake instead. Violation → evidence trust boundary breaks; re-reviewers cannot independently re-attest findings.last_anchor / lifecycle_state stale. Violation → physical last H1 diverges from frontmatter; packet is unusable.Compatibility path — agent-selected stages, scripted writes. Use only when auto loop cannot express the intent:
classic_reason | When |
|---|---|
intake | Reviewer-initiated review-only packet or packet-plus-fix brief that does not need the auto lifecycle |
feedback_validation | User pasted reviewer/team feedback to validate as a defect report before fix |
manual_continuation | User continues an existing classic packet without review-loop run |
Why classic for these: classic is still the prompt-protocol path for review-only packets, pasted feedback validation, and manual packet continuation. It can stop at a portable Fix Handoff without authorizing the auto loop. Auto budget exit (budget_exhausted on final BLOCKED round, including --rounds 1) is not the same as classic "stop at Fix Handoff and wait for a human fixer."
Fresh-eyes "review this" / "second pair of eyes" / "audit this diff" without an explicit closed-loop request defaults to classic intake. Explicit auto-loop or review-fix-re-review intent without verified implementer context uses review-loop run --intake. Explicit review-fix-re-review with visible same-session implementation context uses default review-loop run. If context is ambiguous, choose an Intake origin so the protocol never fabricates an implementer Handoff.
Steps when classic is correct:
packet-anatomy.md — classic-only rows).packet-addressing.md addressing algorithm step 3 mode isolation:
mode: classic.loop: on without mode: classic, or has auto-run runtime state) → create a new classic packet; never re-label an auto packet.mode: classic
classic_reason: intake | feedback_validation | manual_continuation
Closed set only — exactly one of those three reasons. Never write these fields onto auto packets.source-prompt-addressing.md.$BODY_FILE, then append and sync frontmatter: node "$RL" classic-append --repo "$REPO" --packet "$PACKET" --body-file "$BODY_FILE" --anchor "$ANCHOR" --lifecycle "$LIFECYCLE". The script verifies disk bytes before reporting success.packet-addressing.md (not the auto-loop map) after Verdicts.# Review Intake or # Review Handoff → # Review Findings → (conditional) # Fix Handoff.# Fix Completion; re-review appends # Re-review.packet-anatomy.md. Classic lifecycle: packet-addressing.md. Auto lifecycle: auto-loop-contract.md + scripts.auto-loop-contract.md; load references/review-contract.md only on classic / deep-opt-in when that rubric is the current step.Preference or omitted — never reported as bugs.pwd, git rev-parse --show-toplevel, branch, and git status before quoting them.agents/openai.yaml (opens in a new tab)evals/evals.json (opens in a new tab)evals/trigger-eval-set.json (opens in a new tab)evals/trigger-eval.json (opens in a new tab)evals/trigger-results.json (opens in a new tab)references/auto-loop-contract.md (opens in a new tab)references/environment-recovery.md (opens in a new tab)references/example-packet.md (opens in a new tab)references/packet-addressing.md (opens in a new tab)references/packet-anatomy.md (opens in a new tab)references/protocol-evolution-gate.md (opens in a new tab)references/review-contract.md (opens in a new tab)references/source-prompt-addressing.md (opens in a new tab)scripts/review-loop.mjs (opens in a new tab)scripts/review-loop/adapters.mjs (opens in a new tab)scripts/review-loop/auto-run.mjs (opens in a new tab)scripts/review-loop/consult.mjs (opens in a new tab)scripts/review-loop/evidence.mjs (opens in a new tab)scripts/review-loop/prefs.mjs (opens in a new tab)scripts/review-loop/repositories.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/adonis-skills:agentic-review-handofffrom adonis-skills
npx claudepluginhub adonis0123/adonis-skills --plugin adonis-skills34 skills in this plugin
/agent-dispatchPick the lightest agent setup for coding, review, drafting or design research: do it yourself, fan out 2-3 workers across local CLIs and accounts (Claude Code, Codex, Grok, Cursor), run a scoped architecture loop, or brief independent researchers; choose a cross-model reviewer and track dispatched work on a Run Board. Use when work may need delegation, or the user asks to dispatch, parallelize, run several agents or accounts, get another AI's review or independent design opinions, or check dispatched work. 中文触发:派活、并行、多开几个 agent、分给多个账号 / codex / grok、找另一个 AI 审、多方意见、派出的任务进行到哪了。Not for trivial edits, a single diff review (agentic-review-handoff) or the session list (sideby sessions); inside another named workflow, only size its workers./agent-practice-auditScore local coding-agent usage (Claude/Codex/Grok/WorkBuddy/agy) against official docs into HTML report. Triggers: agent 用法体检、实践评分. Never edits config./agent-skill-evaluation