quay/ai-helpers/backport
- community
Checking that the SKILL.md file is still in the repository.
Backport a merged PR to release branches. Detects prior bot failures, performs manual cherry-picks from a fork matching bot conventions, and handles JIRA clone tickets. Derives target branches from fixVersions.
Install
npx vskill@latest install quay/ai-helpers/backportSKILL.md
Backport PR
Backport merged PR #$ARGUMENTS[0] to release branches.
- PR number:
$ARGUMENTS[0] - Branch (optional):
$ARGUMENTS[1]— if omitted, derive from JIRA fixVersions
Phase 1: Discovery
Step 1: Verify PR is merged
The PR must be merged. If not, inform the user and stop. Extract:
mergeCommit.oid— the merge commit SHAtitle— extract the JIRA key (pattern:PROJQUAY-\d+or similar prefix)baseRefName— should bemaster
Step 2: Determine backport branches
If $ARGUMENTS[1] is provided, use it as the sole target branch. Skip to Phase 2.
Otherwise, fetch JIRA fields to compute branches:
Version → Branch mapping: Strip quay-v prefix, extract major.minor, prepend redhat-. Examples: quay-v3.17.z → redhat-3.17, quay-v3.16.2 → redhat-3.16.
Backport branches = branches from Fix Versions, minus the branch matching Target Version (that's the branch the original ticket already covers).
Validate each branch exists:
If no backport branches remain, report "no backports needed" and stop.
Phase 2: Per-Branch State Detection
For each backport branch, determine its current state before acting:
Check 1: Existing backport PR
- If a merged backport PR exists → skip this branch, report "already backported"
- If an open backport PR exists → skip this branch, report the PR URL
Check 2: Prior bot failure
Search the original PR's comments for the cherry-pick robot's failure message:
Then check if the failure is for THIS specific branch by examining the comment body for failed to apply on top of branch "<BRANCH>".
Decision
- Bot already failed for this branch → proceed to Phase 3 (manual fallback)
- No prior attempt → trigger the bot and report:
``bash gh pr comment "$ARGUMENTS[0]" --repo quay/quay --body "/cherrypick <BRANCH>" ``
Phase 3: Manual Fallback
For each branch where the bot failed:
Step 1: Find or create the JIRA clone ticket
The bot usually creates clone tickets during /jira backport (stored as jlp-<branch>:<clone-key> labels on the original JIRA issue). Look it up:
If the result is none, create a clone. First determine the fixVersion for this branch (the fixVersion whose major.minor matches the branch), then:
Step 2: Cherry-pick from fork
Step 3: Resolve conflicts
If git cherry-pick exits non-zero:
- Show conflicting files:
git diff --name-only --diff-filter=U - For each conflicted file, read the file and help resolve the conflict markers
- After resolution:
git add <resolved-files>thengit cherry-pick --continue
Ask the user to confirm each conflict resolution before proceeding.
Step 4: Push and create PR
The PR must match the cherry-pick bot's conventions:
- Title format:
[<BRANCH>] <CLONE_KEY>: <original-title-suffix> <original-title-suffix>is everything after the JIRA key in the original PR title- Example: original
PROJQUAY-11576: feat(ldap): add poolwith clonePROJQUAY-11600
→ [redhat-3.17] PROJQUAY-11600: feat(ldap): add pool
- Body:
This is an automated cherry-pick of #<PR_NUMBER> - Branch name:
cherry-pick-<PR_NUMBER>-to-<BRANCH>
Determine <FORK_OWNER> from: gh api user --jq '.login'
Step 5: Report
For each branch processed, report:
- Clone ticket key (found or created)
- Backport PR URL
- Whether conflicts were resolved or the branch was skipped
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/dev/skills/backport/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/quay/ai-helpers/backport)