mpt-ext-workflow-hotfix-backport
Skill3 starsChanged 4 months agoApache-2.0View on GitHub
Use when a hotfix or backport must carry an existing main PR onto the active release branch and produce a validated release PR. Orchestrates the cherry-pick, validation, release PR, and Jira updates.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/mpt-extension-skills.mdcCursor rule
- mpt-ext-task-apply-dashboard-jira-decisionSkill
- mpt-ext-task-commit-changesSkill
- mpt-ext-task-create-initial-epicSkill
- mpt-ext-task-create-work-branchSkill
- mpt-ext-task-dependabot-pr-policy-fixSkill
- mpt-ext-task-ensure-active-sprintSkill
- mpt-ext-task-fix-pre-commit-failuresSkill
- mpt-ext-task-fix-repository-check-failuresSkill
- mpt-ext-task-handle-pr-commentsSkill
- mpt-ext-task-move-jira-to-code-reviewSkill
- mpt-ext-task-move-jira-to-qaSkill
- mpt-ext-task-notify-pr-ready-in-teamsSkill
- mpt-ext-task-open-pull-requestSkill
- mpt-ext-task-run-repository-checksSkill
- mpt-ext-task-start-jira-workSkill
- mpt-ext-task-update-docs-from-changesSkill
- mpt-ext-task-write-documentationSkill
- mpt-ext-task-write-python-unittestsSkill
- mpt-ext-tool-gh-pr-opsSkill
- mpt-ext-tool-git-branch-opsSkill
- mpt-ext-tool-jira-workitem-opsSkill
- mpt-ext-tool-teams-send-messageSkill
- mpt-ext-workflow-address-review-feedbackSkill
- mpt-ext-workflow-complete-after-mergeSkill
- mpt-ext-workflow-dashboard-failure-triageSkill
- mpt-ext-workflow-decompose-tdrSkill
- mpt-ext-workflow-fix-dependabot-prsSkill
- mpt-ext-workflow-notify-pr-readySkill
- mpt-ext-workflow-send-to-reviewSkill
- mpt-ext-workflow-skill-authoringSkill
- mpt-ext-workflow-start-workSkill
- mpt-ext-workflow-update-documentationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
51 rules. About 0 are common, 31 are distinctive, and 20 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈31
Distinctive · estimate
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 21
No open or merged source pull request exists for main.
- Very specific: line 33
every other issue type means backport
- Very specific: line 47
Use these shared documents and skills as the source of truth instead of restating their policy.
- Distinctive: line 63
Read repository-specific docs when they exist, because they may extend or override shared guidance.
- Distinctive: line 64
Read shared docs using the resolution rule from Shared References.
- Distinctive: line 67
Use the Jira issue key as the default workflow input.
- Distinctive: line 68
Search open and merged pull requests whose title, branch name, body, or linked metadata contains the Jira issue key.
- Distinctive: line 69
If the user provided an explicit pull request, inspect that PR instead of searching by Jira key.
- Distinctive: line 70
Stop and ask the user to choose when multiple matching source PRs target main.
- Distinctive: line 71
Stop when no open or merged source PR targeting main can be found.
- Distinctive: line 74
Read the Jira issue type before classifying the work.
- Very specific: line 75
Use the bundled context script after the Jira issue and original main PR have been read.
- Very specific: line 85
Use the script output fields mode, pr_marker, branch_prefix, release_branch_name, and blockers.
- Very specific: line 86
Use the script output fields fix_version_ok, matching_fix_versions, and needs_fix_version_confirmation to decide whether a Jira fix version …
- Very specific: line 87
Stop and report the script blockers when ready is false.
- Distinctive: line 91
Verify Jira fix version.
- Very specific: line 92
If fix_version_ok is true, preserve the existing matching fix version.
- Very specific: line 93
If needs_fix_version_confirmation is true, ask the user whether the matching hotfix or backport fix version should be added before editing …
- Very specific: line 94
If the user confirms, add the correct fix version through mpt-ext-tool-jira-workitem-ops, then re-read the Jira issue and rerun the bundled …
- Distinctive: line 95
If the user declines or the correct fix version cannot be resolved safely, stop and report the blocker.
- Distinctive: line 96
Never edit Jira fixVersions without explicit user confirmation when the matching marker is missing.
- Very specific: line 99
Use mpt-ext-tool-gh-pr-ops to inspect the original main pull request.
- Distinctive: line 100
Read the source pull request commit list in PR order.
- Very specific: line 101
Use the source_commits values from the bundled context script as the cherry-pick source.
- Very specific: line 102
Stop when the script reports source_pr_not_open_or_merged, source_pr_commits_missing, or a non-main source PR base.
- Very specific: line 105
Use the active release branch rule from standards/pull-requests.md.
- Very specific: line 106
Prefer mpt-ext-tool-git-branch-ops release-branch resolution for hotfix or backport.
- Very specific: line 107
Stop and ask for the target release branch when no active release/* branch can be resolved or multiple candidates are ambiguous.
- Distinctive: line 109
Create the release work branch.
- Very specific: line 111
Create the new branch from the release branch using the release_branch_name value from the bundled context script.
- Distinctive: line 112
Stop instead of reusing an existing branch unless the user explicitly asked to continue that branch.
- Distinctive: line 116
If conflicts occur, resolve only the release-branch equivalent of the original fix.
- Distinctive: line 117
Do not merge main into the release branch.
- Very specific: line 120
Use mpt-ext-task-run-repository-checks to run the repository-required validation flow.
- Very specific: line 121
If checks fail, hand the failing output to mpt-ext-task-fix-repository-check-failures once.
- Very specific: line 128
Use mpt-ext-task-open-pull-request with the target release branch as the explicit base branch.
- Very specific: line 132
Use mpt-ext-task-move-jira-to-code-review after the release PR is open or updated and validation status is known.
- Distinctive: line 133
If the main PR still needs review or merge before the release PR should proceed, report that blocker instead of moving Jira forward.
- Distinctive: line 136
Use the bundled result script to render the final report after the release PR and Jira transition steps:
- Distinctive: line 152
Never create the release-branch PR before the corresponding open or merged main PR exists.
- Distinctive: line 153
Never override Jira issue type based classification without explicit user direction.
- Distinctive: line 154
Never add a missing hotfix or backport fix version without asking the user first.
- Distinctive: line 155
Never backport from an arbitrary feature branch.
- Distinctive: line 156
Never squash the source PR commit list into one cherry-pick when the PR has multiple commits.
- Distinctive: line 157
Never merge main into a release branch as part of this workflow.
- Distinctive: line 158
Never silently choose a release branch when active release branch resolution is ambiguous.
- Distinctive: line 159
Never skip repository-required validation before opening or updating the release PR.
- Distinctive: line 160
Never push or open the release PR while validation is failing.
- Distinctive: line 161
Never wrap a fix task that already owns its bounded loop in a second retry loop.
- Distinctive: line 162
Never use this workflow to change shared hotfix, backport, or release-branch policy.
- Distinctive: line 163
Prefer narrower task or tool skills when the user only asked for one step of the workflow.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hotfix And Backport
Purpose
Coordinate release-branch hotfix and backport work after the corresponding change has been prepared for main.
Use When
- The user wants to backport an open or merged
mainpull request to the active release branch. - The user wants to prepare a hotfix release-branch PR after the fix has been opened for
main. - The task requires finding the source
mainPR from Jira or an explicit PR, selecting the activerelease/*branch, creating a release-branch work branch, cherry-picking source PR commits one by one, validating the result, and opening or updating the release PR. - Jira state needs to remain aligned with the hotfix or backport review flow.
Do Not Use When
- No open or merged source pull request exists for
main. - The user only wants to create a normal feature or bugfix branch from
main. - The task is only to cherry-pick a commit without opening a pull request or managing review state.
- The pull request has already merged and the only remaining action is final Jira handoff.
- The request is to change release-branch or backport policy rather than apply it.
Inputs
- Jira issue key for the hotfix or backport work.
- Optional explicit original
mainpull request number. If omitted, find the source PR from the Jira issue key. - Jira issue type used to classify the mode:
Bugmeanshotfix- every other issue type means
backport
- Jira fixVersions used to verify the issue is marked for the matching hotfix or backport release workflow.
- Optional explicit target release branch when the active release branch cannot be resolved safely.
- Repository validation requirements from repo docs.
- GitHub authentication that can read PR metadata, push branches, and create or update pull requests.
- Jira authentication for review-state updates.
- Installed shared package root:
${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/currentShared References
Use these shared documents and skills as the source of truth instead of restating their policy. When shared guidance is needed, resolve it from ${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current when available; otherwise read the same path from the main branch of the shared GitHub repository.
standards/pull-requests.mdknowledge/backports.mdknowledge/build-and-checks.mdskills/mpt-ext-tool-gh-pr-ops/SKILL.mdskills/mpt-ext-tool-git-branch-ops/SKILL.mdskills/mpt-ext-task-run-repository-checks/SKILL.mdskills/mpt-ext-task-fix-repository-check-failures/SKILL.mdskills/mpt-ext-task-open-pull-request/SKILL.mdskills/mpt-ext-task-move-jira-to-code-review/SKILL.md
Workflow
- Build repository context first.
- Read the target repository
AGENTS.mdonce per session. If you already loaded it earlier in this session and still have its full contents, reuse them instead of re-reading; if the context was summarized or you are unsure it is complete, read it again. Do not pre-load shared docs in this step; read them lazily only when the repository points to them. - Read repository-specific docs when they exist, because they may extend or override shared guidance.
- Read shared docs using the resolution rule from Shared References.
- Find and confirm the source
mainpull request.
- Use the Jira issue key as the default workflow input.
- Search open and merged pull requests whose title, branch name, body, or linked metadata contains the Jira issue key.
- If the user provided an explicit pull request, inspect that PR instead of searching by Jira key.
- Stop and ask the user to choose when multiple matching source PRs target
main. - Stop when no open or merged source PR targeting
maincan be found.
- Confirm the release workflow mode.
- Read the Jira issue type before classifying the work.
- Use the bundled context script after the Jira issue and original
mainPR have been read. The script applies the classification rule fromknowledge/backports.md:Bugmeanshotfix, and every other issue type meansbackport.
python3 "${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-workflow-hotfix-backport/scripts/render_release_context.py" \
--jira-json /tmp/jira_issue.json \
--pr-json /tmp/main_pr.json \
--target-release-branch release/5 \
--pretty- Use the script output fields
mode,pr_marker,branch_prefix,release_branch_name, andblockers. - Use the script output fields
fix_version_ok,matching_fix_versions, andneeds_fix_version_confirmationto decide whether a Jira fix version update is needed. - Stop and report the script blockers when
readyisfalse. - For a hotfix, verify that the fix has already been opened for
main, or stop and send the normalmainwork to review first. - For a backport, verify that the source pull request is open or merged and targets
main.
- Verify Jira fix version.
- If
fix_version_okistrue, preserve the existing matching fix version. - If
needs_fix_version_confirmationistrue, ask the user whether the matchinghotfixorbackportfix version should be added before editing Jira. - If the user confirms, add the correct fix version through
mpt-ext-tool-jira-workitem-ops, then re-read the Jira issue and rerun the bundled context script. - If the user declines or the correct fix version cannot be resolved safely, stop and report the blocker.
- Never edit Jira fixVersions without explicit user confirmation when the matching marker is missing.
- Resolve the source commits.
- Use
mpt-ext-tool-gh-pr-opsto inspect the originalmainpull request. - Read the source pull request commit list in PR order.
- Use the
source_commitsvalues from the bundled context script as the cherry-pick source. - Stop when the script reports
source_pr_not_open_or_merged,source_pr_commits_missing, or a non-mainsource PR base.
- Resolve the target release branch.
- Use the active release branch rule from
standards/pull-requests.md. - Prefer
mpt-ext-tool-git-branch-opsrelease-branch resolution forhotfixorbackport. - Stop and ask for the target release branch when no active
release/*branch can be resolved or multiple candidates are ambiguous.
- Create the release work branch.
- Fetch and update the target release branch.
- Create the new branch from the release branch using the
release_branch_namevalue from the bundled context script. - Stop instead of reusing an existing branch unless the user explicitly asked to continue that branch.
- Cherry-pick the source commits.
- Cherry-pick each commit from the
source_commitslist into the release work branch one by one, preserving the script output order. - If conflicts occur, resolve only the release-branch equivalent of the original fix.
- Do not merge
maininto the release branch.
- Validate the release branch result.
- Use
mpt-ext-task-run-repository-checksto run the repository-required validation flow. - If checks fail, hand the failing output to
mpt-ext-task-fix-repository-check-failuresonce; that task owns the bounded fix-and-rerun loop. Do not re-loop it from here. - Constrain the fix scope to failures caused by the hotfix or backport.
- Act on its returned outcome: continue to publishing only on
fixed; on any other outcome — including failures that are unrelated, environment-related, or that require a product decision — stop without pushing or opening the release PR and record the blocker.
- Publish the release pull request.
- Publish only after the repository-required validation flow passes.
- Push the release work branch.
- Use
mpt-ext-task-open-pull-requestwith the target release branch as the explicit base branch. - Apply the release-branch PR title marker from the bundled context script
pr_markerfield.
- Move Jira to review when ready.
- Use
mpt-ext-task-move-jira-to-code-reviewafter the release PR is open or updated and validation status is known. - If the main PR still needs review or merge before the release PR should proceed, report that blocker instead of moving Jira forward.
- Report the result clearly.
- Use the bundled result script to render the final report after the release PR and Jira transition steps:
python3 "${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-workflow-hotfix-backport/scripts/render_result.py" \
--context-json /tmp/release_context.json \
--release-pr-url "<release-pr-url>" \
--validation-command "make check-all" \
--validation-status "passed" \
--jira-status "moved to Code Review"- State the workflow mode, source
mainPR, source commits, Jira fix version state, target release branch, release work branch, release PR URL, validation result, and Jira transition result. - Surface blockers with the exact missing condition: missing source PR, source PR not open or merged, source PR not targeting
main, missing source commits, missing matching fix version, missing release branch, cherry-pick conflict, failing validation, push failure, PR creation failure, or Jira transition failure.
Guardrails
- Never create the release-branch PR before the corresponding open or merged
mainPR exists. - Never override Jira issue type based classification without explicit user direction.
- Never add a missing hotfix or backport fix version without asking the user first.
- Never backport from an arbitrary feature branch; use the commits from the source pull request that targets
main. - Never squash the source PR commit list into one cherry-pick when the PR has multiple commits.
- Never merge
maininto a release branch as part of this workflow. - Never silently choose a release branch when active release branch resolution is ambiguous.
- Never skip repository-required validation before opening or updating the release PR.
- Never push or open the release PR while validation is failing.
- Never wrap a fix task that already owns its bounded loop in a second retry loop; invoke it once, consume its classified outcome, and stop on anything other than success.
- Never use this workflow to change shared hotfix, backport, or release-branch policy.
- Prefer narrower task or tool skills when the user only asked for one step of the workflow.
Bundled Resources
scripts/render_release_context.py- Inputs: Jira issue JSON, original
mainPR JSON, optional Jira key or summary override, and optional target release branch. - Output: JSON with
mode,pr_marker,branch_prefix,release_branch_name,fix_version_ok,matching_fix_versions,needs_fix_version_confirmation,source_commits,blockers, andready. - Runtime path:
${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-workflow-hotfix-backport/scripts/render_release_context.py
- Inputs: Jira issue JSON, original
scripts/render_result.py- Inputs: release context JSON plus release PR, validation, and Jira transition status.
- Output: compact user-facing release workflow report.
- Runtime path:
${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-workflow-hotfix-backport/scripts/render_result.py
Expected Outcome
A hotfix or backport release-branch pull request is created or updated from the correct source main pull request commits, validated against repository rules, and handed off in Jira for review, or the workflow stops with a precise blocker.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

