Skip to content
Development
Skill

/scrub-issue

Fetch, analyze, reproduce, and minimize GitHub issue reproductions. Use only when the user asks to check whether a GitHub issue reproduces, minimize a GitHub issue's repro, analyze a GitHub bug report, or scrub/triage a GitHub issue for reproducibility. Do not use for standalone

From plugin
pytorch
102k16 skills
Install
$ npx -y skills add pytorch/pytorch --skill scrub-issue --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/scrub-issue

Context preview

The summary Claude sees to decide when to auto-load this skill.

Fetch, analyze, reproduce, and minimize GitHub issue reproductions. Use only when the user asks to check whether a GitHub issue reproduces, minimize a GitHub issue's repro, analyze a GitHub bug report, or scrub/triage a GitHub issue for reproducibility. Do not use for standalone

SKILL.md

scrub-issue.SKILL.md
name: scrub-issue
disable-model-invocation: true
description: Fetch, analyze, reproduce, and minimize GitHub issue reproductions. Use only when the user asks to check whether a GitHub issue reproduces, minimize a GitHub issue's repro, analyze a GitHub bug report, or scrub/triage a GitHub issue for reproducibility. Do not use for standalone reproduction requests without a GitHub issue.

Minimize Issue Reproduction

Fetch a GitHub issue, evaluate whether it has a reasonable repro, check if it still reproduces, and systematically minimize the repro to the smallest possible self-contained script.

Tools

Assume the current environment is correct and run `python` directly. Only use `conda run -n <env>` for version bisection (step 5a) where you need to temporarily use a different environment. Use the Bash tool's `timeout` parameter to enforce timeouts when running repro scripts.

  • `gh issue view <NUMBER> --repo pytorch/pytorch` to fetch the issue body
  • `gh issue view --comments <NUMBER> --repo pytorch/pytorch` to fetch comments
  • `python <script>` to run repro scripts
  • `gh issue comment <NUMBER> --repo pytorch/pytorch --body <BODY>` to comment
  • `gh issue edit <NUMBER> --repo pytorch/pytorch --add-label <LABEL>` to add labels

Multiple `gh issue edit` flags can be combined in a single command (e.g. `--add-label "bug,help wanted" --add-assignee "@me"`). Prefer batching edits into one command to minimize API calls and reduce the chance of auto-subscribing to notifications.

Preserving notification subscription state

Modifying an issue (commenting, adding labels) auto-subscribes you to notifications. Use `tools/stale_issues.py` to save and restore subscription state:

1. **Before the first modification**, save the current state. This can be run in parallel with fetching the issue body/comments, but it must **complete** before any `gh issue edit`, `gh issue comment`, or `gh issue close` command is executed:

   python tools/stale_issues.py subscription save <NUMBER>

2. **After the last modification**, restore the saved state — **unless the issue was closed** (via `gh issue close`), in which case skip the restore so the user stays subscribed to follow any responses to the closure. The restore must be the very last GitHub API call — do not run it in the background or in parallel with any `gh issue edit` or `gh issue comment` commands:

   python tools/stale_issues.py subscription restore <NUMBER>

If either the save or restore command fails, warn the user and continue without the save/restore mechanism.

**Important**: Never run `gh issue edit`, `gh issue comment`, `gh issue close`, or subscription save/restore commands in the background. These must all run in the foreground so their completion can be verified before proceeding. If commenting or editing fails because the issue is locked, report this to the user and skip the modification.

Security review checklist

Before running any repro code, check for the following concerns:

  • Network requests to untrusted URLs (requests, urllib, curl, wget)
  • File operations outside `/tmp/`
  • Shell command execution (os.system, subprocess, eval, exec) — but

`subprocess` used to launch `torchrun` or `mp.spawn` for distributed repros is expected and not a concern

  • Downloading or loading external files (model weights, pickled objects, data

files) — especially `torch.load` on untrusted `.pt`/`.pth` files

  • Obfuscated code (base64-encoded strings, encoded bytes, unusual escapes)
  • Package installation (pip install, conda install)
  • Environment variable manipulation that could affect the host system — but

setting `MASTER_ADDR`, `MASTER_PORT`, `RANK`, `WORLD_SIZE`, `CUDA_VISIBLE_DEVICES`, or other standard PyTorch/CUDA env vars is expected and not a concern

If any of these are present, explain the concern to the user and ask whether to proceed, skip, or modify the repro to remove the risky parts. If the user chooses to skip, still refresh the `triaged` label timestamp (remove and re-add, or just add if not present) before reporting that the analysis is finished.

Even if the repro passes the checklist above, check whether the author of the repro code is a PyTorch collaborator by running `python tools/stale_issues.py collaborator-check <username>`. If the command exits with a non-zero status (user is not a collaborator), show the repro code to the user and ask them to verify it is safe to run before executing it.

Steps

1) Fetch the issue

Fetch the issue body and comments in parallel. Identify the reported repro script and error. If multiple repros are present, prefer the most recent one from the original poster. If a commenter has posted a strictly shorter and more self-contained repro that doesn't require additional context from the issue description, prefer that one. Note which repro you selected. If the repro code is only present in screenshots or images rather than copyable text, stop and report this to the user.

2) Check if the issue is actionable

Before investing effort in reproduction, check whether the issue is actionable. **Do not proceed to later steps** if any of the following apply:

  • **Already closed or resolved** in comments. Report to the user and stop.

Do not modify labels on closed issues.

  • **Duplicate** of another issue (linked or obviously the same bug)
  • **Not a bug report** (feature request, question, discussion, refactoring /

code cleanup task). If the issue is a feature request and doesn't already have the `feature` label, add it via `gh issue edit`. If the issue is a better-engineering / refactoring task and doesn't already have the `better-engineering` label, add it via `gh issue edit`. If the issue includes a repro script that demonstrates the current behavior, apply the security review checklist first, then run it to verify the behavior persists. If the repro needed to be modernized (e.g. updated imports for renamed AP

Read more
Ships withpytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Get the whole plugin

Other skills on pytorch.