Automated GitHub PR Code Review is a development Claude Skill built by Recce. Best for: Development teams use this to automate critical code reviews, catch security/performance issues before merge, and maintain consistent review standards across PRs..
Review pull requests for bugs, security, and performance issues, then post findings as GitHub comments and formal reviews.
Review a pull request for critical issues and post findings to GitHub.
/claude-code-review <PR number or URL>
digraph code_review {
rankdir=TB;
node [shape=box, style=filled, fillcolor=lightblue];
parse [label="1. PARSE INPUT\nExtract PR number\nfrom arg or URL", fillcolor="#e6f3ff"];
details [label="2. GET PR DETAILS\nBranch, draft status,\nchanged files", fillcolor="#e6f3ff"];
draft [label="Draft PR?", shape=diamond, fillcolor="#fff3e6"];
skip [label="Skip — inform user", fillcolor="#ffcccc"];
prior [label="3. CHECK PRIOR REVIEW\nFind existing claude[bot]\ncomment", fillcolor="#ccccff"];
checkout [label="4. CHECKOUT\nSwitch to PR branch\nfetch latest", fillcolor="#e6ffe6"];
diff [label="5. REVIEW DIFF\nRead changed files\nAnalyze diff vs base", fillcolor="#ccffcc"];
verify [label="6. VERIFY\nRun tests, lint,\ntype checks", fillcolor="#ccccff"];
write [label="7. WRITE REVIEW\nCritical issues only\nMarkdown format", fillcolor="#ffe6f3"];
post [label="8. POST COMMENT\nUpdate or create\nPR comment", fillcolor="#f3e6ff"];
approve [label="9. FORMAL REVIEW\nApprove or\nrequest changes", fillcolor=lightgreen];
parse -> details;
details -> draft;
draft -> skip [label="yes"];
draft -> prior [label="no"];
prior -> checkout;
checkout -> diff;
diff -> verify;
verify -> write;
write -> post;
post -> approve;
}
Extract the PR number from the argument. Accept:
123https://github.com/owner/repo/pull/123# Get owner/repo from current repo
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
PR_DATA=$(gh api repos/{owner}/{repo}/pulls/{pr_number})
HEAD_REF=$(echo "$PR_DATA" | jq -r '.head.ref')
IS_DRAFT=$(echo "$PR_DATA" | jq -r '.draft')
BASE_REF=$(echo "$PR_DATA" | jq -r '.base.ref')
If IS_DRAFT is true, inform the user and stop. Do not review draft PRs.
Look for an existing comment from claude[bot] on the PR:
MARKER="<!-- claude-code-review -->"
COMMENT_ID=$(gh api repos/{owner}/{repo}/issues/{pr_number}/comments \
--jq '[.[] | select(.user.login == "claude[bot]" and (.body // "" | contains("<!-- claude-code-review -->")))] | first | .id // empty')
Include <!-- claude-code-review --> as a hidden marker at the top of every review comment so the lookup targets only code review comments, not other bot comments.
If found, read the prior review to understand what was previously flagged. New commits may address those findings.
git fetch origin "$HEAD_REF"
git checkout "$HEAD_REF"
gh pr diff {pr_number}
Read all changed files in full context. Focus the review on:
| Category | What to look for | |----------|-----------------| | Bugs | Logic errors, off-by-one, null/undefined, race conditions | | Security | Injection, auth bypass, secrets in code, OWASP top 10 | | Performance | N+1 queries, missing indexes, unbounded loops, memory leaks | | Test gaps | Untested edge cases, missing error path tests | | Correctness | Does the code do what the PR description says? |
Do NOT flag:
Run the project's verification commands to surface issues that static reading might miss. This strengthens the review with concrete evidence.
Backend (Python):
make test # Unit tests
make flake8 # Lint
Frontend (TypeScript):
cd js && pnpm test # Unit tests
cd js && pnpm lint # Biome lint
cd js && pnpm type:check # TypeScript type checking
Run whichever commands are relevant to the files changed in the PR. Include any failures or warnings as findings in the review — these are concrete evidence of issues, not speculation.
If tests or lint fail, note the specific failures in the review findings. Do NOT attempt to fix them — just report them.
Format the review in Markdown. Write to a temp file to avoid shell escaping issues.
If this is an updated review (prior comment found):
## Updated ReviewStructure:
## Code Review — PR #{pr_number}
### Summary
One-line verdict: what this PR does and overall assessment.
### Findings
#### [Critical/Warning] Issue Title
**File:** `path/to/file.ts:42`
**Issue:** Description of the problem
**Suggestion:** How to fix it
(repeat for each finding)
### Verdict
- Approved or Issues Found with sign-off emoji
Use ### for each finding heading. Use Markdown section links for cross-references. Do not reference issues/PRs with bare #123 syntax in the review body (it creates unwanted GitHub links).
cat > /tmp/review_body.md << 'REVIEW_EOF'
<your review content here>
REVIEW_EOF
Update existing comment or create new one:
# If prior comment exists:
gh api repos/{owner}/{repo}/issues/comments/{comment_id} \
-X PATCH -f body=@/tmp/review_body.md
# If no prior comment:
gh pr comment {pr_number} --body-file /tmp/review_body.md
Submit formal GitHub review:
# No critical issues:
gh pr review {pr_number} --approve \
--body "Claude Code Review: No critical issues found."
# Critical issues found:
gh pr review {pr_number} --request-changes \
--body "Claude Code Review: Critical issues found. See review comment for details."
useActionState, useFormStatus, use(), <Activity>) as unknown or experimental if they are used consistently in the codebase./tmp/review_body.md and use --body-file or cat. Never inline long text in shell commands./plugin install automated-github-pr-code-review@DataRecceRequires Claude Code CLI.
Development teams use this to automate critical code reviews, catch security/performance issues before merge, and maintain consistent review standards across PRs.
No reviews yet. Be the first to review this skill.
Recce
@DataRecce