PR Review Toolkit — Multi-Agent PR Analysis

6 Specialized Review Agents for PR Analysis

A multi-agent review pipeline that runs 6 expert analyzers in parallel against your pull request, filters results by confidence scoring (≥80 threshold), and produces actionable, high-signal feedback.

6
Agents
1
Command
9
Files
MD
Language

🔎 6 Review Agents✅ Confidence Scoring🐛 Bug Detection📊 Type Analysis

📚 What is this & why does it exist?

PR Review Toolkit deploys 6 specialized agents to analyze your pull request from different angles — comments, tests, silent failures, type design, code quality, and simplification opportunities. Each agent produces findings with confidence scores, and only results meeting the ≥80 threshold reach the developer. This eliminates noisy, low-value feedback and ensures every review comment is worth reading.

💡 Real-world analogy

Think of a hospital emergency room triage system. Six specialists (cardiologist, neurologist, radiologist, etc.) each examine the patient independently and write up their findings with a severity score. Only findings above a critical threshold get escalated to the attending physician. The PR Review Toolkit works the same way: 6 expert agents examine your code diff, each scores their findings, and only high-confidence issues make it to your review summary.

Architecture

flowchart TB
    subgraph Input["Validation & Context"]
        V1["Git Diff Extraction"] --> V2["CLAUDE.md Guidelines"]
        V2 --> V3["Scope Validation"]
    end
    subgraph Pipeline["Review Pipeline"]
        V3 --> SUM["Summarization"]
        SUM --> PAR["Parallel Review"]
        PAR --> A1["comment-analyzer"]
        PAR --> A2["pr-test-analyzer"]
        PAR --> A3["silent-failure-hunter"]
        PAR --> A4["type-design-analyzer"]
        PAR --> A5["code-reviewer"]
        PAR --> A6["code-simplifier"]
    end
    subgraph Output["Confidence Filtering"]
        A1 --> CF["Filter ≥80 Confidence"]
        A2 --> CF
        A3 --> CF
        A4 --> CF
        A5 --> CF
        A6 --> CF
        CF --> OUT["Filtered Review Output"]
    end

Key Components

ComponentFileRole
review-prcommands/review-pr.mdMain review command — orchestrates all 6 agents in parallel
comment-analyzeragents/comment-analyzer.mdAnalyzes inline comments, TODOs, FIXMEs, and documentation gaps
pr-test-analyzeragents/pr-test-analyzer.mdEvaluates test coverage, missing edge cases, and test quality
silent-failure-hunteragents/silent-failure-hunter.mdDetects swallowed errors, empty catch blocks, and missing error handling
type-design-analyzeragents/type-design-analyzer.mdReviews type safety, interface design, and generic usage
code-revieweragents/code-reviewer.mdGeneral code quality: logic bugs, race conditions, security issues
code-simplifieragents/code-simplifier.mdIdentifies over-engineering, redundant abstractions, simplification paths
plugin.json.claude-plugin/plugin.jsonPlugin manifest with agent and command registration
README.mdREADME.mdUsage documentation, examples, and configuration guide
CLAUDE.mdCLAUDE.mdProject-level guidelines consumed by review agents

Agent Profiles

💬 comment-analyzer

Scans inline comments, TODOs, FIXMEs, HACKs, and documentation gaps. Identifies stale comments that no longer match the code, missing JSDoc/docstring annotations on public APIs, and TODO items that should be tracked as issues.

  • Model: Sonnet
  • Focus: Documentation quality
  • Confidence avg: 85-92

🧪 pr-test-analyzer

Evaluates test coverage for changed code. Detects missing edge-case tests, untested error paths, and test quality issues like assertions that always pass. Cross-references changed functions against test files.

  • Model: Sonnet
  • Focus: Test completeness
  • Confidence avg: 82-90

🕷️ silent-failure-hunter

Hunts for swallowed exceptions, empty catch blocks, missing error propagation, and functions that fail silently. Detects patterns like catch(e) {}, missing await on async calls, and unchecked return values.

  • Model: Sonnet
  • Focus: Error handling
  • Confidence avg: 88-95

🔬 type-design-analyzer

Reviews TypeScript/Python type safety, interface design, generic usage, and type narrowing patterns. Flags any types, overly broad union types, missing discriminated unions, and inconsistent type parameter naming.

  • Model: Sonnet
  • Focus: Type system quality
  • Confidence avg: 80-88

🐛 code-reviewer

General-purpose code review focusing on logic bugs, race conditions, security vulnerabilities, and performance issues. Uses the Opus model for highest accuracy on subtle bugs that require deep reasoning.

  • Model: Opus
  • Focus: Bug detection
  • Confidence avg: 85-96

✂️ code-simplifier

Identifies over-engineering, redundant abstractions, unnecessary indirection, and code that could be simplified. Suggests concrete simplifications with before/after examples.

  • Model: Sonnet
  • Focus: Complexity reduction
  • Confidence avg: 78-85

