agentleFS
jara-r-kjara-r-k/claude-code-skills/skills/github-pr-review/SKILL.md

github-pr-review

Skill1 starsChanged 46 days agoMITView on GitHub

Review GitHub pull requests with a consistent methodology — code quality, security, performance, and test coverage analysis. Use when asked to 'review a PR', 'check this pull request', 'review PR #123', or 'give feedback on this PR'. Do NOT use for creating PRs, managing issues, or repository administration.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-commit, code-review and 2 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.
  • MicrosoftSkill

    git-commit

    Stage user-selected paths, confirm the exact staged set, and create one local Conventional Commit, or generate a commit message for staged changes without committing. Use when you want a guarded commit or a ready-to-paste message.

    Also in 4 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 3 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these steps in order for every PR review.

    line 29
  2. Very specific:

    Run gh pr view <number> to read the title, description, author, base branch, and linked issues.

    line 33
  3. Distinctive:

    Check the PR size. If the diff exceeds 1,000 lines, note this and consider reviewing file-by-file.

    line 35
  4. Distinctive:

    Do tests cover both happy path and edge cases?

    line 80
  5. Distinctive:

    If test coverage is lacking, note specific scenarios that should be tested.

    line 85
  6. Very specific:

    Run gh pr view 42 and gh pr diff 42.

    line 131
  7. Very specific:

    Ask if the user wants to submit the review via gh pr review 42.

    line 134
  8. Very specific:

    Run gh pr list --base main --limit 1 to find the latest PR.

    line 138
  9. Distinctive:

    Run the review methodology against the identified PR.

    line 144

“Common” is measured: kept by at least 6 in 10 of the 17 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

GitHub PR Review Skill

Companion skill for GitHub via the gh CLI. Provides a structured, consistent methodology for reviewing pull requests covering security, code quality, performance, and test coverage.

Available Tools

This skill uses the gh CLI for all GitHub interactions:

  • gh pr view <number> — View PR metadata (title, author, description, status)
  • gh pr diff <number> — Retrieve the full diff for a PR
  • gh pr checks <number> — View CI/CD check status
  • gh pr review <number> — Submit a review (approve, request changes, comment)
  • gh api repos/{owner}/{repo}/pulls/{number}/comments — Read existing review comments
  • gh api repos/{owner}/{repo}/pulls/{number}/files — List changed files

Instructions

Structured Review Methodology

Follow these steps in order for every PR review.

Step 1: Read the PR Context

  1. Run gh pr view <number> to read the title, description, author, base branch, and linked issues.
  2. Understand the intent — what problem is the PR solving and why.
  3. Check the PR size. If the diff exceeds 1,000 lines, note this and consider reviewing file-by-file.

Step 2: Check for Security Issues (OWASP Top 10)

Scan the diff for common vulnerabilities:

  • Injection — SQL injection, command injection, XSS via unsanitised input
  • Broken authentication — hardcoded credentials, weak token handling
  • Sensitive data exposure — secrets in code, unencrypted PII, verbose logging
  • Broken access control — missing authorisation checks, privilege escalation
  • Security misconfiguration — debug mode enabled, permissive CORS, default credentials
  • Insecure dependencies — new dependencies with known CVEs

Flag any findings as Critical severity.

Step 3: Check Code Quality

Evaluate the diff against these criteria:

  • Naming — variables, functions, and classes use clear, descriptive names
  • Structure — code is well-organised, follows existing project patterns
  • DRY — no unnecessary duplication; shared logic is extracted
  • Readability — logic is easy to follow; complex sections have comments
  • Error handling — errors are caught, logged, and handled gracefully
  • Type safety — types are correct and complete (where applicable)

Flag findings as Suggestion or Nit severity.

Step 4: Check Performance Implications

Look for:

  • N+1 queries — database calls inside loops
  • Unbounded operations — missing pagination, no limits on collection processing
  • Memory concerns — large allocations, retained references, missing cleanup
  • Unnecessary computation — redundant calculations, missing caching opportunities
  • Blocking operations — synchronous I/O in async contexts

Flag findings as Critical (production impact) or Suggestion (optimisation opportunity).

Step 5: Check Test Coverage

Assess whether the changes are adequately tested:

  • Are there new or updated tests for the changed code?
  • Do tests cover both happy path and edge cases?
  • Are error scenarios tested?
  • Is there integration test coverage for new API endpoints or workflows?
  • Are existing tests still valid after the changes?

If test coverage is lacking, note specific scenarios that should be tested.

Step 6: Write the Review Summary

Compile findings into a structured review with the following format:

## PR Review: #<number> — <title>

### Overview
<1-2 sentence summary of the PR's purpose and approach>

### Positives
- <What the PR does well — always include at least one positive>

### Findings

#### Critical
- <Security or performance issues that must be addressed>

#### Suggestions
- <Improvements that would meaningfully enhance the code>

#### Nits
- <Minor style or preference items>

### Test Coverage
<Assessment of test adequacy>

### Verdict
<APPROVE / REQUEST_CHANGES / COMMENT — with brief justification>

Error Handling

ErrorResponse
PR not foundVerify the PR number and repository. Run gh pr list to confirm available PRs. Check that the repository is correct with gh repo view.
No permissionsInform the user they may not have access to the repository. Suggest checking repository visibility and their GitHub authentication via gh auth status.
Large diffs (>1,000 lines)Warn the user about the size. Offer to review file-by-file using gh api to list changed files, then review each file's diff individually. Prioritise files with security implications.
CI checks failingNote failing checks via gh pr checks. Include check failures in the review summary as they may indicate issues with the PR.

Examples

"Review PR #42"

  1. Run gh pr view 42 and gh pr diff 42.
  2. Walk through the six-step methodology.
  3. Present the structured review summary.
  4. Ask if the user wants to submit the review via gh pr review 42.

"Check the latest PR on main"

  1. Run gh pr list --base main --limit 1 to find the latest PR.
  2. Proceed with the full review methodology on the identified PR.

"Give feedback on this PR" (with a URL provided)

  1. Extract the owner, repo, and PR number from the URL.
  2. Run the review methodology against the identified PR.
  3. Present findings and offer to submit.

Important

  • Always be constructive. Note positives alongside issues — every PR has something done well.
  • Use severity ratings consistently: Critical (must fix), Suggestion (should consider), Nit (take it or leave it).
  • Never submit a review without user confirmation. Present the review summary first and let the user decide whether to approve, request changes, or comment.
  • Be specific. Reference file names, line numbers, and code snippets when raising findings.
  • Respect the author. Frame feedback as questions or suggestions rather than commands (e.g., "Have you considered..." rather than "You must...").
  • Consider context. A hotfix PR has different standards to a feature PR — adjust expectations accordingly.

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.