Create a cherry-pick pull request entirely via the GitHub REST API — no local branch changes, no git checkout, no git pull, no temp clones.
Run install.sh from your project directory or anywhere to setup for user level or project level setup.
Given a PR number, this skill:
- Auto-detects the repository from the local git remote (
origin), parsing both HTTPS and SSH URL formats to extractowner/repo. If no git remote is found, it asks the user to provide the repository. - Disables the
ghpager (GH_PAGER=cat) so all commands run non-interactively — no need to pressqto dismiss output. - Fetches the PR's title, body, assignee(s), head branch name, base branch, and commit list
- Auto-detects direction based on the source PR's base branch:
- If base is
master/main→ cherry-pick to the production branch - If base starts with
production/→ cherry-pick tomaster
- If base is
- For each commit, applies it to the target branch as a real 3-way merge via the GitHub Merge API — not a whole-file copy, so previously-diverged target content survives and genuine conflicts stop the run
- Creates a remote branch named
<original_branch>_cherry - Creates a new PR with:
- Base: target branch (production or master)
- Title:
🍒 <original_PR_title> - Body: Copied from the original PR
- Assignee: Same as the original PR
No local repository changes occur at any point. All orchestration lives in scripts/cherry_pick.py, run non-interactively — see Architecture.
Create production cherry pick for 1111
If the direction is master → production, the skill will ask which production branch to target:
Which production branch should I cherry-pick to? (e.g., 1.0)
Create production cherry pick for 1111 to 1.0
The skill normalizes the branch name:
1.0→production/1.0production/1.0→production/1.0(used as-is)
If the source PR's base branch is production/1.0, the skill automatically cherry-picks to master — no production branch prompt needed.
User: Create production cherry pick for 1111 to 1.0
Skill:
0. Detects repo from git remote → owner/repo
1. Fetches PR #1111 → baseRefName: "master" → target: production/1.0
2. Gets commit f58e68d... → modifies README.md
3. Gets production/1.0 HEAD → 856cff9... → tree: 3bf4d4c...
4. Creates new tree with blob c920af9... at the file path (via Git Data API)
5. Creates commit on top of 856cff9... (via Git Data API)
6. Creates remote branch production-update_cherry (via Git Data API)
7. Creates PR: 🍒 [CRASH]... → production/1.0, assigned to user
Result: New PR created at https://github.example.com/owner/repo/pull/XXXXX
- gh CLI installed and authenticated (
gh auth login) - Push access to the repository
- No clean working tree required — the skill never touches the local repo
- Git remote — the skill auto-detects
owner/repofromgit remote get-url origin. If no remote is found, it will ask the user to provide the repository.
SKILL.md only covers what the agent needs to decide (target branch, how to read a result) and how to invoke the script — matching Anthropic's Skill guidance of keeping SKILL.md itself short and pushing deterministic work into bundled scripts, whose code never enters the model's context, only their output does.
| File | Loaded when |
|---|---|
SKILL.md |
Every time the skill triggers |
scripts/cherry_pick.py |
Never read — only executed; its output is what enters context |
references/ALGORITHM.md |
Only if someone asks how the merge itself works |
It doesn't, anymore, in the ways that matter: each commit is applied as a real 3-way merge (GitHub Merge API, with the same conflict detection git cherry-pick has locally), not a whole-file blob copy. See references/ALGORITHM.md for the mechanics.
All gh commands run with GH_PAGER=cat (set in Step 0) so output is never piped through a pager like less. This ensures commands complete without requiring the user to press q.
This skill works with:
| Agent | How to Use |
|---|---|
| Claude (Claude Code) | Reference .claude/skills/remote-cherry-pick/SKILL.md and follow the steps |
| Codex (OpenAI) | Reference .claude/skills/remote-cherry-pick/SKILL.md and follow the steps |
| Cline SR | Say "Create production cherry pick for <PR_number>" — the skill auto-activates |
| GitHub Copilot | Reference .claude/skills/remote-cherry-pick/SKILL.md in your prompt |
Read .claude/skills/remote-cherry-pick/SKILL.md and execute the workflow for PR #<PR_number>
Follow the instructions in .claude/skills/remote-cherry-pick/SKILL.md to create a cherry-pick PR for PR #<PR_number>
| Scenario | Action |
|---|---|
| Branch already exists | Ask user to delete or rename |
| Target branch not found | Verify branch name via API |
| Not authenticated | Remind user to run gh auth login |
| No git remote detected | Ask user to provide owner/repo |
| API rate limited | Retry with backoff |
| File | Description |
|---|---|
SKILL.md |
Trigger conditions and how to run/read the script |
scripts/cherry_pick.py |
All API orchestration — the actual cherry-pick engine |
references/ALGORITHM.md |
How the merge-based cherry-pick works, endpoints, known limitations |
README.md |
This file |
| Feature | git cherry-pick |
remote-cherry-pick |
|---|---|---|
| Local branch changes | Yes (checkout, pull, cherry-pick) | No — fully remote |
| Temp clone | No | No |
| Conflict resolution | Yes (manual via git cherry-pick) |
Yes — real 3-way merge via GitHub's Merge API, genuine conflicts reported and left for manual resolution |
| GHES compatibility | Yes (uses local git) | Yes (uses Git Data API) |
| Direction detection | No (hardcoded to production) | Yes (auto-detect) |
| Production branch prompt | No (hardcoded) | Yes (asks user) |
| Repo auto-detection | No | Yes (from git remote) |
| Non-interactive output | No | Yes (GH_PAGER=cat) |
| Multi-commit support | Yes | Yes |
Recommendation: Use remote-cherry-pick for most scenarios. Use git cherry-pick when you need manual conflict resolution.