agentleFS
alabenkhlifaalabenkhlifa/dayjob/skills/review-pr/SKILL.md

review-pr

Skill1 starsChanged 32 days agoMITView on GitHub

Use when the user asks to review a pull request, merge request, branch, or diff, e.g. "review PR 42", "review this branch before I merge", or wants a self-review before asking others.

185 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use diagnose-ci-failures, docs-loop and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zerx-labSkill

    diagnose-ci-failures

    Diagnose CI failures for a PR using the GitHub CLI, extract error logs, and generate a plan to fix them. Use when the user asks to check CI status, pull CI issues, triage test failures, or investigate PR build failures.

    Also in 3 projects that use this

  • GeiserXSkill

    docs-loop

    Use when the user asks to audit docs, check documentation for stale claims, or verify docs against the code.

    Also in 3 projects that use this

  • GeiserXSkill

    full-loop

    Drive a repository to done with sergio-loop, then keep improving it with refine-loop at a descending theta. Use only when the user explicitly invokes full-loop.

    Also in 3 projects that use this

  • n24q02mSkill

    review-delta

    Review only changes since last commit using impact analysis. Token-efficient delta review with automatic blast-radius detection.

    Also in 3 projects that use this

  • n24q02mSkill

    build-graph

    Build or update the code review knowledge graph. Run this first to initialize, or let hooks keep it updated automatically.

    Also in 3 projects that use this

  • +7 more from GeiserX

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 178 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If <base> comes back empty (no origin/HEAD and no main or master), ask the user which branch is the base before going on.

    line 19
  2. Very specific:

    If git fetch fails with "Repository not found", retry it with that account's token: git -c credential.helper= -c 'credential.helper=!f(){ …

    line 31
  3. Distinctive:

    Read the description first and judge the code against what it claims to do.

    line 33
  4. Very specific:

    Leave out empty sections. Every finding has path:line, a concrete failure, and a suggestion.

    line 65
  5. Distinctive:

    Read-only: never edit, commit, or push the author's code during a review.

    line 73
  6. Distinctive:

    Don't run, install, or test the PR's code unless the user says so — derive failing inputs by reading the code.

    line 74
  7. Distinctive:

    No finding without evidence.

    line 76

“Common” is measured: kept by at least 6 in 10 of the 178 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Review PR

Find what would hurt in production, explain it so the author can fix it fast, and say it kindly.

1. Get the diff

base=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')
[ -n "$base" ] || base=$(git branch --list main master | head -1 | tr -d ' *')

<base> is the remote's default branch (snippet above), falling back to main or master.

If <base> comes back empty (no origin/HEAD and no main or master), ask the user which branch is the base before going on.

  • PR number or URL with gh → gh pr view <n> (title, body, linked issue), gh pr diff <n>, and git fetch -f origin pull/<n>/head:pr-<n> so you can read the PR's files with git show pr-<n>:<path>.
  • PR number without gh → GitHub: git fetch -f origin pull/<n>/head:pr-<n>; GitLab: git fetch -f origin merge-requests/<n>/head:mr-<n>; otherwise ask for the branch name.
  • Branch → git log <base>..<branch> and git diff <base>...<branch>.
  • Nothing given → the current branch against its base.

gh account: the user may have several gh accounts, and the active one may not see this repo. Before the first gh call, list each account's access:

for u in $(gh auth status 2>&1 | sed -n 's/.*account \([^ ]*\).*/\1/p'); do echo "$u $(GH_TOKEN=$(gh auth token --user "$u") gh repo view --json viewerPermission -q .viewerPermission 2>/dev/null)"; done; true

Pick the first account with ADMIN, MAINTAIN or WRITE, else one with READ or TRIAGE. If none shows a permission, skip every gh call. Run every gh call as that account, GH_TOKEN=$(gh auth token --user <account>) gh ..., with 2>/dev/null. Never run gh auth switch. If git fetch fails with "Repository not found", retry it with that account's token: git -c credential.helper= -c 'credential.helper=!f(){ echo username=<account>; echo "password=$(gh auth token --user <account>)"; }; f' fetch ....

Read the description first and judge the code against what it claims to do.

2. Read beyond the diff

For each changed function, read the whole file at the PR's version (git show <branch>:<path>) and cite line numbers from that version. Never check out or switch the user's branch. Find its callers with grep. Bugs hide in what the diff does not show: callers relying on old behavior, places that also needed a change, tests that no longer test anything.

3. Check, in this order

  1. Correctness: logic errors, = vs ===, off-by-one, null or empty input, units, async/await, error paths.
  2. Security: injection, secrets in code, missing auth checks, unsafe input.
  3. Data: migrations, backwards compatibility, breaking API changes.
  4. Tests: is the new behavior covered, and do the tests assert something real?
  5. Readability: names, dead code — only when it will cause real confusion.

Skip style nits a linter would catch.

4. Report

**Verdict:** Approve / Approve with comments / Request changes

**Must fix**
1. `path:line` — <problem>. <concrete input → wrong result>. Suggest: <fix>.

**Should fix**
1. `path:line` — ...

**Nice to have** (max 3)

**Good:** <one specific thing done well>

Leave out empty sections. Every finding has path:line, a concrete failure, and a suggestion.

5. Post — only after a yes

Offer to post only when a PR/MR exists; otherwise the review stays in chat. To post: gh pr review <n> --comment --body-file <file>. Never approve or request changes on GitHub without an explicit yes.

Rules

  • Read-only: never edit, commit, or push the author's code during a review.
  • Don't run, install, or test the PR's code unless the user says so — derive failing inputs by reading the code. You may offer to run it.
  • About the code, not the person. Ask when unsure: "Could this be null when…?"
  • No finding without evidence. Say "not sure" rather than guess.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.