bug-review
Skill201 starsChanged 7 months agoMITView on GitHub
Use this skill when a user asks to review a pull request for bugs, wants AI code review focused on correctness issues, or runs /bug-review. Trigger on PR review, bug finding, code review, "review this PR", "check for bugs", "find issues in this PR". This is a multi-pass review workflow with 5 parallel passes, majority voting, independent Opus validation, and resolution rate tracking. Also trigger on /bug-review:resolve to classify whether findings were fixed at merge time, and /bug-review:report for resolution rate stats. Even if the user just says "review this" while on a PR branch, trigger this skill.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- iaintsaket/how-saket-claudestheir own version, first seen Nov 15, 2026
- BerkaySevinc/agent-toolkittheir own version, first seen Nov 1, 2026
- falcondev-oss/skillstheir own version, first seen Oct 26, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- falcondev-oss/skills★ 2same name
- iaintsaket/how-saket-claudes★ 2same name
- BerkaySevinc/agent-toolkit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/radical-simplification/AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- radical-simplificationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. 0 are common, 16 are distinctive, and 14 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Read config.json for configuration (passes, vote threshold, models, category weights).
- Very specific: line 55
Check cache: Look for ${CLAUDE_PLUGIN_DATA}/bug-review/cache/pr-{N}/ — if cache exists for the same head commit, offer to resume from the …
- Very specific: line 56
Run scripts/fetch-pr.sh <pr-identifier> to get PR diff + metadata as JSON
- Very specific: line 58
Run scripts/gather-context.sh <changed-files-json> to get prioritized context (callers, types, tests, repo rules)
- Very specific: line 59
Read .bug-review.md from repo root if it exists
- Very specific: line 60
Save checkpoint: Write context to ${CLAUDE_PLUGIN_DATA}/bug-review/cache/pr-{N}/context.json
- Very specific: line 77
Use model from config.json agent_model (default: "sonnet").
- Very specific: line 81
Save checkpoint: Write all pass results to ${CLAUDE_PLUGIN_DATA}/bug-review/cache/pr-{N}/pass-results.json
- Distinctive: line 93
If only 1-2 passes found bugs and the others found none, present findings but note they lack consensus.
- Distinctive: line 95
Save checkpoint: Write voted findings to cache.
- Distinctive: line 105
Remove DISCARDed findings.
- Distinctive: line 114
Save checkpoint: Write validated findings to cache.
- Very specific: line 118
Run scripts/dedup.sh <pr-number> to get existing [bug-review] comments.
- Distinctive: line 130
Ask the user (using AskUserQuestion with multiSelect):
- Distinctive: line 134
If no findings survived voting + validation: "No bugs found across 5 review passes.
- Distinctive: line 138
Write approved findings to a temporary JSON file, then run:
- Distinctive: line 151
Read the file and understand surrounding context
- Distinctive: line 154
Scope check: Run git diff --stat — verify only the finding's file was modified and diff is under 20 lines.
- Very specific: line 155
Run existing tests if available (npm test, go test ./..., pytest, etc.)
- Very specific: line 156
If tests pass: commit with fix: {title} [bug-review]
- Very specific: line 157
If tests fail: revert the fix (git checkout -- <file>) and report to user
- Distinctive: line 158
After all fixes: push to the PR branch
- Distinctive: line 164
Run after a PR is merged to classify whether findings were resolved.
- Very specific: line 173
If enough data accumulated (10+ findings, 3+ PRs): run scripts/update-weights.sh to adjust category weights
- Very specific: line 179
Run scripts/resolution-report.sh which outputs:
- Distinctive: line 208
Read workflow.md for detailed step-by-step with error handling.
- Distinctive: line 209
Read review-passes.md for all 5 review pass prompts and the validator.
- Distinctive: line 210
Read categories.md for bug categories and learned weights.
- Distinctive: line 214
Consider creating a Runbook skill for investigating bugs found by this review
- Distinctive: line 215
Consider creating a CI/CD skill to run this review automatically on PR open
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bug Review v2
Multi-pass PR review agent with 5 parallel review passes, majority voting, independent Opus validation, and resolution rate learning. Posts inline PR comments and optionally generates autofix commits. Tracks whether findings get resolved at merge time and uses that signal to improve future reviews.
When to Apply
- User asks to review a pull request for bugs or correctness issues
- User runs
/bug-review <PR-number-or-URL> - User runs
/bug-review:resolve <PR>to classify resolutions after merge - User runs
/bug-review:reportfor resolution rate statistics - User asks for code review focused on logic errors, edge cases, or security
- User wants to find bugs in a diff or set of changes
Setup
On first run, verify:
ghCLI is installed and authenticated (gh auth status)- Current directory is a git repo with a GitHub remote
jqis installed (for JSON processing)bcis installed (for resolution rate calculations; pre-installed on most systems)
Read config.json for configuration (passes, vote threshold, models, category weights).
Workflow Overview
/bug-review <PR>
|
v
Fetch PR context + gather-context.sh
|
v
5 parallel passes (shuffled diffs, Sonnet) --> Aggregate & vote (3/5 majority)
|
v
Independent Opus validator --> Dedup --> Present findings --> Post + store
|
(later, after merge)
v
/bug-review:resolve <PR> --> Classify resolutions --> Update category weightsCommand: /bug-review <PR>
Step 1: Parse Input & Fetch Context
- Parse the PR identifier (number, URL, or branch name)
- Check cache: Look for
${CLAUDE_PLUGIN_DATA}/bug-review/cache/pr-{N}/— if cache exists for the same head commit, offer to resume from the last checkpoint - Run
scripts/fetch-pr.sh <pr-identifier>to get PR diff + metadata as JSON - Save the diff to a temp file for shuffling
- Run
scripts/gather-context.sh <changed-files-json>to get prioritized context (callers, types, tests, repo rules) - Read
.bug-review.mdfrom repo root if it exists - Save checkpoint: Write context to
${CLAUDE_PLUGIN_DATA}/bug-review/cache/pr-{N}/context.json
Step 2: Run 5 Parallel Review Passes
For each pass (1-5), prepare a shuffled diff:
scripts/shuffle-diff.sh <pass-number> < pr.diff > pass-<N>.diffLaunch 5 Agent subprocesses in parallel. Read review-passes.md for the exact prompt for each pass.
- Pass 1: Logic & Edge Cases (seed 1)
- Pass 2: Security & Data Integrity (seed 2)
- Pass 3: Error Handling & API Contracts (seed 3)
- Pass 4: Concurrency & State (seed 4)
- Pass 5: Data Flow & Contracts (seed 5)
Use model from config.json agent_model (default: "sonnet").
Each agent returns a JSON array of findings.
Save checkpoint: Write all pass results to ${CLAUDE_PLUGIN_DATA}/bug-review/cache/pr-{N}/pass-results.json
Step 3: Aggregate & Vote
- Collect findings from all 5 passes
- Group findings by similarity: same file + line within +/-5 + same or related category
- Count votes per group
- Keep only findings with 3+ votes (majority of 5, configurable via
vote_threshold) - Apply category weights from config.json:
final_score = votes × severity_weight × category_weight - Categories with weight < 0.1 are suppressed entirely
- Rank by final_score descending
If only 1-2 passes found bugs and the others found none, present findings but note they lack consensus.
Save checkpoint: Write voted findings to cache.
Step 4: Independent Validation (Opus)
Launch a separate Agent using validator_model from config.json (default: "opus").
This agent has NOT seen the review passes. It receives only the voted findings and the original code. Read the Validator section in review-passes.md for the prompt.
For each finding, the validator outputs: {id, verdict: "KEEP"|"DISCARD", confidence, reasoning}
Remove DISCARDed findings. Multiply each finding's score by the validator's confidence.
Compute each finding's final confidence field:
confidence = (votes / total_passes) × validator_confidenceFindings with confidence < 0.5 are shown with a "low confidence" warning.
Save checkpoint: Write validated findings to cache.
Step 5: Dedup Against Prior Reviews
Run scripts/dedup.sh <pr-number> to get existing [bug-review] comments.
Match by location proximity (file + line within +/-10) and category — not text similarity.
Step 6: Present Findings to User
Display a table:
| # | Severity | Confidence | File | Line | Title | Votes |
For each finding, show full description, trigger scenario, suggested fix, and validator reasoning.
Ask the user (using AskUserQuestion with multiSelect):
- Which findings to post as PR comments (default: all)
- Which findings to autofix (default: none)
If no findings survived voting + validation: "No bugs found across 5 review passes. The changes look clean."
Step 7a: Post PR Review
Write approved findings to a temporary JSON file, then run:
scripts/post-review.sh <pr-number> <findings-json-file>Then persist findings for resolution tracking:
scripts/store-findings.sh <pr-number> <findings-json-file> <head-commit-sha>Step 7b: Autofix (User-Selected Findings)
For each finding selected for autofix:
- Read the file and understand surrounding context
- Generate a minimal fix (smallest possible change)
- Apply the fix using the Edit tool
- Scope check: Run
git diff --stat— verify only the finding's file was modified and diff is under 20 lines. If exceeded, revert and warn. - Run existing tests if available (
npm test,go test ./...,pytest, etc.) - If tests pass: commit with
fix: {title} [bug-review] - If tests fail: revert the fix (
git checkout -- <file>) and report to user - After all fixes: push to the PR branch
Safety: one commit per fix, run tests between fixes, never force-push, scope-validate every fix.
Command: /bug-review:resolve <PR>
Run after a PR is merged to classify whether findings were resolved.
- Run
scripts/classify-resolutions.sh <pr-number>- Loads stored findings from
${CLAUDE_PLUGIN_DATA}/bug-review/findings/pr-{N}.json - Checks if PR is merged
- For each finding: diffs code between review commit and merge commit
- Classifies each as RESOLVED, UNRESOLVED, or INCONCLUSIVE
- Updates the stored findings file with resolution data
- Loads stored findings from
- Display resolution summary to user
- If enough data accumulated (10+ findings, 3+ PRs): run
scripts/update-weights.shto adjust category weights
Command: /bug-review:report
Display resolution rate statistics across all tracked PRs.
Run scripts/resolution-report.sh which outputs:
- Overall resolution rate
- Resolution rate by severity
- Resolution rate by category (sorted worst-first to highlight noisy categories)
- Suppressed categories (weight < 0.1)
Repo-Specific Rules (.bug-review.md)
Teams can create .bug-review.md at their repo root:
## Focus Areas
- Pay special attention to authentication flows
- Check all database queries for SQL injection
## Ignore
- Don't flag issues in generated files (*.generated.ts)
- Ignore style-only concerns
## Invariants
- All API endpoints must check req.user before accessing user data
- Database migrations must be reversible
## Severity Overrides
- Treat any auth bypass as CRITICAL regardless of category defaultHow to Use
Read workflow.md for detailed step-by-step with error handling. Read review-passes.md for all 5 review pass prompts and the validator. Read categories.md for bug categories and learned weights.
Related Skills
- Consider creating a Runbook skill for investigating bugs found by this review
- Consider creating a CI/CD skill to run this review automatically on PR open
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.

