/opencode:adversarial-review [--wait|--background] [--base <ref>] [--model <id> | --free] [--pr <number>] [--path <path>] [--path <path2>] [focus area or custom review instructions]from opencode
Run a steerable adversarial OpenCode review that challenges implementation and design decisions
Ships in opencode. Installing the plugin adds it to Claude Code.
Run an adversarial OpenCode review through the shared built-in reviewer.
Raw slash-command arguments:
$ARGUMENTS
Core constraint:
Execution mode rules:
--wait, do not ask. Run the review in the foreground.--background, do not ask. Run the review in a Claude background task.git status --short --untracked-files=all.git diff --shortstat --cached and git diff --shortstat.git diff --shortstat <base>...HEAD.--pr <N> or a PR #N reference in the focus text), use gh pr view <N> --json additions,deletions,changedFiles and base the recommendation on those numbers (large PRs almost always go to background).git diff --shortstat is empty.AskUserQuestion exactly once with two options, putting the recommended option first and suffixing its label with (Recommended):
Wait for resultsRun in backgroundArgument handling:
--wait, --background, --model, --free, or --pr yourself.--adversarial internally.--model <id> overrides the saved setup default model and OpenCode's own default model for this single review (e.g. --model openrouter/anthropic/claude-opus-4-6). Pass it through verbatim if the user supplied it.--free tells the companion script to shell out to opencode models, filter for first-party opencode/* free-tier models (those ending in :free or -free), and pick one at random for this review. Restricted to the opencode/* provider because OpenRouter free-tier models have inconsistent tool-use support, and the review agent needs read/grep/glob/list. Pass it through verbatim if the user supplied it. --free and --model are mutually exclusive — the companion will error if both are given.--pr <number> reviews a GitHub pull request via gh pr diff instead of the local working tree. The cwd must be a git repo whose remote points at the PR's repository, and gh must be installed and authenticated.--path <path> reviews a specific file or directory instead of git diff. Can be specified multiple times (--path src --path lib). When --path is set, the review is assembled from the actual file contents at those paths rather than from git diff. This is useful for reviewing specific directories, fixed sets of files, or large untracked/imported code drops. Mutually exclusive with --pr (paths take precedence over PR mode).PR reference extraction (REQUIRED — read this carefully):
PR #390, pr #390, PR 390, or pr 390, you MUST extract the number yourself and pass it as --pr 390. Then strip the matched PR phrase from whatever you put in the focus text.#NNN tokens as comments before they ever reach the companion script (e.g. bash -c 'node ... adversarial-review on PR #390' invokes node with argv ["adversarial-review", "on", "PR"] — the #390 is gone)./opencode:adversarial-review on PR #390 challenge the caching strategynode ... adversarial-review on PR #390 challenge the caching strategy (the #390 and everything after is silently dropped by bash)node ... adversarial-review --pr 390 'challenge the caching strategy'Focus text quoting (REQUIRED):
#, *, $, ;, &, |, <, >, parentheses, backticks, etc.), wrap the focus text in single quotes so bash passes it through unchanged. Single quotes preserve everything literally except the single-quote character itself.what's wrong here), use the standard '\'' escape: 'what'\''s wrong here'./opencode:adversarial-review challenge the design → node ... adversarial-review 'challenge the design'/opencode:adversarial-review --background look for race conditions in $RUNTIME → node ... adversarial-review --background 'look for race conditions in $RUNTIME'Foreground flow:
$ARGUMENTS using the PR reference extraction and Focus text quoting rules above. Pass through --wait, --background, --base, --scope, --model, and --pr flags as-is; convert any PR #N reference in the user's text to --pr N; single-quote whatever free-form focus text remains.node "${CLAUDE_PLUGIN_ROOT}/scripts/opencode-companion.mjs" adversarial-review <flags> [--pr N] ['<quoted focus text>']
Background flow:
$ARGUMENTS transformation as the foreground flow above (PR ref extraction + focus text single-quoting).Bash in the background:Bash({
command: `node "${CLAUDE_PLUGIN_ROOT}/scripts/opencode-companion.mjs" adversarial-review <flags> [--pr N] ['<quoted focus text>']`,
description: "OpenCode adversarial review",
run_in_background: true
})
BashOutput or wait for completion in this turn./opencode:status for progress."BashOutput, return the review output, then follow the "Optional: post the review to GitHub" section below.Optional: post the review to GitHub (only when the user explicitly asked):
/opencode:adversarial-review --pr 412 is NOT a request to post. If in doubt, do not post.--pr <N> was in the arguments AND the user's request explicitly asked for publishing. Never post a review for a --path run (paths have no PR to post to).event: COMMENT) containing a clean markdown summary body written in your own voice based on the review output. Do not paste the raw review output verbatim into the body; rewrite it as a digest with a short ship/no-ship line, the handful of material findings, and a closing note.gh api repos/{owner}/{repo}/pulls/<N>/files → patch fields). Skip inline anchoring when the review is prose-only or the lines are unclear.{ "commit_id": "<head SHA>", "event": "COMMENT", "body": "<markdown summary>", "comments": [ { "path": "...", "line": N, "side": "RIGHT", "body": "..." }, ... ] }. Get the head SHA via gh pr view <N> --json headRefOid --jq .headRefOid./tmp/opencode-post-<pr>-<random>.json) using the Write tool so you control escaping — do NOT try to build a heredoc inside a Bash call.gh api -X POST "repos/{owner}/{repo}/pulls/<N>/reviews" --input /tmp/...json via a single Bash call.html_url from the response and append a one-line status to your final turn output: Review posted to PR #<N>: <url>.rm -f /tmp/...json.Failed to post review to PR #<N>: <error> and do not retry.event: "COMMENT" — never REQUEST_CHANGES. This tool is advisory, not gatekeeping.What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
7 commands in this plugin
/reviewRun an OpenCode code review against local git state or a GitHub PRnpx claudepluginhub johnnyvicious/opencode-plugin-cc --plugin opencodeOther plugins' commands for the same job