# Review Github PR

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

- Repository: https://github.com/NVIDIA/OpenShell (20903 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add NVIDIA/OpenShell --skill review-github-pr -g -a claude-code -y`
Codex: `npx skills add NVIDIA/OpenShell --skill review-github-pr -g -a codex -y`
Cursor: `npx skills add NVIDIA/OpenShell --skill review-github-pr -g -a cursor -y`
Gemini CLI: `npx skills add NVIDIA/OpenShell --skill review-github-pr -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:

```bash
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:

```bash
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:

```bash
gh api repos/OWNER/REPO/collaborators/AUTHOR/permission --jq .permission
```

The rest: https://github.com/NVIDIA/OpenShell/blob/HEAD/.agents/skills/review-github-pr/SKILL.md
