PR review
Reviews a pull request against its ticket, verifies each finding in the code, and posts one labelled inline review.
Claude Code skill codemaman-pr-review, works with GitHub and Jira.
LGTM (after we check)
Install it
Copies the skill into ~/.claude/skills:
curl -fsSL https://toolsfortechies.dev/install.sh | bash -s -- codemaman-pr-reviewOr download the zip and unzip it into ~/.claude/skills. Restart Claude Code afterwards.
Try it
- Ask Claude
- “Review PR 482”
- Or run
/codemaman-pr-review 482
Before you start
- You'll need
- gh CLI signed in. Jira connector optional, for acceptance criteria.
- What it won't do without you
- Posts nothing until you approve the draft. Comments are labelled blocking, suggestion, question, nit or praise.
Read the SKILL.md
# PR Review
Produce a review a senior engineer would be glad to receive: accurate, prioritised, specific, and kind. Never post anything to GitHub without the user's explicit approval of the final draft.
## 1. Identify the PR
- Argument may be a PR number, URL, or empty. If empty, use `gh pr view --json number,url` for the current branch; if none exists, review the diff of the current branch against the default branch and say so.
- Collect context in parallel:
- `gh pr view <n> --json title,body,author,baseRefName,headRefName,labels,reviewDecision,isDraft,files,additions,deletions,commits`
- `gh pr diff <n>`
- `gh pr checks <n>` (CI status; note failing checks and open the logs with `gh run view <id> --log-failed` for any failure)
- Existing review threads: `gh api repos/{owner}/{repo}/pulls/<n>/comments` and `.../issues/<n>/comments` so you don't repeat points already raised.
- Find the Jira key (pattern like `ABC-123`) in the branch name, title or body. If a Jira/Atlassian tool is connected, fetch the ticket and read its description and acceptance criteria. If not, ask the user to paste them only if the intent of the PR is unclear.
- Very large PRs (>800 changed lines or >25 files): say so, review by area, and flag that the PR should probably be split.
## 2. Understand before judging
- Check out the PR in a worktree if you need to run it (`gh pr checkout <n>` or `git worktree add`). Do not disturb the user's working tree; never switch branches with uncommitted changes.
- For each changed file read the surrounding code, not just the diff hunk: callers, callees, types, tests, config. Use grep to find all usages of any changed public function, type, route, env var, DB column or event.
- State to yourself in one sentence what the PR is meant to do, then check the code actually does that and satisfies the ticket's acceptance criteria.
## 3. Review checklist (apply what is relevant)
- **Correctness**: logic errors, off-by-one, null/undefined, race conditions, async/await misuse, error handling that swallows failures, timezone/locale bugs, idempotency of retries.
- **Requirements**: every acceptance criterion covered? scope creep or unrelated changes?
- **Tests**: new behaviour tested including failure paths and edge cases; tests assert behaviour not implementation; no skipped/focused tests; flaky patterns (sleeps, real network, ordering). Run the relevant tests if feasible and report results.
- **Security**: input validation, authn/authz on every new endpoint, injection (SQL, shell, template, XSS), secrets or tokens in code/logs, unsafe deserialisation, CORS, dependency additions.
- **Data & migrations**: reversible, safe on large tables, locking, backfills, indexes, backwards compatibility during rolling deploy.
- **API & compatibility**: breaking changes to public interfaces, response shapes, feature flags, versioning.
- **Performance**: N+1 queries, unbounded loops/lists, missing pagination, unnecessary re-renders, large bundle imports, missing caching or cache invalidation.
- **Maintainability**: naming, duplication, dead code, overly clever code, missing docs for non-obvious decisions, consistency with repo conventions (check CLAUDE.md, CONTRIBUTING, lint config).
- **Frontend**: accessibility (labels, focus, keyboard, contrast), loading/empty/error states, responsive behaviour, i18n strings.
- **Ops**: logging/metrics for new failure modes, config/env documentation, rollback story.
## 4. Verify every finding
Before including a finding, confirm it by reading the code path or running something. Drop anything you can't substantiate, or label it clearly as a question. A wrong blocking comment costs more than a missed nit.
## 5. Classify
Prefix every comment with exactly one label:
- `blocking:` must change before merge (bug, security, data loss, broken requirement)
- `suggestion:` worthwhile improvement, author's call
- `question:` genuinely unclear, not a disguised request
- `nit:` trivial style; cap at ~5 and skip anything a linter enforces
- `praise:` call out good decisions; include at least one if deserved
Each comment: what is wrong, why it matters, and a concrete fix (use a GitHub ```suggestion block for small single-file fixes).
## 6. Present the draft to the user first
Show:
1. **Summary** (2-4 sentences: what the PR does, overall assessment)
2. **Verdict**: Approve / Approve with suggestions / Request changes / Comment only, with the reason
3. **Findings grouped by severity**, each with `path:line`
4. **What I did not check** (tests not run, areas skimmed, missing context)
Ask which comments to post and which verdict to use. The user may edit.
## 7. Post (only after approval)
Post as ONE review so the author gets one notification, with inline comments anchored to the head commit:
```
gh api repos/{owner}/{repo}/pulls/<n>/reviews --method POST --input review.json
```
where review.json has `commit_id` (head SHA), `event` (`APPROVE` | `REQUEST_CHANGES` | `COMMENT`), `body` (the summary), and `comments: [{path, line, side: "RIGHT", body}]`. For multi-line use `start_line`/`start_side`. If a line is not in the diff GitHub rejects it: move that point into the summary body instead. If the GitHub MCP/GitKraken `pull_request_create_review` tool is available it may be used instead. Never approve or request changes on the user's own PR; use COMMENT.
After posting, give the user the review URL and a one-line recap. If a Jira ticket exists, offer to add a comment there noting review status.
## Rules
- Don't push commits to someone else's PR branch.
- Be specific and respectful: critique the code, not the person; ask before assuming intent.
- Don't pad. Fewer, higher-confidence comments beat an exhaustive list.Open the raw file