mk:resolving-merge-conflicts — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited mk:resolving-merge-conflicts (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Path convention: Commands assume cwd is the repo root ($CLAUDE_PROJECT_DIR).Iron Laws
operation is the goal. Abort only if the user explicitly asks.
place to add features or refactor.
git status shows Unmerged paths / "you have unmerged files"git merge, git rebase, git cherry-pick, or git pull stopped on conflictsDo NOT use when: no operation is in progress (nothing to resolve), or the request is to start a merge/ship from scratch (use mk:ship).
Phase: on-demand. Most often fires inside Phase 5 (Ship) when mk:ship merges the base branch and hits conflicts. Hands control back once the working tree is clean and checks pass.
Copy this checklist and track progress:
- [ ] 1. See the current state (operation type + conflicted files)
- [ ] 2. Find the primary sources (why each side changed)
- [ ] 3. Resolve each hunk (preserve both intents)
- [ ] 4. Run the project's automated checks
- [ ] 5. Finish the merge/rebaseDetermine whether a merge or a rebase is in progress — the finish step differs.
git status # human summary + hint line
git diff --name-only --diff-filter=U # exact conflicted (unmerged) files
ls .git/MERGE_HEAD 2>/dev/null && echo MERGE # present => merge in progress
ls -d .git/rebase-merge .git/rebase-apply 2>/dev/null && echo REBASE
git log --oneline -5 --all --decorate # orient on recent historyRead every conflicted file. Note each <<<<<<< / ======= / >>>>>>> hunk and which labels mark each side (HEAD/ours vs the incoming branch/commit).
Rebase side-swap: during a rebaseoursis the branch being rebased ONTO andtheirsis your commit being replayed — the opposite of a merge. Confirm before assuming which side is "yours".
For each conflict, understand why each change was made — do not guess from the diff alone.
git log --merge -p -- <file> # commits touching the conflict on both sides
git log -p <side> -- <file> # full history of one side's hunk
gh pr list --state merged --search <term> # the PR that introduced the change
gh pr view <num> ; gh issue view <num> # stated intent, linked ticketsRead commit messages, PR descriptions, and linked issues. The goal is the original intent behind each side, not just the textual difference.
For every hunk, in order of confidence:
neither is lost. This is the default and most common outcome.
(e.g. "merge feature X into main" → keep X's behaviour) and note the trade-off so the discarded intent is visible to the user.
<<<<<<<, =======, >>>>>>>). Verify none remain:git grep -nE '^(<{7}|={7}|>{7})' -- <files> returns nothing.
git add <file>.Never resolve by blindly taking one whole side (-X ours/-X theirs) unless the file's two sides are genuinely one-or-the-other — that silently drops the other intent.
Discover the checks before running them (do not assume). Typical order: typecheck → tests → format.
cat package.json # scripts: typecheck / lint / test / build / format
ls Makefile justfile pyproject.toml Cargo.toml go.mod 2>/dev/nullRun what exists (for this kit: npm run typecheck, npm test, npm run lint). Fix anything the merge broke — a resolution can be marker-free yet semantically wrong (e.g. a function both sides renamed differently). Re-run until green.
keep it conventional and free of AI references.
git add -A
git commit --no-edit # or write a conventional message if none is prepared git add -A
git rebase --continue # repeat steps 1-4 for each subsequent pauseRepeat until git status reports the rebase is complete (no further stops).
Confirm a clean tree (git status → "nothing to commit, working tree clean") before handing off.
## Merge Conflict Resolution: {merge|rebase} of {source} into {target}
**Conflicted files:** {n}
**Resolution summary:**
- {file}: {kept both | chose {side} because {merge goal} — dropped {discarded intent}}
**Checks:** typecheck {pass/fail} · tests {pass/fail} · format {pass/fail}
**Finished:** {commit sha | rebase complete}| Failure | Recovery | ||
|---|---|---|---|
| Cannot tell which side's intent should win | Surface both intents + the merge's stated goal to the user; ask — do NOT abort | ||
| Checks fail after markers removed | Resolution is semantically wrong; re-read both sides' intent (step 2) and fix | ||
| Conflict markers left in a file | `git grep -nE '^(<{7} | ={7} | >{7})'`; resolve remaining hunks before staging |
| Rebase keeps re-conflicting on the same lines | Consider git rerere; otherwise resolve each pause carefully — never --skip a commit without user approval | ||
| Binary file conflict | Choose a version explicitly (git checkout --ours/--theirs <file>) after confirming intent with the user |
On a clean tree with green checks → return to mk:ship (if mid-ship) or mk:verify to confirm the full build is green before continuing.
ours is theupstream you are replaying onto, not your own work. Confirm direction before picking a side.
broken (both sides edited the same logic differently). Step 4's checks are what prove it.
not done until git status says so; resolving the first pause is not the end.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.