adversarial-review
БесплатноБез исполняемых скриптовНе проверенCross-vendor adversarial code review of the current branch. Two different model families (Claude + Codex/GPT) review the diff independently, then try to…
от basicmachines-co★ 4 799 звёзд на GitHubОб этом скилле
Adversarial code review
Two reviewers from different model families — Claude and Codex/GPT — review the same diff independently, then each tries to refute the other's findings. A finding's confidence comes from whether it survives that cross-examination. This kills the two failure modes of solo LLM review: self-ratification (a model won't critique its own work) and confident false positives.
You are the orchestrator — and one of the two reviewers
This skill runs from either Claude Code or Codex. First, identify which model family you are (Claude or Codex/GPT). Then:
- You are reviewer #1. You review natively, in this session, using your own tools.
- The other family is reviewer #2. You invoke it as a subprocess CLI for an independent pass: a fresh process, no shared context — that independence is the point.
The CLI for "the other model":
| If you are… | Invoke the other via… |
|---|---|
| Claude | codex exec (GPT) |
| Codex | claude -p (Claude) |
Everything else in the flow is symmetric. Resolve the prompts/ and schemas/ paths
below relative to this skill's own directory (where this SKILL.md lives).
Inputs
Two independent, optional inputs:
BASE— the ref to diff against. Defaultmain.SCOPE— a pathspec to narrow the review (e.g.src/basic_memory). Default: none (whole diff).
These are separate: a ref and a pathspec are not interchangeable. Build the canonical diff
command once in preflight and reuse it everywhere below — never re-spell the diff inline
(the scattered, inconsistent spelling is what broke earlier). Build it as an argv array,
not a string, so a $SCOPE containing spaces or glob characters survives intact:
BASE="${BASE:-main}"
DIFF=(git diff "$BASE...HEAD") # argv array — never a scalar string
[ -n "$SCOPE" ] && DIFF+=(-- "$SCOPE") # pathspec stays one argument even with spaces
DIFF_STR=$(printf '%q ' "${DIFF[@]}") # shell-quoted rendering, for embedding in a prompt
To run it, use "${DIFF[@]}" (quoted, no word-splitting). To embed it as text inside
a subprocess prompt, use $DIFF_STR.
Preflight
- Set
SKILL_DIRto the directory this SKILL.md lives in. Canonical location is.agents/skills/adversarial-review(the shared agent-skills store); Claude Code reaches it via the.claude/skills/adversarial-reviewsymlink, Codex via its own skills path. Theprompts/andschemas/subdirs are siblings of this file in every case. - Confirm the other model's CLI is on PATH (
codexif you're Claude,claudeif you're Codex). If it's missing, tell the user the panel falls back to single-model (which loses the cross-vendor benefit) and ask whether to proceed or stop. - Run
"${DIFF[@]}". If it prints nothing, report "nothing to review against $BASE" (mention$SCOPEif set) and stop. RUN=$(mktemp -d)— scratch dir for the other model's output. Transient, never committed. No persisted artifacts, no state file.
Phase 0 — Deterministic gates (before the models)
Models are statistically blind to negation ("never do X"). Enforce mechanical house rules with tools, not prompts, and treat hits as high-confidence facts (reported separately from model findings):
just lintandjust typecheckif the diff touchessrc/.- Grep the diff for catchable house-rule violations:
getattr(.*,.*,defaults, bareexcept:/except Exception: pass, function-scope imports.
Phase 1 — Independent review (you + the other model, concurrently)
Both reviewers get the same brief: prompts/review.md + the repo's CLAUDE.md house rules,
reviewing the diff from "${DIFF[@]}". Both emit findings matching schemas/findings.schema.json.
Your native pass: review as yourself, following prompts/review.md. Hold your findings
as that JSON shape.
The other model's pass — run, from the repo root, the row that matches you:
Always redirect codex stdin from /dev/null — if stdin is a pipe (e.g. the call gets
backgrounded), codex exec blocks "Reading additional input from stdin..." and fails.
# You are Claude → run Codex:
codex exec -s read-only \
--output-schema "$SKILL_DIR/schemas/findings.schema.json" \
-o "$RUN/other_findings.json" \
"$(cat "$SKILL_DIR/prompts/review.md")
Review the diff: $DIFF_STR" </dev/null
# You are Codex → run Claude (read-only via plan mode; parse the JSON block it returns):
claude -p --permission-mode plan --output-format json \
"$(cat "$SKILL_DIR/prompts/review.md")
Review the diff: $DIFF_STR
Return ONLY a JSON object matching this schema:
$(cat "$SKILL_DIR/schemas/findings.schema.json")" </dev/null > "$RUN/other_raw.json"
# claude --output-format json output shape varies by CLI version: it may be a JSON ARRAY
# of event objects, OR a single result object. Normalize before reading: if it's an array,
# take the element with type=='result'; ot
Установить adversarial-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл adversarial-review?
Cross-vendor adversarial code review of the current branch. Two different model families (Claude + Codex/GPT) review the diff independently, then try to refute each other's findings; survivors are reported by confidence. Runs from either Claude Code or Codex. Use when the user asks for an adversarial review, a cross-model / second-opinion review, or wants high-confidence findings before merging. Report-only — never auto-applies fixes.
Как установить скилл adversarial-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл adversarial-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic