Skip to content

[Build] [Misc] Add create-pr skill for review-ready aiter PRs - #7207

Open
fsx950223 wants to merge 3 commits into
mainfrom
create-pr-skill
Open

fsx950223 wants to merge 3 commits into
mainfrom
create-pr-skill

Conversation

@fsx950223

Copy link
Copy Markdown
Contributor

Summary

Adds a create-pr Claude Code skill under .claude/skills/create-pr/. It guides an agent through opening or updating a ROCm/aiter PR that passes aiter-bot's PR Self-Review the first time. It ships with validate_pr_body.py, which runs the bot's own validator against a draft description before it is posted.

Motivation

aiter's PR rules are spread across three places, and agents writing PRs miss parts of them:

  • CONTRIBUTE.md → "Pull Requests": one backend per PR, component tags vs. hand-written type tags, readiness criteria.
  • .github/pull_request_template.md.
  • .github/scripts/pr_self_review.py (aiter-bot), with its five ### self-review headings, word-unit minimums, evidence/unverified-scope regexes, path-selected question, and current-head-SHA rule.

The existing repo skills cover reviewing PRs (review-pr) and validating them on a GPU (validate-kernel-pr); none covers writing one. In practice the bot's rules are discovered only after posting.

Changes

  • .claude/skills/create-pr/SKILL.md: the procedure.
    1. Scope check: one backend, hygiene, formatter versions.
    2. Title tags.
    3. Template sections, including performance-table honesty rules.
    4. The exact PR Self-Review rules, plus a table of the question select_question() picks for each kind of changed path.
    5. Local validation, then gh pr create/edit.
    6. Post-push upkeep: refresh the SHA, reply to Copilot, ask before adding ci:* labels.
  • .claude/skills/create-pr/validate_pr_body.py:
    • Loads .github/scripts/pr_self_review.py from origin/main (overridable with --ref), so it always applies the rules the bot currently runs, not a copy.
    • Calls validate_author_answers() and select_question().
    • Takes the head SHA and changed op_tests/ files from --pr N (via gh) or from the local HEAD / origin/main...HEAD.
    • Prints OK or the bot's issue list; the exit code is 0 or 1.
  • Not changed: no .github/ workflow, bot script, template or CONTRIBUTE.md edit. The skill only reads them.
  • Both files are force-added past .gitignore's .claude/ entry, the same way the existing .claude/skills/* are tracked.

Testing

  • Unit tests added or updated: not applicable; this is a developer tool with no runtime surface in aiter.
  • Performance benchmarks run: not applicable.
  • Tested on MI250X: not applicable, no GPU code.
  • Tested on MI300X: not applicable, no GPU code.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

The skill is documentation for agents. CONTRIBUTE.md remains the source of truth that it points to.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

The script uses only the standard library plus git and, for --pr, gh.

Breaking Changes

None.

PR Self-Review

Reviewed revision

013b45e

Behavior and intent

This adds a create-pr agent skill and a validate_pr_body.py checker; nothing in the aiter package, CI or the bot changes. Previously, PR authors and agents learned aiter-bot's self-review rules only after posting. #7197's first description failed 9 checks, and the rules were scattered across CONTRIBUTE.md, the template and pr_self_review.py. The skill puts those rules in one place, and the checker lets the bot's own rules run locally before a PR or edit is published.

Validation and unverified scope

Validator runs against the bot script on origin/main:

  • python .claude/skills/create-pr/validate_pr_body.py <body> --pr 7197 on [FlyDSL] pa_decode: peel the last KV tile so only it carries the V tail mask #7197's live description prints OK with exit 0. The question it selects matches the bot's own comment, and its word-unit counts match the bot's accepted answers.
  • On a copy with a wrong SHA and the validation section removed, it reports the same three issues the bot would (missing heading, SHA mismatch, empty answer) and exits 1.
  • Without --pr, it read this branch's head 013b45e433 and selected the generic question for .claude/ paths.
  • ruff check (ruff 0.16.0, as pinned in CI) and black --check passed.

Not covered or unverified:

  • The skill text has been followed end-to-end only for [FlyDSL] pa_decode: peel the last KV tile so only it carries the V tail mask #7197 and this PR, so other path categories (csrc/, configs, .github/) have not been tried in practice.
  • validate_pr_body.py imports the bot script dynamically, so a future change to the signature of validate_author_answers or select_question would break it. The traceback would point at the call site.

PR-specific question

The most important failure mode is the checker drifting from the real bot: it would print OK while the bot still reports "NOT READY".

The script avoids this by never copying rules. It git shows origin/main:.github/scripts/pr_self_review.py at run time and calls that module's own validate_author_answers() and select_question(). Thresholds, regexes and question selection are therefore always whatever the bot currently enforces.

Evidence: on #7197, the script's verdict and per-section unit counts (102/142/175/25) match the bot's "Author self-review accepted" comment for head 553002cfa0bf.

The remaining drift risk is an API change in those two functions. That fails loudly with an exception, not as a false OK.

Changed op tests

None. This PR changes no op_tests/ file; it only adds .claude/skills/create-pr/SKILL.md and validate_pr_body.py.

🤖 Generated with Claude Code

Adds .claude/skills/create-pr: a SKILL.md that turns CONTRIBUTE.md's
PR rules, .github/pull_request_template.md and aiter-bot's PR
Self-Review checks into one procedure, and validate_pr_body.py, which
runs the bot's own validate_author_answers() from origin/main against a
draft description before it is posted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: fsx950223 <[email protected]>
@fsx950223
fsx950223 requested review from a team and a balanced review from Copilot October 30, 2026 08:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7207 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@aiter-bot

aiter-bot commented Oct 30, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 682e2862ff3f · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What permissions and untrusted-input boundary does this CI change have, and can fork PR code or text reach a privileged execution path?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

…icates (#7208)

Adds a rocm-aiter marketplace (.claude-plugin/marketplace.json) with one
plugin, plugins/aiter, whose skills/ links to .claude/skills so each
skill keeps a single source. Removes flydsl-kernel-authoring and
flydsl-kernel-code-cleanup, which duplicate skills maintained in
ROCm/FlyDSL, and repoints the FlyDSL Copilot instructions to those.

Signed-off-by: fsx950223 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

plugins/aiter/skills links to .claude/skills. Black follows the symlink
and matches extend-exclude against the link's path, so the existing
/\.claude/ exclude did not cover it and 14 review-bot tooling files
failed the style check under plugins/aiter/skills/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: fsx950223 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 08:24
@github-actions github-actions Bot changed the title [Misc] Add create-pr skill for review-ready aiter PRs [Build] [Misc] Add create-pr skill for review-ready aiter PRs Nov 2, 2026
@github-actions github-actions Bot added the Build label Nov 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The workflow can validate against stale fork rules, invoke missing or incorrect checkout-local helpers, and mix stacked changes by hard-coding the PR base to main.

3 open issues

Review effort: Balanced

Comment on lines +100 to +101
python .claude/skills/create-pr/validate_pr_body.py body.md # head SHA = local HEAD
python .claude/skills/create-pr/validate_pr_body.py body.md --pr 1234 # head SHA + changed op_tests from GitHub

```bash
git push -u origin HEAD
gh pr create --repo ROCm/aiter --base main --title "<title>" --body-file body.md
ap.add_argument("--ref", default="origin/main", help="where to read the bot script")
args = ap.parse_args()

source = run("git", "show", f"{args.ref}:.github/scripts/pr_self_review.py")
@github-actions

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build stale The PR hasn't been updated in 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants