Modelopt Release Cherry Pick
Audit merged bug-fix PRs and release NVBugs for missing cherry-pick labels, then cherry-pick labeled PRs into a release branch and open a PR. Use when asked to "cherry-pick PRs for release/X.Y.Z", "pick PRs to release branch", "verify cherry-pick labels", or "cherry-pick labeled PRs".
mkdir -p ~/.claude/skills/modelopt-release-cherry-pick && curl -fsSL 'https://raw.githubusercontent.com/NVIDIA/Model-Optimizer/main/skills/modelopt-release-cherry-pick/SKILL.md' -o ~/.claude/skills/modelopt-release-cherry-pick/SKILL.md
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Modelopt Release Cherry Pick when an AI agent needs a reusable SKILL.md workflow for this job: Audit merged bug-fix PRs and release NVBugs for missing cherry-pick labels, then cherry-pick labeled PRs into a release branch and open a PR. Use when asked to "cherry-pick PRs for release/X.Y.Z", "pick PRs to release branch", "verify cherry-pick labels", or "cherry-pick labeled PRs".
When not to use it
Skip Modelopt Release Cherry Pick when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/modelopt-release-cherry-pick && curl -fsSL 'https://raw.githubusercontent.com/NVIDIA/Model-Optimizer/main/skills/modelopt-release-cherry-pick/SKILL.md' -o ~/.claude/skills/modelopt-release-cherry-pick/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/modelopt-release-cherry-pick/SKILL.md. For a shared project, commit the folder at .claude/skills/modelopt-release-cherry-pick/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Modelopt Release Cherry Pick skill for this task: Use Modelopt Release Cherry Pick when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
71/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 77/100
- Practical detail
- 68/100
- Source evidence
- 63/100
- Source signals
- 72/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# Cherry-pick PRs to a Release Branch
Cherry-pick all merged `main` PRs labeled `cherry-pick-<version>` (but not `cherry-pick-done`) into the corresponding `release/<version>` branch, one by one in merge order.
## Step 1 — Identify the target version
Ask the user for the release version (e.g. `0.44.0`) and target release candidate (e.g. `rc2`) if not already provided. Confirm whether this is the final RC.
Set `VERSION=<version>` for use in subsequent steps.
## Step 2 — Audit candidates for missing labels
Before fetching the labeled queue, audit for missing bug fixes:
- **Non-final RC:** audit release NVBugs and recent merged PRs. - **Final RC:** audit only fixes tied to NVBugs with the exact keyword `Committed_ModelOpt_<VERSION>` and QA-verification evidence for the fix. Verify that evidence in the NVBug or linked QA results before recommending **Needs label**; if missing or unclear, classify as **Unknown** and ask for confirmation. Skip the general recent-PR audit; do not introduce general bug-fix PRs or fixes tied only to NVBugs committed for another release.
### Audit release NVBugs
Use the NVBugs MCP to search for every NVBug whose **Keywords** field contains the exact keyword `Committed_ModelOpt_<VERSION>`. Follow pagination until no next token is returned.
Fetch each matching NVBug with its comments. Extract every Model-Optimizer PR link or unambiguous `PR #<NUM>` reference from the comments, not only the latest comment. Keep only PRs that are merged into `main`, lack `cherry-pick-<VERSION>`, and are not already included in the release branch. Verify each remaining PR is a bug fix. The NVBug keyword is evidence for review, not by itself proof that every linked PR should be picked.
### Audit recent merged PRs
For non-final RCs only: Audit PRs merged into `main` since the latest release candidate. Exclude PRs that already have `cherry-pick-<VERSION>` and changes already present on the release branch:
```bash git fetch origin main "release/$VERSION" --tags RC_TAG=$(git tag --merged "origin/release/$VERSION" \ --list "${VERSION}rc*" --sort=-version:refname | head -1) test -n "$RC_TAG" || { echo "No ${VERSION}rc* tag found on origin/release/$VERSION" >&2 exit 1 } SINCE=$(git for-each-ref --format='%(creatordate:iso-strict)' \ "refs/tags/$RC_TAG")
PATCH_STATUS=$(git cherry "origin/release/$VERSION" origin/main)
SEARCH_RESULTS=$( gh search prs \ --repo NVIDIA/Model-Optimizer \ --merged \ --base main \ --merged-at ">=$SINCE" \ --limit 1000 \ --json number,title,author,labels,url \ -- "-label:cherry-pick-$VERSION" )
if test "$(jq 'length' <<<"$SEARCH_RESULTS")" -ge 1000; then echo "Recent-PR audit reached the 1,000-result limit" >&2 exit 1 fi
jq -r '.[].number' <<<"$SEARCH_RESULTS" \ | while read -r pr; do sha=$(gh pr view "$pr" --repo NVIDIA/Model-Optimizer \ --json mergeCommit --jq '.mergeCommit.oid') if grep -q "^+ $sha$" <<<"$PATCH_STATUS"; then gh pr view "$pr" --repo NVIDIA/Model-Optimizer \ --json number,title,author,labels,url fi done ```
A release is not normally expected to reach the 1,000-PR limit.
Review each PR's title, body, labels, changed files, and linked issue context. Classify it as:
- **Yes** — repairs incorrect behavior, a regression, crash, compatibility problem, or documentation defect relevant to the release. - **No** — feature, refactor, cleanup, dependency refresh, or other change not needed to correct the release. - **Unclear** — insufficient evidence or meaningful backport risk; ask the user.
Deduplicate PRs found through both audits.
### Report and label
Present the complete audit before changing GitHub labels:
| PR | Title | Author | NVBug(s) | Bug fix? | `cherry-pick-<VERSION>` present? | Recommendation | |---|---|---|---|---|---|---|
Use these recommendation values and sort the table in this order:
1. **Needs label** — confirmed release-relevant bug fix. 2. **Unknown** — requires user judgment. 3. **No action needed** — not a release-relevant bug fix.
Use `—` when no NVBug is known. Also list NVBugs with no linked PR. Ask the user to confirm which recommended PRs should receive the missing label. After confirmation, apply it:
```bash for pr in <APPROVED_NUMBERS>; do gh pr edit "$pr" --repo NVIDIA/Model-Optimizer --add-label "cherry-pick-$VERSION" done ```
Do not label unmerged PRs, PRs not based on `main`, or candidates classified **Unclear** without explicit approval. Re-run the audit table after edits so it reflects the final label state.
## Step 3 — Fetch pending PRs
Use the GitHub search API to list PRs that have the cherry-pick label but not cherry-pick-done, sorted by merge date ascending:
```bash gh api "search/issues?q=repo:NVIDIA/Model-Optimizer+is:pr+is:merged+base:main+label:cherry-pick-<VERSION>+-label:cherry-pick-done&sort=updated&order=asc&per_page=50" \ --jq '.items[] | [.number, .title, .pull_request.merged_at] | @tsv' \ | sort -t$'\t' -k3 ```
Present the list to the user before proceeding.
## Step 4 — Set up the release branch
Check out `release/<VERSION>`, creating it from the remote if it doesn't exist locally:
```bash git fetch origin release/<VERSION> git checkout release/<VERSION> ```
## Step 5 — Get merge commit SHAs
All PRs are squash-merged, so each has a single-parent commit. Retrieve the SHA for each PR:
```bash gh pr view <NUM> --repo NVIDIA/Model-Optimizer --json mergeCommit --jq '.mergeCommit.oid' ```
## Step 6 — Cherry-pick in merge order
Cherry-pick each commit with `-s` (DCO sign-off). GPG signing is handled automatically by the repo's git config.
```bash git cherry-pick -s <SHA> ```
**On conflict:** Tell the user which PR caused the conflict and ask them to fix it, then continue:
```bash git cherry-pick --continue ```
## Step 7 — Create a PR to the release branch
Push the cherry-picks to a new branch and open a PR targeting `release/<VERSION>`. The PR title lists every cherry-picked PR number. The body uses `## Cherry-picked PRs` as the only heading with one `- #<NUM>` bullet per PR — no titles, no links, no extra text.
```bash git checkout -B cherry-picks/release-<VERSION> git push -u origin cherry-picks/release-<VERSION>
gh pr create \ --title "[Cherry-pick] PRs #<NUM1> #<NUM2> ..." \ --base release/<VERSION> \ --head cherry-picks/release-<VERSION> \ --body "$(cat <<'EOF' ## Cherry-picked PRs
- #<NUM1> - #<NUM2> ... EOF )" ```
## Step 8 — Apply cherry-pick-done label
Add the `cherry-pick-done` label to every PR that was successfully cherry-picked:
```bash for pr in <NUM1> <NUM2> ...; do gh pr edit $pr --repo NVIDIA/Model-Optimizer --add-label "cherry-pick-done" done ```
Intended uses
- Use Modelopt Release Cherry Pick when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.