PyTorch Pull Request Review
Reviews PyTorch pull requests for code quality, test coverage, security, and backward compatibility.
- Skill Road
- PyTorch Pull Request Review
Categories
PyTorch Pull Request Review is an official skill in the PyTorch repository. It supports a human or agent-assisted examination of pull request changes and focuses on questions that an ordinary CI pipeline cannot fully answer. According to the provider, those questions include code quality, adequate test coverage, security vulnerabilities, and backward compatibility. The skill is a review playbook for the PyTorch context, not a merge bot, not a replacement for maintainers, and not a guarantee that a reviewed patch is defect-free. Its recommendations must be checked against the actual diff, unchanged surrounding code, and the current project rules.
Usage and context
The skill can be used with a pull request number, a GitHub URL, or a local branch. With no argument, it should first ask what the user wants reviewed. In normal local mode, the prescribed GitHub tools are used to inspect metadata, changed files, commits, the diff, and existing comments. In branch mode, the comparison with main and the commit history provide the context. In an automated GitHub Action, pull request metadata, description, comments, reviews, and the changed-file list may already be included in the prompt; in that case the diff should be obtained through the supplied Git references rather than assuming another retrieval path is available.
Review focus
According to the provider, every changed line should be considered together with its surrounding code. The focus is not formatting, linting, or failures already covered by CI, but design quality, interfaces, thread safety, device behavior, PyTorch infrastructure, test patterns, and effects on existing users. One missing device guard, an incorrect dispatch integration, or a manual type check can have broad consequences. Relevant project files such as CONTRIBUTING.md, CLAUDE.md, internal testing helpers, OpInfo structures, operator declarations, and autograd rules should be read when needed, because PyTorch conventions cannot be inferred from a filename alone.
Consolidation and reporting
The workflow recommends building context first, then reviewing every diff line deeply, checking backward compatibility, and consolidating observations before drafting the report. Findings with the same root cause or the same fix should become one finding. The report should contain only problems, concerns, and actionable requests. Each finding needs a traceable file and line reference together with a concrete recommendation. The suggested categories distinguish security, thread safety, backward compatibility, API design, infrastructure, testing, performance, and code quality. Missing tests for new functionality mean Request Changes under the specified output format.
Security boundaries and responsibility
A review agent can send source code, comments, and context to the connected model provider. Local repository inspection therefore does not automatically mean that all data remains with the local user. Credentials, private diffs, and confidential comments must be handled under the organization’s policies. The skill does not make pull request changes and does not replace permission checks or maintainer accountability. Recommendations can become stale when PyTorch infrastructure or review rules change. PyTorch publishes its source under BSD-3-Clause. This entry was reviewed on September 9, 2026 against the official skill file and the official PyTorch documentation. GitHub stars are not stored because the Skill model has no github_stars field.
Installation instructions
What the PyTorch pull-request review skill is and why it matters
The skill named pr-review comes directly from the official PyTorch repository on GitHub, located at .claude/skills/pr-review/SKILL.md. It helps evaluate pull requests within the PyTorch project systematically, with an explicit focus on aspects that an automated continuous-integration pipeline cannot check: code quality, adequacy of test coverage, security vulnerabilities, and backward compatibility. A pull request, commonly abbreviated PR, is in everyday software development a proposal to merge changes from a development branch into a project's main branch, and having experienced colleagues review such proposals is a central part of professional software quality assurance. According to the skill's description, it activates whenever a user asks for a PR review, mentions a PR number or URL, or uses phrasing such as review this PR. What stands out about this skill in particular is its explicit review philosophy: it is meant to report only problems and never praise correctly implemented code, because, in the vendor's own words, the reader's time is precious and every sentence should point to something actionable. For a project the size of PyTorch, with thousands of contributions per year, a structured, consistent review aid like this is a significant lever for keeping quality uniform across all submissions.
Step 1: Prerequisites
For the skill to function you first need a working Git installation and, depending on the mode, the GitHub CLI, since in its local command-line mode the skill relies on the gh tool to fetch PR metadata, diffs, and comments. For reviewing a local branch without an existing PR, plain Git commands such as git diff and git log against the main branch are sufficient instead. According to the skill's description there is also a third operating mode for GitHub Actions, in which PR metadata is already injected into the prompt beforehand and only Git commands, not the gh CLI, may be used. In terms of substance, the skill assumes the user has access to the PyTorch repository and is familiar with its project conventions, since it explicitly points to project-specific files such as CLAUDE.md, CONTRIBUTING.md, or the operator declaration file native_functions.yaml, which it expects to be read for a well-founded assessment.
Step 2: Step-by-step setup
Usage begins with choosing the right mode: if the skill is invoked without an argument, it first asks specifically what should be reviewed rather than guessing blindly. The actual review then runs through a multi-stage process. In the first step, the skill builds an understanding of the context by deriving the purpose of the change from the title and description, deploying sub-agents in parallel to read the surrounding, unchanged code and understand existing patterns. According to the vendor, a medium-sized PR should typically spawn three to eight such sub-agents. In the second step, every changed line is evaluated against a detailed checklist maintained in a separate reference file. In the third step, the skill specifically evaluates backward compatibility and, for unclear cases, deploys further sub-agents that search for existing callers of the modified interface. In the fourth step, all findings are consolidated, meaning observations that share the same root cause or the same fix are merged into a single finding to avoid redundancy. In the fifth and final step, every surviving finding is independently fact-checked by its own sub-agent, which classifies it as valid, invalid, or needing rewording, before the final review document is produced.
Security and best practices
Because code reviews require access to source code that can itself be security-sensitive, the skill should only be used in environments where repository access is already properly authorized, for example within a GitHub Actions pipeline with appropriately scoped permissions or in a local development environment using a personal GitHub token. The skill itself also treats security as its own review category and, per its defined precedence, assigns it the very highest priority ahead of backward compatibility or API design whenever a single finding touches multiple categories at once. Also notable is the rule that missing tests for new functionality or for bug fixes must always, according to the skill, result in a Request Changes recommendation, which represents a deliberate quality gate against insufficiently validated changes. Anyone adapting the skill for their own projects should be aware of these strict, undiplomatic evaluation rules, since they are deliberately designed so that every sentence in the output points to a concrete problem rather than containing generic, well-meaning praise.
Practical example and limits
A practical example straight from the skill's own documentation illustrates the standard it sets: a missing device guard can, according to the vendor, cause silent data corruption in multi-GPU operation, a missing Composite dispatch key breaks every out-of-tree backend, and a manual dtype check used instead of TensorIterator can silently skip a necessary type promotion. Failure modes this deeply rooted in PyTorch's architecture show why the skill is designed to be project-specific rather than generically applicable to arbitrary software projects. That is also exactly where its limits lie: anyone transplanting it unchanged into a different project loses the connection to PyTorch-specific concepts such as dispatch keys, the OpInfo test framework, or backward formulas in derivatives.yaml, which is why the referenced files and evaluation criteria need to be adapted to the target project. For PyTorch itself, and for projects with a similarly complex, multi-layered system architecture, however, the skill offers a thoughtful blueprint for combining careful human-style review with AI-assisted consolidation and fact-checking.
- Provider
- PyTorch
- License
- BSD-3-Clause
- Last reviewed
- 09.09.2026
Repository and documentation
Categories
Compatible with
Related guides
Guides and background related to this entry.