agentleFS
gigayayagigayaya/gigachang-skills/skills/ab-review/SKILL.md

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.

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
  1. Very specific:

    Before doing anything else, use AskUserQuestion to ask the user which code change to review.

    line 32
  2. Distinctive:

    Do not guess the scope. If the working directory is not a git repository, stop and tell the user.

    line 41
  3. Distinctive:

    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 …

    line 46
  4. Distinctive:

    If the chosen scope yields no changes, tell the user there is nothing to review and stop.

    line 54
  5. Distinctive:

    Run the verifier (standard-library Python, no install needed):

    line 94
  6. Very specific:

    Read its output. Any item marked SNIPPET_NOT_FOUND or FILE_NOT_FOUND is an unverified citation — discount it in the judgment, and discount …

    line 99
  7. Distinctive:

    Delete the two temp files after reading the result.

    line 103
  8. Very specific:

    If a report omits or malforms its JSON block, verify that side's strongest claims manually with Grep before relying on them.

    line 105
  9. Distinctive:

    After verification, the main agent — not a sub-agent, not the skill — does the judging.

    line 110
  10. Distinctive:

    Do not merely average the two sides.

    line 122
  11. Very specific:

    No third-party dependencies — git, the Agent tool, and one standard-library Python script (scripts/verify_evidence.py) for Step 5.

    line 127
  12. Distinctive:

    Always exactly two sub-agents: one Pro, one Con.

    line 131
  13. Very specific:

    If the final write-up is long, the markdown-to-html-article skill may naturally apply for presenting it — optional and separate.

    line 133

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. All unstaged changes — git diff
  2. Latest commit — git show HEAD
  3. All commits on the current feature branch — git diff main...HEAD
  4. 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 diff does 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.

  1. From each report, extract the JSON array under ## Evidence (machine-readable) and write it to a temp file — ./.tmp-ab-pro.json and ./.tmp-ab-con.json.
  2. 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
  3. Read its output. Any item marked 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.
  4. 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:

  1. The review scope that was reviewed.
  2. Pro's strongest evidence and Con's strongest evidence — concise, pointing to file:line.
  3. 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.
  4. 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 Agent tool, 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, in agents/); 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-article skill may naturally apply for presenting it — optional and separate.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.