backport
Installation
SKILL.md
Backport Skill
Create a backport pull request that applies changes from a source (current branch, a PR, another branch, or specific commits) onto a target branch — interactively, from the local workspace. The target is typically a release branch (e.g. rel/0.32), but any existing branch is allowed except the source's own base branch (a backport onto the same base is a no-op).
Inputs to resolve
Before running any git commands, determine:
- Source — one of:
- Current branch (default if the user says "backport this" without specifying).
- PR number (e.g. "backport PR #1234").
- Branch name.
- Commit SHA(s) or range.
- Target branch — any existing branch on
origin. Typical case is a release branch (rel/*). If the user did not specify, list candidates withgit branch -r --list 'origin/rel/*'first; if none match or the user wants something else, fall back togit branch -rand ask. Refuse the source's own base branch (e.g. if the PR or current branch already targetsmain, refusemain; if it targetsrel/0.32, refuserel/0.32) — a backport onto the same base is a no-op. Verify the target exists onoriginbefore proceeding. - Squash — only if the user explicitly says "squash". Default: no squash.
If anything is ambiguous, ask once before touching the working tree.