con un clic
process-cherry-picks
// Process cherry-picks from a release tracker issue. Trigger on "process cherry-picks", "cherry-picks", "update cherry picks".
// Process cherry-picks from a release tracker issue. Trigger on "process cherry-picks", "cherry-picks", "update cherry picks".
Draft a dev-discuss.pytorch.org forum post that calls for feature submissions for an upcoming PyTorch release, in the style of "Reminder — Calls for Features & Upcoming Branch Cut". Use when the user asks for a release announcement, feature-submission reminder, call-for-features post, or dev-discuss post for a release. Produces a Markdown draft that merges the official key-dates timeline with the AI-identified feature list, and asks owning teams to file "Release highlight for Proposed Feature" issues.
Produce a draft "Features" section for a PyTorch release blog post by comparing two release branches (e.g., release/2.11 vs release/2.12). Use when the user asks to generate a release blog, list new features for a release, compare release branches, or draft content for pytorch.org/blog. Organizes features similar to https://pytorch.org/blog/pytorch-2-11-release-blog/ with Highlights and per-component sections (Dynamo, Inductor, Distributed, Export, MPS, ROCm, XPU, CPU, etc.), each tagged with stability (Stable / Beta / Prototype / API-Unstable).
Generate PyTorch release notes for a functional area. Use when the user says "gen-release-notes", "release notes", or wants to write/complete release notes for a functional area like "aotdispatcher", "dynamo", "inductor", etc.
Distribute miscategorized PRs back to correct worksheets. Trigger on "categorize miscategorized", "distribute miscategorized", "process miscategorized".
| name | process-cherry-picks |
| description | Process cherry-picks from a release tracker issue. Trigger on "process cherry-picks", "cherry-picks", "update cherry picks". |
Parse a GitHub release tracker issue, handle reverts by removing entries from worksheets, and add new cherry-picks to cherrypicks.md.
/process-cherry-picks <version> <tracker-issue-url>
Both arguments are required. Do NOT guess the tracker issue URL — always require the user to provide it.
<version> and <tracker-issue-url> are provided. If either is missing, ask the user.175093 from https://github.com/pytorch/pytorch/issues/175093).gh issue view <number> --repo pytorch/pytorch --json title --jq '.title'
[v.<version>] Release Tracker or [v<version>] Release Tracker (e.g., [v.2.11.0] Release Tracker). If the version doesn't match, error out with a clear message: "Issue #NNNNN is for version X.Y.Z but you specified A.B.C".<version>/ directory exists.<version>/cherrypicks.md exists (the template should already be there with empty ## <category> headings).Fetch comments:
gh issue view <number> --repo pytorch/pytorch --comments
Parse each comment looking for the structured cherry-pick template:
Link to landed trunk PR (if applicable):
* <URL or NA>
Link to release branch PR:
* <URL>
Criteria Category:
* <category text>
Handle these variations:
* or -https://github.com/pytorch/pytorch/pull/NNNNN) or shorthand (#NNNNN)Skip non-structured comments — discussion, status messages like "Please monitor...", etc. A comment is structured if it contains both "Link to landed trunk PR" and "Link to release branch PR".
For each structured entry, extract:
trunk_prs: list of PR numbers (empty list if "NA")release_branch_prs: list of PR numberscriteria: the criteria category text (e.g., "Critical", "Reverted on trunk", "CI changes", "Release only changes", "Regression", "Docs")Do NOT rely on @<username> merged annotations in issue comments — these are unreliable and frequently missing for entries that were actually merged. Instead, check the actual merge state of each release branch PR via GraphQL:
gh api graphql -f query='
{
pr175108: repository(owner: "pytorch", name: "pytorch") {
pullRequest(number: 175108) { number merged }
}
pr175159: repository(owner: "pytorch", name: "pytorch") {
pullRequest(number: 175159) { number merged }
}
}'
Build the query with one alias per release branch PR (up to 100 per query, split if needed). A cherry-pick entry is merged if and only if merged: true on its release branch PR. If an entry has multiple release branch PRs, it is merged if at least one of them is merged.
Only process entries whose release branch PR is merged. Report skipped/unmerged entries so the user knows what was excluded and can follow up.
For each revert entry:
<version>/done/result_*.md and <version>/todo/result_*.md worksheets for each PR number (grep for #NNNNN).- ... ([#NNNNN](...)) line AND any indented continuation lines below it (for bc breaking entries with multi-line write-ups — keep removing lines until hitting another - entry, a ### heading, or a blank line followed by a non-indented line).### not user facing and already dropped.For each new (non-revert) merged cherry-pick:
Determine the PR number to categorize. Use the trunk PR if available (it has the original labels); fall back to the release branch PR if trunk is "NA".
Batch-fetch labels via GraphQL — same pattern as /categorize-miscategorized Step 4. Build a query with up to 100 aliases:
gh api graphql -f query='
{
pr175100: repository(owner: "pytorch", name: "pytorch") {
pullRequest(number: 175100) {
number
state
title
labels(first: 20) { nodes { name } }
}
}
}'
Classify area: follow the exact classification logic defined in .claude/skills/categorize-miscategorized/SKILL.md Step 5. Priority chain: release notes: labels (HIGH) → module: labels (MEDIUM) → title keywords (MEDIUM) → LOW if no match.
Classify category: follow the exact logic in .claude/skills/categorize-miscategorized/SKILL.md Step 6. Use topic: labels and title keywords to determine ## bc breaking, ## bug fixes, ## improvements, etc.
Format entries: follow the exact formatting standards defined in .claude/skills/gen-release-notes/SKILL.md under "Category guidelines" (Step 3b):
bc breaking, deprecation, new features: fetch the PR body and diff, write full detailed entries (summary, impact, workaround, before/after code examples for bc breaking; before/after code for deprecation; clean description for new features)..claude/skills/categorize-miscategorized/SKILL.md Step 7a.The cherrypicks.md format differs from the area worksheets — it uses ## <category> top-level headings with ### <Area> subheadings grouped by functional area. Area names use the "nice names" from merge.py module_name_mapping (e.g., "Inductor", "Distributed", "FX", "MPS"). See 2.10.0/cherrypicks.md for a populated example.
For each categorized entry:
<version>/cherrypicks.md.## <category> heading (e.g., ## bug fixes).### <Area> subheading under it (use the nice name from module_name_mapping).Entries that can't be confidently categorized (LOW confidence) go under ## Untopiced with a note explaining why.
The criteria text from the tracker issue provides hints but is NOT authoritative for categorization — always prefer PR labels. However, use these criteria-based defaults:
## not user facing unless PR labels/title indicate otherwise.## docs, but verify with labels.Tell the user:
## category / ### Area| File | Why |
|---|---|
.claude/skills/categorize-miscategorized/SKILL.md | Reuse: area classification (Step 5), category classification (Step 6), title cleanup (Step 7a) — follow the exact same logic |
.claude/skills/gen-release-notes/SKILL.md | Reuse: formatting standards ("Category guidelines" in Step 3b) — follow the exact same format |
merge.py lines 94-134 | module_name_mapping — maps short area names to nice display names for ### <Area> subheadings in cherrypicks.md |
<version>/cherrypicks.md | Output file — ## category + ### Area structure |
2.10.0/cherrypicks.md | Example of a populated cherrypicks.md to match format |