ab-review
Skill0 starsChanged 5 months agoMITView on GitHub
Use when the user explicitly asks for an "AB", adversarial, two-sided, or "red-team" code review of code changes they have made — e.g. "AB review my diff", "do an AB review of my changes", "red-team this code change", "have two reviewers argue about my code". Dispatches two opposing sub-agents — one building the evidence-based case that the change is mergeable, one building the case that it must not merge — runs them in parallel, and returns both reports to the main agent to judge. The skill itself never issues the verdict. Manual-trigger only — never auto-invoke; always ask the user to choose the review scope first. Skip for a routine single-perspective code review.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs-driftSkill
- markdown-to-html-articleSkill
- scope-researchSkill
- session-reflectionSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Before doing anything else, use AskUserQuestion to ask the user which code change to review.
- Distinctive: line 41
Do not guess the scope. If the working directory is not a git repository, stop and tell the user.
- Distinctive: line 46
Run the git command for the chosen scope and capture the diff text once — the identical text is handed to both sub-agents so they argue …
- Distinctive: line 54
If the chosen scope yields no changes, tell the user there is nothing to review and stop.
- Distinctive: line 94
Run the verifier (standard-library Python, no install needed):
- Very specific: line 99
Read its output. Any item marked SNIPPET_NOT_FOUND or FILE_NOT_FOUND is an unverified citation — discount it in the judgment, and discount …
- Distinctive: line 103
Delete the two temp files after reading the result.
- Very specific: line 105
If a report omits or malforms its JSON block, verify that side's strongest claims manually with Grep before relying on them.
- Distinctive: line 110
After verification, the main agent — not a sub-agent, not the skill — does the judging.
- Distinctive: line 122
Do not merely average the two sides.
- Very specific: line 127
No third-party dependencies — git, the Agent tool, and one standard-library Python script (scripts/verify_evidence.py) for Step 5.
- Distinctive: line 131
Always exactly two sub-agents: one Pro, one Con.
- Very specific: line 133
If the final write-up is long, the markdown-to-html-article skill may naturally apply for presenting it — optional and separate.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AB Review
Two sub-agents with opposing assigned stances independently review the same code change and report concrete evidence. One argues the change is mergeable, the other argues it is not. The main agent then reads both reports and forms its own judgment.
A single-perspective review tends to anchor on one read of a change. Forcing one agent to build the strongest case for merging and another to build the strongest case against surfaces both the strengths and the risks a one-sided pass would miss — and leaves the final call to the main agent with both cases in hand.
When to invoke
- Manual only. The user explicitly asks for an AB / adversarial / two-sided / red-team review of their code changes.
- Never auto-invoke. Dispatching two sub-agents is expensive; wait for an explicit request.
- The skill and the sub-agents never pronounce the final verdict — that is the main agent's job (Step 6), after the evidence is verified (Step 5).
Workflow
Step 1 — Confirm the review scope (always ask)
Before doing anything else, use AskUserQuestion to ask the user which code
change to review. Offer these options:
- All unstaged changes —
git diff - Latest commit —
git show HEAD - All commits on the current feature branch —
git diff main...HEAD - Specific lines of code — then ask the user for file path(s) and line range(s)
Do not guess the scope. If the working directory is not a git repository, stop and tell the user.
Step 2 — Capture the code change once
Run the git command for the chosen scope and capture the diff text once — the identical text is handed to both sub-agents so they argue about the same artifact.
- For scope 4, capture the specified line ranges with a few lines of surrounding context.
- For scope 1, also list untracked files (
git diffdoes not show them) and include their contents if they are relevant to the change. - If the chosen scope yields no changes, tell the user there is nothing to review and stop.
Step 3 — Dispatch the two reviewers in parallel
In a single message, make two Agent calls dispatching the plugin's
bundled reviewer agents:
subagent_type: ab-review-pro— argues the change is correct and mergeable.subagent_type: ab-review-con— argues the change is flawed and must not merge.
They run independently and in parallel; neither sees the other's findings. Each
agent already carries its assigned stance, tool boundaries, the no-fabrication
rule, and the required report format — defined in agents/ab-review-pro.md and
agents/ab-review-con.md. Do not re-specify any of that here.
Pass both agents the same task prompt:
- the captured code change from Step 2 (the identical text for both),
- the review scope chosen in Step 1,
- the repository path, so the agent can read surrounding code for context.
Step 4 — What each reviewer returns
Each agent returns a structured report (canonical format defined in its agent
file): its side, a one-line position, numbered evidence items — each with a
file:line location, a verbatim code snippet, an argument, and a strength
rating — its single strongest point, and an honest statement of where its own
side is weakest. Each report also ends with a machine-readable JSON evidence
block (a [...] array under ## Evidence (machine-readable)) mirroring the
prose evidence — Step 5 uses it.
Step 5 — Verify the cited evidence (mandatory)
Both reviewers are assigned advocates, so their citations must be checked, not trusted. This step is not optional.
- From each report, extract the JSON array under
## Evidence (machine-readable)and write it to a temp file —./.tmp-ab-pro.jsonand./.tmp-ab-con.json. - Run the verifier (standard-library Python, no install needed):
python ${CLAUDE_PLUGIN_ROOT}/skills/ab-review/scripts/verify_evidence.py \ --repo <repo_path> ./.tmp-ab-pro.json ./.tmp-ab-con.json - Read its output. Any item marked
SNIPPET_NOT_FOUNDorFILE_NOT_FOUNDis an unverified citation — discount it in the judgment, and discount it heavily when its strength isstrong(the script flags these and exits non-zero). Treat onlyVERIFIEDitems as load-bearing. - Delete the two temp files after reading the result.
If a report omits or malforms its JSON block, verify that side's strongest
claims manually with Grep before relying on them.
Step 6 — Judge (main agent)
After verification, the main agent — not a sub-agent, not the skill — does the judging. Present to the user:
- The review scope that was reviewed.
- Pro's strongest evidence and Con's strongest evidence — concise, pointing to
file:line. - The main agent's own independent judgment: which evidence holds up under scrutiny (built on the Step 5 verification — unverified citations carry no weight), and where the two sides genuinely disagree.
- A clear recommendation — merge as-is / merge after specific fixes / do not merge — with concrete action items.
Do not merely average the two sides; weigh the evidence. If a side cited something that does not hold up, say so.
Notes
- No third-party dependencies — git, the
Agenttool, and one standard-library Python script (scripts/verify_evidence.py) for Step 5. - The two reviewers are bundled plugin agents (
ab-review-pro,ab-review-con, inagents/); they are review-only, with read-only file and git access. - Always exactly two sub-agents: one Pro, one Con.
- The skill never writes files or changes code; it is review-only.
- If the final write-up is long, the
markdown-to-html-articleskill may naturally apply for presenting it — optional and separate.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

