К основному содержанию
правило CX Codex

adversarial-review — правило для Claude Code: проверка изменений

Правило adversarial-review требует независимой проверки изменений поведения и задаёт три вердикта. Оно пригодится, чтобы не считать сбой проверяющего одобрением.

MIT ★ 880 обновлён 2026-09-03

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/rules/adversarial-review.md
Открыть на GitHub

Что делает adversarial-review

Правило распространяется на изменения кода, команд, хуков, конфигурации и других частей, которые меняют поведение системы. Документацию и опечатки можно не проверять этим циклом; если непонятно, поведенческое ли изменение, его нужно считать поведенческим. Для авторизации, платежей, секретов и других рискованных изменений предусмотрены две независимые линии проверки.

Проверяющий выносит один из вердиктов: APPROVE, REQUEST_CHANGES или UNVERIFIED. Если он не запустился, завершился по тайм-ауту или проверял уже изменённую версию, это UNVERIFIED, а не одобрение. Проверяющий должен работать с чистым контекстом, не быть автором изменения и не редактировать исходники.

Условия независимости поддерживаются соглашением, а не техническими ограничениями репозитория: механизм не блокирует самопроверку. Это значит, что качество результата зависит от того, кто назначает проверяющего. После двух возвратов одного дефекта с REQUEST_CHANGES цикл останавливается: человеку передают находку, обе попытки исправления и данные воспроизведения.

Какие задачи решает

  • отделить проверку поведения от правок документации
  • различить одобрение, найденный дефект и неполную проверку
  • назначить отдельные линии проверки рискованным изменениям
  • передать повторяющийся дефект человеку после двух неудачных исправлений

Примеры запросов агенту

  • Проверь это изменение поведения по правилу adversarial-review и вынеси один из трёх вердиктов.
  • Убедись, что проверяющий не видел авторский контекст и не редактировал исходники.
  • Этот дефект вернулся с REQUEST_CHANGES второй раз — подготовь материалы для передачи человеку.

Как установить adversarial-review

Вручную: положить файлы

.claude/rules/adversarial-review.md

Поле paths во frontmatter ограничивает файлы

По шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать

Вопросы об adversarial-review

Как установить adversarial-review в Claude Code?

Добавьте файл правила по пути .claude/rules/adversarial-review.md.

Что делает правило adversarial-review?

Оно задаёт порядок независимой проверки изменений поведения и три возможных вердикта: APPROVE, REQUEST_CHANGES и UNVERIFIED.

Что делать, если проверяющий не запустился?

Считайте результат UNVERIFIED и попробуйте другого проверяющего, среду или стратегию. Если связаться с проверяющим невозможно, остановитесь и сообщите, что изменение не проверено.

Исходный текст

adversarial-review.md · MIT
---
name: adversarial-review
load: always
audience: team
sensitivity: L1
category: verification
critical: true
description: Behavioural changes are done when an independent checker approves them, not when the author believes they work — the three verdicts, what checker independence means, and when to stop and ask a human.
---

# Adversarial Review (CRITICAL)

> Analogy: nobody grades their own exam. The author of a change has already convinced themselves;
> that is why they shipped it. The only reading that adds information comes from someone who did
> not write it and is trying to prove it wrong.

## When the loop is mandatory

Every change to behaviour goes through the loop in `skills/review-loop/SKILL.md` before it is
called done: executable code, shell/Python/JS/TS/SQL, CI/CD, hooks, commands, agent and skill
definitions, runtime prompts, and configuration that changes what the system does.

Prose docs, copy and typos are exempt. Diff size is not an exemption in either direction: a one-line
change to an authorization check is behavioural, and a large documentation reflow is not. When a
change is ambiguous, treat it as behavioural.

Ordinary changes need one independent checker. Auth, authorization, payments, access-control rules,
secrets, destructive data changes and irreversible deploys need two lanes run by different checkers:
correctness, plus the risk-specific angle (runtime security, or rollback).

## The three verdicts

There are exactly three. A fourth phrasing ("approve with comments", "looks good, but") is a
category error: decide which of the three it is.

| Verdict | What it means | What it obligates |
|---|---|---|
| `APPROVE` | The checker tried to break the claim against the current revision and failed, with no CRITICAL or HIGH finding | Completion is allowed, for **this** revision only. Any further edit voids it |
| `REQUEST_CHANGES` | At least one CRITICAL or HIGH finding, reproduced | The maker fixes exactly those findings, re-runs the evidence, and dispatches a **fresh** checker. Not the same one |
| `UNVERIFIED` | No judgement was reached: the checker never ran, returned empty or malformed output, timed out, was rate-limited, or reviewed a revision that has since moved | Retry with a different checker, runtime or strategy. Never convert it to a pass |

### Audit statuses are not verdicts

`skeptical-auditor` returns `PASS`, `FAIL` or `UNCERTAIN`. Those are audit statuses about a claim
another agent already made, not loop verdicts, and the two vocabularies must not be mixed in the
same sentence. When an audit feeds a completion decision, map it:

| Audit status | Loop verdict | Why |
|---|---|---|
| `PASS` | `APPROVE` | The claimed steps were re-run and actually pass |
| `FAIL` | `REQUEST_CHANGES` | A blockable finding was reproduced |
| `UNCERTAIN` | `UNVERIFIED` | No judgement was reached: turn budget exhausted, the revision moved, or the evidence could not be re-run |

`UNCERTAIN` maps to `UNVERIFIED` and never to `REQUEST_CHANGES`. "I could not judge this" is a
different statement from "this is broken", and collapsing the two sends the maker off to fix a
defect nobody has demonstrated.

## Reviewer death is not approval

