GitHub

PR Review Assistant

Reviews a pull request diff for bugs, style issues, and potential improvements with inline suggestions.

SKILL.md

SKILL.md
---
description: Review a pull request and provide structured feedback
allowed-tools: Bash(gh pr diff *), Bash(gh pr view *), Bash(gh pr checks *)
---

# Pull Request Review

Review the specified pull request and provide structured, actionable feedback.

## Arguments

- `$ARGUMENTS` — the PR number or URL to review

## Steps

1. Run `gh pr view $ARGUMENTS --json title,body,baseRefName,headRefName,files` to get PR metadata.
2. Run `gh pr diff $ARGUMENTS` to retrieve the full diff.
3. Run `gh pr checks $ARGUMENTS` to see CI status.
4. Analyze the diff for:
   - **Bugs**: null pointer risks, off-by-one errors, race conditions, unhandled errors
   - **Security**: injection vulnerabilities, exposed secrets, insecure defaults
   - **Performance**: N+1 queries, unnecessary re-renders, missing indexes
   - **Style**: naming inconsistencies, dead code, missing types
   - **Testing**: untested edge cases, missing assertions

## Output format

```markdown
## PR Review: <title>

### Summary
<1-2 sentence summary of what this PR does>

### Critical Issues
- [ ] **file.ts:42** — <description of bug or security issue>

### Suggestions
- **file.ts:17** — Consider using `Map` instead of plain object for better key semantics
- **file.ts:85** — This function exceeds 60 lines; extract the validation logic

### Positive Notes
- Good test coverage for the auth flow
- Clean separation of concerns in the service layer

### Verdict
🟢 Approve / 🟡 Approve with suggestions / 🔴 Request changes
```

## Rules

- Be specific: always reference file names and line numbers.
- Distinguish blocking issues from nice-to-have suggestions.
- Acknowledge good patterns — reviews should not be purely negative.
- Do not suggest stylistic changes that contradict the project's existing conventions.

How It Works

This skill showcases argument handling with `$ARGUMENTS` to accept a PR number at invocation time. The allowed tools use glob patterns (`gh pr diff *`) so the agent can pass any PR identifier to the GitHub CLI commands.

The review structure is intentionally opinionated — it separates critical issues (blocking) from suggestions (non-blocking) and includes positive notes. This mirrors how experienced reviewers write feedback that is both thorough and constructive, making it more likely that PR authors will engage with the suggestions.

The verdict section with emoji indicators gives a quick at-a-glance signal. By providing this template, the skill ensures every review follows the same format, which is especially valuable on teams where review quality varies between developers.