agentleFS
pytorchpytorch/helion/.agents/skills/fix-pr/SKILL.md

fix-pr

Skill979 starsChanged 6 days agoBSD-3-ClauseView on GitHub

Address CI failures and unresolved review comments on a single Helion pull request that is not part of a stack you own — leaving the fixes uncommitted for its author. Auto-activate when the user mentions a URL like https://github.com/pytorch/helion/pull/<number>; for your own stack-pr stack, use fix-pr-stack instead.

  • Commits and pushes

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rebase, review-pr and 3 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.
  • raineSkill

    rebase

    Rebase the current branch with smart conflict resolution.

    Also in 3 projects that use this

  • DockerSkill

    review-pr

    Review one or more incoming Docker documentation pull requests as a maintainer. Independently validate technical claims, assess editorial fit and information architecture, choose a verdict, and draft exact inline or PR-wide feedback behind a confirmation gate. Use for requests such as "review PR 123", "is this PR correct?", "does this information belong here?", "validate this PR", or "help review backlog PRs". Do not use to maintain or fix a PR you own; use maintain-pr for that.

    Also in 4 projects that use this

  • SentrySkill

    deslop

    Strip AI-generated noise from the diff before pushing — extra comments a human wouldn't write, defensive try/catch in trusted code paths, casts to any, inline imports in Python, and other style inconsistencies with the surrounding file. Use this immediately before commit so the diff stays clean.

    Also in 3 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 4 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run git log -n1 to see the current commit.

    line 18
  2. Distinctive:

    Commit message stack-info line: look for a line of the form

    line 23
  3. Very specific:

    Use the URL on that line. Ignore the branch: value — do not run any checkout, branch, or switch commands.

    line 27
  4. Distinctive:

    Both present: if the user-provided URL and the stack-info URL disagree, abort with an error.

    line 28
  5. Very specific:

    Use gh to list the PR's check runs and pull failure logs:

    line 35
  6. Distinctive:

    Leave all fixes uncommitted and unstaged.

    line 66

“Common” is measured: kept by at least 6 in 10 of the 13 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.

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

Fix a Helion pull request

Goal: bring a PR green by fixing CI failures and addressing unresolved review comments. Leave the fixes uncommitted and unstaged — the user handles committing and updating the PR.

This skill fixes the single PR for the HEAD commit and is for pull requests you do not own, or one-off branches not managed with stack-pr. For a stack-pr stack of your own (even one commit), use the fix-pr-stack skill: it amends the fixes, resubmits and watches CI. If GitHub is unreachable from your session, step 0 of fix-pr-stack lists the fallback routes.

1. Identify the target PR

Run git log -n1 to see the current commit. The local commit must correspond to the PR being fixed.

Resolve the PR number using whichever sources are available:

  • User-provided URL (e.g. https://github.com/pytorch/helion/pull/1234): extract the PR number directly.
  • Commit message stack-info line: look for a line of the form
    stack-info: PR: https://github.com/pytorch/helion/pull/<number>, branch: ...
    Use the URL on that line. Ignore the branch: value — do not run any checkout, branch, or switch commands.
  • Both present: if the user-provided URL and the stack-info URL disagree, abort with an error.
  • Neither present: abort with an error explaining that the PR could not be identified.

Then fetch the PR metadata with gh pr view <number> --repo pytorch/helion --json title,body,.... Verify the PR title matches the local commit's subject line. If they differ, abort with an error — the local commit does not match the PR.

2. Fix CI failures

Use gh to list the PR's check runs and pull failure logs:

gh pr checks <number> --repo pytorch/helion
gh run view <run-id> --log-failed --repo pytorch/helion

For each failing check:

  • Infra failures (most commonly CUDA Compute Check, runner provisioning errors, transient network issues): do not attempt to fix. Note them and report at the end.
  • Real failures (lint, type-check, test failures, build errors): read the logs, locate the root cause, and fix it in the working tree. Re-run the relevant check locally when feasible (e.g. ./lint.sh, pytest <file>::<test>) to confirm the fix.

3. Address unresolved review comments

Fetch inline review threads with GraphQL — the REST endpoints don't report whether a thread is resolved:

gh api graphql -F n=<number> -f query='query($n:Int!){repository(owner:"pytorch",name:"helion"){pullRequest(number:$n){reviewThreads(first:100){nodes{isResolved isOutdated path comments(first:20){nodes{author{login} body diffHunk}}}}}}}'

Review summaries and the top-level conversation come from:

gh api repos/pytorch/helion/pulls/<number>/reviews
gh pr view <number> --repo pytorch/helion --comments

For each thread with isResolved: false, and each unaddressed review summary or top-level comment, apply the requested change in the working tree. If isOutdated is true, the code changed after the comment: find the spot via path + diffHunk and check whether it's already addressed. Skip comments that are non-actionable (praise, questions answered in thread) or that the author explicitly waved off.

4. Wrap up

  • Leave all fixes uncommitted and unstaged. Do not run git add, git commit, git push, or any rebase/checkout commands.
  • Report a short summary covering:
    • PR identified (number + title)
    • CI failures fixed (with file:line where useful)
    • Review comments addressed
    • Any infra failures skipped (so the user knows to retry them)
    • Anything that could not be fixed and why

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.