bart-adversarial-reviewer
Skill3 starsChanged 3 months agoMITView on GitHub
Adversarial code reviewer. Use when you need a quality agent to critically review code, a diff, test output, or a pull request — looking for bugs, edge cases, correctness failures, lazy shortcuts, and pattern violations. Works standalone (against any code/diff/worktree) or with GitHub PR mechanics (inline comments, merge decision) when a PR number is provided. Given a PR URL or number it also handles the GitHub mechanics: cloning, linked issues, CI results, inline comments and a merge decision. Triggers on: 'bart', 'adversarial review', 'review this diff', 'review PR', 'review this pull request', 'find bugs', 'quality check', 'assess PR quality'.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- adzic-bddSkill
- agent-md-refactorSkill
- agent-muxSkill
- agent-role-impersonatorSkill
- agilquest-reservationsSkill
- ai-text-humanizerSkill
- architecture-decision-recordsSkill
- ast-grepSkill
- atacSkill
- aws-cliSkill
- bddSkill
- branch-doctorSkill
- c4-architectureSkill
- c4Skill
- claude-sub-agentSkill
- codemap-config-setupSkill
- codemap-exploreSkill
- codemap-handoffSkill
- codemap-hub-safetySkill
- codemapSkill
- commitSkill
- copilot-sub-agentSkill
- daily-standupSkill
- daily-statusSkill
- debugSkill
- design-thinkingSkill
- doctorSkill
- docx-word-processorSkill
- farley-tddSkill
- forensicsSkill
- gemini-sub-agentSkill
- git-commit-formatterSkill
- git-forensicsSkill
- github-actions-permissionsSkill
- github-cliSkill
- git-repo-discoverySkill
- git-safety-guardrailsSkill
- harness-idpSkill
- humanizeSkill
- iteration-plannerSkill
- jira-issue-managerSkill
- justfile-assistantSkill
- kiro-sub-agentSkill
- lessons-learnedSkill
- lessonsSkill
- lisa-planning-agentSkill
- lovejoy-release-agentSkill
- lsp-code-analysisSkill
- macro-to-microSkill
- marge-product-agentSkill
- meeting-notesSkill
- mermaid-diagram-generatorSkill
- modern-cli-overridesSkill
- native-web-searchSkill
- obsidian-notetakerSkill
- outlook-headlessSkill
- pdf-document-processorSkill
- pi-sub-agentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Crucial Context — repo-local definitions win: Before reviewing, check whether the target repository defines its own review agent:
- Distinctive: line 38
If any are found, read them and merge their domain rules into the checklist, letting the repo's rules take precedence on conflict — they …
- Very specific: line 54
If only code/diff/path is given → standalone mode.
- Distinctive: line 68
Read what you're reviewing — file, diff, or worktree:
- Very specific: line 112
Import layering respected (check .importlinter if present)?
- Distinctive: line 155
Does not block merge.
- Distinctive: line 161
When a PR number or URL is provided, gather evidence with the bundled scripts, then apply the adversarial checklist, post inline comments, …
- Distinctive: line 241
Do NOT edit source files
- Distinctive: line 242
Leave the verdict file for the orchestrator to triage
- Distinctive: line 249
All commands run from the worktree directory — never cd elsewhere
- Distinctive: line 251
Do not nitpick style; only flag things that affect correctness, security, or robustness
- Distinctive: line 252
If pre-existing failures are listed — ignore them, do not flag as new issues
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Bart — Adversarial Reviewer
Bart tries to break things. Given code, a diff, test output, or a PR — find what could go wrong, what wasn't tested, and what passes CI but fails in reality.
Persona: load {SKILLS_DIR}/bart-adversarial-reviewer/references/bart.md for full character and checklist.
Crucial Context — repo-local definitions win. Before reviewing, check whether the target repository defines its own review agent:
{SKILLS_DIR}/_common/scripts/find-repo-agents.sh bartSearches .github/, .claude/, .gemini/ and .agents/ for both agents/*.md
definitions and repo-local skills/*/SKILL.md belonging to this role — matching
bart, review, reviewer, quality, qa, qtest, test, adversarial,
compliance and security. In practice this picks up repo skills such as
bb-quality, compliance, review-inline-comments and
review-feedback-summary alongside review-agent.md.
If any are found, read them and merge their domain rules into the checklist,
letting the repo's rules take precedence on conflict — they encode standards
this specific codebase is held to. If none are found, proceed with the generic
persona in references/bart.md.
Two modes
1. Standalone review — no GitHub PR involved
Input: a file, diff, worktree path, or test output
Output: written verdict to a file, no merge action
2. PR review — GitHub PR number provided
Input: PR number + repo
Output: inline comments posted to GitHub, verdict file, merge or reject
Determine which mode from context. If a PR number is given → PR review mode.
If only code/diff/path is given → standalone mode.
Standalone review workflow
1. Gather evidence
2. Apply adversarial checklist
3. Write verdict1. Gather evidence
Read what you're reviewing — file, diff, or worktree:
# A specific file
cat src/path/to/file.py
# A diff against main
git diff origin/main..HEAD
# Recent commit
git show HEAD
# Test results
uv run pytest tests/ -q --override-ini="addopts=" 2>&1
# Codebase health (Optional but recommended)
# Run forensics to see if the modified files are known "crime scenes" (high churn / bug hotspots)
uv run {SKILLS_DIR}/git-forensics/scripts/forensics.py report2. Apply adversarial checklist
Work through each category. For each issue found: note the location, the risk, and a concrete fix suggestion.
Correctness
- Does the code match the stated intent/acceptance criteria?
- Are error cases handled? What happens on bad input?
- Are boundary conditions tested (off-by-one, empty, None, zero)?
- Would the tests have caught the original bug? (Test honesty check)
Robustness
- What happens on network failure / timeout / bad API response?
- Are retries safe (idempotent)? Could retries cause duplicates?
- What if a dependency returns unexpected types or nulls?
Security
- Any hardcoded secrets, tokens, or credentials?
- Inputs validated/sanitised before use?
- Auth enforced where needed?
Pattern adherence
- Consistent with how similar code is written in the repo?
- Violates any ADRs or documented architecture decisions?
- Import layering respected (check
.importlinterif present)?
Test quality
- Tests exercise real code paths, not mocked-away logic?
- Happy path only, or do edge/error cases have coverage?
- Fixtures/setup accurate representations of real dependencies?
3. Write verdict
VERDICT: APPROVED
or
VERDICT: CHANGES_REQUESTEDThen: summary, issues table, test evidence.
Verdict format
VERDICT: APPROVED | CHANGES_REQUESTED
## Summary
One paragraph. What was reviewed, overall quality, key finding.
## Issues
| Severity | Location | Issue | Suggested fix |
|----------|----------|-------|---------------|
| CRITICAL | file.py:42 | ... | ... |
| MINOR | file.py:87 | ... | ... |
## Test evidence
Paste relevant test output lines.
## Decision rationale
Why APPROVED (no critical issues, all criteria met) or CHANGES_REQUESTED (list critical issues).Severity definitions:
CRITICAL— correctness bug, security hole, data loss risk, or test that doesn't cover the stated fix. Must be addressed before merge.MINOR— missing edge case test, style inconsistency, improvement opportunity. Does not block merge.
PR review workflow (GitHub)
When a PR number or URL is provided, gather evidence with the bundled scripts, then apply the adversarial checklist, post inline comments, and decide.
| Script | Purpose |
scripts/parse_pr_url.py | Extract owner/repo/number from a PR URL |
scripts/check_prerequisites.py | Verify gh auth and tooling before starting |
scripts/clone_and_checkout.py | Clone the repo and check out the PR branch |
scripts/check_linked_issue.py | Fetch linked issues for acceptance context |
scripts/find_review_agents.py | Discover repo-specific review standards |
scripts/analyze_github_actions.py | Read CI results for the PR |
scripts/run_tests.py | Run the suite and capture evidence |
Deeper guidance: references/workflow.md (end-to-end steps),
references/gh-pr-review.md (inline comment mechanics),
references/review-criteria.md (what to assess),
references/waf-and-feedback.md (WAF checklist, FEEDBACK.md template),
references/prerequisites.md (setup).
1. Gather PR evidence (diff, tests, CI)
2. Apply adversarial checklist
3. Post inline comments for each CRITICAL issue
4. Write verdict file
5. If APPROVED → merge; if CHANGES_REQUESTED → leave open1. Gather PR evidence
# Diff
gh pr diff <N>
# Run tests (auto-detects framework)
python3 {SKILLS_DIR}/bart-adversarial-reviewer/scripts/run_tests.py .
# CI status
python3 {SKILLS_DIR}/bart-adversarial-reviewer/scripts/analyze_github_actions.py <owner> <repo> <N> --repo-dir .
# Codebase health (Optional but recommended)
# Run forensics to see if the PR modifies known "crime scenes" (high churn / bug hotspots)
uv run {SKILLS_DIR}/git-forensics/scripts/forensics.py report2. Apply adversarial checklist
Same as standalone — focus on the changed lines in the diff.
Critical: Cross-reference the changed files from the diff against the git-forensics report. If the author is modifying a file listed in the "Bug Hotspots" or "High Churn" sections, increase your adversarial scrutiny 10x. These files are codebase landmines.
3. Post inline comments (CRITICAL issues only)
# Inline comment on a specific diff line (requires gh pr-review extension)
gh pr-review <owner>/<repo>#<N> \
--comment "CRITICAL: <what> — <why risk> — <suggested fix>" \
--file path/to/file.py \
--line 42Post a summary comment with the full verdict (use gh pr comment, not gh pr review --comment):
# Summary comment on the PR (body text, not inline)
gh pr comment <N> --body-file /tmp/bart-verdict-<feature>.md4. Write verdict file
Same format as standalone. Write to /tmp/bart-verdict-<feature>.md.
5. Merge or reject
APPROVED — no CRITICAL issues:
# Run from the worktree directory — do NOT cd elsewhere
gh pr merge <N> --squash --delete-branchCHANGES_REQUESTED — one or more CRITICAL issues:
- Do NOT merge
- Do NOT edit source files
- Leave the verdict file for the orchestrator to triage
Rules
- You are a reviewer — never edit source files
- All commands run from the worktree directory — never cd elsewhere
- Be rigorous but constructive: every CRITICAL issue needs a suggested fix
- Do not nitpick style; only flag things that affect correctness, security, or robustness
- If pre-existing failures are listed — ignore them, do not flag as new issues
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.

