AgentSkillsCN

gh-pr-diff

获取 GitHub 拉取请求的统一差异。适用于用户想要查看代码变更、审阅差异,或了解 PR 中究竟发生了哪些变化时使用。

SKILL.md
--- frontmatter
name: gh-pr-diff
description: "Get the unified diff for a GitHub pull request. Use when the user wants to see code changes, review a diff, or understand what changed in a PR."
allowed-tools: Bash(python3 *)

gh-pr-diff

Retrieve the unified diff for a GitHub pull request, showing all code changes in standard diff format.

Command

bash
python3 .claude/skills/gh-pr-diff/scripts/get_diff.py --owner OWNER --repo REPO --pr-number PR_NUMBER

Arguments

ArgumentRequiredDescription
--ownerYesRepository owner (username or organization)
--repoYesRepository name
--pr-numberYesPull request number

Usage Examples

bash
# Get diff for PR #42 in octocat/hello-world
python3 .claude/skills/gh-pr-diff/scripts/get_diff.py --owner octocat --repo hello-world --pr-number 42

# Get diff for a PR in the current project
python3 .claude/skills/gh-pr-diff/scripts/get_diff.py --owner my-org --repo my-repo --pr-number 123