/motoedie-utils:git-conflict-resolvefrom motoedie-utils
Resolve git conflicts by understanding intent on every side, not by picking a winner. Use when an integration step (merge, rebase, cherry-pick, revert, or — only on explicit request — stash apply) left files with `<<<<<<<` markers. Scope is conflict resolution only — does not commit, continue, drop, or otherwise advance the integration.
Ships in motoedie-utils. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Resolve $ARGUMENTS (paths, or all unmerged files if empty). The job is to figure out what each side meant to do, not to make markers go away. Deleting one side to "solve" a conflict is how regressions ship.
Out of scope. No committing, no --continue, no dropping stashes, no advancing the integration. Resolution stops once every file is marker-free and verified. The user drives the next step.
Identify the integration source from git status (rebase in progress, MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD, …). Stash is never assumed implicitly — only treat conflicts as stash-derived when the user explicitly says so.
Two-way markers (<<<<<<< / ======= / >>>>>>>) hide the common ancestor and force you to guess which side changed what. Three-way (diff3 / zdiff3) markers show the base in the middle:
<<<<<<< ours
ours-side
||||||| base
common-ancestor
=======
theirs-side
>>>>>>> theirs
If files show only two-way markers, recommend the user enable diff3 (merge.conflictStyle = zdiff3) and re-trigger the integration. If re-triggering is too disruptive, continue without — and call out in the summary that base context was unavailable, which weakens conclusions about intent.
For each conflicting file, name three refs:
| Source | ours | base | theirs |
|---|---|---|---|
| merge | HEAD | merge-base of HEAD and MERGE_HEAD | MERGE_HEAD |
| rebase | HEAD = upstream tip + already-replayed commits | parent of the commit being replayed | the commit being replayed (from your branch) |
| cherry-pick / revert | HEAD | parent of CHERRY_PICK_HEAD | CHERRY_PICK_HEAD |
| stash apply (only when user says so) | HEAD | stash@{N}^ | stash@{N} |
Rebase gotcha — ours/theirs are inverted from intuition. During a rebase, git's HEAD is the upstream side (e.g. main), and the commit being replayed from your branch is theirs. So <<<<<<< ours in the markers = main, >>>>>>> theirs = your branch. Same for git checkout --ours/--theirs. The classification rules below use these labels mechanically — read them as "the HEAD side" and "the incoming side", not "my work" vs "their work".
Rebase intent — also consult the original merge-base. The per-commit base above is what git uses mechanically, but for intent you usually want the original divergence point: git merge-base <your-branch>@{1} <upstream> (or whatever pre-rebase ref you have). Diff main and your-branch from that point to see what each side contributed as a whole — much more useful for "did this side really mean to remove X?" than a one-commit window.
For stash, ours is also dirtied by the working tree, not just HEAD. For rebased branches, the same logical commit may have a different SHA on ours vs theirs — compare by content, not SHA.
For each conflicting file, gather:
The two diffs and the two logs are the load-bearing artifacts.
Not every conflict is a <<<<<<< block inside a file. git status shows file-level conflicts with two-letter codes — handle these before chasing markers:
DU / UD — modify/delete: one side deleted the file, the other modified it. No markers; git leaves the modified version in the tree as a hint. Read the deleting commit message (or, if the stash itself is the deleter, the stash entry from git stash list / git stash show). If the deletion was intentional (refactor, dead code, moved elsewhere), git rm the file — but scan the modifications first for anything still needed and move it. If the deletion was incidental (theirs branched before the file existed in its current form), keep the modified version.AA — add/add: both sides added the same path with different content. Markers will be present, but the ||||||| base section is empty — there's no common ancestor. Intent reasoning is weaker; usually hand-merge to take the union (exports, fields, imports). If the two files are unrelated despite sharing a path, surface to the user.git rm the renamed path; otherwise keep the rename.AU / UA and other exotic states: surface to the user with the git status output — don't guess.For all the delete-involved cases, the deletion commit message (or stash entry, when stash is the deleter) is load-bearing — same rule as in-file removals: don't override an intentional delete just to keep code alive.
For each <<<<<<< block, walk these questions in order. Stop at the first that fits.
Rule of thumb: "removed" beats "kept" only when the removal is intentional. A conflict that exists only because theirs was branched from an older base is mechanical, not semantic — defer to ours.
Edit the file directly. Replace the entire conflict block — including all three markers — with the resolved content. No marker fragments left behind.
When grafting theirs' new code onto ours' refactored structure: rename helper calls, swap imports, update type names. The new code must compile against ours' current API surface, not theirs' old one.
In this order:
Fixing conflicts often surfaces pre-existing breakage from theirs' feature — e.g. theirs flips a default and ours' tests didn't account for it. That's not a conflict, it's behavioural drift the integration exposed. Fix those tests too, but call them out separately in the summary so the user knows they weren't caused by the resolution.
--continue, commit, stash drop, stash pop) — stop at "verified marker-free".reset --hard, checkout ., clean -f) to redo a botched resolution. Restart that one file (git checkout --merge -- <path> brings the conflict markers back) and re-resolve.merge.conflictStyle = zdiff3 (set globally once) makes every future conflict show the base section, with common lines collapsed.rerere.enabled = true records and replays your resolutions on long-lived rebases.yarn.lock conflicts: don't hand-merge. Take either side (or leave the markers) and run yarn install — Yarn rewrites the lockfile from package.json.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
/code-commentsAdd, review, or rewrite code comments so they explain intent, invariants, branch rationale, and multi-step flows without narrating obvious syntax. Use when documenting newly added or recently changed code, converting line-by-line comments into concise block comments, checking whether comment density is too sparse or too heavy, or making non-obvious branches, scripts, and side effects easier for reviewers to scan./implementation-planStructure an implementation plan for a coding AI agent to execute autonomously. Use when preparing a multi-phase coding task that another agent (or future session) will carry out without human intervention. Produces a self-contained plan document with all context an agent needs./skillsmithCreate, audit, optimize, or test Agent Skills for coding agents. Use when designing a new skill or improving an existing skill's routing, instructions, token economy, resources, portability, safety, or evaluations. Existing-skill work is report-first and requires approval before edits. Do not use for ordinary prompt editing or unrelated documentation./tddTest-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.npx claudepluginhub motoedie/.dotfiles --plugin motoedie-utils