Cherry-picks a merged PR into a target branch and handles the process, including conflict resolution and verification.
Install
mkdir -p .claude/skills/cherry-pick && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9105" && unzip -o skill.zip -d .claude/skills/cherry-pick && rm skill.zipInstalls to .claude/skills/cherry-pick
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Cherry-pick a PR to a target version branchKey capabilities
- →Fetch PR metadata
- →Automate git branch creation
- →Cherry-pick specific commits
- →Resolve merge conflicts
- →Create backport pull requests
How it works
It sequences Git and GitHub CLI operations to manually replicate specific commits across different version branches.
Inputs & outputs
When to use cherry-pick
- →Backporting a hotfix to a maintenance branch
- →Syncing a specific feature across release versions
- →Resolving failed automated backport workflows
- →Creating a cherry-pick PR for a target version
About this skill
Cherry-pick the PR with the GitHub URL $0 to the $1 branch. This command is only run when automated cherry-picking failed, so expect merge conflicts.
Steps
-
Gather PR information using
gh pr view:- The base branch the PR was merged into (source branch)
- The merge commit SHA
- The PR branch name
- The PR title
- The PR description
- The PR labels
-
Prepare branches:
- Fetch latest commits for the source branch:
git fetch origin <source-branch> - Fetch latest commits for the target branch:
git fetch origin $1 - Create a new branch from the remote target branch using
--no-track:git checkout -b <branch-name> origin/$1 --no-track - Name the branch using the PR branch name with the target branch as suffix (e.g.,
fix/click-event-listener-$1)
- Fetch latest commits for the source branch:
-
Cherry-pick the merge commit:
- Run
git cherry-pick -m 1 <merge-commit-sha> - Resolve any merge conflicts. If needed, read the conflicting files from both the source and target branches to understand the differences.
- Run
-
Verify the changes:
- Run unit tests for the affected component package(s)
- If tests fail, investigate and fix the issue before proceeding
-
Commit the resolved cherry-pick:
- Stage only the files that were part of the original cherry-pick or that you had to fix after running tests (do not include untracked files)
- Complete the cherry-pick commit using the PR title as the commit message, appending "(CP: $1)" to the subject line
-
Push and create PR:
- Push the branch to origin
- Create a new PR targeting the $1 branch using
gh pr create - Start the description with "This PR cherry-picks changes from the original PR #<pr-number> to branch $1."
- Then add a separator (
---) surrounded by new lines - Then add the original PR description, wrapped in a Markdown blockquote (prefix each line with
>)
-
Update original PR:
- If the original PR has the label
need to pick manually $1, remove it - Add the label
cherry-picked-$1to the original PR - Ignore any errors if the labels do not exist
- If the original PR has the label
You can use the gh CLI tool for GitHub operations throughout these steps.
When not to use it
- →Standard feature development
- →Merging main branches
- →Creating documentation-only commits
Prerequisites
Limitations
- →Requires resolution of complex conflicts
- →Only for post-failure scenarios
- →Dependent on Git merge history
How it compares
It automates the specific backporting workflow of identifying and porting merge commits, including PR metadata replication.
Compared to similar skills
cherry-pick side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| cherry-pick (this skill) | 0 | 6mo | Review | Intermediate |
| github-workflow-automation | 11 | 2mo | Review | Advanced |
| testing-workflow | 16 | 9mo | Review | Intermediate |
| github-actions-templates | 7 | 3mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
testing-workflow
amo-tech-ai
Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.
github-actions-templates
wshobson
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
glab
NikiforovAll
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
create-pr
n8n-io
Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.
gh-fix-ci
openai
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.