resolve-backport-conflicts
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "resolve-backport-conflicts" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9bc1b721bfb240c662b0ff06b454efbd6aa211e95aa84c74caadc1509d947946. Verify the upstream source and version against https://github.com/frappe/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Resolve merge conflicts in Mergify backport pull requests. Use this skill when a cherry-pick fails and Mergify has committed files containing conflict markers. Accepts a pull request link or number as a parameter to locate and handle the conflicts.
Introduction source: third_party · frappe · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Resolve merge conflicts in a Mergify backport pull request. When a cherry-pick fails, Mergify commits the conflict markers as they are. This skill takes a pull request link or number as an argument.
- Testing
- Not tested
Browse files
Frontmatter
name: resolve-backport-conflicts
description: Resolve merge conflicts in a Mergify backport pull request. When a cherry-pick fails, Mergify commits the conflict markers as they are. This skill takes a pull request link or number as an argument.
disable-model-invocation: trueHow Mergify leaves the branch
Mergify backports a pull request with a cherry-pick. When the cherry-pick conflicts, Mergify runs git add on the conflicted files and commits them unresolved. The branch then holds raw conflict markers:
<<<<<<< HEAD
content of the target branch, such as version-16-hotfix
=======
content of the commit under backport
>>>>>>> <sha> (commit subject)
The HEAD side is the target branch. The >>>>>>> side is the pull request under backport. Neither side wins by default.
Steps
1. Check out the pull request
Work inside the repository that owns the pull request. If the current directory is a different repository, clone the correct one into the scratchpad directory.
gh pr view <pr-url> --json number,title,body,baseRefName,headRefName,headRepositoryOwner,url
gh pr checkout <pr-url> --force
The --force flag resets a stale local branch to the pull request head. If the working tree is dirty, stop and tell the user. Do not discard the work of the user.
2. Read the original pull request
The Mergify description holds the line This is an automatic backport of pull request #<N>. Read the number from that line. If the line is absent, read the number from the branch name mergify/bp/<branch>/pr-<N>.
gh pr view <N> --json title,body,url
gh pr diff <N>
This diff states the intent of the backport. Read all of it before you edit a file.
3. Find every marker
git grep -nE '^(<{7}|={7}|>{7})' -- . || echo "no markers"
git diff HEAD~1 --stat
git log -1 --format=%s
The last command confirms that HEAD is the conflict commit of Mergify. Look also for leftover .rej and .orig files.
4. Resolve each conflict
- Read the code around the conflict until you know what it does on this branch.
- Start from the target branch side. It shows what the release branch holds today.
- Apply the change of the original pull request on top of that side.
- Drop every line that the diff of the original pull request does not contain.
- Delete the three marker lines.
Step 4 matters most. A conflict hunk drags in unrelated work from later commits on the source branch. Renamed helpers, new APIs, and unrelated refactors arrive this way. None of them belong in a release branch.
If the backport needs a function or a module that the target branch does not have, do not write a replacement. Report the gap and ask the user how to continue.
Mergify also stages clean hunks that belong to other commits. To catch these, compare the whole conflict commit against the diff of the original pull request. Revert the hunks that do not match.
5. Verify
git grep -nE '^(<{7}|={7}|>{7})' -- .
git diff HEAD
The first command must print nothing. Read every line that the second command prints. Compare git diff HEAD~1 against gh pr diff <N>. Apart from branch differences, the two diffs must match.
If the repository has a linter or a formatter, run it on the files you changed.
6. Commit and push
git add <modified files>
git commit -m "chore: resolve conflict"
git push <remote> HEAD:<headRefName>
To choose the remote, match headRepositoryOwner from step 1 against the output of git remote -v. A Mergify branch lives on the upstream repository, not on a fork. Never force-push.
7. Remove the conflicts label
Mergify adds a conflicts label when the cherry-pick fails. The label stays until someone removes it. After the push succeeds, and only if no marker remains, remove it:
gh pr edit <pr-url> --remove-label conflicts
The command fails if the pull request does not carry the label. That failure is harmless. If you could not resolve every conflict, leave the label in place.
8. Summarize
Report these points to the user:
- The backport pull request and the original pull request.
- Each file that held a conflict, with one line on how you resolved it.
- Each change you dropped as unrelated, with the reason.
- Each conflict you could not resolve.
- The sha of the pushed commit.
State the facts. If a resolution is a judgment call, say so.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Mergify 反向移植冲突这一明确开发痛点,提供端到端解决方案
- 流程完整,覆盖从检出到推送的全生命周期
Highlights
- 触发条件清晰:Mergify backport PR 中的合并冲突
- 输入参数明确:PR 链接或编号
Highlights
- 8个步骤划分清晰,逻辑连贯
- 包含背景说明、具体命令、验证逻辑和出口条件
- frontmatter 完整,文档结构规范
Areas to improve
-
子命令错误处理未覆盖 Reported severity: Minor
未显式处理 gh pr checkout、gh pr view 等子命令执行失败的情况
Recommendation: 建议在关键命令后添加错误检查逻辑,如 `|| { echo "Error: failed to checkout PR"; exit 1; }`
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.