review-github-pr

작성자: nvidia

깃허브 풀 리퀘스트의 diff와 주요 설계 결정을 요약하여 검토합니다. 사용자가 PR을 검토하거나, 브랜치의 변경 사항을 이해하거나, 또는…

npx skills add https://github.com/nvidia/openshell --skill review-github-pr

Review GitHub Pull Request

Summarize a GitHub pull request diff, highlighting key design decisions and notable code snippets.

Prerequisites

  • The gh CLI must be authenticated (gh auth status)
  • You must be in a git repository with a GitHub remote

Step 1: Resolve the PR

The user will provide either a PR number (e.g., #123 or 123) or a branch name. Determine which input was given and resolve it to a PR.

If a PR number is provided

Strip any leading # and use the numeric ID directly. Proceed to Step 2.

If a branch name is provided

Look up the open PR whose head branch matches:

gh pr list --head "<branch>" --state open
  • If exactly one PR is found, extract its number and proceed to Step 2.
  • If multiple PRs are found, list them and ask the user which one to review.
  • If no PR is found, skip Step 2 (no PR description to fetch) and go directly to Step 3 using the local git diff fallback.

Step 2: Fetch PR Description

Retrieve the PR metadata:

gh pr view <number> --json title,body,state,headRefName,baseRefName,labels,author

Record the title, body, headRefName, and baseRefName for use in later steps.

Step 3: Generate the Diff

Primary: gh pr diff

Fetch the diff via the GitHub CLI:

gh pr diff <number>

If this succeeds, use this diff and proceed to Step 4.

Fallback: local git diff

If no PR exists (branch-only case) or the gh diff command fails, fall back to a local diff:

# Ensure both branches are available locally
git fetch origin <target-branch> <source-branch>

# Generate the diff
git diff origin/<target-branch>...origin/<source-branch>

If the user provided a branch name and no PR was found, diff against main:

git fetch origin main <branch>
git diff origin/main...origin/<branch>

Handling large diffs

If the diff output is very large (thousands of lines), use the Task tool to process it in chunks. Summarize each chunk independently, then merge the summaries. Do not skip or truncate parts of the diff — accuracy depends on reading all of it.

Step 4: Analyze and Summarize

Read through the full diff (and the PR description if available). Produce a summary with the following sections. Keep every section as concise as possible — brevity is a priority.

Summary format

## PR Review: <title>

**PR:** [#<number>](<url>)  <- only if a PR exists
**Author:** <author>
**Branch:** `<source>` -> `<target>`

### Overview
<1-3 sentences describing what this PR does and why>

### Key Design Decisions
- <decision 1 with file:line reference>
- <decision 2 with file:line reference>
- ...

### Notable Code
<short fenced code snippets that illustrate the most important changes -- max 3 snippets>

### Potential Concerns  <- omit if none
- **<concise user-visible behavior>** — Before this PR, <affected persona>
  experienced <previous behavior>. With this PR, <new concerning behavior>, so
  <user-visible impact>. Details: `<file>:<line>`.

Guidelines for the summary:

  • Overview: State what changed and why. Pull context from the PR description if available.
  • Key Design Decisions: Focus on why something was done a particular way, not what changed. Include file_path:line_number references. Examples: choice of algorithm, new abstraction introduced, API contract change, migration strategy.
  • Notable Code: Include only the most instructive or surprising snippets. Keep each snippet under 15 lines. Always include the file path above the code block.
  • Potential Concerns: Only include genuine risks that warrant a change or a deliberate accept/reject decision. Describe each concern in terms of observable behavior for the affected persona, such as a sandbox creator, sandbox user, operator, administrator, SDK consumer, or developer maintaining the system. Always compare the previous behavior with the new concerning behavior and state the resulting user-visible impact. Prefer the compact form: "Before this PR, <persona> experienced <old behavior>. With this PR, <new behavior>, so <impact>." Add only the minimum file and line references needed to substantiate the finding.
    • Use the PR base as the normal previous-behavior baseline. Review older history only when the change is fixing or extending an earlier feature and that history is necessary to explain the behavioral contract. In that case, describe the relevant transitions explicitly: "Before <commit>, ... After <commit>, ... With this PR, ...".
    • Translate internal failure modes and race conditions into what the affected person would observe. Internal implementation details belong in the trailing file and line references, not in place of the behavior description.
    • Do not assign P0/P1/P2 or similar priority labels. The behavioral comparison and impact should give maintainers enough context to accept or reject the suggested change.
    • Do not fabricate concerns or claim a behavioral regression without evidence for both the prior and proposed behavior.
  • Agent infrastructure: When the PR changes behavior, commands, or development workflows, use the sync-agent-infra maintenance map to check that related skills were updated. When it adds, removes, or renames skills or crates; changes workflow relationships or skill coverage; modifies issue or PR templates; or changes agent cross-references, apply the full consistency checklist. Report missing companion updates or drift under Potential Concerns.

Step 5: Output

Print the summary directly in the chat as formatted markdown.

If the user requests it, also save the summary to a file:

# Default path
reviews/<number>-review.md

# Or for branch-only reviews
reviews/<branch-name>-review.md

Useful Commands Reference

CommandDescription
gh pr list --head <branch>Find PR by head branch
gh pr diff <number>Get PR diff
gh pr view <number> --json ...Get full PR metadata
git diff origin/<target>...origin/<source>Local diff between branches

Example Usage

Review by PR number

User says: "Review PR #456"

  1. Fetch PR metadata for number 456
  2. Fetch diff via gh pr diff 456
  3. Produce summary

Review by branch name

User says: "Review branch feature/add-pagination"

  1. Look up PR with gh pr list --head "feature/add-pagination"
  2. If found, fetch PR metadata and diff
  3. If not found, diff against main locally
  4. Produce summary

nvidia의 다른 스킬

compileiq-debug
nvidia
무언가 잘못되었을 때 사용: Search()가 멈추거나, 모든 평가가 INVALID_SCORE를 반환하거나, 점수가 개선되지 않거나, 모든 설정이 동일한 숫자를 반환하거나, ptxas 오류 등이 발생할 때
create-github-pr
nvidia
gh CLI를 사용하여 GitHub 풀 리퀘스트를 생성합니다. 사용자가 새 PR을 만들거나, 코드 리뷰를 제출하거나, 풀 리퀘스트를 열고자 할 때 사용합니다. 트리거 키워드 -…
nemoclaw-maintainer-cross-issue-sweep
nvidia
다른 열린 이슈들을 스캔하여 주어진 PR이 함께 수정하거나 실수로 망가뜨릴 수 있는 이슈를 찾습니다. 인접 수정 기회와 모순 위험을 file:line…과 함께 출력합니다.
fhir-basics
nvidia
에이전트에게 FHIR R4 API의 작동 방식, 사용 가능한 리소스, 검색 매개변수를 사용한 쿼리 방법, 모든 응답 형식을 올바르게 파싱하는 방법을 가르칩니다…
compileiq-validate-result
nvidia
검색이 완료된 후, 속도 향상을 청구하거나 ACF를 발송하기 전에 사용합니다. dump_results CSV를 로드하고, 상위 K개 후보(단일 목표)를 추출합니다…
changelog-audit
nvidia
릴리스 전에 Warp CHANGELOG.md를 감사합니다: 누락된 항목 복구, 사용자 영향별 정렬, 항목 언어 다듬기, 줄 바꿈, (릴리스 브랜치 모드) 비교 업데이트…
maintain-dynamic-plugins
nvidia
NeMo Relay 동적 플러그인 로더, 매니페스트, Rust 네이티브 SDK, gRPC 워커 프로토콜, Python 워커 SDK, 문서, 테스트 및 릴리스 워크플로 커버리지를 유지 관리합니다.
dgx-diagnose
nvidia
일반적인 DGX Station GB300 문제 진단 — CUDA 충돌, 잘못된 GPU 타겟팅, vLLM/SGLang 컨테이너 버그, MIG 상태 문제, NVLink/Fabric Manager 오류,…