xpu-ops-pr-creation
Skill121 starsChanged 5 months agoApache-2.0View on GitHub
How to create a pull request for the intel/torch-xpu-ops repository. Use when an agent has finished implementing a fix or feature and needs to prepare a branch and PR description that satisfies CI and review requirements.
- Commits and pushes
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
- pr-reviewSkill
- release-branchingSkill
- skill-writerSkill
- ut-checkSkill
- ut-issue-authoringSkill
- ut-refactor-reviewSkill
- xpu-alignmentSkill
- xpu-build-pytorchSkill
- xpu-ci-health-checkSkill
- xpu-release-notesSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Read .github/copilot-instructions.md for full repo context before starting.
- Very specific: line 17
Read .claude/skills/fix-root-cause/SKILL.md for issue triaging before creating a PR.
- Distinctive: line 22
If there is a CUDA kernel implementation, you have to refer to it first.
- Distinctive: line 23
Before you make any changes, you need to understand the root cause, and answer yourself "why CUDA works but XPU failed".
- Distinctive: line 24
After you make changes, you need to answer "If the implementation is different with the CUDA logic, is it reasonable?" If there is any …
- Very specific: line 40
Every PR must include a pytest-compatible test under test/repro/ if it is newly introduced.
- Distinctive: line 56
Use this exact template:
- Distinctive: line 88
Before pushing, run pre-commit and/or lintrunner to catch style and lint issues:
- Distinctive: line 99
If neither tool is configured in the repo, skip this step and note it in your summary.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Creation — torch-xpu-ops
- Read
.github/copilot-instructions.mdfor full repo context before starting. - Read
.claude/skills/fix-root-cause/SKILL.mdfor issue triaging before creating a PR.
MANDATORY STEPS:
- You MUST read the issue body "Root Cause Analysis" and "Proposed Fix Strategy" BEFORE proposing any fix.
- If there is a CUDA kernel implementation, you have to refer to it first.
- Before you make any changes, you need to understand the root cause, and answer yourself "why CUDA works but XPU failed". If there is any misalignment, you need to write in the PR body description.
- After you make changes, you need to answer "If the implementation is different with the CUDA logic, is it reasonable?" If there is any misalignment, you need to write in the PR body description.
Step 1: Verify your branch
git status # confirm clean working tree
git log main..HEAD --oneline # confirm commits are on your branch, not main
git diff main --stat # sanity-check the changed filesBranch must follow: agent/<slug> (lowercase, hyphens, max 50 chars).
Step 2: Write a reproducer test (mandatory)
Every PR must include a pytest-compatible test under test/repro/ if it is newly introduced. If the test is in PyTorch or torch-xpu-ops tests, you should explicitly write the run command in the PR body (see Step 3).:
Note: For now, if the test is in PyTorch, explicitly point it out in PR message with bold font!
- File name:
test_<description>.py - Contains
def test_...()functions orclass Test...classes - Runnable:
pytest test/repro/test_<description>.py - Imports
torch, targetsxpudevice (alsocudaif relevant)
Exceptions (CI-only changes, docs, build fixes): no new test file required, but you must name existing tests that validate the change.
Step 3: Compose the PR body
Use this exact template:
Fixes <original_issue_link>
<description of what the PR does and why>
Test: <one of the three forms below>Three valid Test: forms:
- New reproducer added:
Test: test/repro/test_<description>.py - Existing test(s) cover it:
Test: test/repro/test_foo.py, test/xpu/test_bar_xpu.py - No test applicable:
Test: none (<reason>)
The Test: line is required in every PR body. CI reviewers look for it.
Step 4: Run linting checks
Before pushing, run pre-commit and/or lintrunner to catch style and lint issues:
# Option A — pre-commit (if configured)
pre-commit run --files $(git diff main --name-only)
# Option B — lintrunner (if configured)
lintrunner --take FLAKE8,MYPY,CLANGFORMAT -a $(git diff main --name-only)Fix any reported issues and amend your commit before proceeding. If neither tool is configured in the repo, skip this step and note it in your summary.
Step 5: Push your branch
git push origin agent/<slug>origin for this repo is intel/torch-xpu-ops. This is not a fork — push directly
to origin. Do not push to main.
Step 6: Open the PR (or hand off)
Agents do not auto-open PRs for this repo. Output your summary so a human can review and open the PR.
At the end of your response output EXACTLY this block:
### Agent Summary
- **What I found:** <one sentence>
- **What I changed:** <bullet list of files>
- **Test file:** test/repro/<filename>.py | none (<reason>)
- **Branch:** agent/<slug>
- **PR body draft:**
<title>
<description paragraph>
Test: <test line>
- **Open questions / risks:** <concerns or "None">Critical: The **Branch:** line must contain the exact branch name. It is machine-parsed.
Checklist before handing off
- pre-commit / lintrunner passed (or not configured — noted in summary)
src/, andtest/are consistent (if any were touched)- Test file added to
test/repro/orTest: none (reason)written - No unrelated files changed
- Commit message is imperative, max 72 chars
- Branch is
agent/<slug>, notmain - No direct push to
mainorupstream
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.

