Automates RHDH plugin backport process: cherry-pick with AI conflict resolution, PR creation, CI monitoring, auto-merge, and changelog updates. Accepts release version and PR number/URL.
Ships in plugins. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
<essential_principles>
The script performs local preparation and read-only discovery. For every external write it emits a WRITE_PLAN file and waits on stdin. The agent's role is: 1. Validate prerequisites, then invoke /mutation-gate for every WRITE_PLAN 2. Run the credential scanner on the plan, render its exact target, command, preview, precondition, failure behavior, and recovery as a conversation table 3. Only after the user approves that specific plan, send the printed WRITE_APPROVAL line to the still-running script via stdin 4. If approval is denied, send a line other than WRITE_APPROVAL so the process exits; report that write and later writes as skipped. If the precondition changed, prepare a new plan 5. Handle cherry-pick conflicts if the script exits with code 2 6. Report each write receipt, including failures and skipped operations When the script exits with code 2 (cherry-pick conflict), it saves state to a JSON file and prints the path as `STATE_FILE=` to stderr. The agent must:If user chooses Option 1:
git log and git showgit add . && git cherry-pick --continue--continue-from <state_file>If user chooses Option 2:
See references/ai-conflict-resolution.md for detailed resolution strategies.
</essential_principles>
gh CLI — installed and authenticatedrhdh-pluginsrhdh-plugins with origin remote pointing to forkupstream remote — pointing to redhat-developer/rhdh-plugins/backport <release-version> <pr-source> [--mode auto|create|finish]
Examples:
# Full automation (default)
/backport 1.10 3456
/backport 2.1 3456
/backport 1.9 https://github.com/redhat-developer/rhdh-plugins/pull/2345
# Create PR only, stop for manual review
/backport 1.10 3456 --mode create
# Complete after manual PR merge
/backport 1.10 3456 --mode finish
Runs all 11 steps, pausing before each external write for the approval above. Later PR numbers and workflow results are discovered at runtime, so approval for the first push cannot approve the later merges or /publish comment. Keep stdin attached in an interactive terminal; never pipe an automatic approval string.
python scripts/backport.py <release> <pr_source> --mode auto
Runs steps 1-7: workflow bootstrap, cherry-pick, push, create PR. Stops and prints the PR URL.
You review and merge manually, then run with --mode finish.
python scripts/backport.py <release> <pr_source> --mode create
Runs steps 8-11: Version Packages, overlays update, changelog.
Assumes PR #1 from --mode create is already merged.
python scripts/backport.py <release> <pr_source> --mode finish
The skill picks the branch model from the release version. 2.1 is the cutoff.
release-2.1)main).release-2.1 directly.maintenance-changesets-release/release-x.y/{plugin}
(per workspace; rhdh-plugins #4854).release-2.1 branch must already exist and must be cut from main after
#4854 merges — the skill
does not auto-create it.release-1.10/lightspeed)release-x.y/{plugin} directly.maintenance-changesets-release/release-x.y/{plugin}.maintenance.workspace/{plugin}release-1.x/{plugin} or release-x.y.release_workspace_version.yml on the release branch includes
#4173 changes;
cherry-pick once if missing (skipped for yarn.lock-only and 2.1+ unified branches)If the script exits with code 2, cherry-pick had conflicts:
STATE_FILE=<path> from stderr outputconflict_files listAI resolution:
# Read each conflicting file
# Analyze conflict markers
# Write resolution using Edit tool
# Then:
git add .
git cherry-pick --continue
python scripts/backport.py <release> <pr_source> --continue-from <state_file>
Manual resolution:
Print instructions and stop.
Before the first backport to a release-x.y/{plugin} branch (< 2.1) that expects an
npm release via changesets, the release branch must carry the updated
.github/workflows/release_workspace_version.yml from
#4173 (commit ef07585).
Why: GitHub runs Prior Version Release Workspace using the workflow file on the
target branch, not on main. Release branches created before #4173 only trigger on
workspace/**, not release-*/*. Merging a backport with a changeset will not
open Version Packages without this fix.
The script checks automatically in --mode auto and --mode create. If the workflow
is missing the #4173 markers, it cherry-picks ef07585 once (or syncs the workflow
file from main) and pushes to the release branch. Do not repeat for every
backport — only once per release branch.
Required markers in release_workspace_version.yml:
branches: ['workspace/**', 'release-*/*']version_branch_id output for release-*/* base refsversionBranch: maintenance-changesets-release/${{ version_branch_id }}maintenance-changesets-release/release-x.y/{plugin} (full base ref)See references/workflow-bootstrap.md for manual bootstrap commands.
2.1+ unified branches (release-2.1, etc.) do not use this bootstrap — the
Version Packages workflow on those branches is owned by the release team and may
change as that work lands.
When the PR only changes yarn.lock files (e.g., CVE dependency fix with no code changes),
the script automatically skips Version Packages (step 7) and changelog (step 9).
No npm release is needed — the overlays update (step 8) uses the merge commit directly as repo-ref.
The Version Packages workflow fails if a stale changesets branch exists from a previous cycle. The script deletes it per workspace before waiting for Version Packages:
| Release model | Stale branch cleaned |
|---|---|
| Pre-2.1 per-plugin | maintenance-changesets-release/release-x.y/{plugin} |
| 2.1+ unified | maintenance-changesets-release/release-x.y/{plugin} (per workspace) |
Both prior-version models use the maintenance-changesets-release/ prefix.
main publishes via a different workflow (changesets-release/{plugin}/main) and
is not used for backports.
| Flag | Description |
|---|---|
--mode auto | Full workflow (default) |
--mode create | Steps 1-7 only, creates PR #1 and stops |
--mode finish | Steps 8-11, handles Version Packages, overlays, and changelog (after PR #1 merge) |
--continue-from FILE | Resume after conflict resolution |
--force | Skip already-backported check |
--json | Structured JSON output to stdout |
--repo REPO | Override plugins repo |
--overlays-repo REPO | Override overlays repo |
<reference_index>
| Reference | Used for |
|---|---|
references/ai-conflict-resolution.md | AI conflict resolution strategies (agent reads on exit code 2) |
references/pr-detection.md | PR source format documentation |
references/plugin-detection.md | Plugin auto-detection logic |
references/overlays-lookup.md | Overlays repo structure |
references/overlays-update.md | Overlays update + /publish flow |
references/ci-monitoring.md | CI monitoring and merge logic |
references/version-packages-detection.md | Version Packages PR detection |
references/workflow-bootstrap.md | One-time #4173 workflow bootstrap per release branch |
references/pr-creation.md | PR templates and patterns |
</reference_index>
Report the PR numbers and URLs for every PR created or merged (backport PR, Version Packages PR, overlays PR, changelog PR), the plugin name, the release version, the VP commit SHA, and the published npm version. For yarn.lock-only changes, note that Version Packages and changelog were skipped. Take exact values from script output rather than reconstructing them.
README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)references/ai-conflict-resolution.md (opens in a new tab)references/ci-monitoring.md (opens in a new tab)references/overlays-lookup.md (opens in a new tab)references/overlays-update.md (opens in a new tab)references/plugin-detection.md (opens in a new tab)references/pr-creation.md (opens in a new tab)references/pr-detection.md (opens in a new tab)references/version-packages-detection.md (opens in a new tab)references/workflow-bootstrap.md (opens in a new tab)scripts/backport.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
backport, cherry-pick, release-branch, plugin-backport, rhdh
/plugins:rhdh-backportfrom plugins
npx claudepluginhub redhat-developer/rhdh-skills --plugin plugins19 skills in this plugin
/backstage-api-changesNames the breaking and notable changes between the early Backstage New Frontend System alpha and the current GA surface, for Red Hat Developer Hub plugins: NavItemBlueprint removed in favour of nav auto-discovery from PageBlueprint, config.schema replaced by top-level configSchema with direct zod/v4 imports, AppRootWrapperBlueprint Component renamed to component and moved to @backstage/plugin-app-react, defaultPath/defaultTitle/defaultGroup renamed, SubPageBlueprint added, useRouteRef returning undefined, and AppDrawerContentBlueprint taking element rather than loader. Use when NFS code that used to compile now fails, a Blueprint param produces a TypeScript error, or a plugin migrated against an older alpha needs bringing forward./mutation-gateSupplies the approval rule another RHDH skill applies when it is already about to change something outside the session: how to state each operation, what approval binds to, what to report afterwards, and how to keep credentials out of a plan preview. Cited by name from the skill doing the work. Not an entry point — it performs no forge, Jira, or repository action itself, and a request to open, comment, transition, push, or post belongs to the skill that owns that target./prose-editingEdits or audits prose that the caller supplies as text or a file, preserves its claims and voice, removes machine-writing patterns, and verifies the result with the bundled linter. Use for explicit requests such as "rewrite this draft", "edit this existing PR body", "make this sound human", or "audit this prose without changing it". It does not review code, decide what a pull request or Jira issue should say, or compose from a blank sheet./rhdh-backstage-upgradeMoves the @backstage/* dependency versions of a Backstage plugin, workspace, app, or the redhat-developer/rhdh monorepo forward to a chosen release, staying within what a Red Hat Developer Hub version ships: read backstage.json and package.json, pick the target from the RHDH compatibility matrix or an explicit version, run versions:bump and versions:migrate, preserve the repository's dependency range style, audit stale resolutions, work through release changelogs, and re-verify the repository. Use for "upgrade @backstage dependencies", "bump Backstage in rhdh", "versions:bump", "which Backstage version does RHDH 1.8 ship", moved package namespaces, or dependencies that are too old for the API they need./rhdh-forgeReads GitHub and GitLab and constructs unexecuted forge payloads for the other RHDH skills: parse an issue, pull request, or merge request reference, fetch issue detail, resolve a plugin workspace, inspect checks or pipelines, read repository files, or build the exact command for a GitHub pull request, GitLab merge request, comment, label, assignee, approval, or /publish write. Use for a forge URL, a bare #number, a !number merge request, "which workspace is this issue in", a stale statusCheckRollup, "why did that check fail", or safe gh, glab, and jq command construction./rhdh-localOperates a local Red Hat Developer Hub environment with the rhdh-local-setup customization system: enable or disable dynamic plugins, apply configuration, switch pristine and customized modes, start or stop containers, inspect health and logs, run plugin verification, and back up or restore customizations. Use for local RHDH, podman compose plugin testing, PR artifact verification, 504 or startup troubleshooting, and local Extensions Catalog checks.Other plugins' skills for the same job