agentleFS
intelintel/torch-xpu-ops/.claude/skills/xpu-ops-pr-creation/SKILL.md

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

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
  1. Very specific:

    Read .github/copilot-instructions.md for full repo context before starting.

    line 16
  2. Very specific:

    Read .claude/skills/fix-root-cause/SKILL.md for issue triaging before creating a PR.

    line 17
  3. Distinctive:

    If there is a CUDA kernel implementation, you have to refer to it first.

    line 22
  4. Distinctive:

    Before you make any changes, you need to understand the root cause, and answer yourself "why CUDA works but XPU failed".

    line 23
  5. Distinctive:

    After you make changes, you need to answer "If the implementation is different with the CUDA logic, is it reasonable?" If there is any …

    line 24
  6. Very specific:

    Every PR must include a pytest-compatible test under test/repro/ if it is newly introduced.

    line 40
  7. Distinctive:

    Use this exact template:

    line 56
  8. Distinctive:

    Before pushing, run pre-commit and/or lintrunner to catch style and lint issues:

    line 88
  9. Distinctive:

    If neither tool is configured in the repo, skip this step and note it in your summary.

    line 99

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Creation — torch-xpu-ops

  • Read .github/copilot-instructions.md for full repo context before starting.
  • Read .claude/skills/fix-root-cause/SKILL.md for 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 files

Branch 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 or class Test... classes
  • Runnable: pytest test/repro/test_<description>.py
  • Imports torch, targets xpu device (also cuda if 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:

  1. New reproducer added:
    Test: test/repro/test_<description>.py
  2. Existing test(s) cover it:
    Test: test/repro/test_foo.py, test/xpu/test_bar_xpu.py
  3. 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/, and test/ are consistent (if any were touched)
  • Test file added to test/repro/ or Test: none (reason) written
  • No unrelated files changed
  • Commit message is imperative, max 72 chars
  • Branch is agent/<slug>, not main
  • No direct push to main or upstream

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.