一键导入
merge-conflict-resolution
Resolve git merge/rebase conflicts safely without losing intended changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Resolve git merge/rebase conflicts safely without losing intended changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Minimum-requirements checklist for any change — code or docs-only. Run this before every PR creation or push to avoid CI failures on the first attempt.
Generate PNG screenshots for release notes using the repository's HtmlRenderer and ScreenshotGenerator tools. Use when asked to add screenshots to release notes or documentation.
Determine the next available issue number across all change types (feature, fix, workflow) by checking both local docs and remote branches, then reserve it by pushing an empty branch.
Convert the mermaid diagram in docs/agents.md to a blueprint-styled SVG for the website. Use when the workflow diagram in agents.md is updated and needs to be reflected on the website.
Run a focused accessibility pass for website changes (WCAG 2.1 AA-oriented).
Create and update interactive examples for the Eleventy website using page entrypoints and src/examples fragments.
| name | merge-conflict-resolution |
| description | Resolve git merge/rebase conflicts safely without losing intended changes. |
Prevent accidental loss of intended changes when a git merge or rebase hits conflicts (e.g., documentation regressions like the docs/architecture.md incident referenced in Feature 024).
This skill is intended for any agent that can commit changes.
A conflict is not a “choose ours/theirs” problem — it’s an intent reconciliation problem.
You must understand the intent of both changes before resolving anything. The correct resolution depends on intent, not on which side is main.
Often the right answer is “keep the intent of both changes”, which may require a manual edit that combines or restructures content.
Sometimes, intent is genuinely contradictory and cannot be resolved automatically. In that case, ask the user how to proceed.
<<<<<<<, =======, >>>>>>>).scripts/git-status.sh shows no unmerged paths.git checkout --ours <file> / git checkout --theirs <file> without validating intent.If the conflict touches source-of-truth docs (e.g., docs/spec.md, docs/architecture.md) and the correct content is not unambiguous from the current task context, you must ask the maintainer which version to keep/merge before committing.
If the two change intents are contradictory (both cannot be true at the same time), you must ask the user to choose a direction. Do not attempt to “average” or invent a new intent.
Before you modify any conflicted file, produce an explicit analysis in chat using this template:
Conflict analysis
Change A intent:
- <what this change is trying to achieve>
Change B intent:
- <what this change is trying to achieve>
Compatibility:
- Compatible / Partially compatible / Contradictory
- Notes: <why>
Proposed resolution:
- <how you will preserve the intent of both changes>
Open questions (must answer before proceeding):
- <question 1>
If you cannot confidently state the intent for both changes, stop and ask.
If you are in doubt about the intent of a change, ask questions until you understand it. Useful prompts:
Use git to confirm the conflict state and list conflicted files:
scripts/git-status.sh
git diff --name-only --diff-filter=U
scripts/git-status.sh
# or (machine-friendly)
git diff --name-only --diff-filter=U
git merge ...)For each conflicted file:
# See conflict hunks and surrounding context
sed -n '1,200p' <file>
# Compare current index stages (2=ours, 3=theirs) if available
# (These commands are safe even if a stage is missing.)
git show :2:<file> 2>/dev/null | head -50 || true
git show :3:<file> 2>/dev/null | head -50 || true
While inspecting, explicitly determine intent:
# Review what you’re about to commit
scripts/git-diff.sh
# Ensure git sees conflicts as resolved
scripts/git-status.sh
Also do a repo-wide check that no conflict markers remain. Prefer tooling that searches files directly (no scripts required), for example:
<<<<<<< , =======, and >>>>>>> <<<<<<<, =======, and >>>>>>>git grep -n '^<<<<<<< ' || true (repeat for the other markers)After conflicts are resolved, validate correctness based on file type:
Documentation changes:
Code changes:
git add <file>...
git commit
git add <file>...
git rebase --continue
When you create a commit that resolves conflicts, the commit message must describe:
Template:
<type>: resolve merge conflicts
Conflicts:
- <file/group>: <what conflicted>
Resolution:
- <how you preserved intent of both changes OR what decision was made>
Why:
- <why this is correct>