Automated summary
Guides an agent through backporting a merged upstream GitHub pull request by cherry-picking its merge commit onto selected stable branches and opening backport PRs.
Strengths
- Verifies that the PR is merged into devel and retrieves the merge commit SHA with gh.
- Applies a backport policy based on the fix type and confirms target stable branches with the user.
- Stops on cherry-pick conflicts and asks for manual resolution instead of continuing.
- Pushes to the user’s fork and creates backport pull requests with gh.
Limitations
- Assumes gh is authenticated and the upstream/origin remotes are correctly configured.
- Relies on a repository-specific backport policy in context/contributing.md.
- Cherry-pick conflicts require manual intervention and halt the workflow.
Use when a fix already merged into devel must be replicated to one or more stable branches via a backport PR.
Do not use for an unmerged PR, for a security issue that must be reported privately, or in a repository without stable-branch and backport conventions.
Security analysis
CautionThe skill drives real git and gh operations (fetch, checkout, cherry-pick, push, pr create) against a repository, so it is not purely informational and warrants caution. However, it is defensively written: it aborts on conflicts instead of forcing through, explicitly forbids pushing to the upstream remote, requires user confirmation at key steps, and handles security issues by directing to a private email rather than GitHub. No exfiltration, obfuscated payloads, secret access, or destructive commands (rm -rf, reset --hard, force-push) are present.
- •Uses git and the GitHub CLI (gh) for branch creation, cherry-pick, and pushing branches to a remote repository
- •Runs `git pull --rebase <upstream> devel` when syncing devel, which rewrites local unpushed commits on the branch
- •Creates and pushes branches and opens pull requests on the user's fork — mutating remote state, though the skill explicitly warns against pushing to upstream and asks for confirmation
Examples
Backport PR #1234 from the upstream repository to the latest stable branch. Verify it merged into devel, create the backport branch, cherry-pick the merge commit, push to my fork, and open the PR.This is a critical bug fix in PR #5678 that merged into devel. Create backports to the latest and previous stable branches, and stop if any cherry-pick conflicts.Can you help me backport merged PR #9012? First check context/contributing.md for the backport policy and confirm which stable branches are appropriate.name: creating-backports description: Create backports of a GitHub pull request that has merged into the devel branch in the upstream repository user-invocable: true
Creating Backports
Backport creation workflow
Backporting Progress:
- [ ] Step 1: Verify the referenced pull request
- [ ] Step 2: Identify the git remote for the upstream repository
- [ ] Step 3: Determine the stable branches for the backport
- [ ] Step 4: Create the backport branches
- [ ] Step 5: Create pull requests
- [ ] Step 6: Summarize the work
Step 1: Verify the referenced pull request
Use gh pr view <number> to verify the PR is merged into devel and get the merge commit SHA:
gh pr view <number> --json mergeCommit -q .mergeCommit.oid
Abort if the PR is not merged or merged to wrong branch.
Step 2: Identify the git remote for the upstream repository
Identify the upstream remote (typically named upstream). If it doesn't exist, offer to create it.
Sync the local devel branch with the identified upstream remote:
git fetch <upstream_remote>git checkout develgit pull --rebase <upstream_remote> devel
Step 3: Determine the stable branches for the backport
Refer to the backport policy in context/contributing.md:
- Bug fixes: backported to latest stable only
- Critical bug fixes: backported to latest and previous stable
- Security issues: must be reported to security@ansible.com privately (not via GitHub)
Ask the user what type of fix this is and confirm the target branches before proceeding.
To identify available stable branches, run: git ls-remote --heads <upstream_remote> 'refs/heads/stable-*'
Step 4: Create the backport branches
Before creating backport branches, verify you're not on a branch you want to keep (the workflow will create and switch between multiple branches).
First, ensure stable branches are up to date:
- Run
git fetch <upstream_remote>to get latest stable branch refs
The backport process consists of these steps:
- Create a new branch for each stable branch:
git checkout -b backport/VERSION/PR_NUMBER <upstream_remote>/STABLE_BRANCHExample:git checkout -b backport/2.20/1234 upstream/stable-2.20(if upstream remote is namedupstream) - Cherry-pick the MERGE commit from the referenced pull request into each branch using the
-xoption. (The merge commit SHA was obtained in Step 1 withgh pr view) Example:git cherry-pick -x <merge_commit_sha>If merge conflicts are encountered:- Run
git cherry-pick --abortto abort the cherry-pick - Notify the user that manual conflict resolution is required for this stable branch
- Explain the user can either: a) Manually resolve conflicts (you can help guide them) b) Skip this stable branch backport
- Do NOT continue with remaining branches if conflicts occur - wait for user direction
- Run
- Before pushing, identify the user's fork remote:
- Typically named
origin - Verify with
git remote -vthat it points to the user's fork, not upstream - Confirm the remote name before pushing
- Typically named
- Push each backport branch to the user's fork remote (identified in step 3, typically
origin):git push <fork_remote> backport/VERSION/PR_NUMBERExample:git push origin backport/2.20/1234(if fork remote is namedorigin) Never push to the upstream remote - this would push directly to the upstream repository.
Step 5: Create pull requests
Confirm with the user that they would like to create a pull request for each backport branch.
Use gh pr create for each branch:
--base STABLE_BRANCH_NAME(the stable branch being backported to)--title "[STABLE_BRANCH_NAME] ORIGINAL_PR_TITLE"--body "Backport of PR #XXXX\n\n(cherry picked from commit COMMIT_HASH)"
Example: gh pr create --base stable-2.20 --title "[stable-2.20] Fix bug in module" --body "Backport of PR #1234\n\n(cherry picked from commit abc123)"
Step 6: Summarize the work
Give the user a summary of the backports that were created. The summary must provide a list of the URL links to all pull requests that were created.
Error Recovery
If errors occur during the backport process:
- Cherry-pick conflicts: List which branches succeeded and which failed due to conflicts
- PR creation failures: Clean up any orphaned branches that weren't converted to PRs
- Partial success: Summarize what succeeded and offer to retry failed branches individually
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/creating-backports-mte1lfmw/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/creating-backports-mte1lfmw' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/creating-backports-mte1lfmw/download' --output '.skill-downloads/creating-backports-mte1lfmw/SKILL.md.part' && mv '.skill-downloads/creating-backports-mte1lfmw/SKILL.md.part' '.skill-downloads/creating-backports-mte1lfmw/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/creating-backports-mte1lfmw/SKILL.md' && test -s '.skill-downloads/creating-backports-mte1lfmw/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/creating-backports' && cp -R '.skill-downloads/creating-backports-mte1lfmw' '.claude/skills/creating-backports'Codex
test -f '.skill-downloads/creating-backports-mte1lfmw/SKILL.md' && test -s '.skill-downloads/creating-backports-mte1lfmw/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/creating-backports' && cp -R '.skill-downloads/creating-backports-mte1lfmw' '.agents/skills/creating-backports'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/creating-backports-mte1lfmw'openskills read 'creating-backports-mte1lfmw'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/creating-backports-mte1lfmw/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.