pr-review
Skill121 starsChanged 5 months agoApache-2.0View on GitHub
Review pull requests for XPU operator or backend code. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".
195 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- neomjs/neo-agent-skillstheir own version, first seen Nov 15, 2026
- asarelcastellanos/claude-workbenchtheir own version, first seen Nov 15, 2026
- ceilidhboy/skillstheir own version, first seen Nov 15, 2026
- NVIDIA/cclustertheir own version, first seen Nov 15, 2026
- jellydn/my-ai-toolstheir own version, first seen Nov 15, 2026
- richkuo/rk-skillstheir own version, first seen Nov 14, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
jtenniswoodSkillexpert-reset
Reimagine this repository from first principles using the current product and user experience as the target. Use when the user says "/expert-reset", asks how the project should be rebuilt if starting again, wants bold architecture or component-structure recommendations, or wants a research-only reset plan unconstrained by current implementation details.
Also in 3 projects that use this
jtenniswoodSkillupdates
Summarize user-facing project updates from the last 7 days, ordered by importance and written as one-sentence "Feature: description" entries. Use when the user says "/updates", asks what changed recently, or wants a concise list of recent features, device support, fixes that users will notice, or other product value.
Also in 3 projects that use this
openchamberSkillclack-cli-patterns
Use when creating or modifying OpenChamber CLI commands, prompts, terminal output, non-TTY behavior, `--quiet`, or `--json` behavior.
Also in 3 projects that use this
openchamberSkilldrag-to-reorder
Use when implementing or modifying OpenChamber sortable or drag-to-reorder behavior, especially `@dnd-kit`, touch/mobile interactions, variable-width items, or wrapping layouts.
Also in 3 projects that use this
- +6 more from openchamber
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- pytorch/pytorch★ 106k25% same
- pytorch/tutorials★ 9.4k26% same
- pytorch/executorch★ 5.2k34% same
- facebookincubator/velox★ 4.3k20% same
- harshitsinghbhandari/domain-expansion★ 225% same
Wrote their own version · 190
- Significant-Gravitas/AutoGPT★ 188ksame name
- rtk-ai/rtk★ 87ksame name
- saadeghi/daisyui★ 43ksame name
- rustfs/rustfs★ 36ksame name
- dotnet/maui★ 23ksame name
- NVIDIA/Megatron-LM★ 18ksame name
- MiniMax-AI/skills★ 14ksame name
- openchamber/openchamber★ 13ksame name
- btriapitsyn/openchamber★ 13ksame name
- LMCache/LMCache★ 12ksame name
180 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- asm-source-mappingSkill
- at-dispatch-v2Skill
- auto-labelSkill
- extract-asm-onednnSkill
- extract-asm-syclkernel-aotSkill
- extract-asm-syclkernel-jitSkill
- extract-asm-tritonSkill
- extract-xpu-kernel-asmSkill
- fix-implementSkill
- fix-reproduceSkill
- fix-root-causeSkill
- fix-verifySkill
- issue-handlerSkill
- issue-triageSkill
- label-issueSkill
- oob-perf-analysisSkill
- release-branchingSkill
- skill-writerSkill
- ut-checkSkill
- ut-issue-authoringSkill
- ut-refactor-reviewSkill
- xpu-alignmentSkill
- xpu-build-pytorchSkill
- xpu-ci-health-checkSkill
- xpu-ops-pr-creationSkill
- xpu-release-notesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 17 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 179 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
If the user invokes /pr-review with no arguments, do not perform a review.
- Very specific: line 41
Use gh CLI to fetch PR data:
- Distinctive: line 63
Use git commands to get branch changes:
- Distinctive: line 84
Use the current branch name in the review header instead of a PR number
- Distinctive: line 85
All other review criteria apply the same as PR reviews
- Very specific: line 89
When invoked via @copilot /pr-review or @claude /pr-review on a GitHub PR, detect this mode by the presence of <formatted_context>, …
- Distinctive: line 94
All comments and review comments (with file/line references)
- Very specific: line 97
Use git commands to get the diff and commit history.
- Very specific: line 114
Do NOT use gh CLI commands in this mode -- only git commands are available.
- Distinctive: line 115
All PR metadata, comments, and reviews are already in the prompt context.
- Distinctive: line 139
Before reviewing, build understanding of what the PR touches and why:
- Very specific: line 153
Use gh api or spawn a sub-agent to fetch the upstream file content.
- Very specific: line 159
If the diff adds or modifies any agent instruction files (SKILL.md, AGENTS.md, claude.md, copilot-instructions.md, or files under .claude/ …
- Distinctive: line 179
After drafting the review, spawn a sub-agent per reported issue (in parallel) to independently verify the claim by re-reading the relevant …
- Distinctive: line 183
Omit sections where you have no problems to report: Every sentence must identify a problem or request a change.
- Distinctive: line 225
When performing a detailed review, group findings by severity:
- Distinctive: line 249
If there are zero issues in a severity level, omit that section.
- Distinctive: line 259
Use these terms in all code, variable names, and function names:
- Distinctive: line 270
Use these only in comments to explain why a particular optimization choice was made (e.g., occupancy, register pressure, memory alignment).
- Distinctive: line 287
Test names and descriptions
- Distinctive: line 304
Edge case — API boundaries: When the underlying API (Level Zero, OpenCL, SYCL extensions) still uses old terms in function/enum names, it's …
- Distinctive: line 348
All of these are the same anti-pattern:
- Distinctive: line 382
When reviewing, consult these for context:
- Distinctive: line 389
If a calling workflow explicitly requires a skill marker, append this exact literal final line: Custom skills applied: pr-review.
“Common” is measured: kept by at least 6 in 10 of the 179 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
XPU PR Review Skill
Review torch-xpu-ops pull requests focusing on what CI cannot check: correctness against CPU/CUDA semantics, XPU-specific risks (synchronization, indexing, precision), test adequacy, and backward compatibility.
Detailed reference:
- torch-xpu-ops-review-notes.md
- review-checklist.md
- bc-guidelines.md
- pr-submission-guidelines.md — for PR authors (process & etiquette)
Usage Modes
No Argument
If the user invokes /pr-review with no arguments, do not perform a review. Instead, ask:
What would you like me to review?
- A PR number or URL (e.g.,
/pr-review 12345)- A local branch (e.g.,
/pr-review branch)
Local CLI Mode
The user provides a PR number or URL:
/pr-review 12345
/pr-review https://github.com/intel/torch-xpu-ops/pull/12345For a detailed review with line-by-line specific comments:
/pr-review 12345 detailedUse gh CLI to fetch PR data:
# Get PR details
gh pr view <PR_NUMBER> --json title,body,author,baseRefName,headRefName,files,additions,deletions,commits
# Get the diff
gh pr diff <PR_NUMBER>
# Get PR comments
gh pr view <PR_NUMBER> --json comments,reviewsLocal Branch Mode
Review changes in the current branch that are not in main:
/pr-review branch
/pr-review branch detailedUse git commands to get branch changes:
# Get current branch name
git branch --show-current
# Get list of changed files compared to main
git diff --name-only main...HEAD
# Get full diff compared to main
git diff main...HEAD
# Get commit log for the branch
git log main..HEAD --oneline
# Get diff stats (files changed, insertions, deletions)
git diff --stat main...HEADFor local branch reviews:
- The "Summary" should describe what the branch changes accomplish based on commit messages and diff
- Use the current branch name in the review header instead of a PR number
- All other review criteria apply the same as PR reviews
GitHub Actions Mode
When invoked via @copilot /pr-review or @claude /pr-review on a GitHub PR, detect this mode by the presence of <formatted_context>, <pr_or_issue_body>, and <comments> tags in the prompt.
The prompt already contains:
- PR metadata (title, author, branch names, additions/deletions, file count)
- PR body/description
- All comments and review comments (with file/line references)
- List of changed files with paths and change types
Use git commands to get the diff and commit history. The base branch name is in the
prompt context (look for PR Branch: <head> -> <base> or the baseBranch field).
# Get the full diff against the base branch
git diff origin/<baseBranch>...HEAD
# Get diff stats
git diff --stat origin/<baseBranch>...HEAD
# Get commit history for this PR
git log origin/<baseBranch>..HEAD --oneline
# If the base branch ref is not available, fetch it first
git fetch origin <baseBranch> --depth=1Do NOT use gh CLI commands in this mode -- only git commands are available.
All PR metadata, comments, and reviews are already in the prompt context;
only the diff and commit log need to be fetched via git.
Review Philosophy
- Only report problems — The review output must contain only issues, concerns, and actionable suggestions. Do NOT mention things that are done correctly, do NOT praise good decisions, do NOT explain why something is fine. If a section has no problems, omit it entirely. The reader's time is precious — every sentence must point to something that needs fixing or further discussion.
- Investigate, don't guess — When uncertain whether a checklist item applies, spawn a sub-agent to read the relevant code. A reviewer who guesses wrong provides negative value.
- Review the design, not just the implementation — A PR can have perfectly correct implementation of a bad design. Question side-channel communication, on/off private flags, and demand concrete interface documentation for new contracts between components.
- Focus on what CI cannot check — Don't comment on formatting, linting, type errors, or CI failures. Focus on design quality, interface correctness, thread safety, BC implications, test adequacy, and pattern adherence.
- Everything is a must-fix — There are no "nits." If it's worth mentioning, it's worth fixing. Every inconsistency degrades the codebase over time.
- Be specific and actionable — Reference file paths and line numbers. Name the function/class/file the author should use.
- Match the immediate context — Read how similar features are already implemented in the same file. Pattern mismatches within a file are always wrong.
- Assume competence — The author knows PyTorch; explain only non-obvious context.
- No repetition — Each observation appears in exactly one section of the review output.
- Verify CPU/CUDA parity from source — Do not infer behavior from memory. Inspect the actual upstream implementation from
pytorch/pytorch.
Using sub-agents
The review checklist is large. Spawn sub-agents to investigate whether checklist items apply: read surrounding code, check upstream PyTorch implementation for parity, or verify tests exist. Spawn them in parallel for independent areas.
Review Workflow
Step 1: Understand Context
Before reviewing, build understanding of what the PR touches and why:
- Identify the purpose of the change from title/description/issue
- Group changes by type (new code, tests, config, docs)
- Note the scope of changes (files affected, lines changed)
- Spawn sub-agents to read the unchanged code surrounding each significantly changed file to understand existing patterns and infrastructure
Step 2: Verify Upstream Semantics
For every changed kernel or operator file, fetch and read the corresponding upstream PyTorch implementation BEFORE evaluating correctness:
src/ATen/native/xpu/<Op>.cpp→ readaten/src/ATen/native/<Op>.cppsrc/ATen/native/xpu/sycl/<Op>Kernels.cpp→ readaten/src/ATen/native/cuda/<Op>.cu- Shared math utilities (e.g.,
MathExtensions.h) → readaten/src/ATen/native/Math.h
Use gh api or spawn a sub-agent to fetch the upstream file content. Do NOT proceed to the deep review until upstream code has been read. Quote or summarize relevant upstream patterns in your working notes before continuing.
Step 3: Deep Review
Go through every changed line in the diff and evaluate against the review checklist in review-checklist.md.
If the diff adds or modifies any agent instruction files (SKILL.md, AGENTS.md, claude.md, copilot-instructions.md, or files under .claude/ / .github/), load the skill-writer skill and evaluate those changes against its guidelines. Do NOT skip this — treat it as a blocking gate for those files.
Pay special attention to XPU-specific risks:
- Synchronization: hidden host sync, unnecessary synchronize, stream misuse
- Indexing: 32-bit vs 64-bit indexing, large tensor overflow risk
- Layout: contiguous vs non-contiguous, channels_last handling
- Precision: FP32 / BF16 / FP16 behavior, accumulation dtype, AMP impact
- Kernel efficiency: branch divergence, work-group choice, unnecessary copies
- Fallback/dispatch: wrong registration, silent fallback, inconsistent path coverage
Step 4: Check Backward Compatibility
Evaluate BC implications per bc-guidelines.md. For non-trivial BC questions, spawn a sub-agent to search for existing callers of the modified API.
Step 5: Formulate Review
Structure your review with actionable feedback organized by category. Every finding should be traceable to a specific line in the diff.
Step 6: Fact-Check
After drafting the review, spawn a sub-agent per reported issue (in parallel) to independently verify the claim by re-reading the relevant code. Drop invalid issues, reword uncertain ones with a note about confidence level.
Output Format
Omit sections where you have no problems to report. Every sentence must identify a problem or request a change.
VERDICT: <one sentence — the outcome and why>
## PR Review: #<number>
<!-- Or for local branch reviews: -->
## Branch Review: <branch-name> (vs main)
### Summary
What the PR does (1 sentence), then the overall verdict.
### Correctness
[Problems only — semantic parity, edge cases, behavioral issues]
### XPU-Specific Risks
[Problems only — synchronization, indexing, precision, kernel issues]
### Dispatch & Registration
[Problems only — yaml wiring, fallback, backend path]
### Testing
[Problems only — missing tests, wrong patterns, inadequate coverage]
### Backward Compatibility
[Problems only]
### Performance
[Problems only]
### Recommendation
**Approve** / **Request Changes** / **Needs Discussion**
Missing tests (new functionality without tests, bug fixes without regression tests) always means **Request Changes**.
[Brief justification — focus on what blocks approval. IMPORTANT: Do NOT use `#N` (e.g., #1, #2, #3) to reference findings — GitHub auto-links these to real issues/PRs. Instead use descriptive references like "the step numbering issue", "the stale path in auto-labeling", or inline the file path.]Specific Comments (Detailed Review Only)
Only include this section if the user requests a "detailed" or "in depth" review.
When performing a detailed review, group findings by severity:
- 🔴 Must Fix — Incorrect terminology, bugs, magic numbers in logic, correctness issues
- 🟡 Should Fix — Naming inconsistency, missing comments on non-obvious logic
- 🟢 Suggestion — Style nits, minor improvements
For each finding, quote the offending line and provide a concrete fix.
### 🔴 Must Fix (N issues)
**[Category] file.cpp:42** — <description>
<quoted code>
→ <suggested fix>
### 🟡 Should Fix (N issues)
...
### 🟢 Suggestions (N issues)
...
### ✅ What looks good
<briefly note well-written parts — good reviews are balanced>If there are zero issues in a severity level, omit that section. Always include the "What looks good" section in detailed reviews.
Intel GPU Terminology
Principle: For SYCL programming, always use SYCL programming model terms. Hardware architecture terms should only appear in comments explaining the motivation for a particular optimization.
This is a 🔴 Must Fix category.
SYCL Programming Model Terms
Use these terms in all code, variable names, and function names:
| ❌ Deprecated Term | ✅ Current Term | Notes |
| SIMD width / SIMD length / simd_width | subgroup size | SYCL/oneAPI standard term |
| SIMD lane | work-item (within subgroup) | Aligns with SYCL spec |
| SIMD-8 / SIMD-16 / SIMD-32 | subgroup size 8 / 16 / 32 | Use numeric subgroup size |
| thread block / threadblock | work-group | SYCL/oneAPI standard term |
Hardware Architecture Terms (comments/documentation only)
Use these only in comments to explain why a particular optimization choice was made (e.g., occupancy, register pressure, memory alignment). They must NOT appear in variable names, function names, or general code.
| ❌ Deprecated Term | ✅ Current Intel Term | Generic Term | Abbreviation |
| Execution Unit (EU) | Xe Vector Engine | Vector Engine | XVE |
| Systolic / "DPAS part of EU" | Xe Matrix eXtension | Matrix Engine | XMX |
| Subslice (SS) / Dual Subslice (DSS) | Xe-core | — | XC |
| HW thread | XVE thread | — | Each XVE thread executes a subgroup (subgroup size 16 or 32) |
| SIMD-16 / SIMD-32 (hardware context) | XVE thread width | — | The number of data elements processed per thread; maps to subgroup size |
| GRF file / GRF count | register file / register count | — | Use architecture-neutral where possible |
| SLM (ambiguous) | SLM (Shared Local Memory) | — | Spell out on first use |
Where to check:
- Variable names:
subslice_count→xc_countorxecore_count - Function names:
getSimdWidth()→getSubgroupSize() - Comments and docstrings
- Log/error messages
- Test names and descriptions
Examples
// 🔴 Bad
int num_subslices = device.get_info<ext::info::device::gpu_subslices_per_slice>();
int simd_len = 16;
// Each EU has 8 HW threads
// ✅ Good
int num_xecores = device.get_info<ext::info::device::gpu_subslices_per_slice>();
// Note: API name still uses "subslices" — wrap in a helper if possible
int subgroup_size = 16;
// Each XVE supports 8 concurrent threadsEdge case — API boundaries: When the underlying API (Level Zero, OpenCL, SYCL extensions) still uses old terms in function/enum names, it's acceptable to use them at the call site only. Wrap in a helper with modern naming, and add a comment:
// ✅ OK — API uses legacy name, but our abstraction uses modern term
// Level Zero API still exposes "subslice" in its info query
int xecore_count = zeDeviceGetSubsliceCount(device); // legacy API nameSubgroup Reduction Anti-Pattern
Principle: Never use sycl::shift_group_left combined with a reduction operation to perform subgroup reductions. Always use sycl::reduce_over_group instead.
This is a 🔴 Must Fix category.
Detection Criterion
Flag any code where sycl::shift_group_left is combined with a reduction combiner (any binary operation that accumulates values: add, min, max, mean, product, bitwise-or/and, etc.). The true signal is the shift + combine combination, not the loop itself — the loop may be at a different call site or abstracted behind a helper.
The Problem
sycl::shift_group_left produces excessive integer ALU instructions for index manipulation, which stalls the ALU-INT pipeline and degrades performance. The SYCL runtime's built-in reduce_over_group can use hardware-optimized reduction paths.
// 🔴 Bad — shift_group_left generates massive int-related instructions,
// causing ALU-INT pipe stall
for (int offset = 1; offset < sg_size; offset <<= 1) {
arg_t other = sycl::shift_group_left(sg, value[i], offset);
value[i] = combine(value[i], other); // combine = any reduction op
}The Fix
Replace with sycl::reduce_over_group using the appropriate SYCL binary operation:
// ✅ Good — uses hardware-optimized reduction
value[i] = sycl::reduce_over_group(sg, value[i], sycl::plus<arg_t>()); // for sum/mean
value[i] = sycl::reduce_over_group(sg, value[i], sycl::minimum<arg_t>()); // for min
value[i] = sycl::reduce_over_group(sg, value[i], sycl::maximum<arg_t>()); // for maxVariants to Flag
All of these are the same anti-pattern:
// 🔴 Bad — inline loop (any direction)
for (int offset = 1; offset < sg_size; offset <<= 1) { ... shift_group_left ... }
for (int offset = (sg_size >> 1); offset > 0; offset >>= 1) { ... shift_group_left ... }
// 🔴 Bad — shift+combine split into a functor (loop lives elsewhere)
struct ShiftAndCombine {
arg_t operator()(sycl::sub_group sg, arg_t value, int offset) const {
arg_t other = sycl::shift_group_left(sg, value, offset);
return combine_(value, other);
}
BinaryOp combine_;
};
// 🔴 Bad — with vectorized inner loop
for (int offset = 1; offset < sg_size; offset <<= 1) {
for (int i = 0; i < out_vec_sz; ++i) {
arg_t other = sycl::shift_group_left(sg, value[i], offset);
value[i] = combine(value[i], other);
}
}Where to Check
src/ATen/native/xpu/sycl/— All SYCL kernel files- Any file using
sycl::shift_group_leftin combination with a reduction combiner - Reduction kernels, softmax, norm, and scan operations are common locations
- Functors or lambdas whose body contains shift+combine — trace callers for the loop
Files to Reference
When reviewing, consult these for context:
src/ATen/native/xpu/— XPU operator implementationssrc/ATen/native/xpu/sycl/— SYCL kernel implementationssrc/ATen/native/xpu/XPUFallback.template— Fallback logictest/xpu/— XPU-specific teststest/test_ops_xpu.py— OpInfo-based XPU operator tests
If a calling workflow explicitly requires a skill marker, append this exact literal final line: Custom skills applied: pr-review.
Otherwise, keep the reply in the requested review format and do not force an extra trailing sentence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