A checker that crashes, times out, hits a rate limit, or returns nothing has told you nothing. The
absence of findings is not the absence of defects. Treat every one of these as `UNVERIFIED` and
dispatch again; if no checker can be reached at all, report the change as unverified and stop.
Self-review does not substitute for a dead reviewer. That substitution is the failure this rule
exists to prevent, because it feels like diligence while removing the only independent signal.

## What makes a checker independent

All four must hold:

1. **Fresh context.** The checker starts from the change and the goal, not from the conversation
   that produced them. It has not seen the reasoning that justified the code.
2. **Did not author the change.** Not this revision, and not an earlier revision of the same work.
   A past maker is permanently disqualified as that change's checker.
3. **Not a fork of the maker.** A continuation, fork or resumption of the authoring session carries
   the author's assumptions, which is precisely what needs testing.
4. **Read-only.** If the checker edits the source, it has joined the maker set and its verdict is
   void. Findings go back to the maker.

A checker that reads the maker's summary and agrees with it has verified the summary, not the code.
Independence is about what the checker reproduces, not about which model ran it.

These four conditions are enforced by convention, not by machinery: nothing in this repository
physically prevents a maker from reviewing its own change, and a self-review returns an envelope
that looks exactly like a real one. The loop is only as good as the dispatcher honouring condition 2.
That is why the honest failure report is `UNVERIFIED` rather than a verdict you were in no position
to issue.

## Escalate to a human after two

When the same finding comes back `REQUEST_CHANGES` twice in a row, stop. Two failed fixes on one
defect mean the diagnosis is wrong, and the third attempt usually enlarges the damage rather than
the understanding.

Surface to the human: the finding, both attempted fixes, the reproduction command and its output,
and what you now believe is actually wrong. Do not keep looping, do not lower the severity, and do
not restate the goal so the current code satisfies it.

## Related

- `skills/review-loop/SKILL.md` — the loop itself, dispatch instructions, re-verification etiquette
- `agents/adversarial-reviewer.md` — the checker and the `forge.review/v1` verdict envelope
- `agents/skeptical-auditor.md` — re-verification after a self-verifying agent claims a pass
- `docs/VERIFICATION-LOOP.md` — a worked example, with three real defects this loop caught
- `rules/verification.md` — evidence before completion claims (this rule adds: whose evidence)

© sangrokjung · MIT · sangrokjung/claude-forge

Похожие правила IDE

Все правила IDE по теме «Код-ревью и рефакторинг» →
adversarial-reviewer ekreloff Скилл adversarial-reviewer проводит критический ревью изменений через три роли: саботажника, новичка и аудитора безопасности. Подойдёт перед слиянием PR. CX Codex +1 813установок named-persona-adversarial-review Alireza Rezvani Скилл named-persona-adversarial-review организует код-ревью через задокументированные принципы Линуса Торвальдса, Кена Томпсона, Джона Кармака и Стива Джобса. Пригодится перед мержем PR с правками архитектуры или UX. CX Codex +1 35установок verify OrchestKit Скилл verify проверяет готовность работы к слиянию: запускает тесты, проверки безопасности и типов, затем даёт оценку от 0 до 10. CX Codex +1 210установок reviewer Rohit Ghumare Субагент reviewer, который проверяет код построчно, читая реальные файлы и цитируя ошибки прямо из текста. Работает перед коммитом, при ревью PR и после крупных изменений. CX Codex ★ 2 966звёзд репо sdlc-review Jakub Wolniewicz (@frizikk) + Hermes Agent Скилл sdlc-review для Claude Code независимо проверяет задачу, переданную исполнителем в колонку review на Kanban-доске, и принимает её, возвращает на доработку или передаёт человеку. CX Codex +1 162установок peer-review prathamdby Скилл peer-review для Claude Code и Codex оценивает готовность плана, архитектуры или правок до написания кода. Анализ запускается перед внедрением фичи или после подготовки диффа. CX Codex +1 723установок

Из того же набора44

Весь набор →
humanize-korean Скилл humanize-korean правит переводные обороты и шаблонные фразы ИИ в готовом корейском тексте, сохраняя факты, числа, имена и цитаты. Работает за один проход. CX Codex +1 ★ 880звёзд репо workflow-classify Команда workflow-classify оценивает задачу по шкале S/M/L/XL и предлагает рабочий процесс. Запустите её до начала работы, чтобы выбрать подходящий объём планирования и проверок. CX Codex +1 ★ 880звёзд репо build-error-resolver Субагент build-error-resolver доводит упавшую сборку до зелёного состояния минимальными правками: типы, компиляция, импорты, зависимости. Рефакторинг и смена архитектуры исключены. CX Codex ★ 880звёзд репо review-loop Скилл review-loop запускает цикл встречной проверки: исполнитель пишет код, а независимый проверяющий агент ищет в нём уязвимости и ошибки до вердикта APPROVE. CX Codex +1 ★ 880звёзд репо relay Скилл relay собирает однострочную команду для /compact и документ-«эстафету» с задачей для следующей сессии, чтобы работа не прерывалась при нехватке контекста. CX Codex +1 ★ 880звёзд репо adversarial-reviewer Субагент adversarial-reviewer для Claude Code проверяет изменения поведения перед закрытием задачи: воспроизводит дефекты и выносит вердикт, не меняя файлы репозитория. CX Codex ★ 880звёзд репо rca-debugger Субагент rca-debugger разбирает сложные сбои, когда обычная отладка не нашла причину: например, при нестабильной ошибке или расхождении CI и локального запуска. CX Codex ★ 880звёзд репо security-reviewer Субагент security-reviewer проверяет изменения кода на уязвимости OWASP Top 10, зашитые секреты и дырявые зависимости. Возвращает отчёт с приоритетами и безопасными примерами. CX Codex ★ 880звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой