Cut PR review time from 48h to 4h. Smart reviewer assignment, semantic diff summaries, and load balancing for GitHub repositories.
PRs sit idle because:
- Wrong reviewer assigned — the person has no context on the changed files
- Overloaded reviewers — some engineers have 10 PRs queued, others have 0
- No summary — reviewers spend 20 minutes just understanding what changed
pr-accelerator solves all three with one CLI.
npm install -g @phoenixaihub/pr-accelerator
# or use npx (no install needed in CI)
npx @phoenixaihub/pr-accelerator analyze 42Requirements:
- Node.js 18+
ghCLI installed and authenticated (gh auth login)- Run inside a git repository
Full PR analysis: complexity score, semantic diff summary, and reviewer recommendations.
$ pr-accelerator analyze 142
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PR #142: feat: add OAuth2 provider support
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Author: alice
Files: 14 | +342 -87
▸ Review Complexity
Level: COMPLEX (score: 68/100)
Est. time: ~175 minutes
Factors:
Lines changed ████████████ +17.1
Files touched ████████ +14.0
High-risk areas ███████████ +12.0
Directory spread ████ +7.5
New files ████ +6.0
Deleted files ██ +3.0
▸ Semantic Diff Summary
🔐 Auth & Permissions
+189 -42 across 5 file(s)
src/auth/oauth.ts
src/auth/providers/google.ts
src/auth/providers/github.ts
src/auth/session.ts
src/middleware/auth.ts
🧪 Test Updates
+98 -20 across 4 file(s)
src/auth/oauth.test.ts
...
⚙️ Configuration
+55 -25 across 3 file(s)
▸ Reviewer Recommendations
🥇 Bob Chen
Score: 142.3
Open PRs: 1
Est. wait: ~4.2h
Expertise: src/auth/session.ts, src/middleware/auth.ts
🥈 Sarah Kim
Score: 98.7
Open PRs: 3
Est. wait: ~8.1h
Expertise: src/auth/oauth.ts
▸ AI-Style Summary
Core changes in: Auth & Permissions, API / Endpoints. Tests updated (4 files). Configuration changed
Show expertise rankings across the codebase, or for a specific file.
# Overall rankings
pr-accelerator reviewers
# Expertise for a specific file
pr-accelerator reviewers --file src/auth/login.tsOutput:
▸ Overall Codebase Expertise Rankings
🥇 Alice Smith score: 287.45 commits: 142
Top areas: src/auth, src/api, src/core
🥈 Bob Chen score: 198.20 commits: 98
🥉 Sarah Kim score: 156.80 commits: 77
Expertise scoring algorithm:
- TF-IDF on git log: contributors to rare files score higher than contributors to common files
- Exponential decay: recent commits weighted more (90-day half-life by default)
- Lines touched: more code touched = higher signal
- Formula:
score = Σ(files) recency × log(1 + lines) × IDF(file)
Show current reviewer queue and recommend the least-loaded expert.
pr-accelerator loadOutput:
▸ Current Queue
Alice Smith 5 open avg: 4.0h est. wait: ~24.0h
Bob Chen 1 open avg: 4.0h est. wait: ~8.0h
Sarah Kim 0 open avg: 4.0h est. wait: ~4.0h
▸ Recommendation
Assign to: Sarah Kim
Expected wait: ~4.0h
Current queue: 0 PRs
Uses an M/M/c queue model for wait time estimation.
Generate a semantic diff summary (terminal, markdown, or PR comment).
# Terminal output
pr-accelerator summarize 42
# Post as PR comment
pr-accelerator summarize 42 --comment
# Output markdown
pr-accelerator summarize 42 --markdownWhen posted as a comment (--comment), it produces:
## 🤖 PR Summary — *feat: add OAuth2 provider support*
> Generated by pr-accelerator
### 🔐 Auth & Permissions
**+189 -42** across 5 file(s)
- `src/auth/oauth.ts`
- ...
### ⚠️ Potential Breaking Changes
- Possible removed export in src/auth/session.tsInitialize .pr-accelerator.yml for your repo.
pr-accelerator setupCreates .pr-accelerator.yml:
# pr-accelerator configuration
# Minimum number of reviewers required before merging
minReviewers: 2
# Automatically assign reviewers when CI runs pr-accelerator ci auto-assign
autoAssign: false
# Paths to ignore when computing expertise scores
ignorePaths:
- "*.lock"
- "dist/**"
- "node_modules/**"
- ".github/**"
# Expertise decay: contributions older than this many days are weighted less
expertiseDecayDays: 90
# Maximum number of reviewer suggestions to show
maxReviewersToSuggest: 3
# Use load balancing (M/M/c model) when suggesting reviewers
loadBalancing: truepr-accelerator ci auto-assignpr-accelerator ci summarizeAdd to .github/workflows/pr-accelerator.yml:
name: PR Accelerator
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
pr-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for git history
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Post semantic summary
run: npx @phoenixaihub/pr-accelerator ci summarize
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Auto-assign reviewers
run: npx @phoenixaihub/pr-accelerator ci auto-assign
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}Note:
fetch-depth: 0is required sopr-acceleratorcan analyze git history for expertise scoring.
For each file in the PR, we find all historical contributors and weight them:
score(contributor, file) = TF × IDF
TF = Σ(commits) recency_weight × log(1 + lines_changed)
IDF = log(total_commits / (1 + contributors_to_file))
recency_weight = exp(-ln(2) / decay_days × age_days)
Contributors with deep expertise in rarely-touched files score highest.
We model the review process as a queue:
- λ = PR arrival rate
- μ = reviewer service rate (from historical review times)
- Expected wait = queue_length / μ + 1/μ
We assign to the reviewer minimizing expected wait × expertise penalty.
Files are clustered by:
- Pattern matching — test/spec, config, auth, api, ui, docs, deps, ci patterns
- Directory proximity — files in the same directory/module grouped together
- Purpose labels — human-readable labels generated from cluster type + top directory
| Field | Type | Default | Description |
|---|---|---|---|
minReviewers |
number | 2 |
Minimum reviewers to assign |
autoAssign |
boolean | false |
Auto-assign in CI mode |
ignorePaths |
string[] | ["*.lock", "dist/**"] |
Glob patterns to ignore |
expertiseDecayDays |
number | 90 |
Half-life for recency weighting |
maxReviewersToSuggest |
number | 3 |
Max suggestions shown |
loadBalancing |
boolean | true |
Use M/M/c load balancing |
git clone https://github.com/phoenix-assistant/pr-accelerator
cd pr-accelerator
npm install
npm run build
npm testSee CONTRIBUTING.md.
MIT © Phoenix AI Hub