Skip to content

commandGit and releases

Review PR

Reviews a pull request by number or link and returns a verdict with blocking issues, optional suggestions and what was checked.

npx workspacetemplates add review-pr --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/review-pr.md15 lines · 1.2 KBFile
---
description: Reviews a pull request by number or link and returns a verdict with blocking issues, optional suggestions and what was checked.
argument-hint: "[PR number or URL]"
---

Review the pull request: $ARGUMENTS (number or URL).

1. Fetch it with `gh pr view <pr> --json title,body,author,baseRefName,files,reviews,comments` and `gh pr diff <pr>`. If `gh` is unavailable, ask for the diff.
2. Read the description first and state in one sentence what the change should do. Check the diff does that and nothing else.
3. Read changed files in full where the diff lacks context. Check callers of changed functions with search.
4. Look for, in order: correctness bugs and unhandled edge cases; security (input handling, secrets, authorization); data loss or migration risk; missing or weak tests; performance traps such as queries in loops; unclear names; leftover debug code.
5. Check CI status with `gh pr checks <pr>`.
6. Write each comment as `path:line`, the problem, why it matters and a suggested fix. Mark it **Blocking** or **Optional**.

End with a verdict: approve, approve with optional comments, or request changes, plus a short list of what you did not check. Do not post anything; ask first whether to submit with `gh pr review`.

What it does

A useful review reads the whole change, checks it against the stated goal, and separates must-fix problems from taste. This command fetches the pull request, reads the description, diff and discussion, and writes comments with file and line references.

It ends with a clear verdict. Nothing is posted to the pull request unless you ask for it.

Example

you › /review-pr 482

agent › PR 482 "Add rate limiting to login": the goal matches the diff.
Blocking: auth/limiter.ts:41 counts attempts per IP only, so one shared office IP locks everyone out; key on IP plus username.
Optional: rename `lim` to `limiter`.
CI passing. Verdict: request changes. Not checked: Redis config in deploy files. Post this review?

Questions

Does it comment on GitHub by itself?
No. It writes the review in the terminal and asks before submitting anything with the gh tool.
What if the PR is huge?
It says so and suggests reviewing by area. It also lists which files it only skimmed, so you know where to look.
  • Branch Cleanup

    CommandGit and releases

    Free
  • Changelog Entry

    CommandGit and releases

    Free
  • Cherry Pick Fix

    CommandGit and releases

    Free
  • Commit Message

    CommandGit and releases

    Free