agentleFS
sjain-stanfordsjain-stanford/claude-workspace/skills/peanut-review/SKILL.md

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.

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
  1. Very specific:

    Use exactly the agents entries from the selected .peanut-review.json when creating a session.

    line 30
  2. Very specific:

    Use --author Orchestrator for driver-authored replies and reports, and --by Orchestrator when resolving addressed comments.

    line 58
  3. Distinctive:

    Never push comments, approvals, request-changes verdicts, replies, edits, or any other review state to GitHub unless the user explicitly …

    line 72
  4. Very specific:

    Read comments --format json.

    line 106
  5. Very specific:

    Run curate through the CLI using the session's configured curator, then confirm its round-done signal and inspect its report.

    line 109
  6. Distinctive:

    Keep published/imported comments and substantive human/developer discussion intact, including necessary parent comments.

    line 117
  7. Very specific:

    Do not launch or rerun reviewers, patch source, or push to GitHub during curate unless the user explicitly asks.

    line 135
  8. Distinctive:

    Keep real repository names, identities, and discovery output in gitignored local files.

    line 164
  9. Distinctive:

    Use project config and discoverable local facts first.

    line 221
  10. Distinctive:

    If the lifecycle is unclear, ask: "Is this a local author-owned review, or a GitHub PR review?"

    line 227
  11. Very specific:

    When .peanut-review.json exists, use it as-is.

    line 257
  12. Distinctive:

    If that directory is missing or no session exists, inspect git worktree list --porcelain in the matching repository and reuse the …

    line 269
  13. Distinctive:

    Use the synchronization procedure below to reconcile the existing directory.

    line 274
  14. Very specific:

    Create a new worktree only when no suitable existing PR worktree exists or the user explicitly requests a separate one.

    line 276
  15. Distinctive:

    When the PR branch exists only as a remote-tracking branch, explicitly create and track a local branch:

    line 289
  16. Very specific:

    After selecting or creating the worktree, run every peanut-review start command from inside that worktree because the shared config uses …

    line 299
  17. Very specific:

    Verify that the committed HEAD is the intended review snapshot before launch.

    line 314
  18. Distinctive:

    Keep the directory, branch name, build artifacts, and existing session when re-reviewing an updated PR, including after a force push:

    line 320
  19. Very specific:

    Verify checkout HEAD equals the latest fetched PR head, then run sync-pr and gh-pull on the same session.

    line 340
  20. Very specific:

    Do not blur roots. reviewRoot is session storage/web UI data.

    line 353
  21. Distinctive:

    When root/layout changed or is ambiguous, dry-run before spending reviewer runs:

    line 358
  22. Distinctive:

    When build tools live outside the runner workspace, Cursor permissions must also allow the paths or commands reviewers are expected to use.

    line 380
  23. Very specific:

    Use the enclosing workspace's $PR_BIN to inject local context into reviewer and curator prompts, including reruns, custom templates, and …

    line 385
  24. Distinctive:

    Use this for PR numbers, PR URLs, or external author changes.

    line 410
  25. Distinctive:

    Start without launching unless the checkout is already built.

    line 419
  26. Distinctive:

    Read the curator's report and comments to summarize the outcome.

    line 444
  27. Distinctive:

    Add one top-level verdict comment summarizing the completed configured review and curation outcome.

    line 458
  28. Very specific:

    Stop after the dry-run and show the user what would be published.

    line 476
  29. Distinctive:

    Only when the user explicitly asks to publish or push the review, rerun the dry-run and then push:

    line 480
  30. Very specific:

    Treat gh-push-verdict the same way: never run it without explicit user authorization to publish the verdict.

    line 488
  31. Very specific:

    After PR updates, follow Synchronize an existing PR worktree above, then run sync-pr and gh-pull on the existing session.

    line 491
  32. Distinctive:

    Use this when the orchestrator can modify and commit the patch under review.

    line 502
  33. Very specific:

    Create the session. If project config exists, reuse its complete agents lineup, including its dedicated curator.

    line 509
  34. Very specific:

    Run the configured reviewers, wait for them to finish, then run the configured curator and wait for its round-done signal.

    line 521
  35. Very specific:

    Use status, signals, logs, and reports to confirm the curator completed.

    line 535
  36. Very specific:

    After the commit, migrate the session to the new HEAD so comment anchors follow the updated snapshot.

    line 549
  37. Very specific:

    If a later reviewer finds that a resolved concern still applies, that reviewer must unresolve <c_id> before replying on the existing thread.

    line 556
  38. Distinctive:

    Keep the reopened thread unresolved until the new concern has been fixed or rebutted and explicitly resolved again.

    line 558
  39. Distinctive:

    Run any final project verification warranted by the implemented changes and record the configured review outcome and verification results …

    line 585
  40. Distinctive:

    After any launch, monitor reports, rerun failed reviewers, and stop stale processes through the CLI:

    line 606
  41. Very specific:

    Use status for a compact view, but treat signal files, comments, reports, logs, and live processes as the real health checks.

    line 619
  42. Very specific:

    Use prose for impact and uncertainty.

    line 638
  43. Very specific:

    Use kill-agents only when status shows stale live processes, a launch needs to be aborted, or the user explicitly asks.

    line 647
  44. Distinctive:

    Use configured reviewers as-is during a review.

    line 657
  45. Very specific:

    Use display-case agent names in config, e.g.

    line 666
  46. Very specific:

    If the user says the review server is already up, discover its root from the running peanut_review serve --root ...

    line 676
  47. Very specific:

    Use --host 0.0.0.0 when serving from Docker through a published port.

    line 685
  48. Very specific:

    If an agent times out, inspect status and <session>/log/.

    line 707
  49. Very specific:

    If an agent exits without round-done, treat it as failed or incomplete and use rerun --agent <name> after confirming no live reviewer …

    line 708
  50. Distinctive:

    If a session was launched under bad assumptions, prefer archiving it and starting fresh over reusing stale signals/comments.

    line 710
  51. Very specific:

    If the orchestrator crashes, run status, then resume from the latest comments, reports, logs, and signals.

    line 712

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.json first and keep reviewRoot, workspaceRoot, and repoRelative separate.
  • Read comments --format json. Also read comments --include-deleted --format json when duplicate cleanup, prior deletions, or mistaken cleanup might matter.
  • Run curate through the CLI using the session's configured curator, then confirm its round-done signal 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 Orchestrator report 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.json controls agents and review roots; the gitignored <primary-session-root>/.queue/config.json controls accounts and checkout mappings. Keep private mappings out of the tracked reviewer config.
  • Inventory all stored gh identities and canonical checkouts under projects/<repo>/ and projects-emu/<organization>/<repo>/, excluding worktree trees. Inspect remotes and effective peanut-review.githubAccount Git config, including includeIf. Preserve saved queue/session identity choices; ask only about unresolved or conflicting mappings. Do not select accounts by Git author email or the active gh login. Public and EMU accounts may share github.com.
  • For each included repository, map the PR target's owner/repo to its canonical path and explicit repository-specific worktreeRoot. Use projects/worktrees/<repo>/ for public work and projects-emu/worktrees/<organization>/<repo>/ for EMU work. Reuse the existing reviewer config and its complete agent lineup. repositories supplies 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, and wait-all.
  • Inspect failed runs and non-review agent reports promptly.
  • Track the last reviewed comment id for later --since queries.
  • 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, then launch, unless the user says the checkout is already built.
  • GitHub PR: after all reviewers signal round-done, let wait-all launch and wait for the Curator agent by default; use --no-curate only 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-run and 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-launch

