peanut-review
Skill2 starsChanged 23 days agoApache-2.0View on GitHub
Set up the local review queue, orchestrate configured reviewer personas and a dedicated curator through the peanut-review CLI, and address their findings as the developer in local review loops. Use when configuring the queue, starting or managing review sessions, or when asked to deduplicate, shorten, validate, dismiss, filter, or decide whether agent review comments are worth pushing.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cleanup-worktreesSkill
- find-security-vulnerabilitiesSkill
- gh-address-commentsSkill
- gh-fix-ciSkill
- pr-createSkill
- pr-reviewSkill
- rocjitsu-build-testSkill
- rocjitsu-projectSkill
- self-reviewSkill
- stage-and-commitSkill
- sync-reposSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
51 rules. About 0 are common, 22 are distinctive, and 29 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
29
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Use exactly the agents entries from the selected .peanut-review.json when creating a session.
- Very specific: line 58
Use --author Orchestrator for driver-authored replies and reports, and --by Orchestrator when resolving addressed comments.
- Distinctive: line 72
Never push comments, approvals, request-changes verdicts, replies, edits, or any other review state to GitHub unless the user explicitly …
- Very specific: line 106
Read comments --format json.
- Very specific: line 109
Run curate through the CLI using the session's configured curator, then confirm its round-done signal and inspect its report.
- Distinctive: line 117
Keep published/imported comments and substantive human/developer discussion intact, including necessary parent comments.
- Very specific: line 135
Do not launch or rerun reviewers, patch source, or push to GitHub during curate unless the user explicitly asks.
- Distinctive: line 164
Keep real repository names, identities, and discovery output in gitignored local files.
- Distinctive: line 221
Use project config and discoverable local facts first.
- Distinctive: line 227
If the lifecycle is unclear, ask: "Is this a local author-owned review, or a GitHub PR review?"
- Very specific: line 257
When .peanut-review.json exists, use it as-is.
- Distinctive: line 269
If that directory is missing or no session exists, inspect git worktree list --porcelain in the matching repository and reuse the …
- Distinctive: line 274
Use the synchronization procedure below to reconcile the existing directory.
- Very specific: line 276
Create a new worktree only when no suitable existing PR worktree exists or the user explicitly requests a separate one.
- Distinctive: line 289
When the PR branch exists only as a remote-tracking branch, explicitly create and track a local branch:
- Very specific: line 299
After selecting or creating the worktree, run every peanut-review start command from inside that worktree because the shared config uses …
- Very specific: line 314
Verify that the committed HEAD is the intended review snapshot before launch.
- Distinctive: line 320
Keep the directory, branch name, build artifacts, and existing session when re-reviewing an updated PR, including after a force push:
- Very specific: line 340
Verify checkout HEAD equals the latest fetched PR head, then run sync-pr and gh-pull on the same session.
- Very specific: line 353
Do not blur roots. reviewRoot is session storage/web UI data.
- Distinctive: line 358
When root/layout changed or is ambiguous, dry-run before spending reviewer runs:
- Distinctive: line 380
When build tools live outside the runner workspace, Cursor permissions must also allow the paths or commands reviewers are expected to use.
- Very specific: line 385
Use the enclosing workspace's $PR_BIN to inject local context into reviewer and curator prompts, including reruns, custom templates, and …
- Distinctive: line 410
Use this for PR numbers, PR URLs, or external author changes.
- Distinctive: line 419
Start without launching unless the checkout is already built.
- Distinctive: line 444
Read the curator's report and comments to summarize the outcome.
- Distinctive: line 458
Add one top-level verdict comment summarizing the completed configured review and curation outcome.
- Very specific: line 476
Stop after the dry-run and show the user what would be published.
- Distinctive: line 480
Only when the user explicitly asks to publish or push the review, rerun the dry-run and then push:
- Very specific: line 488
Treat gh-push-verdict the same way: never run it without explicit user authorization to publish the verdict.
- Very specific: line 491
After PR updates, follow Synchronize an existing PR worktree above, then run sync-pr and gh-pull on the existing session.
- Distinctive: line 502
Use this when the orchestrator can modify and commit the patch under review.
- Very specific: line 509
Create the session. If project config exists, reuse its complete agents lineup, including its dedicated curator.
- Very specific: line 521
Run the configured reviewers, wait for them to finish, then run the configured curator and wait for its round-done signal.
- Very specific: line 535
Use status, signals, logs, and reports to confirm the curator completed.
- Very specific: line 549
After the commit, migrate the session to the new HEAD so comment anchors follow the updated snapshot.
- Very specific: line 556
If a later reviewer finds that a resolved concern still applies, that reviewer must unresolve <c_id> before replying on the existing thread.
- Distinctive: line 558
Keep the reopened thread unresolved until the new concern has been fixed or rebutted and explicitly resolved again.
- Distinctive: line 585
Run any final project verification warranted by the implemented changes and record the configured review outcome and verification results …
- Distinctive: line 606
After any launch, monitor reports, rerun failed reviewers, and stop stale processes through the CLI:
- Very specific: line 619
Use status for a compact view, but treat signal files, comments, reports, logs, and live processes as the real health checks.
- Very specific: line 638
Use prose for impact and uncertainty.
- Very specific: line 647
Use kill-agents only when status shows stale live processes, a launch needs to be aborted, or the user explicitly asks.
- Distinctive: line 657
Use configured reviewers as-is during a review.
- Very specific: line 666
Use display-case agent names in config, e.g.
- Very specific: line 676
If the user says the review server is already up, discover its root from the running peanut_review serve --root ...
- Very specific: line 685
Use --host 0.0.0.0 when serving from Docker through a published port.
- Very specific: line 707
If an agent times out, inspect status and <session>/log/.
- Very specific: line 708
If an agent exits without round-done, treat it as failed or incomplete and use rerun --agent <name> after confirming no live reviewer …
- Distinctive: line 710
If a session was launched under bad assumptions, prefer archiving it and starting fresh over reusing stale signals/comments.
- Very specific: line 712
If the orchestrator crashes, run status, then resume from the latest comments, reports, logs, and signals.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Peanut Review
You are the orchestrator for a structured multi-agent review. Drive the review
lifecycle with tools/peanut-review/bin/peanut-review; it sets PYTHONPATH
for the local checkout, so no install step is needed.
Role Boundaries
The driver of this skill orchestrates the review and, in an authorized local development loop, acts as the developer. It does not act as a reviewer or curator. Launched agents perform only their assigned reviewer or curator role.
- Configured reviewers inspect the patch, discover and validate findings, post new review threads, and reassess fixes and rebuttals on later rounds.
- Configured curator validates and curates existing reviewer findings,
including wording, deduplication, deletion, anchor repair, and local approval
decisions. Its authoritative instructions are in
tools/peanut-review/peanut_review/templates/curator-prompt.md. - Driver prepares the session and build, launches and monitors configured agents, reads their results, and reports progress. In a local development loop it investigates curated concerns, implements and tests fixes, commits, migrates anchors, replies or rebuts in existing threads, resolves addressed concerns, and launches the next configured round.
Use exactly the agents entries from the selected .peanut-review.json when
creating a session. When resuming, use the lineup captured in session.json;
do not silently replace it with a changed project config. Entries with
role: curator are curators; the other entries are reviewers. Preserve their
names, personas, runners, models, reasoning settings, and other configured
options. Launch them through peanut-review only. Do not add ad hoc reviewers,
spawn extra review agents through another tool, substitute the driver model,
or run an additional driver, self-review, or PR-review pass. If a configured
runner fails, repair or rerun that entry; do not fill in as the reviewer.
Missing configuration requires clarification, not an invented lineup. Change
the lineup or model choices only when the user explicitly requests it.
The driver must not create new finding threads, seed the session with findings
from prior reviews or its own probes, impersonate a persona, or rewrite/delete
reviewer findings as curation. Developer investigation and verification of a
fix are allowed; an independent search for review findings is not. If an
incidental concern arises while developing, record the observation and repro
in a note report for the next configured reviewer round. The reviewer must
independently assess it and own any resulting finding.
Reports are not automatically included in agent prompts. When a report needs
reviewer or curator action, use --template on launch, rerun, or curate
with a temporary copy of the authoritative reviewer or curator template.
Preserve its existing instructions and append a request to read
${PR_BIN} --session ${SESSION} notes --agent Orchestrator --format json,
identifying the relevant report ID. Keep the configured agent settings intact;
do not edit shared templates or the prompts of running agents.
Use --author Orchestrator for driver-authored replies and reports, and
--by Orchestrator when resolving addressed comments. Do not let automated
driver actions inherit the human's Git identity. Driver comments are limited
to add-comment --reply-to <c_id> and an overall verdict that summarizes the
configured agents' outcome; the verdict must not introduce new findings.
The curator may prepare one local LGTM approval after verifying the full
finding history and completed review of the current head. Useful naming and
organization concerns can remain substantive; optional polish can coexist with
approval. Keep the approval local for the human user to publish. A scope skip
or a failed, blocked, or incomplete review is not approval evidence.
Remote Publishing Requires Explicit Authorization
Never push comments, approvals, request-changes verdicts, replies, edits, or
any other review state to GitHub unless the user explicitly asks to publish or
push it. A request to run, start, perform, or complete a review—including
/peanut-review pr ...—authorizes local review work and a push dry-run only;
it does not authorize gh-push or gh-push-verdict.
For GitHub PR reviews, prepare and curate a push-ready comment set, run
gh-push --dry-run, report exactly what would be published, and stop. If the
user later explicitly asks to push, rerun the dry-run against current session
state immediately before publishing.
Subcommands
Codex skills do not have a separate subcommand registry. Treat the first word
after /peanut-review as a routing hint when present:
/peanut-review setup-queue: configure the local review queue from checked-out projects and authenticated GitHub identities using Queue Setup. This is setup only; it does not start a review lifecycle./peanut-review curate <session-or-pr-context>: have the configured curator clean up an existing review session's comments. This is not a new reviewer pass./peanut-review pr <PR URL>: run the GitHub PR review lifecycle below./peanut-review local <base-ref>: run the author-owned local review lifecycle below./peanut-review status <session-path>: inspect or recover a session without changing comments unless asked.
For curate, orchestrate the configured curator to produce a push-ready,
author-facing comment set. Do not perform curation in the driver:
- Resolve the live session path and source checkout. If the current directory
is a wrapper, read
.peanut-review.jsonfirst and keepreviewRoot,workspaceRoot, andrepoRelativeseparate. - Read
comments --format json. Also readcomments --include-deleted --format jsonwhen duplicate cleanup, prior deletions, or mistaken cleanup might matter. - Run
curatethrough the CLI using the session's configured curator, then confirm itsround-donesignal and inspect its report. If the curator is missing or fails, use the configuration or failure workflow; the driver must not take over its role. - The curator owns validation, keep/rewrite/merge/delete decisions, and review
voice. Preserve its wording. Put any user-requested curation corrections or
operational problems in an
Orchestratorreport for a subsequent curator pass instead of editing the findings yourself. - Keep published/imported comments and substantive human/developer discussion intact, including necessary parent comments. The curator should automatically consolidate unpublished reviewer comments covering the same concern or outcome, including resolved comments, old replies, and fix acknowledgments. None of those properties alone requires preservation. Before soft-deleting redundant records, retain unique evidence, commit references, decisions, and unresolved disagreements in the survivor or curation report. Routine "fixed" or "tests pass" acknowledgments usually need at most one reply per issue and can all be deleted when they add no useful information. Keep distinct concerns separate and record the survivor for each merge. Have the curator restore necessary discussion deleted by mistake and reopen threads with renewed actionable concerns. Leave imported GitHub thread state alone unless the discussion is actually resolved or the user asks you to manage it.
- For GitHub-backed sessions, finish with
gh-push --dry-run. Treat it as authoritative for what will surface and whether anchors are pushable. If an anchor is out of range, report it to the curator for repair and repeat the dry-run after that pass completes; do not recreate the finding as the driver.
Do not launch or rerun reviewers, patch source, or push to GitHub during
curate unless the user explicitly asks. Launching the dedicated curator
agent is allowed when the user asks for curation or when a GitHub review
lifecycle reaches the automatic curation step.
Queue Setup
For first-time queue setup or mapping updates, follow the README's
one-time setup, fictional config, and validation commands.
setup-queue is a skill routing hint, not a peanut-review CLI subcommand.
- Discover the actual enclosing workspace, running server's session root and
queue-config path, and available tool checkout. Preserve existing queue
entries. The tracked
.cache/peanut-review/.peanut-review.jsoncontrols agents and review roots; the gitignored<primary-session-root>/.queue/config.jsoncontrols accounts and checkout mappings. Keep private mappings out of the tracked reviewer config. - Inventory all stored
ghidentities and canonical checkouts underprojects/<repo>/andprojects-emu/<organization>/<repo>/, excluding worktree trees. Inspect remotes and effectivepeanut-review.githubAccountGit config, includingincludeIf. Preserve saved queue/session identity choices; ask only about unresolved or conflicting mappings. Do not select accounts by Git author email or the activeghlogin. Public and EMU accounts may sharegithub.com. - For each included repository, map the PR target's
owner/repoto its canonicalpathand explicit repository-specificworktreeRoot. Useprojects/worktrees/<repo>/for public work andprojects-emu/worktrees/<organization>/<repo>/for EMU work. Reuse the existing reviewer config and its complete agent lineup.repositoriessupplies checkout hints; it does not restrict which review requests the account discovers. - Keep real repository names, identities, and discovery output in gitignored local files; use fictional names in tracked examples. Do not print or save tokens. Validate a candidate with the README's loader command, check resolved paths, then replace the local queue config while preserving a backup. The loader does not verify credentials; dashboard account status does that after startup. Show the startup/restart command, or run it when requested, using the same session root and credential environment. Configuration changes require restarting the server. Finish setup without launching reviews or publishing.
Operator Checklist
Track these items explicitly. If your harness has a todo list, create this list before running commands and keep it current.
- Choose one lifecycle: GitHub PR review or local author-owned review.
- Record the session path, source workspace, any separate build/tool root, base/topic refs or PR number, and configured reviewers.
- Ask for external facts/preferences that are not discoverable: review root, web UI root, repo layout, build/test command, session reuse/archive choice, persona lineup, runner, and model choices.
- Confirm the checkout is built/testable and reviewer-visible tools are reachable before launching reviewers.
- Confirm project config and reviewer permissions are valid.
- Prepare optional local context and verify its prompt path when available; otherwise continue without it.
- Launch reviewers and verify startup with
status, logs, andwait-all. - Inspect failed runs and non-review agent reports promptly.
- Track the last reviewed comment id for later
--sincequeries. - Wait for configured curation; in a local development loop, address every surviving finding with a fix or rebuttal. Publish only with explicit user authorization.
- Finish with the right artifact: a push-ready GitHub dry-run for PRs, or a local verdict/archive for author-owned reviews. Push only when the user explicitly asks.
Mode-specific checklist:
- GitHub PR: reuse the existing branch-backed PR worktree and session; discover existing worktrees before creating one when none is available.
- GitHub PR: prefer
start --no-launch, build/test, thenlaunch, unless the user says the checkout is already built. - GitHub PR: after all reviewers signal
round-done, letwait-alllaunch and wait for theCuratoragent by default; use--no-curateonly when scheduling a separate configured curator pass. - GitHub PR: inspect the curated feedback; do not fix code, resolve imported GitHub threads, or force rebuttal loops unless the user asks.
- GitHub PR: always finish with
gh-push --dry-runand stop unless the user explicitly asked to publish the review. - Local review: own the patch and run the iterative development loop below. Have the configured agents review and curate, address every surviving finding, commit relevant fixes, migrate anchors, reply or resolve addressed comments, and refresh the same session until the curator leaves no actionable comments.
Ask Before Guessing
Use project config and discoverable local facts first. If a choice affects where session data is written, which checkout is reviewed, or which paid/local model runner is used, and the answer is not already in the repo or user request, ask a concise question instead of inventing it. Do not ask for facts you can cheaply read from config files or CLI discovery.
If the lifecycle is unclear, ask: "Is this a local author-owned review, or a GitHub PR review?"
Working Variables
Set these descriptive names in an operator scratchpad or shell snippets:
PR_BIN=tools/peanut-review/bin/peanut-review
SESSION=<session-path>
WORKSPACE=<source-workspace>
REVIEW_ROOT=<configured-review-root>
LAST_COMMENT_ID=<last-reviewed-comment-id>Examples assume PR_BIN and the intended SESSION path are set.
Name new GitHub PR sessions <repo>-pr-<number>-<change-title>, using the PR
head branch or title for change-title. Development worktrees keep their
task-oriented names under projects/worktrees/<repo>/; a session name does
not require a matching worktree leaf. Keep descriptive suffixes and avoid bare
PR-number names.
Config And Permissions
Resolve the repository, worktree root, and intended base from workspace
instructions and LOCAL_CONTEXT.md (if present). NPI rocjitsu local sessions
use the designated internal base. For GitHub sessions, retain the PR's declared
range and flag any mismatch with the current required PR target. The public
path examples below do not override internal worktree routing.
When .peanut-review.json exists, use it as-is. In this workspace, use the
shared config at .cache/peanut-review/.peanut-review.json, run from the
branch-backed development worktree under projects/worktrees/<repo>/, and
store <repo>-pr-<number>-<change> sessions under
.cache/peanut-review/sessions/. The config defines
reviewRoot, workspaceRoot, repoRelative, reviewAgentTimeoutSeconds, and
the exact agents lineup. Point the web UI at the same reviewRoot. If no
config exists, ask before choosing persistent roots, repo layout, reviewers,
runners, or models.
peanut-review start consumes an existing checkout; it does not create a
worktree. For a GitHub-backed PR session, reuse its saved workspace and branch.
If that directory is missing or no session exists, inspect
git worktree list --porcelain in the matching repository and reuse the
branch-backed worktree associated with this PR. Verify repository, account,
and PR identity; do not repurpose an unrelated task's checkout. A force push,
divergent branch, or local edits do not justify creating another worktree.
Use the synchronization procedure below to reconcile the existing directory.
Create a new worktree only when no suitable existing PR worktree exists or the
user explicitly requests a separate one. Preserve the workspace's public/EMU
path conventions. Do not create a detached or review-only worktree under
.cache/peanut-review/. When creation is needed, run the following commands
from the claude-workspace root. When the local PR branch already exists and
is not checked out elsewhere, use:
git -C projects/<repo> worktree add \
../worktrees/<repo>/<task>-<change> \
<local-pr-branch>When the PR branch exists only as a remote-tracking branch, explicitly create and track a local branch:
git -C projects/<repo> worktree add \
--track -b <local-pr-branch> \
../worktrees/<repo>/<task>-<change> \
<remote>/<remote-pr-branch>After selecting or creating the worktree, run every peanut-review start
command from inside that worktree because the shared config uses $PWD as its
workspace. Capture absolute paths before changing directories so the workspace
tool and shared config remain reachable:
META_WORKSPACE="$PWD"
PR_BIN="$META_WORKSPACE/tools/peanut-review/bin/peanut-review"
CONFIG="$META_WORKSPACE/.cache/peanut-review/.peanut-review.json"
WORKTREE="$META_WORKSPACE/projects/worktrees/<repo>/<task>-<change>"
cd "$WORKTREE"
"$PR_BIN" start <pr> --config "$CONFIG" --dry-run --no-launchVerify that the committed HEAD is the intended review snapshot before
launch. Peanut-review pins commit ranges, so use the local author-owned
lifecycle for intended review changes that are not yet represented by the PR.
Synchronize an existing PR worktree
Keep the directory, branch name, build artifacts, and existing session when re-reviewing an updated PR, including after a force push:
- Inspect the session's live agents and worktree ownership. Wait or report a conflict if another task or active agent is using it; do not move its branch or silently create another worktree to bypass that conflict.
- Fetch the latest PR head and base with the session's selected GitHub account.
Preserve a divergent branch's old
HEADon a uniquely named local backup branch before moving it, retaining both previous PR history and local commits. - Preserve staged and unstaged edits in a named stash or other recoverable backup, recording its object ID or location. Check untracked and ignored files for collisions with paths in the fetched revision, and preserve affected files separately. Keep unaffected build directories in place; do not use a blanket stash of ignored build outputs or delete them to make checkout work.
- With the tracked checkout clean, fast-forward the existing branch when
possible. For rewritten history, use
git reset --keep <fetched-pr-head>in the same worktree after those preservation checks. Do not usereset --hardorgit clean, merge old PR history into the new review snapshot, or reapply local edits before review. If synchronization refuses a conflicting path, investigate and preserve that path before retrying. - Verify checkout
HEADequals the latest fetched PR head, then runsync-prandgh-pullon the same session. If the remote moved again, reconcile the worktree before launching. Follow project build/test instructions and retain the session's saved reviewer/curator lineup. Include backup branch names, stash object IDs, and any saved files in the handoff so local work is recoverable.
For GitHub PR and local review sessions, the config must include a dedicated
curator agent in agents, for example {"name":"Curator","model":"gpt-5.5-high",
"runner":"cursor","role":"curator"}. The curator uses a dedicated prompt, so
do not invent a curator.md persona. Do not rely on a Python default for the
curator model; missing curator config should fail before launch. Both
lifecycles require configured curation before declaring review complete.
Do not blur roots. reviewRoot is session storage/web UI data;
workspaceRoot + repoRelative identify the checkout under review. If build
outputs or project tools live outside the source checkout, make sure the actual
runner workspace and permissions let agents reach them before launch.
When root/layout changed or is ambiguous, dry-run before spending reviewer runs:
"$PR_BIN" start <pr> --config <config> --dry-run --no-launch
"$PR_BIN" start <pr> --config <config> --no-launch
SESSION=<printed-session-path>
"$PR_BIN" --session "$SESSION" launch --dry-runCursor agents need .cursor/cli.json in the actual runner workspace shown by
launch --dry-run.
mkdir -p "$WORKSPACE/.cursor"
cp tools/peanut-review/peanut_review/templates/cli.sample.json "$WORKSPACE/.cursor/cli.json"The launch command validates config and Cursor permissions. Keep
Shell(peanut-review **) allowed, and keep Shell(**) out of the deny list
because it overrides all Shell allows.
When build tools live outside the runner workspace, Cursor permissions must also allow the paths or commands reviewers are expected to use.
Optional Local Context
Use the enclosing workspace's $PR_BIN to inject local context into reviewer
and curator prompts, including reruns, custom templates, and automatic curation.
The launcher discovers the nearest LOCAL_CONTEXT.md in the runner workspace
or its parents. Keep this file gitignored in the enclosing workspace; it holds
local instructions and routes to references at their original locations.
Preserve existing files, including empty files that disable inherited context
for a subtree. No separate path setting is needed. See
setup and path resolution.
Unknown, missing, or unreadable context is optional: continue with tracked project instructions without asking for clarification or blocking the review.
While the selected agents are idle, use launch --dry-run for reviewers or
curate --dry-run for the curator. Check $SESSION/prompts/<Agent>.md for the
Optional local context section, original absolute file path, and workspace
root. Repeat when the workspace or context file changes. Dry runs rewrite
prompts; agent execution logs establish whether the file was actually read.
References stay at their original locations, separate from session storage. Prompts contain the path only; keep private mappings and contents out of tracked files and follow the references' handling rules. SSH reviewers omit local paths.
GitHub PR Review
Use this for PR numbers, PR URLs, or external author changes. Import GitHub context, run reviewers, curate findings, and prepare a push-ready preview. Publish comments or an approve/request-changes decision only when the user explicitly asks.
- Select the PR's branch-backed development worktree described above and run
from inside it. Verify that its committed
HEADis the intended snapshot; preserve any uncommitted work. Start without launching unless the checkout is already built. The command imports existing GitHub context and prints the session path.
"$PR_BIN" start <pr-number-or-url> --no-launch SESSION=<printed-session-path>- Build/test the checkout with the project workflow. For rocjitsu, use rocjitsu-build-test, including its compressed debug defaults for fresh builds. Prepare one build for the reviewed revision and tell reviewers its path, compiler, mode and available test binaries in the launch context. Reuse that build for ordinary verification; separate builds are for changed snapshots, mutations or different configurations. If reviewers need non-obvious tool paths, make them available through the runner workspace or rendered prompt before launch; do not use Agent reports as setup chat.
Launch reviewers and wait for the first pass plus automatic curation:
"$PR_BIN" --session "$SESSION" launch "$PR_BIN" --session "$SESSION" wait-all round-done --timeout 900Read the curator's report and comments to summarize the outcome. The curator owns finding validation and cleanup; use another configured curator pass for requested corrections or anchor failures. Driver replies may clarify workflow or relay an existing finding, using
--author Orchestrator, but must not introduce new review concerns. Do not resolve imported GitHub comments unless the GitHub discussion was actually resolved or the user asks you to manage it."$PR_BIN" --session "$SESSION" gh-pull "$PR_BIN" --session "$SESSION" comments "$PR_BIN" --session "$SESSION" comments --since "$LAST_COMMENT_ID"Add one top-level verdict comment summarizing the completed configured review and curation outcome. This is a lifecycle summary, not a driver review pass; cite existing findings rather than introducing new concerns:
"$PR_BIN" --session "$SESSION" add-global-comment --author Orchestrator --category request-changes --body "Configured review leaves <c_id> unresolved: ..." "$PR_BIN" --session "$SESSION" add-global-comment --author Orchestrator --category approve --body "Configured review and curation completed with no actionable findings."For self-owned PRs, GitHub may reject approve/request-changes events; use
--category commentfor the same outcome summary in that case.Preview the review payload:
"$PR_BIN" --session "$SESSION" gh-push --dry-runStop after the dry-run and show the user what would be published. Do not infer push permission from a request to review a PR, run
/peanut-review pr, complete the lifecycle, or produce a verdict.Only when the user explicitly asks to publish or push the review, rerun the dry-run and then push:
"$PR_BIN" --session "$SESSION" gh-push --dry-run "$PR_BIN" --session "$SESSION" gh-pushTreat
gh-push-verdictthe same way: never run it without explicit user authorization to publish the verdict.
After PR updates, follow Synchronize an existing PR worktree above, then
run sync-pr and gh-pull on the existing session. Rerun reviewers only for
substantial updates or a human request.
"$PR_BIN" --session "$SESSION" sync-pr
"$PR_BIN" --session "$SESSION" gh-pullLocal Author-Owned Review
Use this when the orchestrator can modify and commit the patch under review. The stopping condition is a completed curator pass with no remaining actionable curated findings. A clean reviewer pass without a completed curator pass is not enough.
Iterative Local Development Loop
Create the session. If project config exists, reuse its complete
agentslineup, including its dedicated curator. If no curator is configured, ask before changing the lineup."$PR_BIN" --session "$SESSION" init \ --workspace "$WORKSPACE" \ --base <base-ref> \ --topic HEAD \ --agents '<agents-json-or-file>'Run the configured reviewers, wait for them to finish, then run the configured curator and wait for its
round-donesignal. Local sessions do not launch the curator automatically. Inspect the curated unresolved comments, including the curator report and deleted comments when needed to understand the result."$PR_BIN" --session "$SESSION" launch "$PR_BIN" --session "$SESSION" wait-all round-done --timeout 900 "$PR_BIN" --session "$SESSION" curate "$PR_BIN" --session "$SESSION" status "$PR_BIN" --session "$SESSION" comments --unresolved --format jsonUse
status, signals, logs, and reports to confirm the curator completed;wait-allwaits for reviewers only in a local session. If the curator leaves no actionable comments, continue to step 5.- Act as the developer addressing every curated finding; do not silently skip
any. Investigate the reported behavior, apply real fixes, and run
proportionate verification. For findings that should not be fixed, add a
concrete rebuttal with
add-comment --reply-to <c_id> --author Orchestratorso the configured reviewers can reassess it on the next round. Check the implementation diff for intended changes as a developer; do not conduct another review pass or create finding threads. When code changed, stage only relevant paths and commit the iteration locally using the project's commit workflow. Do not create empty commits and do not push. After the commit, migrate the session to the new
HEADso comment anchors follow the updated snapshot. Then reply to and resolve comments addressed by the commit; keep genuinely outstanding comments unresolved. Leave comment cleanup to the curator under the rules above. Preserve the substantive commit/fix/rebuttal discussion and necessary parent comments, while allowing the curator to consolidate redundant local reviewer records and routine acknowledgments even when they are resolved or from an earlier round. If a later reviewer finds that a resolved concern still applies, that reviewer mustunresolve <c_id>before replying on the existing thread. Keep the reopened thread unresolved until the new concern has been fixed or rebutted and explicitly resolved again. The curator must unresolve it as a safety net if a reviewer adds an actionable reply without doing so. Refresh the review by rerunning every configured reviewer in the same session, wait for the reviewer round, and run the curator again. Repeat from step 2 until the curator leaves no actionable findings. Here, "refresh" meansmigrateplus a full configured-reviewer rerun and curator pass; there is norefreshCLI subcommand."$PR_BIN" --session "$SESSION" migrate "$PR_BIN" --session "$SESSION" add-comment --reply-to <c_id> --author Orchestrator --body "Addressed in <commit>: ..." "$PR_BIN" --session "$SESSION" resolve <c_id> --by Orchestrator "$PR_BIN" --session "$SESSION" rerun \ --agent <reviewer-1> --agent <reviewer-2> "$PR_BIN" --session "$SESSION" wait-all round-done --timeout 900 "$PR_BIN" --session "$SESSION" curate "$PR_BIN" --session "$SESSION" comments --since "$LAST_COMMENT_ID"List every configured reviewer with a repeated
--agent; do not rerun the curator throughrerun. Track each round's starting comment id and use--since <comment-id>to isolate new feedback. There is no round counter.At the clean stopping point, confirm the configured reviewers and curator completed against the final
HEAD, with the full session base-to-head diff available to them. Do not add a final driver review of the aggregate diff. Run any final project verification warranted by the implemented changes and record the configured review outcome and verification results in the final verdict. If final verification requires another code fix, repeat the configured review/curation loop after committing and migrating. A verdict writesresult.jsonbut does not close the session or prevent later reruns."$PR_BIN" --session "$SESSION" verdict --approve --body "All substantive findings addressed" "$PR_BIN" --session "$SESSION" verdict --request-changes --body "X can lose data; please address before merging"Summarize the complete result and local commits, then stop so the user has a chance to push them through the normal development workflow. Do not push on the user's behalf unless separately authorized. If the branch has a PR, offer to update its title and description after the user confirms the remote contains the final commits. Re-read the pushed PR and complete diff before proposing metadata, and update remote PR metadata only with explicit user authorization.
Shared Review Mechanics
After any launch, monitor reports, rerun failed reviewers, and stop stale processes through the CLI:
"$PR_BIN" --session "$SESSION" status
"$PR_BIN" --session "$SESSION" wait-all round-done --timeout 900
"$PR_BIN" --session "$SESSION" comments
"$PR_BIN" --session "$SESSION" launch --agent Irene
"$PR_BIN" --session "$SESSION" rerun --agent Irene
"$PR_BIN" --session "$SESSION" kill-agents
"$PR_BIN" --session "$SESSION" kill-agents --agent IreneUse status for a compact view, but treat signal files, comments, reports, logs,
and live processes as the real health checks. process=... is supervisor-owned
runtime status; review=done means the agent posted round-done. There is no
separate session lifecycle state: web progress is derived from reviewer and
Curator runtime status, and an optional verdict is stored independently.
wait-all round-done reports successful/failed completion counts and stops
waiting on terminal failures. Its --max-reviewer-failures N option defaults to
zero; use a nonzero allowance only when requested. Allowing curation after a
failure does not make the dashboard certify a complete review or authorize an
approval. Recover failed reviewers and complete the configured review loop.
Saved snapshots retain their Git objects independently of the worktree.
retain-git --repo <surviving-repository> repairs older session storage. Curator
recovery reuses the saved branch's worktree or restores a missing checkout at
its recorded path; it never resets a moved branch or overwrites local work.
For mismatched or dirty worktrees, follow the synchronization procedure above.
Prepare any missing build environment or Cursor permissions before launching.
Use prose for impact and uncertainty; comment commands no longer accept
--severity. Keep agent scratch files in <session>/tmp/, with separate agent
directories. Explicit persona-directed scope skips are exempt from tests and
must record a reason in a note before signaling completion.
The authoritative reviewer prompt is
tools/peanut-review/peanut_review/templates/agent-prompt.md; do not maintain
a second skill-local copy. It tells agents to signal round-done and exit. The
supervisor should stop a lingering process shortly after observing that signal.
Use kill-agents only when status shows stale live processes, a launch needs
to be aborted, or the user explicitly asks.
There is no interactive agent help channel. If a reviewer is blocked, it may
record one Review Blocked report and exit without round-done; inspect the
runner log/report, fix the environment, then rerun it. Review discussion stays
in comments and anchored comment replies.
Reviewer Selection
Use configured reviewers as-is during a review. When authoring config, ask
before changing persistent roots, runners, personas, or models. If asked to
choose a lineup, include Vera, one domain expert suited to the patch, and two
or three breadth reviewers such as Felix, Petra, or Soren. Map tier: expert
personas to the strongest available model and
tier: standard to a balanced/fast model. Discover models with
cursor-agent --list-models or opencode models; common Codex ids are
gpt-5.5-high, gpt-5.5, gpt-5.4, and gpt-5.3-codex.
Use display-case agent names in config, e.g. Vera, while keeping persona
filenames lowercase, e.g. vera.md. The web UI shows the configured agent
name.
Web UI
The web UI reads the same session storage as the CLI. Its --root should match
the configured reviewRoot; without --root, it uses $PEANUT_SESSION's
parent if set, otherwise /tmp/peanut-review.
If the user says the review server is already up, discover its root from the
running peanut_review serve --root ... process and use that for session
storage instead of starting a new server or guessing a different root.
"$PR_BIN" serve --root "$REVIEW_ROOT" --host 0.0.0.0 --port 27183
"$PR_BIN" stop --root "$REVIEW_ROOT"Use --host 0.0.0.0 when serving from Docker through a published port. For a
direct connection, leave --base-url unset and open the server root. Set a
base URL only behind a reverse proxy that strips the same prefix before
forwarding requests.
Runners
- cursor:
cursor-agent --printthrough Shell/CLI, not MCP; isolated runtime home under<session>/runtime/cursor/. - opencode:
opencode run; model ids areprovider/model, includingopenai/*,opencode/*, or localllama.cpp/*. - codex:
codex exec; requirescodex loginand gets--add-dir <session>so it can write session files. Set per-agent"fastMode": trueto enable Codex fast mode. It defaults tofalse.
Agents submit findings, comment replies, non-review reports, and completion
signals with peanut-review CLI commands from the rendered prompt. The note
channel is only for reports such as test execution and comment curation; notes
are not pushed to GitHub.
Failure Handling
- If an agent times out, inspect
statusand<session>/log/. - If an agent exits without
round-done, treat it as failed or incomplete and usererun --agent <name>after confirming no live reviewer remains. - If a session was launched under bad assumptions, prefer archiving it and starting fresh over reusing stale signals/comments.
- If the orchestrator crashes, run
status, then resume from the latest comments, reports, logs, and signals.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

