بنقرة واحدة
review-pr
// Review-only GitHub pull request analysis with the gh CLI. Use when asked to review a PR, provide structured feedback, or assess readiness to land. Do not merge, push, or make code changes you intend to keep.
// Review-only GitHub pull request analysis with the gh CLI. Use when asked to review a PR, provide structured feedback, or assess readiness to land. Do not merge, push, or make code changes you intend to keep.
Analyze code quality metrics for a Go package
Elite background evaluator agent combining 30-year Google/AWS test/devops expertise with 30-year Apple design mastery. Strictest production standards. Pixel-perfect design scrutiny. Spawned in a worktree for independent grading.
Merge a GitHub PR via squash after /prepare-pr. Use when asked to merge a ready PR. Do not push to main or modify code. Ensure the PR ends in MERGED state and clean up worktrees after success.
Prepare a GitHub PR for merge by rebasing onto main, fixing review findings, running gates, committing fixes, and pushing to the PR head branch. Use after /review-pr. Never merge or push to main.
| name | review-pr |
| description | Review-only GitHub pull request analysis with the gh CLI. Use when asked to review a PR, provide structured feedback, or assess readiness to land. Do not merge, push, or make code changes you intend to keep. |
Perform a thorough review-only PR assessment and return a structured recommendation on readiness for /prepare-pr.
main or origin/main, not during review, not ever.git push at all during review. Treat review as read only..local/review.md inside the worktree.Create a checklist of all review steps, print it, then continue and execute the commands.
Use an isolated worktree for all review work.
# Sanity: confirm you are in the repo
git rev-parse --show-toplevel
WORKTREE_DIR=".worktrees/pr-<PR>"
git fetch origin main
# Reuse existing worktree if it exists, otherwise create new
if [ -d "$WORKTREE_DIR" ]; then
cd "$WORKTREE_DIR"
git checkout temp/pr-<PR> 2>/dev/null || git checkout -b temp/pr-<PR>
git fetch origin main
git reset --hard origin/main
else
git worktree add "$WORKTREE_DIR" -b temp/pr-<PR> origin/main
cd "$WORKTREE_DIR"
fi
# Create local scratch space that persists across review to prepare to merge
mkdir -p .local
Run all commands inside the worktree directory.
Start on origin/main so you can check for existing implementations before looking at PR code.
gh pr view <PR> --json number,title,state,isDraft,author,baseRefName,headRefName,headRepository,url,body,labels,assignees,reviewRequests,files,additions,deletions --jq '{number,title,url,state,isDraft,author:.author.login,base:.baseRefName,head:.headRefName,headRepo:.headRepository.nameWithOwner,additions,deletions,files:.files|length,body}'
rg -n "<keyword_from_pr_title>" -S src || true
git log --oneline --all --grep="<keyword_from_pr_title>" | head -20
If it already exists, call it out as a BLOCKER or at least IMPORTANT.
Assign yourself so others know someone is reviewing.
gh_user=$(gh api user --jq .login)
gh pr edit <PR> --add-assignee "$gh_user"
Use the body from step 1. Summarize goal, scope, and missing context.
gh pr diff <PR>
If you need full code context locally:
git fetch origin pull/<PR>/head:pr-<PR>
git diff --stat origin/main..pr-<PR>
git diff origin/main..pr-<PR>
Be honest. Call out low value AI slop.
Review correctness, design, performance, and ergonomics.
Check auth, input validation, secrets, dependencies, tool safety, and privacy.
Identify what exists, what is missing, and what would be a minimal regression test.
Check if the PR touches code with related documentation.
Check if CHANGELOG.md exists and whether the PR warrants an entry.
Decide if /prepare-pr can fix issues or the contributor must update the PR.
Write the full structured review sections A through J to .local/review.md.
ls -la .local/review.md
wc -l .local/review.md
A) TL;DR recommendation
B) What changed
C) What is good
D) Security findings
E) Concerns or questions (actionable)
F) Tests
G) Docs status
H) Changelog
I) Follow ups (optional)
J) Suggested PR comment (optional)