agentleFS
sevenschultesevenschulte/agentic-harness/.claude/skills/review-pr/SKILL.md

review-pr

Skill2 starsChanged 7 months agoMITView on GitHub

Review an open pull request against this repo's conventions. Pulls the diff via `gh pr diff`, scans for common issues (missing tests, secrets, hard-coded config, missing error handling, conventions violations), and posts a structured review comment via `gh pr comment`. Use when the user says "review PR #N", "look at this PR", or pastes a PR URL and asks for an opinion.

  • Reads credentials

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, review-delta 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

  • 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

  • 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

    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
  • Other versions185 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 185

    1. denoland/deno★ 109ksame name
    2. ToolJet/ToolJet★ 41ksame name
    3. remix-run/remix★ 33ksame name
    4. tirth8205/code-review-graph★ 33ksame name
    5. alpinejs/alpine★ 32ksame name
    6. nrwl/nx★ 29ksame name
    7. PrefectHQ/fastmcp★ 29ksame name
    8. jlowin/fastmcp★ 29ksame name
    9. livewire/livewire★ 24ksame name
    10. microsoft/fluentui★ 20ksame name

    175 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 178 edited versions we read keep these.

  • 9

    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 the PR isn't in the current repo, stop.

    line 42
  2. Distinctive:

    Read the whole diff before forming an opinion.

    line 72
  3. Distinctive:

    Commit messages follow Conventional Commits format

    line 82
  4. Very specific:

    Test names describe behaviour (Test_returns_403_when_user_is_not_owner) not function names (TestUpdate)

    line 91
  5. Distinctive:

    No hardcoded API keys, tokens, passwords, JWTs

    line 97
  6. Distinctive:

    No production hostnames, IPs, or internal URLs hardcoded

    line 100
  7. Distinctive:

    No new dependencies with known CVEs

    line 121
  8. Distinctive:

    No drive-by refactors mixed in

    line 126
  9. Distinctive:

    No formatter churn dominating the diff (a separate PR if needed)

    line 127
  10. Distinctive:

    No N+1 queries (loops calling a repo / fetch per item)

    line 131
  11. Distinctive:

    No synchronous external calls in hot paths

    line 133
  12. Very specific:

    If you have zero critical/high findings, the verdict is APPROVE.

    line 178

“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

You are reviewing a pull request. The user has pointed you at a specific PR; your job is to read it, judge it against the conventions in .claude/rules/, and post a useful review comment.

This skill is intentionally simpler than ship-pr. The PR review job is mostly judgement, which means most of the work is reading and thinking, not running scripts. The script in this skill posts the comment; you draft what it says.

Step 0 — Resolve the PR number

# $ARGUMENTS may be a number (123) or a URL (https://github.com/org/repo/pull/123)
PR_INPUT="$ARGUMENTS"

if [[ "$PR_INPUT" =~ ^[0-9]+$ ]]; then
  PR="$PR_INPUT"
elif [[ "$PR_INPUT" =~ /pull/([0-9]+) ]]; then
  PR="${BASH_REMATCH[1]}"
else
  echo "Could not parse PR number from: $PR_INPUT" >&2
  exit 1
fi

# Confirm we're in the right repo
gh repo view --json nameWithOwner -q .nameWithOwner

If the PR isn't in the current repo, stop. Cross-repo review needs --repo and the user should be explicit.

Step 1 — Gather PR metadata

# Title, body, branch, base, author, state, CI
gh pr view "$PR" --json title,body,headRefName,baseRefName,author,state,statusCheckRollup,reviewDecision,additions,deletions,changedFiles,createdAt

Read it. Note:

  • Size — > 500 lines changed is hard to review well. Flag it
  • CI status — if checks are failing, that's the first thing to mention
  • Existing reviews — has someone already reviewed? Don't repeat their points
  • Description quality — is the why in the body, or just the what?

Step 2 — Read the diff

gh pr diff "$PR"

For very large PRs, narrow:

gh pr diff "$PR" --name-only          # Just the file list
gh pr diff "$PR" -- path/to/file      # Single file

Read the whole diff before forming an opinion. Don't just spot-check.

