npm · open source · offline

Stop reviewing PRs blind.

prbrief turns any git range into a high-signal review briefing: module clusters, risk hotspots, a sensible reading order, and test-gap hints — in seconds, on your machine, with no API key.

$ npx prbrief --base main

prbrief — PR review briefing
────────────────────────────────────────────────────────────────
range  a1b2c3d4e5f6...HEAD
stats  28 files  +612/−140  6 commits  (2 noise, 5 tests)

Summary
  28 files · 4 modules · focus: packages/api, packages/web · flags: migration

Signals
  CRITICAL  1 database migration — confirm rollback plan
  WARN      2 files touch auth/security-sensitive areas

Suggested review order
   1. packages/api/migrations/20260701_add_entitlements.sql
   2. packages/api/src/auth/session.ts
   3. packages/api/src/billing/invoice.ts
   …

Local-first

Runs on git only. No cloud, no telemetry, no model quota. Safe for private monorepos.

Deterministic

Same diff ⇒ same briefing. Heuristics you can explain in code review, not opaque scores.

Composable

Terminal for humans, markdown for PR bodies, JSON for CI and editor plugins.

CI-ready

Drop-in GitHub Action example posts an updating briefing comment on every PR.

Install

$ npm install -g prbrief
$ prbrief --base main --md
$ prbrief --base origin/main --json -o brief.json

What it surfaces

SectionWhy it saves time
ClustersSee which package/app absorbed the risk before opening files
HotspotsMigrations, schemas, auth, and large churn rise to the top
Review orderRead contracts and security before tests and docs
Test gapsProduction source changed with no matching test path in the diff
SignalsSecrets, lockfile skew, mass deletes, oversized PRs

Library API

import { analyze, formatMarkdown } from "prbrief";

const brief = analyze({ base: "main", head: "HEAD" });
console.log(formatMarkdown(brief));