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 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
| Component | File | Role |
|---|---|---|
review-pr | commands/review-pr.md | Main review command — orchestrates all 6 agents in parallel |
comment-analyzer | agents/comment-analyzer.md | Analyzes inline comments, TODOs, FIXMEs, and documentation gaps |
pr-test-analyzer | agents/pr-test-analyzer.md | Evaluates test coverage, missing edge cases, and test quality |
silent-failure-hunter | agents/silent-failure-hunter.md | Detects swallowed errors, empty catch blocks, and missing error handling |
type-design-analyzer | agents/type-design-analyzer.md | Reviews type safety, interface design, and generic usage |
code-reviewer | agents/code-reviewer.md | General code quality: logic bugs, race conditions, security issues |
code-simplifier | agents/code-simplifier.md | Identifies over-engineering, redundant abstractions, simplification paths |
plugin.json | .claude-plugin/plugin.json | Plugin manifest with agent and command registration |
README.md | README.md | Usage documentation, examples, and configuration guide |
CLAUDE.md | CLAUDE.md | Project-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:
| Factor | Weight | Description |
|---|---|---|
| Pattern certainty | 40% | How clearly the code matches a known anti-pattern |
| Context evidence | 30% | Supporting evidence from surrounding code and project conventions |
| Severity impact | 20% | Potential impact if the finding is a real issue |
| False positive risk | 10% | 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
| Stage | Duration | Description |
|---|---|---|
| 1. Validation | ~2s | Verify git repository state, check for uncommitted changes, identify diff scope |
| 2. Context Loading | ~3s | Read CLAUDE.md guidelines, extract project conventions and review standards |
| 3. Summarization | ~5s | Generate change summary with file categories, impact assessment, and risk areas |
| 4. Parallel Review | ~30s | Dispatch to 4-6 agents simultaneously, each analyzing their specialty area |
| 5. Confidence Filter | ~1s | Aggregate findings, apply ≥80 threshold, de-duplicate overlapping findings |
| 6. Output | ~2s | Format 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:
- Same file + same line range + overlapping description → keep highest-confidence finding
- Same file + different lines + similar pattern → group under a single “pattern” heading
- Different files + same pattern (e.g., missing error handling) → list all locations, one finding
Interactions
| Module | Interface | Data Exchanged |
|---|---|---|
| Git | git diff | Retrieves the PR diff for analysis scope |
| CLAUDE.md | File read | Project-level guidelines and coding standards |
| GitHub CLI | gh pr view | PR metadata, labels, and linked issues |
| Claude Code Platform | Agent orchestration | Parallel agent spawning, result collection |
| code-reviewer agent | Opus model | Higher-capability model for bug detection accuracy |
Configuration Reference
| Parameter | Default | Description |
|---|---|---|
confidence_threshold | 80 | Minimum confidence score for findings to appear in output |
model (code-reviewer) | opus | Uses Opus model for higher accuracy on bug detection |
model (other agents) | sonnet | Standard model for comment, test, type, and simplifier agents |
filter | latest | Diff scope: latest for last commit, branch for full PR |
scope | git diff | Input source: git diff output piped to all agents |
parallel_agents | 4 | Number of agents run concurrently (max 6) |
output_format | markdown | Output 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