From gigachang-skills
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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gigachang-skills:ab-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Two sub-agents with opposing assigned stances independently review the **same**
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.
Before doing anything else, use AskUserQuestion to ask the user which code
change to review. Offer these options:
git diffgit show HEADgit diff main...HEADDo not guess the scope. If the working directory is not a git repository, stop and tell the user.
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.
git diff does not show them) and
include their contents if they are relevant to the change.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:
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.
Both reviewers are assigned advocates, so their citations must be checked, not trusted. This step is not optional.
## Evidence (machine-readable) and write it to a temp file —
./.tmp-ab-pro.json and ./.tmp-ab-con.json.python ${CLAUDE_PLUGIN_ROOT}/skills/ab-review/scripts/verify_evidence.py \
--repo <repo_path> ./.tmp-ab-pro.json ./.tmp-ab-con.json
SNIPPET_NOT_FOUND or FILE_NOT_FOUND is
an unverified citation — discount it in the judgment, and discount it
heavily when its strength is strong (the script flags these and exits
non-zero). Treat only VERIFIED items as load-bearing.If a report omits or malforms its JSON block, verify that side's strongest
claims manually with Grep before relying on them.
After verification, the main agent — not a sub-agent, not the skill — does the judging. Present to the user:
file:line.Do not merely average the two sides; weigh the evidence. If a side cited something that does not hold up, say so.
Agent tool, and one
standard-library Python script (scripts/verify_evidence.py) for Step 5.ab-review-pro, ab-review-con,
in agents/); they are review-only, with read-only file and git access.markdown-to-html-report skill may
naturally apply for presenting it — optional and separate.npx claudepluginhub gigayaya/gigachang-skills --plugin gigachang-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.