/adversarial-loop:adversarial-loopfrom adversarial-loop
Run adversarial review→fix self-improvement loops on an artifact (skill, prompt, doc, config, code) without the loop degrading what it improves. Charter-guarded invariants, verified findings, regression gates, decision ledger, convergence-based stopping. Trigger - /adversarial-loop <target> [max rounds or budget]
Ships in adversarial-loop. 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.
None: SKILL.md is the whole skill.
A naive review→fix loop degrades its own artifact. Every part of this protocol exists to block a specific, observed failure mode:
| Failure mode | Defense |
|---|---|
| A fix introduces a worse defect than it removed | Regression gate (step 4) on every diff |
| Single-lens myopia — optimizing one quality destroys another (e.g. security fixes that delete knowledge) | Charter with explicit priority order; gate checks ALL dimensions every round; rotating primary lens |
| Oscillation — round N+2 reverts round N's deliberate decision | Decision ledger; verifiers reject findings that re-litigate ledger entries without new evidence |
| Reviewer padding — "find up to 8 issues" always finds 8 | Severity floor + independent refutation of every finding before it drives a change |
| Scar tissue — patches accumulate into contradictory, bloated instructions | Size budget per round + consolidation pass with zero-loss gate |
| Running blind — no ground truth for prose artifacts | Golden scenarios simulated as the test suite |
| Fixed round count — stopping too early or churning past convergence | Convergence-based stopping with a hard cap |
| Silent invariant erosion — hard-won properties weakened by later fixes | Invariants named in the charter; gate fails any diff that weakens or ambiguously alters one |
| Charter drift — the yardstick edited to match the artifact | Charter frozen once round 1 begins; changes need user approval, a ledger entry, and reset the clean-round counter |
| Stale test suite — new behavior no golden scenario covers | Gate appends a scenario for any confirmed finding or new behavior outside existing ones; append-only, never weakened |
| Ossification — a refuted finding can never be raised again | Independent rediscovery counts as new evidence; a second verifier who hasn't seen the refutation can overturn the ledger entry |
security > information-fidelity > usability > concision). Every tradeoff in the loop resolves by this ranking — not by whichever lens the current reviewer holds.review (find defects)
→ verify (skeptics try to REFUTE each finding — before any fix exists)
→ fix (edits applied to the working copy)
→ regression gate (fresh agent judges the applied diff)
pass → record: ledger + version bump + local commit
fail → back to the fixer with the specific failure (max 2 attempts)
fail twice → revert the whole round, escalate to the user
next round… until converged / cap / blocked
→ consolidation pass (de-scar, zero-loss gate)
→ final report
Note the two orderings people expect differently: findings are verified BEFORE a fix is created (unconfirmed findings never drive changes), and the fix is applied first, then gated (the snapshot makes application revertible, and the gate judges the real diff in the real file — not a proposal).
Run steps 1–5 in order. Fresh subagents per step — the fixer never grades its own fix, the reviewer never sees prior reviewers' prose.
Input: current artifact + Charter + ledger summary listing decision outcomes only (finding ID, one-line claim, status) — never rationale prose — with: do not re-report a fixed finding UNLESS you can show the failure scenario is still reachable in the current text, in which case report it as a failed fix. Plus the previous round's diff. Instructions to the reviewer:
Verifier input: the findings, the current artifact (all files), the Charter, and the ledger's decision list. For each finding, attempt to REFUTE it: is the failure scenario actually reachable? Does the cited text really say that? Drop findings that are refuted, unverifiable, or that re-litigate a ledger decision without new evidence. Drop findings below the severity floor (default: fix high/medium; log low without acting unless free to fix alongside). Independent rediscovery IS new evidence: if a finding matching a refuted ledger entry is re-reported by a reviewer who was not told of the refutation, or recurs in two separate rounds, don't silently drop it — send it to a second verifier who has not seen the original refutation rationale; if confirmed, the ledger entry is overturned and the reversal logged. Output: the confirmed list. If it's empty, record a clean round (see Stopping) and skip to step 5.
Brief must be self-contained: confirmed findings with exact fix wording where possible, file paths, the Charter (invariants marked DO-NOT-WEAKEN — a deliberate strengthening must be flagged as such for the gate), and constraints: smallest change that resolves each finding; no restructuring beyond the findings; stay inside the size budget; match the artifact's existing voice.
Given the diff, the Charter, and the golden scenarios, answer five questions:
If a confirmed finding or a diff-introduced behavior falls outside all existing golden scenarios, the gate appends a new scenario covering it (append-only, logged in the ledger, user-confirmed if available). Existing scenarios are never removed or weakened.
Any "no" → return the diff to the fixer with the specific failure (max 2 attempts). Two failures → revert the round entirely and escalate to the user with the conflict spelled out; do not force a fix that can't pass the gate.
Append the round to the Ledger. Bump the artifact's version if it's versioned (semver: behavior change = minor, wording/docs = patch). Commit locally with a message naming the round and its findings. Never push without the user's say-so.
Stop when the FIRST of these hits:
Fixed round counts ("run it 5 times") are a cap, not a target — if the loop converges at round 3, stop at round 3 and say so.
Patched prose accumulates scar tissue even when every individual round passed its gate. Run one dedicated pass:
Deliver to the user: rounds run and why the loop stopped, the ledger (findings fixed / refuted / deferred), remaining known low-severity issues, size before/after, and the invariant checklist confirmed one last time against the final artifact.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub fallen90/claude-plugins --plugin adversarial-loop