Skip to Content
MeowKit
Skills

mk:resolving-merge-conflicts

Resolves a merge or rebase conflict hunk by hunk, preserving both sides' intent, and finishes only with your approval.

Source.claude/skills/resolving-merge-conflicts/SKILL.md
Ownergit
Runtimeclaude-code
Riskhigh

What it does

Resolves a merge, rebase, cherry-pick or pull that stopped on conflicts, one hunk at a time. It keeps both sides' intent where the two are compatible and does not add features or refactor. Use it when git status shows unmerged paths or you say "resolve the conflicts" or "finish the rebase". It most often fires in Phase 5 (Ship) when mk:ship merges the base branch and hits conflicts.

When not to use

If no operation is in progress, or the request is to start a merge or ship from scratch, use mk:ship.

Usage

Run /mk:resolving-merge-conflicts while a merge or rebase is paused. There are no flags. Two rules always apply. Aborting (git merge --abort, git rebase --abort) needs your explicit direction, and so does completing the operation with a commit or git rebase --continue.

Steps

  1. See the state. Find out whether a merge or a rebase is in progress (.git/MERGE_HEAD, .git/rebase-merge, .git/rebase-apply), list the files with git diff --name-only --diff-filter=U and read every conflicted file. During a rebase ours is the branch being rebased onto and theirs is your commit being replayed, the reverse of a merge.
  2. Find the intent behind each side with git log --merge -p -- <file>, and the merged PR and issue through gh pr view and gh issue view.
  3. Resolve each hunk. Combine both intents when they are compatible. When they are not, keep the side that matches the stated goal of the merge and note what was dropped. Remove every marker, check with git grep -nE '^(<{7}|={7}|>{7})' -- <files>, and git add each finished file. Do not take a whole side blindly with -X ours or -X theirs.
  4. Discover and run the project's checks (typecheck, tests, lint or format). A file with no markers can still be broken, for example when both sides renamed a function differently.
  5. Show the resolved files and check results and wait for your approval. For a merge, run git add -A then git commit --no-edit. For a rebase, run git add -A and git rebase --continue, and repeat from step 1 at each pause until git status reports it finished.

Outputs

A summary with the number of conflicted files, one line per file (kept both, or chose a side and what was dropped), the check results and the finish state. On a clean tree with green checks it hands back to mk:ship or mk:verify.

Gotchas

SituationWhat to do
Unsure which intent should winShow both intents and the merge goal and ask. Do not abort.
Checks fail after markers are goneThe resolution is wrong. Reread both intents.
A rebase keeps conflicting on the same linesConsider git rerere. Never --skip a commit without approval.
Binary file conflictConfirm with you, then pick a version with git checkout --ours or --theirs.

On this page