AgentSkillsCN

review-pr

借助gh CLI对GitHub Pull Request进行仅限审核的分析。当您被邀请审阅PR、提供结构化的反馈,或评估PR的上线准备情况时,此方法将助您事半功倍。但请勿进行合并、推送,也不要在PR中直接修改代码。

SKILL.md
--- frontmatter
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.

Review PR

Overview

Perform a thorough review-only PR assessment and return a structured recommendation.

Inputs

  • Ask for PR number or URL.
  • If missing, always ask. Never auto-detect from conversation.

Safety

  • Never push to main or origin/main.
  • Do not run git push at all during review. Treat as read only.

Setup: Use a Worktree

sh
WORKTREE_DIR=".worktrees/pr-<PR>"
git fetch origin main
git worktree add "$WORKTREE_DIR" -b temp/pr-<PR> origin/main
cd "$WORKTREE_DIR"
mkdir -p .local

Steps

  1. Identify PR meta and context via gh pr view
  2. Check if the change already exists in main before looking at PR branch
  3. Claim the PR (assign yourself)
  4. Read the PR description carefully
  5. Read the diff thoroughly via gh pr diff <PR>
  6. Validate the change is needed and valuable
  7. Evaluate implementation quality
  8. Perform a security review
  9. Review tests and verification
  10. Check docs
  11. Check changelog
  12. Answer: can /preparepr fix issues or must contributor update?
  13. Save findings to .local/review.md

Output Sections (A-J)

  • A) TL;DR recommendation: READY | NEEDS WORK | NEEDS DISCUSSION | CLOSE
  • B) What changed
  • C) What is good
  • D) Security findings
  • E) Concerns (BLOCKER / IMPORTANT / NIT with file references)
  • F) Tests
  • G) Docs status
  • H) Changelog
  • I) Follow ups (optional)
  • J) Suggested PR comment (optional)

Guardrails

  • Worktree only. Do not delete the worktree after review.
  • Review only: do not merge, do not push.