Skills

Review Github PR

Review a GitHub pull request by summarizing its diff and key design decisions.

Install

npx skills add NVIDIA/OpenShell --skill review-github-pr -g -a claude-code -y
Repository
NVIDIA/OpenShell20.9k
Category
Design
Updated
4d ago
License
Apache-2.0
Context cost
Mediumabout 2,030 tokens
Runs scripts
No, instructions only

What it does

Review a GitHub pull request by summarizing its diff and key design decisions. Use when the user wants to review a PR, understand changes in a branch, or get a code review summary. Trigger keywords - review PR, review pull request, summarize PR, summarize diff, code review, review branch, PR summary, diff summary.

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,closingIssuesReferences

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

Check Issue Acceptance

Inspect every closing issue reference (paginate as needed) and fetch its current repository and labels. Verify the PR author's permission in the target repository:

gh api repos/OWNER/REPO/collaborators/AUTHOR/permission --jq .permission
Read the whole SKILL.md on GitHub

More in Design