Adversarial Review Loop

Has a second, independent model review every change before merge so two different reviewers must agree — code only lands when both clear the bar.

WorkflowengineeringMIT1 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
Not listed in source
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/components/loops/engineering/adversarial-review-loop.md

---
name: adversarial-review-loop
description: Has a second, independent model review every change before merge so two different reviewers must agree — code only lands when both clear the bar.
category: engineering
interval: 15m
stop-condition: The implementing agent and the independent cross-model reviewer both approve with no blocking findings and tests pass.
components: [agent:expert-advisors/architect-review, command:git-workflow/gemini-review, command:git-workflow/pr-review]
tags: [code-review, cross-model, quality, loop]
---

# Adversarial-Review Loop

> **Loop Engineering** — the verifier inside the loop is the hard part, and an agent grading its own homework will delete the failing test and call it done. This loop puts a *second, different* model in the reviewer seat: two model families must agree before code lands.

## 🎯 Goal
Implement a change, then have an **independent cross-model reviewer** argue against it. Iterate on findings until both the builder and the outside reviewer sign off — no self-grading.

## ⏱️ Schedule
Suggested interval: `15m` (or run until the change is merge-ready).

## ▶️ Run it
```
/loop 15m "Implement the change. Then have a different model review it adversarially for correctness, security and design. Address every blocking finding and re-run tests. Land it only when both the builder and the independent reviewer agree there are no blocking findings. Max 5 review rounds."
```

## 🔁 Iteration steps
1. **Build** — implement the next slice.
2. **Cross-review** — run `/gemini-review` so a *different* model family critiques the diff.
3. **Reason** — collect blocking findings from the outside reviewer.
4. **Act** — fix them; `architect-review` validates the revision; re-run tests.
5. **Observe** — re-review with `/pr-review`; loop until both sides agree (cap the rounds).

## 🛑 Stopping condition
Both reviewers report zero blocking findings and tests pass — or the review-round cap is reached and the loop hands off with the open findings.

## 💰 Budget & guardrails
A `--max-iter` style cap on review rounds and a severity threshold: only findings at/above the bar block. Two independent models must agree, so neither can rubber-stamp itself.

## 🧩 Referenced components
- `agent:expert-advisors/architect-review` — the in-house reviewer.
- `command:git-workflow/gemini-review` — an independent, different-model review.
- `command:git-workflow/pr-review` — structured re-review checklist.

## 💡 Example
The builder ships an auth change; the cross-model reviewer flags a timing-attack risk the in-house reviewer missed. The loop fixes it, both agree, and only then does it land.

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: d24466ea7f4c15de1da65f9aa24e43b84b8eff2a54751c64b30e3292ba30da0c. Files are served as downloads and are never executed by this page.