pr-review
Review PyTorch pull requests for code quality, test coverage, security, and backward compatibility. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".
Security Assessment
About pr-review
PyTorch PR Review is a focused code-review skill for PyTorch pull requests that concentrates on what continuous integration cannot check: code quality, test-coverage adequacy, security vulnerabilities, backward compatibility, interface design, and thread safety. It deliberately avoids commenting on formatting, linting, type errors, or CI failures, on the premise that a single line can be load-bearing, so every changed line is treated as potentially consequential.
It supports several invocation modes. With no argument it does not review anything and instead asks whether to review a PR number or URL or a local branch. In local CLI mode it uses the gh CLI to fetch PR details, the diff, and existing comments for a given PR number or URL, with an optional detailed mode for line-by-line comments. In local branch mode it compares the current branch against main using git diff, git log, and diff stats. In GitHub Actions mode, detected by the presence of formatted_context and related tags in the prompt, it relies only on git commands for the diff and commit log because gh is unavailable, and reads PR metadata and comments already injected into the prompt.
The review philosophy is strict: report only problems and omit any praise or affirmative commentary, investigate rather than guess, review the design and not just the implementation, treat every mentioned issue as a must-fix with no nits, and keep each observation in exactly one section. Because the checklist is large, the workflow spawns sub-agents, typically 3 to 8 for a medium PR, to read surrounding code, check backward-compatibility implications, and independently fact-check each drafted issue as valid, invalid, or needing rewording before it appears in the output. The output is structured into sections such as Code Quality, Infrastructure, Testing, API Design, Security, and Thread Safety, with empty sections omitted and a one-sentence summary of what the PR does.
FAQ
What does the review focus on?
What CI cannot check, including design quality, test adequacy, backward compatibility, security, interface correctness, and thread safety, while ignoring formatting, linting, and type errors.
What are the invocation modes?
A PR number or URL via the gh CLI, a local branch compared against main via git, and a GitHub Actions mode that uses only git commands with metadata injected into the prompt.
What happens if it is invoked with no argument?
It does not perform a review and instead asks whether you want to review a PR number or URL or a local branch.
Does it point out things that are done well?
No, the output contains only problems and actionable suggestions, with no praise or affirmative commentary, and sections with no issues are omitted.
How does it use sub-agents?
It spawns sub-agents, typically 3 to 8 for a medium PR, to investigate surrounding code and to independently fact-check each drafted issue as valid, invalid, or needing rewording.
Install pr-review
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
pytorch/pytorch