A skill that generates a skill to review PRs. Mine your last 100 merged PRs into an AI reviewer that knows your business logic, your team's past decisions, and the module that has burned you three times. Why · How it works · Quick start · FAQ · Roadmap AI code reviewers are great at syntax and generic best practices — and blind to everything that makes review actually hard: - the invariant your bi
npx mdskills install paanSinghCoder/pr-review-skill-generatorMeta-skill that mines merged PRs to generate a custom, context-aware code review skill with backtesting
1<div align="center">23<img src="assets/icon.svg" width="128" height="128" alt="pr-review-skill-generator — a shiba bonking a bad PR" />45# pr-review-skill-generator67**A skill that generates a skill to review PRs.**89Mine your last 100 merged PRs into an AI reviewer that knows your business logic,<br/>10your team's past decisions, and the module that has burned you three times.1112[](LICENSE)1314151617[Why](#-why) · [How it works](#%EF%B8%8F-how-it-works) · [Quick start](#-quick-start) · [FAQ](#-faq) · [Roadmap](#%EF%B8%8F-roadmap)1819</div>2021---2223## 🧠 Why2425AI code reviewers are great at syntax and generic best practices — and blind to26everything that makes review actually hard:2728- the invariant your billing code must never violate,29- the "wrong-looking" pattern your team deliberately adopted two years ago,30- the hot path that has produced three hotfixes this quarter.3132That knowledge already exists. It's written down in your merged PRs — in review33threads, in the commits that followed them, in the decisions your team defended.34Nobody, human or AI, reads 100 PRs before reviewing yours.3536**This tool reads them once, and distills them into a skill your AI reviewer37loads every time.**3839## ⚙️ How it works4041```mermaid42flowchart LR43 A["📦 last ~100<br/>merged PRs"] --> B["⛏️ mine<br/>parallel agents"]44 B --> C["⚗️ distill<br/>cluster · score · cut"]45 C --> D["📜 generated<br/>review skill"]46 D --> E["🎯 backtest<br/>vs. real human reviews"]47 E -. score stamped<br/>into the skill .-> D48```4950Every signal in your history becomes a specific kind of knowledge:5152| Signal in your merged PRs | What it becomes |53|---|---|54| 💬 Review comment → author pushed a fix | An **enforced rule**, with PR citations |55| 🛡️ "This is intentional because…" → reviewer accepted | A **do-not-flag entry** — kills the false-positive nitpicks generic reviewers spam you with |56| 🚨 "Hotfix for regression from #N" | A rule that would have **caught the miss** — review's most expensive failures |57| 🗣️ Q&A threads and PR descriptions | **Domain glossary + business invariants** |58| 🔥 Where comments and hotfixes cluster | A **risk map** — hot zones get scrutiny, cold zones get skimmed |59| 🤖 AI-reviewer comments your team acted on | Kept. Ignored ones are discarded — AI noise is never laundered into "team knowledge" |6061Every mined rule carries provenance (`PR #482, #519`). Your team can audit any62rule back to the discussion it came from — and review findings cite their sources.6364## 👀 What a review looks like6566````markdown67## Review: refund flow change looks risky — 1 blocker6869### 🔴 Blocker — refund can exceed remaining balance70`src/billing/refunds.ts:84` — checks the order total, not the ledger balance;71a partial refund followed by this path double-refunds.72Why: refunds must be computed against the ledger (rule: rules/payments.md, PR #482)73Suggestion:74```diff75- if (amount <= order.total) {76+ if (amount <= ledger.remainingBalance(order.id)) {77```7879### 🔵 Consider — new endpoint has no rate-limit annotation80`src/api/routes.ts:112` — every public endpoint added since PR #519 carries one.8182Checked and fine: idempotency-key handling, migration ordering, webhook signature paths.83````8485Capped at **5 findings**, ranked by severity. If the change is fine, it says so86in one line instead of manufacturing feedback.8788## 🎯 It measures itself before you trust it8990Generation holds out a handful of human-reviewed PRs, reconstructs the code91*as the reviewer originally saw it*, reviews it blind with the freshly92generated skill, and compares against what your humans actually flagged:9394```95backtest: caught 7/11 human concerns on 5 held-out PRs; 1/3 novel findings dubious96```9798That number is stamped into the generated skill's metadata. If your repo's99review culture is thin and the skill comes out weak, it tells you that too.100101## 🚀 Quick start102103> **Requirements:** [Claude Code](https://claude.com/claude-code) and the104> [GitHub CLI](https://cli.github.com), authenticated (`gh auth login`).105106```bash107git clone https://github.com/paanSinghCoder/pr-review-skill-generator108cp -r pr-review-skill-generator/pr-review-skill-generator ~/.claude/skills/109```110111Then, in Claude Code inside the repo you want a reviewer for:112113```114> generate a PR review skill from our merged PRs115```116117Answer the setup questions (PR count — default 100, output path, monorepo118scope) and let it run; mining and backtesting take a while. When it's done:119120```121> review PR #1234122```123124## 📦 What gets generated125126```127.claude/skills/pr-review/128├── SKILL.md # review procedure + path→rules routing table129├── decisions.md # deliberate patterns — never flagged130├── glossary.md # domain terms + business invariants131├── hot-zones.md # risk-weighted attention map132├── context-wanted.md # things the miner couldn't read — fill these in133└── rules/134 ├── general.md # cross-cutting mined rules135 └── <domain>.md # per-domain rules, every one cited136```137138Commit this folder to your repo: the whole team gets the same reviewer, and139changes to your review knowledge go through PR review themselves.140141## 🔄 Keeping it fresh142143The skill stamps its training range (`trained through PR #964`) and nags when144it falls ~150 PRs or 6 months behind. Regeneration is **incremental**: it145mines only new PRs, extends provenance on existing rules, flags contradictions146(your team changed its mind — it asks rather than assumes), and never touches147the `HUMAN-CURATED` sections where your team adds what no miner can infer.148149## ❓ FAQ150151<details>152<summary><b>Does my code leave my machine?</b></summary>153<br/>154155Everything runs locally: PR data is fetched with *your* `gh` auth into a local156work directory. The model backing your Claude Code session sees it — the same157exposure as any AI-assisted review.158</details>159160<details>161<summary><b>What does generation cost?</b></summary>162<br/>163164Roughly 15–25 agent runs for 100 PRs (parallel mining batches + backtest).165Scale down with a smaller PR count; quality scales with input.166</details>167168<details>169<summary><b>Our reviews are mostly "LGTM". Will this work?</b></summary>170<br/>171172Honestly: the mined skill will be thin, and the backtest will say so. You173still get the skeleton (routing, hot zones, glossary) and the HUMAN-CURATED174sections to grow it by hand.175</details>176177<details>178<summary><b>Why cap reviews at 5 findings?</b></summary>179<br/>180181A senior reviewer surfaces the five things that matter, not thirty182observations. Ranking is the feature; volume is noise.183</details>184185<details>186<summary><b>Monorepos?</b></summary>187<br/>188189Supported via path scoping at generation time — or generate one skill per190sub-tree.191</details>192193<details>194<summary><b>Is the generated skill safe to share?</b></summary>195<br/>196197Inside your private repo, yes — that's the point. Publicly, no: it is your198business logic, distilled. The <i>generator</i> is safe to share; its199<i>output</i> is not.200</details>201202## 🚧 Limitations (v1)203204- **GitHub only.** GitLab/Bitbucket are on the roadmap.205- **Review-culture-bound.** It can only learn what your team wrote down.206- **Internal doc links** (Notion, Confluence) can't be fetched; they're queued207 in `context-wanted.md` for a human to summarize.208209## 🗺️ Roadmap210211- [ ] GitHub Action mode — auto-review on PR open, comment inline212- [ ] GitLab / Bitbucket support213- [ ] Org mode — shared conventions across repos, per-repo domain rules214- [ ] Issue-tracker mining (Linear/Jira) for requirement context215216## 🤝 Contributing217218Issues and PRs welcome. One rule of the house: changes to the mining or219distillation heuristics should demonstrate improvement — run a generation220before and after on a public repo and compare backtest results in the PR221description.222223```224pr-review-skill-generator/225├── SKILL.md # orchestration: fetch → mine → distill → backtest226├── scripts/fetch-pr-data.sh # resumable PR-data fetch (gh only, no jq)227└── references/228 ├── mining-guide.md # signal taxonomy, bot filtering, miner output contract229 ├── distillation-guide.md # clustering, scoring, cutting, organizing230 ├── backtest-guide.md # holdout evaluation procedure231 └── generated-skill-template.md # exact structure of the generated skill232```233234---235236<div align="center">237238**[MIT](LICENSE)** · built for [Claude Code](https://claude.com/claude-code) · your PRs already know how to review your PRs239240</div>241
Full transparency — inspect the skill content before installing.