scrub-issue

Fetch, reproduce, and minimize GitHub issue reproductions for PyTorch bug triage.

103k|29.1k|Updated Aug 13, 2016
One-click install
npx skills add https://github.com/pytorch/pytorch --skill scrub-issue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scrub-issue
Source: https://github.com/pytorch/pytorch/tree/main/.claude/skills/scrub-issue
Command: npx skills add https://github.com/pytorch/pytorch --skill scrub-issue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Triaging GitHub issues manually is slow and error-prone. This Skill automates fetching, verifying, and minimizing bug reproductions so maintainers can quickly determine whether an issue is actionable, still reproduces, or has already been fixed.

Core Features & Use Cases

  • Automated Issue Triage: Fetches issue bodies and comments, evaluates actionability, and applies appropriate labels (e.g., feature, tracker, needs reproduction, triaged).
  • Reproduction Verification: Runs the reported repro script with timeouts, captures exit codes and output, and distinguishes between same-error, fixed, and different-error outcomes.
  • Systematic Minimization: Reduces repro scripts to the smallest self-contained form using ordered reduction strategies (remove imports, shrink models, reduce tensor sizes, simplify backends).
  • Use Case: A PyTorch maintainer receives issue #12345 reporting a torch.compile crash. Use this Skill to fetch the issue, verify the crash still reproduces on the current PyTorch version, minimize the repro to under 20 lines, and post a concise summary comment on the issue.

Quick Start

Use the scrub-issue skill to fetch, verify, and minimize the reproduction for PyTorch issue 12345.

Frequently Asked Questions about scrub-issue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I minimize a PyTorch GitHub issue reproduction script?

Use the scrub-issue skill to fetch the issue, extract the repro, and apply ordered reduction strategies: remove unnecessary imports, shrink models, reduce tensor sizes, simplify backends, and remove control flow. The skill stops when the repro is under ~20 lines or two consecutive rounds fail to simplify further.

How to check if a PyTorch bug still reproduces on the current version?

Run the original repro script with a 120-second timeout and compare the exception class and distinctive error substring against the reported error. Exit codes above 128 indicate signal kills (e.g., segfault = 139). For non-deterministic bugs, run 3-5 times with PYTHONHASHSEED=0 and torch.manual_seed.

What labels should be applied during PyTorch issue triage?

Apply `feature` for feature requests, `better-engineering` for refactoring tasks, `tracker` for umbrella/meta issues, `needs reproduction` when repro code is missing, and `triaged` to update the last-modified timestamp. Use `gh issue edit --add-label` or `--remove-label` to manage labels.

How to bisect PyTorch versions to find when a bug was fixed?

Check for conda environments named `pytorch-<version>` (e.g., pytorch-2.6, pytorch-2.8) and binary-search across them. Run from /tmp with cleared PYTHONPATH using `conda run -n pytorch-<version> python /tmp/repro.py`. Test 2-3 evenly-spaced probe points in parallel each round.

Why does the skill require a security review before running repros?

Repro scripts from untrusted authors may contain network requests, file operations outside /tmp, shell execution, obfuscated code, or package installation. The skill checks for these patterns and verifies the author's collaborator status before executing any code.