---
name: suggest-pr-reviewers
description: >-
  Ranks reviewers for a change by who reviewed and authored earlier pull requests touching the same files and their sibling files, resolved to GitHub logins with the change author and bots excluded. Use whenever a reviewer has to be chosen: "who should review this", "who knows this code best", "find me a reviewer", "add reviewers", "who should I request review from", or when opening a pull request and deciding whom to assign.
title: suggest-pr-reviewers
canonical_url: https://skilld.dev/gh/webpro/skills/suggest-pr-reviewers
last_updated: 2026-10-07T10:30:44.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [scripts/reviewers](https://skilld.dev/api/skills-raw/webpro/skills/suggest-pr-reviewers/scripts/reviewers), [tests/backtest](https://skilld.dev/api/skills-raw/webpro/skills/suggest-pr-reviewers/tests/backtest), [tests/test_reviewers.py](https://skilld.dev/api/skills-raw/webpro/skills/suggest-pr-reviewers/tests/test_reviewers.py).
>
> If the user asked to install this Skill, run `npx skilld install webpro/skills/suggest-pr-reviewers`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/suggest-pr-reviewers`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/webpro/skills/suggest-pr-reviewers) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/suggest-pr-reviewers`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/suggest-pr-reviewers --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/suggest-pr-reviewers --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Suggest PR Reviewers

Rank reviewers from who reviewed earlier pull requests on the same paths. Do not fall back to `git blame` of the changed lines: people mostly edit their own code, so blame largely returns the change author, who cannot review their own work.

## Usage

```text
reviewers [-n LIMIT] [--since DAYS] [--exclude LOGIN] [--no-github] [branch] [base]
```

- `-n LIMIT`: maximum reviewers to show (default: 5)
- `--since DAYS`: history window (default: 365)
- `--exclude LOGIN`: leave someone out; repeatable
- `--no-github`: commit authorship only, no `gh` calls
- `branch`: branch to analyze (default: `HEAD`)
- `base`: branch to diff against (default: the pull request base if the branch has one, else `main`, `master`, or the remote HEAD; the remote-tracking ref such as `origin/main` wins over a local branch, which falls behind in worktrees nobody pulls)

Resolve [scripts/reviewers][1] to an absolute path once and run it from inside the repository under review. In Claude Code: `SCRIPT="${CLAUDE_SKILL_DIR}/scripts/reviewers"`. A globally installed skill directory is not reachable by a relative path from the repository you are in.

```bash
"$SCRIPT"                        # current branch, top 5
"$SCRIPT" -n 3 feature-branch    # pick the branch and limit
"$SCRIPT" --exclude alice        # alice is away
```

Requires `git` and Python 3. With `gh` authenticated, the ranking includes review history; without it, the script says so and ranks by commit authorship.

## Workflow

1. Run the script from the repository under review. It diffs the branch against the merge base, excludes lockfiles, and reads the history of the changed files and their directories on the base branch. With nothing committed yet it ranks the working tree instead, and says so.
2. Read the header. It names who was excluded and why, how much of the path history carried review data, whether a pull request already exists for the branch and who has reviewed or been requested, and whether GitHub data was available.
3. Recommend up to three reviewers from the table. Prefer `files` matches over `dirs`; treat `repo` rows as a last resort, since they carry no evidence about these paths. Explain each pick from the columns: how many pull requests on these paths the person reviewed or authored and how recently.
4. Drop anyone known to be unavailable and rerun with `--exclude` if that empties the list. Do not infer availability from history.
5. If the header reports no GitHub data, say so: authorship alone is a weaker signal, and names may be git author names rather than GitHub logins.

## Ranking

| Column   | Meaning |
| -------- | ------- |
| Score    | Review evidence plus a quarter of authoring evidence, relative to the top candidate |
| Reviewed | Pull requests on these paths the person approved or requested changes on |
| Authored | Pull requests (or commits) on these paths the person wrote |
| Last     | Days since the person's most recent activity on these paths |
| Match    | `files`: touched the same files; `dirs`: sibling files only; `repo`: repository-wide recent reviews |

With GitHub data the ranking reads the fifty most path-relevant pull requests. Each contributes the share of the changed files it touched, or a quarter of the share it sits beside, halved every 90 days. Reviews count when the reviewer approved or requested changes, is not the pull request author, and is not a bot. A pull request whose reviews could not be read contributes nothing at all, including for its author, so that both signals rest on the same evidence. The change author (by commit email and, once the branch is pushed, GitHub login), the local git user, and `--exclude` logins are left out.

## How well this works

[tests/backtest][2] replays merged pull requests as if they were open, ranking against history older than each one, and scores the result against the people who actually reviewed it. It also scores a control that ignores the changed paths and names the busiest recent reviewers. Two hundred pull requests per repository, one year of history each:

| Repository | Busiest reviewer covers | Ranked hit@1 / hit@3 | Control hit@1 / hit@3 |
| ---------- | ----------------------- | -------------------- | --------------------- |
| grafana/grafana | 4% of reviewed pull requests | 29% / 54% | 4% / 16% |
| apache/airflow | 26% of reviewed pull requests | 46% / 74% | 47% / 58% |
| vitejs/vite | 63% of reviewed pull requests | 72% / 99% | 72% / 97% |

Path evidence decides the answer where review is spread across the codebase, and the more concentrated review is, the more a repository-wide guess catches up with it. That is what the `repo` rows are for. Reproduce any row inside a blobless clone of that repository:

```bash
git clone --filter=blob:none --no-checkout https://github.com/grafana/grafana.git
tests/backtest -n 200 --since 365
```

`--set NAME=VALUE` overrides a scoring constant, which is how to check that a term still earns its place before changing one.

[1]: scripts/reviewers
[2]: tests/backtest
