用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rome-os/rome-apps --skill get-pr-diff命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | get-pr-diff |
| description | Fetch GitHub pull request diffs with gh CLI, including large-PR fallback strategies. |
| tools | ["Bash"] |
Skill for fetching GitHub pull request diffs using the gh CLI. Supports normal and large PRs with automatic fallback strategies.
Given a repository (owner/repo) and PR number, use these commands to get the diff.
gh pr diff <PR_NUMBER> --repo <OWNER/REPO>
This returns the unified diff for the entire PR. It works for most PRs but will fail with HTTP 406 if the diff exceeds GitHub's 20,000 line limit.
If the full diff fails or the PR is known to be large, fetch the list of changed files with their individual patches:
gh api "repos/<OWNER/REPO>/pulls/<PR_NUMBER>/files" --paginate -q '.[] | "--- \(.filename) (\(.status), +\(.additions) -\(.deletions))\n\(.patch // "")"'
Note on pagination: GitHub returns at most 30 files per page. The --paginate flag handles this automatically, but for PRs with 300+ files, the response may be very large. In that case, consider reviewing only the most impactful files.
To fetch the patch for a single file:
gh api "repos/<OWNER/REPO>/pulls/<PR_NUMBER>/files" --paginate -q '.[] | select(.filename == "<FILE_PATH>") | .patch'
To see the full content of a file at the PR's head commit:
gh api "repos/<OWNER/REPO>/contents/<FILE_PATH>?ref=<BRANCH_OR_SHA>" -q '.content' | base64 -d
When dealing with a large PR (many files or a diff that exceeds GitHub's limit):
Start with the file list — use Strategy 2 without the patch to get an overview:
gh api "repos/<OWNER/REPO>/pulls/<PR_NUMBER>/files" --paginate -q '.[] | "\(.filename)\t\(.status)\t+\(.additions)\t-\(.deletions)"'
Prioritize files for review — focus on:
Fetch patches for priority files using Strategy 3
Use the local clone if available — for understanding broader context, the repository clone (if provided) lets you Read, Grep, and Glob files directly without API calls.
gh CLI is pre-authenticated. No token setup needed.gh api calls support --paginate for multi-page results.-q / --jq flag lets you filter JSON responses inline.gh pr diff.Use for creative/product/design work before implementation. Guides the guardian from rough idea to approved design spec.
Senior engineer code review workflow — whole-picture understanding, mandatory beyond-the-diff verification, architecture-level review (SSOT, Occam's razor), SOLID, security, performance, and code quality, with P0-P3 severity classification.
Use when the task is to summarize a pull request's reviews and discussion into a prioritized, triage-style report — an overview plus per-item fix-size (LOC bucket) and fix-value (trigger probability × impact). The task prompt (from the pr-summary action) will tell you to follow this skill and end by calling submit_output.