Confidence Scoring

Each agent assigns a confidence score (0–100) to every finding. The scoring considers:

FactorWeightDescription
Pattern certainty40%How clearly the code matches a known anti-pattern
Context evidence30%Supporting evidence from surrounding code and project conventions
Severity impact20%Potential impact if the finding is a real issue
False positive risk10%Likelihood this is a false positive based on code patterns
Only findings with confidence ≥ 80 are included in the final output. This eliminates ~40% of raw findings, dramatically improving signal-to-noise ratio.

Usage Examples

Basic Review

# Review the latest commit
/review-pr

# Review with specific scope
/review-pr --filter=branch

# Review only type issues
/review-pr --agents=type-design-analyzer

Output Format

## PR Review Summary

### 🐛 code-reviewer (Opus) — 3 findings
| # | Confidence | Finding |
|---|-----------|---------|
| 1 | 94 | Race condition in concurrent map access (line 142) |
| 2 | 87 | SQL injection via unsanitized user input (line 89) |
| 3 | 82 | Off-by-one error in pagination logic (line 201) |

### 📊 type-design-analyzer — 2 findings
| # | Confidence | Finding |
|---|-----------|---------|
| 1 | 91 | `any` type used in public API return (line 55) |
| 2 | 83 | Missing discriminated union for status field (line 78) |

*Filtered: 8 findings below confidence threshold (80)*

Data Flow

sequenceDiagram
    participant Dev as Developer
    participant Cmd as /review-pr
    participant Git as Git Diff
    participant A1 as comment-analyzer
    participant A2 as pr-test-analyzer
    participant A3 as silent-failure-hunter
    participant A4 as type-design-analyzer
    participant Filter as Confidence Filter

    Dev->>Cmd: /review-pr
    Cmd->>Git: Extract diff (latest commit)
    Git-->>Cmd: Diff payload + file list
    Cmd->>Cmd: Load CLAUDE.md guidelines
    Cmd->>Cmd: Summarize changes
    par Parallel Review
        Cmd->>A1: Analyze comments
        Cmd->>A2: Analyze tests
        Cmd->>A3: Hunt silent failures
        Cmd->>A4: Analyze type design
    end
    A1-->>Filter: Findings + scores
    A2-->>Filter: Findings + scores
    A3-->>Filter: Findings + scores
    A4-->>Filter: Findings + scores
    Filter->>Filter: Discard confidence < 80
    Filter-->>Dev: High-confidence review output

Review Pipeline Details

Pipeline Stages

StageDurationDescription
1. Validation~2sVerify git repository state, check for uncommitted changes, identify diff scope
2. Context Loading~3sRead CLAUDE.md guidelines, extract project conventions and review standards
3. Summarization~5sGenerate change summary with file categories, impact assessment, and risk areas
4. Parallel Review~30sDispatch to 4-6 agents simultaneously, each analyzing their specialty area
5. Confidence Filter~1sAggregate findings, apply ≥80 threshold, de-duplicate overlapping findings
6. Output~2sFormat markdown report grouped by agent, sorted by confidence descending

De-duplication Strategy

When multiple agents flag the same code location, the pipeline de-duplicates using these rules:

Interactions

ModuleInterfaceData Exchanged
Gitgit diffRetrieves the PR diff for analysis scope
CLAUDE.mdFile readProject-level guidelines and coding standards
GitHub CLIgh pr viewPR metadata, labels, and linked issues
Claude Code PlatformAgent orchestrationParallel agent spawning, result collection
code-reviewer agentOpus modelHigher-capability model for bug detection accuracy

Configuration Reference

ParameterDefaultDescription
confidence_threshold80Minimum confidence score for findings to appear in output
model (code-reviewer)opusUses Opus model for higher accuracy on bug detection
model (other agents)sonnetStandard model for comment, test, type, and simplifier agents
filterlatestDiff scope: latest for last commit, branch for full PR
scopegit diffInput source: git diff output piped to all agents
parallel_agents4Number of agents run concurrently (max 6)
output_formatmarkdownOutput format: markdown summary with grouped findings

Directory Map

Source tree for PR Review Toolkit
pr-review-toolkit/
├── .claude-plugin/plugin.json          ← Plugin manifest
├── README.md                           ← Usage documentation
├── CLAUDE.md                           ← Project guidelines
├── commands/
│   └── review-pr.md                    ← Main review command
└── agents/
    ├── comment-analyzer.md             ← Comment & TODO analysis
    ├── pr-test-analyzer.md             ← Test coverage analysis
    ├── silent-failure-hunter.md        ← Silent failure detection
    ├── type-design-analyzer.md         ← Type safety review
    ├── code-reviewer.md                ← General code review (Opus)
    └── code-simplifier.md              ← Simplification opportunities