Step 3 — Run the review checklist

Walk through each category. Note specific files and line numbers for each finding so the author can act without hunting.

Conventions

  • Branch name follows <type>/<short-slug> (see .claude/rules/conventions.md)
  • Commit messages follow Conventional Commits format
  • PR title matches the conventions
  • PR body has What / Why / How / Test plan

Tests

  • New code has tests
  • New behaviour has a test for the behaviour
  • Bug fixes have a test that would have caught the bug
  • Test names describe behaviour (Test_returns_403_when_user_is_not_owner) not function names (TestUpdate)
  • No skip, xtest, it.only, fdescribe, or equivalent slipped in

Secrets & config

  • No hardcoded API keys, tokens, passwords, JWTs
  • No .env or credentials files added
  • New config values have a corresponding entry in .env.example
  • No production hostnames, IPs, or internal URLs hardcoded

Error handling

  • Errors propagate (not swallowed with _ = err or empty catch blocks)
  • Errors are wrapped with context (fmt.Errorf("...: %w", err), throw new Error("...", { cause }))
  • No panic / process.exit in non-init code paths

Database (if applicable)

  • Schema changes go through migrations
  • Queries use parameterised statements (no string concatenation into SQL)
  • Indexes added for new query patterns
  • Multi-statement writes wrapped in a transaction where atomicity matters

Security (if applicable)

  • Authorization checks on mutation endpoints (caller can do this thing for that resource)
  • Input validation at the boundary
  • Output encoding for anything user-controlled rendered into HTML/SQL/shell
  • No new dependencies with known CVEs

Scope

  • Changes match the PR title / linked issue
  • No drive-by refactors mixed in
  • No formatter churn dominating the diff (a separate PR if needed)

Performance (if applicable)

  • No N+1 queries (loops calling a repo / fetch per item)
  • Pagination on list endpoints
  • No synchronous external calls in hot paths

Step 4 — Categorise findings

For each finding, assign a severity:

  • CRITICAL — security flaw, data loss risk, auth bypass, leaked secret. Block the merge
  • HIGH — broken functionality, missing tests for critical paths, breaks API contract. Should be fixed before merge
  • MEDIUM — design smell that will hurt later, performance issue, incomplete vs spec. Fix before merge if cheap; flag and merge if not
  • LOW — style, naming, minor refactor opportunity. Note it; author decides
  • NIT — typo, comment polish. Author can ignore

Step 5 — Draft the review comment

Use this structure:

## Review

**Verdict:** APPROVE / REQUEST CHANGES / COMMENT

**TL;DR:** <1 sentence summary>

### Critical
<list — file:line — issue — suggested fix. Or "None.">

### High
<same shape>

### Medium
<same shape>

### Low / Nits
<same shape, but you can group these>

### What's good
<2–4 bullets noting things done well. Calibrates the rest of the review.>

### Open questions
<things you want the author to clarify, not necessarily change>

If you have zero critical/high findings, the verdict is APPROVE. If you have any, it's REQUEST CHANGES. COMMENT is for cases where you have observations but no required fixes (e.g. you read a docs PR and have a few suggestions).

Do not post a review with no findings and no praise — it adds noise. If there's truly nothing to say, just gh pr review --approve with no comment.

Step 6 — Post the comment

.claude/skills/review-pr/scripts/post-comment.sh "$PR" "$(cat <<'EOF'
<your drafted review here>
EOF
)"

The script handles the gh invocation. You handle the content.

What this skill will not do

  • It will not approve, request changes, or merge — it posts a comment. The user makes the merge call. (You can extend this skill to do gh pr review --approve or --request-changes if your team's culture allows; default is comment-only because reviewing on a delegated agent's authority is a strong claim.)
  • It will not push fixes to the author's branch. If you can fix something trivially, mention the fix in the review and let the author do it
  • It will not pull external context (linked tickets, RFCs) unless the PR body links to them and the user explicitly asks for that depth

Calibration

Good reviews are short and specific. Three high-quality findings beat fifteen nits. If your review is longer than the PR's diff, you're doing it wrong.

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.