Verify 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:

  1. 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.
  2. Fetch the latest PR head and base with the session's selected GitHub account. Preserve a divergent branch's old HEAD on a uniquely named local backup branch before moving it, retaining both previous PR history and local commits.
  3. 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.
  4. 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 use reset --hard or git 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.
  5. Verify checkout HEAD equals the latest fetched PR head, then run sync-pr and gh-pull on 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-run

Cursor 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.

  1. Select the PR's branch-backed development worktree described above and run from inside it. Verify that its committed HEAD is the intended snapshot; preserve any uncommitted work.
  2. 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>
  3. 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.
  4. 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 900
  5. Read 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"
  6. 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 comment for the same outcome summary in that case.

  7. Preview the review payload:

    "$PR_BIN" --session "$SESSION" gh-push --dry-run

    Stop 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.

  8. 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-push

    Treat gh-push-verdict the 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-pull

Local 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

  1. Create the session. If project config exists, reuse its complete agents lineup, 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>'
  2. Run the configured reviewers, wait for them to finish, then run the configured curator and wait for its round-done signal. 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 json

    Use status, signals, logs, and reports to confirm the curator completed; wait-all waits for reviewers only in a local session. If the curator leaves no actionable comments, continue to step 5.

  3. 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 Orchestrator so 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.
  4. After the commit, migrate the session to the new HEAD so 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 must unresolve <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" means migrate plus a full configured-reviewer rerun and curator pass; there is no refresh CLI 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 through rerun. Track each round's starting comment id and use --since <comment-id> to isolate new feedback. There is no round counter.

  5. 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 writes result.json but 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 Irene

Use 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 --print through Shell/CLI, not MCP; isolated runtime home under <session>/runtime/cursor/.
  • opencode: opencode run; model ids are provider/model, including openai/*, opencode/*, or local llama.cpp/*.
  • codex: codex exec; requires codex login and gets --add-dir <session> so it can write session files. Set per-agent "fastMode": true to enable Codex fast mode. It defaults to false.

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 status and <session>/log/.
  • If an agent exits without round-done, treat it as failed or incomplete and use rerun --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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.