microsoft/cherry-pick-to-release
Cherry-pick a merged main-branch PR onto a MsQuic release branch (release/X.Y).
npx skills add https://github.com/microsoft/msquic --skill cherry-pick-to-release
You are helping a maintainer back-port a fix from main to one or more
MsQuic release branches (release/2.4, release/2.5, etc.).
This skill encodes the patterns the project uses.
The user asks to cherry-pick / back-port / "CP" a PR or commit from main
onto a release branch. Typical requests:
Before doing anything, make sure you know:
main (preferred) or a commit SHA on origin/main.release/2.4, release/2.5. If theuser is ambiguous (e.g. "to the release branches"), ask whether they want
one branch or both, and which.
without explicit permission. Stop and ask before any git push or gh pr create.
If anything is missing, ask before proceeding.
[CP] <Original PR title> (#<original_pr_number>)
Examples actually used on the release branches:
[CP] Fix underflow in ACK frame parsing #5942 (→ PR #5943 on 2.5, #5944 on 2.4)[CP] Fix SAL annotation placement on function templates (#5895)[CP] Free AES 256 GCM algorithm handle on cleanup (#5526)[CP] Fix double deref in connection pool error path (#5597)When the same fix targets multiple release branches, the title is identical
across PRs; only the target branch differs. After squash-merge, GitHub
appends the new PR number, producing commits like
[CP] Fix underflow in ACK frame parsing #5942 (#5943) on the release
branch — this is expected and required (it makes traceability trivial).
Do not invent new prefixes; stick to [CP] unless asked.
Use the exact body of the original PR, verbatim, including the
## Description, ## Testing, and ## Documentation sections as the
original author wrote them. Do not rewrite, summarize, or augment them
with cherry-pick commentary.
No additions or modification of the original description is acceptable.
Project convention (observed on most recent cherry-pick PRs):
<user>/cp_<short_description>_<target_version>_copilot
The <short_description> is a snake_case summary of the fix, mirroring
prior branches like cp_conn_pool_deref, cp_free_aes_256_gcm_handle,
underflow_fix_cp.
Use one branch per target release branch (do not try to land both
release branches from a single branch / PR).
original message preserved.
release branch build/pass tests (merge conflict resolutions and build fixes).
Keep these tightly scoped to enabling the cherry-pick; do not sneak in unrelated changes.
(cherry picked from commit X) trailers — the projectdoesn't use git cherry-pick -x; traceability comes from the PR title
containing the original PR number.
Follow these steps in order. Do not skip a phase.
origin/main: gh pr view <orig_pr> --repo microsoft/msquic --json mergeCommit,state,title,body,baseRefName
Verify state == MERGED and baseRefName == main. If not merged, stop and tell the user — never cherry-pick an unmerged change.
origin/main: git --no-pager log -1 --format="%H %s" <sha>
git --no-pager branch -r --contains <sha> | Select-String "origin/main"
Repeat for each target release branch.
git status). If not, stop and ask.git fetch origin --prune. git checkout -b <user>/cp_<short_desc>_2_5_copilot origin/release/2.5
git cherry-pick <commit_sha> (no -x).## Description so reviewers know what differs from main.Check whether the cherry-pick touches things that require regeneration. CI
will fail otherwise (check-clog.yml, check-dotnet.yml).
QuicTraceLogInfo, QuicTraceEvent,etc., or anything under src/manifest/):
./scripts/update-sidecar.ps1
Commit any changes under src/generated/ and src/manifest/clog.sidecar as part of the same commit (or amend).
src/inc/, especially msquic.h): ./scripts/generate-dotnet.ps1
Commit any changes under src/cs/.
If neither applies, skip this phase.
Build and run tests locally before pushing. This is **required for every
cherry-pick**, regardless of whether the git cherry-pick was clean or
required conflict resolution. Do not skip this phase.
./scripts/build.ps1 -Tls schannel # Windows
pwsh ./scripts/build.ps1 -Tls openssl # Linux
GoogleTest --Filter to keep the runtime short:
./scripts/test.ps1 -Tls schannel -Filter '<TestSuite>.<TestPattern>*'
At minimum, run:
TlsTest.* for src/platform/tls_*, ApiTest.* for src/inc/
surface changes, HandshakeTest.* for src/core/ handshake logic).
pass on main, stop and ask the user — do not push a broken
cherry-pick. Likely causes: missing prerequisite commits, API drift
between branches, or test infra changes that didn't get back-ported.
Capture the build and test outcome (pass/fail, number of tests run) to
mention briefly when you ask for permission to push.
Stop here and show a summary of the cherry-pick to the user:
original PR, target branch, branch name, PR title, build and test status.
Confirm with the user before pushing. Then:
git push -u origin <user>/cp_<short_desc>_2_5_copilot
gh pr create --repo microsoft/msquic `
--base release/2.5 `
--head <user>/cp_<short_desc>_2_5_copilot `
--draft `
--title "[CP] <Original title> (#<orig_pr>)" `
--body-file <path_to_body.md>
--base must be the release branch (release/2.4, release/2.5, …), not main.Companion PR for release/2.4: #5944).Before telling the user the cherry-pick is ready:
--base is the correct release/X.Y branch (never main).[CP] <orig title> (#<orig_pr>) (or an explicitly approved variant).<user>/cp_<short_desc>_<X_Y>_copilot.scripts/update-sidecar.ps1 was run and generated files committed.src/inc/ public headers were touched → scripts/generate-dotnet.ps1 was run and generated files committed.main yet.git cherry-pick -x — the project doesn't include(cherry picked from commit X) trailers in the final commit message.
see a related-but-distinct issue, open a separate cherry-pick.
[BACKPORT 2.5]) — stick to[CP] to stay consistent with the last ~2 years of cherry-pick PRs.
description. The body must contain the original PR's body verbatim without additions.
cherry-pick applied with no conflicts. Auto-merged hunks can still
produce subtly wrong code.
version bumps (Bump version to v2.5.X) are separate PRs done at
release time.
that; this skill just executes the cherry-pick cleanly.
processes handled outside this skill.
Take microsoft/cherry-pick-to-release from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.