/vivswan-skills:rubber-duck-reviewfrom Vivswan Skills
Use when asked to rubber duck a change, get a second opinion, or run an independent cross-model review of code changes.
Ships in Vivswan 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.
Get a second opinion on code changes from a different model while you keep ownership of the task.
Use this skill when someone asks for:
/rubber-duck-reviewscripts/run-review.mts (step 4). Pick the reviewer by which model you are:
codex, fallback copilot.claude, fallback copilot.read-only mode, its live web search asked for. A read, a search (the web search included), or a command its sandbox can run goes unasked. A file edit, or a command the sandbox refuses (a write, shell network), asks and is refused; the trajectory shows the refusal, and the review fails naming it when codex ends the turn on it.plan mode. Its read-only tools run unasked, and whatever asks (a write, a plan approval, a web tool its settings gate) is refused; the review fails naming it when claude ends the turn on it.git diff, typecheck) but writes are blocked. copilot can only read and grep files. That self-checking makes findings concrete.--network asks for it, the script reviews a snapshot copy instead (step 4), allowing the commands codex asks to run there and a network-only sandbox grant. Nothing confines a command inside the copy: the copy keeps a write it forbade out of the checkout by path alone, and a file edit through codex's own tool is refused under both.CODEX_CONFIG carries web_search = live over the caller's own; a managed install that caps the modes still wins), and where its provider offers hosted search it searches and opens pages under read-only. Shell network stays refused there; --network (step 4) opens it by the snapshot copy.--stall <seconds> (default 900): a stream with no byte for that long gets its reviewer killed, process group included, and the review fails as stalled: no stream event for 900 s. Relaunch that one review once. Specimen: a codex round sat three hours behind a stuck browser-extension host it had spawned, silent, while a 3600 s wait ran.Ask for a review of the relevant changes and surrounding context only.
Always include: This is a review-only task. Do not edit, write, or modify any files. Only read and report findings.
Tell it how to see the change, naming the same target the convergence gate scopes to, rather than pasting diffs. It follows imports and cross-file behavior better that way.
Before a commit, that is "run git --no-pager diff --cached and read the new files". For a branch or PR, it is "run git --no-pager diff <base>...HEAD" with the branch's actual base. git diff HEAD is neither: empty on a committed branch, and polluted by unstaged edits before a commit.
Ask the reviewer to look for:
Correctness issues
Demonstrable defects: a correctness finding earns work when it names a concrete input or state and the wrong output, crash, or data loss it produces in the change under review. A maintainability finding earns work when it points at something concrete in this change, per the next bullet.
Naming or design choices that are already awkward in this change: a name that misleads about what the code does today, or duplication and structure introduced here
Workarounds propped up by long justification comments: if it takes a paragraph-long comment to argue the workaround is OK, the code is wrong. Flag both the comment and the code for fixing.
The standing library question, verbatim: "Does any code this change adds, moves, touches, reuses, or depends on do what a good library or a tool already in the repository does? Name it and what it covers." A moved or reused helper is reviewed as if new. A confirmed one is a blocking finding (the /code-standards skill's rule).
A large library or an unclear fit is a blocking entry whose claim begins Ask the owner: and names the library; the driver puts it to the user and builds nothing until they answer. A library that needs a runtime or API the repository has dropped is not a fit, and not a finding.
The standing test question: for each NEW test in the change, the fact it pins that the source does not already say. The reviewer never asks for a test without naming that fact.
needs equals the list in the yaml, a constant pinned to its own literal, a config file the repository ships parsed and asserted back./code-standards skill's tests reference owns the rule, its three valid answers, and where a constant's value is pinned instead.PII in anything the change publishes: anything that tells a reader who the author is, how they work, or how their machine is set up, including values measured or copied from the author's real environment. Every fixture is hand-authored. A provenance comment naming real data is a finding.
The template carries the wording. The /pr-and-issue-discipline skill owns the rule and its substitutes. Paste the PR title, body, and comments into the prompt, since a sandboxed reviewer may not reach GitHub.
Platform claims, in the template's words: "Verify every claim about a platform (AWS, Cloudflare, GitHub, Tailscale, NixOS, a provider) against its current online documentation and cite the page; a claim you could not verify is reported as unverified, never as a finding and never as settled." The reviewer has the web (step 1); the template says which instrument.
Specimen: a WAF rule compared http.request.headers.names to Authorization, and review rounds passed it. The provider's page says the field keeps the case received and HTTP/2 lowercases header names, so the comparison never sees the header an HTTP/2 client sends as authorization. The fact lived on the page, not in the diff.
The web is for doubt too: the template tells the reviewer to look up anything it is unsure of, or that may have moved since it learned it (a library's current API, a default, a version), before deciding, and to name the page.
Fill the template's External facts this change relies on slot with the platform claims you know the change leans on, each with its page when you know it. The reviewer verifies each against the current page all the same; the slot saves the search and names what you lean on.
Speculative hardening (hostile callers that cannot reach the code, races in single-user tools, deadlines already bounded by an outer timeout, defensive checks for inputs the code never receives) is listed under a Recorded, not built heading, never as a finding. It stays unbuilt unless the user asks for it.
In a repository with outside users or a hostile-input surface (a published package, a public service), or when the user asks, it is instead surfaced to the user and built only after they confirm (step 6). A small, obvious hardening that rides along in the change under review (an exit-code check beside a version check) is fine to keep. The reviewer must not propose a wider one to replace it.
Companion skills' criteria ride in by the script, never from memory. A launch through scripts/run-review.mts appends a ## Companion review criteria section naming the page of every installed skill of this collection that declares ## Review Criteria, one line each with its real path, and tells the reviewer to read and apply each. Triage the resulting findings with that skill's own workflow.
skills-lock.json above the skills directory, and the global .skill-lock.json), the skills under the same source as this skill's. A checkout of the repository counts what its plugin manifest lists. Another collection's skill never rides in by default, even when it declares the heading. No record at all is said on stderr, never silent.bun "<skill-dir>/scripts/run-review.mts" criteria.disable-model-invocation: true in its frontmatter) is never appended by default, since automatic folding is a model invocation; it rides in only when --criteria names it.Specimen: a lead's fifteen briefs pointed builders at the prompt template and never said "expand code-standards"; about thirty rounds in one day passed closure factories and paragraph comments the house rules forbid.
## <Context> Review Criteria is not picked up: that skill folds its own criteria into the reviews it launches itself. The pages are named, never pasted, so the prompt stays short and the reviewer reads each skill's own words.--criteria <name>[,<name>] names the given skills alone, any installed one that declares the heading, for the one exception: someone else's PR, where the /reply-and-review-discipline skill's lens choice names them. --criteria none appends nothing. A name that declares no section is a usage error naming the ones that do.criteria field lists the names that went in, so a converged report can cite its rubric (step 7).Ask for prioritized findings (blocking vs non-blocking), and ask it to say so plainly if the code is correct. This keeps re-reviews terminable.
The report is one JSON object: blocking, non_blocking, and unverified arrays of {where, claim, evidence}, a recorded_not_built string array, and a summary. Paste the report-format block from the template. Every reviewer has only the prompt to go on, and the script's own reading of the final message holds each to the same contract.
If the user has already declined or reverted something in this thread, add a short Already decided / out of scope section so the reviewer does not keep re-raising it.
On a re-review, state which fixes were already applied so it focuses on what remains.
For a reusable prompt template, see references/reviewer-prompt.md.
This skill ships scripts/run-review.mts (the path is relative to the installed skill folder, not the repo under review). It encapsulates the launch pitfalls:
$(...) in the prompt stay literal)bun "<skill-dir>/scripts/run-review.mts" --help:
usage: run-review.mts <codex|claude|copilot> <prompt-file> [--background] [--network] [--stall <seconds>] [--criteria <names>|none]
codex runs through the codex-acp adapter on PATH (npm install -g @agentclientprotocol/codex-acp) in its read-only mode: a file edit it asks for is refused, and the review fails naming it when codex ends the turn on it
claude runs through the claude-agent-acp adapter on PATH (npm install -g @agentclientprotocol/claude-agent-acp) in its plan mode: its read-only tools run unasked, and whatever asks (a write, a plan approval) is refused
run-review.mts <codex|claude|copilot> --extract <output-file>
run-review.mts <codex|claude|copilot> --extract --wait <output-file> [--timeout <seconds>] (polls every 2 s; default timeout 3600)
run-review.mts <codex|claude|copilot> <prompt-file> --capture <dir> [--network] [--stall <seconds>] [--criteria <names>|none] (internal)
run-review.mts prepare <section>
run-review.mts criteria [--criteria <names>|none] (prints the block a launch appends, for a review run through a dedicated tool)
the prompt gets a '## Companion review criteria' section naming the SKILL.md of every installed skill of this collection (the installer's
records say which: every skills-lock.json above the skills directory and the global .skill-lock.json; a checkout of the repository counts what its plugin manifest lists) that declares '## Review Criteria',
except a skill whose frontmatter says disable-model-invocation: true, which rides in only when named;
--criteria <name>[,<name>] names skills (any installed one that declares the heading), --criteria none appends nothing; the report's criteria lists the names
scratch (rubber-duck-*) lives under the OS tmp dir for 24 hours, finished reviews the newest 100 at most; prepare and a launch purge the rest, and the count never takes a review still running
codex whose bubblewrap sandbox cannot start reviews a snapshot copy of the repository inside its scratch dir, where the commands it asks to run are allowed; under a working sandbox only reads and searches are
codex's web search: every launch sets CODEX_CONFIG to web_search = live merged over the caller's own (a JSON object the adapter folds into the session config; unset or blank is none, and not JSON or not an object is a usage error)
--network reviews the snapshot copy by choice, so codex's shell reaches the network (curl, an API read); codex alone, since claude's plan mode has its web tools and copilot cannot reach the network
a reviewer silent for --stall seconds (default 900) is killed with its process group and the review fails as stalled: no stream event for <n> s
prints: the JSON report (verdict, tool_calls, capture, trajectory, and sandbox only when codex reviewed the snapshot copy); --background prints output-file: <path> and pid: <n>
exits: 0 verdict printed, or a --background launch started (its verdict comes via --extract);
1 review FAILED - relaunch: no usable verdict, whatever the cause, a stall, or --wait timed out; never a clean pass;
2 usage error, the reviewer binary not installed, or codex's sandbox unavailable outside a git repository
Write the step-3 prompt to a tmp file and pass the reviewer name plus that file. Several agents (or several sections of one fan-out) review at once on one machine. A predictable name such as /tmp/rubber-duck-prompt-<section>.md lets one writer overwrite another's prompt before the script reads it, so the script mints the path:
prepare <section> creates a private directory with mkdtemp (atomic, so two callers can never receive the same one), leaves its marker there, and prints the section's prompt file inside it.TMPDIR.Where the harness sandbox refuses a Bash heredoc whose text contains git commands (some agent-worktree setups do, unable to verify the command stays inside the worktree), write the prompt file with the harness's file-writing tool:
# 1. Mint the prompt path, one call per review section. Shell state does not survive
# between tool calls, so copy the printed path by hand:
bun "<skill-dir>/scripts/run-review.mts" prepare api-gateway # prints e.g. /tmp/rubber-duck-prompt-Kq3mZp/api-gateway.md
# 2. Write the step-3 prompt to that path with the harness's file-writing tool (a heredoc
# with a quoted delimiter serves where the sandbox allows it).
# 3. Then, in one shell call:
prompt_file="/tmp/rubber-duck-prompt-Kq3mZp/api-gateway.md"
bun "<skill-dir>/scripts/run-review.mts" codex "$prompt_file" # codex|claude|copilot per step 1
codex: runs the codex-acp adapter on PATH (npm install -g @agentclientprotocol/codex-acp) as an ACP session in codex's read-only mode. The prompt travels in the request, and every session update and permission request lands in the capture.
the reviewer asked to edit (apply_patch); a review is read-only.config.toml says, though a managed install that caps web search modes still wins: the launch sets CODEX_CONFIG to {"web_search": "live"} merged over the caller's own CODEX_CONFIG (a JSON object the adapter folds into the session config, other keys kept). A web search is a search tool call that never asks.CODEX_CONFIG that is not JSON is refused here, where the adapter would die on it unnamed. One that is not an object is refused because the key has nowhere to go. Both are usage errors; an unset or blank one reads as none.codex sandbox -- true. --network skips the probe and takes the copy outright. On Linux codex runs every sandboxed command under bubblewrap (Seatbelt on macOS), and a container whose AppArmor profile denies mount propagation refuses it at start: bwrap: Failed to make / slave: Permission denied.codex-acp bundles is probed the same way, so an adapter-only install in such a container still gets the snapshot copy.--network, switches the launch. The script snapshots the repository through git into the review's scratch dir and runs the session from the cwd's twin there (the copy's root when the cwd holds nothing tracked).git diff --cached or git diff <base>...HEAD in the copy show the change the prompt names.not removed in review.err), and the report and the launch record carry sandbox: "copy". A line in review.err, and on stderr in the foreground, names why the copy was taken and its path.claude: runs the claude-agent-acp adapter on PATH (npm install -g @agentclientprotocol/claude-agent-acp) as an ACP session in Claude Code's plan mode: its read-only tools run unasked, and a write or a plan approval asks and is refused; claude then ends the turn, and the review fails naming it.copilot: runs copilot -p <prompt> -s --available-tools=view,rg,glob --deny-tool=write --deny-tool=shell --disable-builtin-mcps. Last-resort fallback, so prefer codex/claude. Its limits:
git diff and no typecheck, so name the files to read.--criteria <name>[,<name>] or --criteria none: which installed skills' Review Criteria pages the launcher names in the prompt (step 3). Absent, this collection's declaring skills.--network: codex reviews the snapshot copy by choice (the copy mode above, chosen rather than fallen back to), so the commands it asks to run are allowed and its shell reaches the network: curl, an API read. Nothing confines them there; the copy keeps a write out of the checkout by path alone.
request_permissions tool) is allowed there too when it asks for network alone, so network access goes through and codex's own edits stay refused. Under read-only it is refused. A refused grant ends no turn: codex goes on without it, and the trajectory shows the denial.curl against which page, which API read).--stall <seconds> (default 900): how long the captured stream may stay silent before the launcher kills the reviewer and its process group and fails the review as stalled. Every byte on stdout or stderr resets it, so a slow review that keeps talking is never a stall. Raise it for a reviewer that prints nothing until the end (copilot) on a very large change.--background and then wait in bounded foreground calls (step 5): a worker that ends its turn waiting for a background reviewer's completion notification never gets one.--background prints exactly two lines, output-file: <path> and pid: <n>.
output-file is the captured stream. A detached monitor records the reviewer's exit status beside it.--extract --wait (step 5); a subagent uses it for a review that may outlast one foreground call, with step 5's bounded waits.review FAILED line; the codex copy mode adds its notice first). Silence in between is normal. A real review can take a while.bun 1.4.4 or newer (the frontmatter read uses its YAML parser, and the copy's CODEX_HOME goes through its native realpath, which an older bun resolves by the text).exits: lines of the usage block above. Step 5 says what to do on each.Exit 0 from a foreground run or --extract: stdout is one JSON report. (A --background launch also exits 0, printing only the output path and PID. Its verdict comes from --extract.)
verdict.blocking and verdict.non_blocking: the findings, each {where, claim, evidence}. Triage them per steps 6-7: apply or reject each one.verdict.recorded_not_built: speculative hardening the reviewer set aside. Step 6 says what happens to it.verdict.unverified: platform claims the reviewer could not check against current documentation, each with what it searched or opened. Neither findings nor passes. Step 6 says how you settle them.verdict.summary: what was reviewed and how. Treat a plain "the code is correct" as convergence input, not a reason to skip re-review after fixes.tool_calls, trajectory: how many tool calls preceded the verdict (reads, commands, web searches and fetches alike, never a think), and a compact row per reviewer step. A verdict whose trajectory shows a single git diff and no reads of the changed files is a weak review. Sharpen the prompt (name the files) and relaunch.capture: the full reviewer stream, kept for 24 hours, among the newest 100 finished reviews. Read it when a finding or the summary looks off and you want the exact reviewer message.criteria: the skills whose Review Criteria pages the launcher named, [] under --criteria none. The prompt snapshot beside the capture holds the text as sent.Exit 1 (review FAILED - relaunch): that is no review at all, never a clean pass. Relaunch it.
It means the reviewer was killed as stalled, the stream was empty, cut mid-turn, truncated on its final line, held a failed turn or an error with no verdict after it, ended in a message that is not the verdict object, ended in a verdict with no tool call before it (a preamble), or the reviewer exited non-zero. While the captured stream still exists, the failure message names its path.
A verdict with tool calls but no read of the change before it (web searches, fetches, or MCP tool calls alone) exits 1 the same way, as no read of the change before the final message: name the files to read and relaunch.
Exit 2: fix the invocation or install the missing reviewer binary. Nothing was reviewed.
After a --background launch, the wait for the verdict has two shapes, one per actor. They differ for one reason: a subagent that goes idle after one long call is never woken, while the lead's session is re-invoked when a background command ends.
The lead (a session the harness re-invokes) waits in one background shell, so the harness delivers the completion. Never poll review.status or the output path by hand:
out=<the path from the output-file: line>
bun "<skill-dir>/scripts/run-review.mts" <reviewer> --extract --wait "$out" --timeout 3600 > "${out%/*}/verdict.out" 2>&1
A subagent (a worktree builder, a spawned worker) launches with --background once, then repeats this call, each run its own foreground tool call with the Bash timeout parameter at 300000 ms, until a verdict, a failure line, or the stall line:
out=<the path from the output-file: line>; record="${out%/*}/review.status"
! grep -q '"status"' "$record" && find "$record" -mmin +60 | grep -q . && { echo "review stalled: no verdict an hour after the launch; report it to the lead"; exit 3; }
bun "<skill-dir>/scripts/run-review.mts" <reviewer> --extract --wait "$out" --timeout 240
What the call printed decides the next step, never its exit code alone, since exit 1 covers both a wait that timed out and a review that failed:
| The call printed | It means | Next |
|---|---|---|
| the JSON report on stdout, exit 0 | the verdict | act on it, below |
review FAILED - relaunch (--wait timed out: ...) on stderr, exit 1 | no verdict yet | run the call again |
review FAILED - relaunch (stalled: no stream event for <n> s ...) on stderr, exit 1 | the launcher killed a reviewer whose stream went silent | relaunch it once; a second stall is tooling trouble to report |
review FAILED - relaunch (<any other reason>) on stderr, exit 1 | the review failed | relaunch it |
review stalled: ..., exit 3 | the launch record is an hour old and still has no status: the block's own cap, not the launcher's | report the stall to the lead |
Every wait is a short foreground call repeated, never one long call: each wait is its own foreground tool call, never a shell loop, which is one long call again. The /orchestrator-mode skill's references/spawn-briefs.md, The Stop-and-Wait Ban, carries the brief's side and points here for the block.
For both shapes:
<reviewer> is the argument the review was launched with.verdict.out inside that review's capture dir, so parallel reviews (step 2) never overwrite one another. It travels and is removed with the dir. A subagent's foreground call prints the verdict as the tool result.--timeout <seconds> (default 3600) passes first, it exits 1 with the reason --wait timed out on stderr and prints no report.--stall seconds whatever the wait's --timeout. A shorter --timeout still returns first, as a timeout to run again.review FAILED - relaunch line, the timeout included, means relaunch.bun "<skill-dir>/scripts/run-review.mts" <reviewer> --extract <output-file> without --wait reads a finished run once: it exits 1 (no exit status recorded) while the reviewer is still running instead of blocking.
Every run that reached the reviewer keeps its scratch dir for up to 24 hours (under the OS tmp dir, never the working tree): the directory holding the capture path in the report, or the output kept at path in the failure. The script snapshots your prompt into that dir, so everything the launcher writes travels and cleans up together.
prepare and each launch first remove sibling rubber-duck-* directories older than 24 hours, then the oldest finished reviews past 100. A review still running (no exit status in its record yet) and a minted prompt directory (no record) are never removed by count. A symlink is never followed, and a purge that fails is reported on stderr and never fails the review.rubber-duck-* there kills other sessions' in-flight reviews.TMPDIR to a directory it created before launching. prepare and the launch both honor it.--background one keeps its dir so --extract can report the missing binary, so remove it after that.Treat valid "non-blocking" feedback as real work when it is a correctness or maintainability finding with a demonstrated effect in this change.
Recorded, not built. A demonstrable defect found in a later round is still work under the first bullet.Recorded, not built are not work: leave them in the report and open no task or PR for them, unless the user asks. The other exception is a repository with outside users or a hostile-input surface (a published package, a public service): surface those items to the user with the concrete risk, and build only the ones they confirm.Fix valid non-blocking findings as well as the blocking ones, including fixes that improve maintainability (clearer naming, removed duplication, simpler structure).
blocking entry whose claim begins Ask the owner: is a question, not a finding: put it to the user with the library named, and build nothing on it until they answer. It holds the change like any blocking finding./code-standards skill's rule). A large library or an unclear fit waits on the owner's answer first.Do not blindly accept every finding. If you disagree, explain why, and watch for fixes that would conflict with the design (e.g. a suggested guard that breaks a legitimate path).
An "add a test" finding that names no fact the test would pin beyond what the source says is rejected with that reason, whichever reviewer raised it. A deletion with no behavior of its own is proved by the census in the PR body or landing report, not a test.
If a finding conflicts with an explicit user decision, follow the user and record that the issue was intentionally skipped.
An unverified entry is yours to settle, never to drop. Nothing in that list is a finding, and nothing in it is a pass.
Re-validate after each batch of fixes before re-reviewing: the typecheck, where the language has one, plus the tests the change and its proof touch, never the full suite CI runs anyway. A long run carries an explicit timeout, and a process is stopped by the PID you spawned, never by pattern.
Where CI minutes are metered or scarce (for example a private repository on a metered plan), the full check runs locally once before the push instead. If you are not sure which kind it is, ask the user, or the lead when one briefed you.
After applying fixes, re-run the review on the updated state, one review per section, not a single overall pass.
Repeat until no valid blocking findings remain, every non-blocking finding has been handled per step 6 (fixed, skipped for a recorded reason, or rejected as incorrect or inapplicable), and every unverified claim is settled per step 6.
That convergence IS the gate: nothing commits or lands until the review has converged on the exact final content of the change being landed. At commit time that is the staged diff, since Git commits the index, not the tree. At merge time it is the branch or PR diff.
This is the single definition of review convergence. Skills that gate on it (e.g. /pr-landing-discipline's Converged) point here rather than restating it.
A converged report names the rubric it ran against: the prompt file's path, or a one-line digest of its criteria (the report's criteria list plus the prompt's own) and its Already decided list. Instructions move mid-run, and a lead reading "converged" needs to see which version it converged on.
Specimen: three builders reported "converged" against a rubric the owner had superseded while their rounds ran; nothing in their reports showed it. One line per report would have.
SKILL.md, references/, or scripts/).LICENSE.md (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)package.json (opens in a new tab)references/reviewer-prompt.md (opens in a new tab)scripts/acp.mts (opens in a new tab)scripts/copy-mode.mts (opens in a new tab)scripts/criteria.mts (opens in a new tab)scripts/run-review.mts (opens in a new tab)scripts/verdict.mts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vivswan/skills --plugin vivswan-skillsOther plugins' skills for the same job
19 skills in this plugin
/claude-remote-peersUse when this Claude Code session must message, ping, or coordinate with a Claude Code session running on another machine, or when a peer the user names is on a different host and ListAgents does not show it./code-standardsUse when writing code changes, sweeping or shortening comments (including file-size or comment-cap findings), or asked to apply the code standards./codex-browser-fixUse when Codex on macOS must drive the user's Chromium browser (Brave, Vivaldi, Opera, Edge, Chrome) through the bundled Chrome plugin, or that plugin fails with "Codex auth token is unavailable", a missing extension connection, or a stale plugin cache after a desktop app update. Codex only.