Cherry-Pick Pull Requests
When To Use
Use this skill when you need to cherry-pick a merged PR onto a release branch and want the agent to handle the git and GitHub workflow while keeping conflict resolution and test decisions in the loop.
Workflow
Replace <SKILL_DIR> with the path to this skill directory.
- Run a dry-run first:
python3 <SKILL_DIR>/scripts/cherry_pick_pr.py pick \
--pr <number> \
--target-branch <release-X.Y> \
--dry-run
- Start the cherry-pick from a clean working tree:
python3 <SKILL_DIR>/scripts/cherry_pick_pr.py pick \
--pr <number> \
--target-branch <release-X.Y>
- If
pickexits with code3, inspect the conflicted files from the output, read the source diff withgh pr diff <number>, resolve the conflicts, stage the files withgit add, then continue:
python3 <SKILL_DIR>/scripts/cherry_pick_pr.py continue
- Run targeted validation after a clean cherry-pick:
python3 <SKILL_DIR>/scripts/cherry_pick_pr.py test
- Create the PR only after
testreports success:
python3 <SKILL_DIR>/scripts/cherry_pick_pr.py create-pr
- Abandon a failed or stale attempt with:
python3 <SKILL_DIR>/scripts/cherry_pick_pr.py abort
Notes
- The script refuses to start
pickfrom a dirty working tree. - The script refuses to start a new attempt while
.git/cherry-pick-pr.jsonexists. Runabortfirst. - The state file lives under
.git/intentionally so it stays untracked. continuerunsgit cherry-pick --continuenon-interactively.testrecordspassed,failed, orbuild_failedso the agent can tell the difference between test failures and target-branch compatibility issues.create-prreads.github/PULL_REQUEST_TEMPLATE.mdat runtime and fails if required anchors drift.create-prexpects the source PR to already carry akind/...label. If it does not, fix that first or update the source PR metadata before creating the cherry-pick PR.- Use
--chain <branch>...onpickwhen you want the resulting PR body to append a follow-up/cherrypick ...command for later serialized backports.