agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/resolve-conflicts/SKILL.md

resolve-conflicts

Skill2 starsChanged 5 months agoMITView on GitHub

Walk through git merge, rebase, or cherry-pick conflicts — understand both sides, resolve each hunk correctly, and verify the result before continuing. Use when the user says "resolve merge conflicts", "fix these conflicts", "help me with this merge", "I have conflicts", "finish this rebase", or "git says conflicts".

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After resolving a file, git add <file> to mark it resolved.

    line 34
  2. Very specific:

    Sanity-check the result builds/lints/tests: if a quick command exists — a clean merge that doesn't compile isn't resolved.

    line 39
  3. Very specific:

    Don't git checkout/reset/abort to "clean up" without explicit confirmation — that can throw away the user's work.

    line 46

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Conflict state

!git status --short 2>/dev/null || echo "Not a git repository"

!git diff --name-only --diff-filter=U 2>/dev/null | sed 's/^/CONFLICTED: /' || true

!ls -d .git/rebase-merge .git/rebase-apply .git/MERGE_HEAD .git/CHERRY_PICK_HEAD 2>/dev/null | sed 's/^/IN-PROGRESS: /' || echo "No merge/rebase/cherry-pick in progress"

Instructions

Resolve the conflicted files listed above. Honor any preference in $ARGUMENTS (e.g. "prefer our version"). If there's no conflict in progress, say so and stop.

Orient first

  1. Identify the operation from the in-progress markers: a merge (MERGE_HEAD), a rebase (rebase-merge/rebase-apply), or a cherry-pick. This changes what "ours" and "theirs" mean:
    • Merge: ours = current branch (HEAD), theirs = the branch being merged in.
    • Rebase: roles are flipped — ours = the upstream you're replaying onto, theirs = your commit being applied. Call this out so the user doesn't pick the wrong side.
  2. See what's diverging. For context, check what each side was doing: git log --oneline --left-right HEAD...MERGE_HEAD (merge) or look at the commit being applied during a rebase.

Resolve each file

  1. Read the full conflicted file, not just the hunk — surrounding code reveals intent. Find every <<<<<<< / ======= / >>>>>>> block.
  2. Understand both sides before editing. What did each side intend to change, and why? Use git log/git blame on the region if the reason isn't obvious. The goal is a result that preserves both intents, not a mechanical pick of one side.
  3. Resolve by meaning, not by deletion. Usually you keep parts of both. Take one side wholesale only when they're genuinely mutually exclusive. Remove all conflict markers and leave syntactically valid code.
  4. Watch for semantic conflicts git can't see: both sides renamed the same thing differently, one side's change relies on code the other side moved or deleted, duplicate imports/definitions after merging. Re-read the merged region for these.
  5. After resolving a file, git add <file> to mark it resolved.

Verify, then continue

  1. Confirm no markers remain: git diff --check and a grep for <<<<<<< across the resolved files.
  2. Sanity-check the result builds/lints/tests if a quick command exists — a clean merge that doesn't compile isn't resolved. Hand off to the lint-fix or test tooling if useful.
  3. Continue the operation: git merge --continue, git rebase --continue (repeat per replayed commit — a rebase can hit fresh conflicts on the next commit), or git cherry-pick --continue. For a plain merge, a commit completes it.

Rules

  1. Never resolve by blindly taking one side unless the user said so or the sides are truly exclusive — silent data loss is the main hazard here. When unsure which intent wins, show the user both sides and ask.
  2. Remember rebase flips ours/theirs. Don't rely on --ours/--theirs shortcuts unless you've confirmed which is which for the current operation.
  3. Don't git checkout/reset/abort to "clean up" without explicit confirmation — that can throw away the user's work. If things look wrong, explain the state and offer git merge --abort / git rebase --abort as a choice.
  4. A rebase resolves one commit at a time; after --continue, re-check status for the next conflict rather than assuming you're done.
  5. Summarize what you changed per file, which intent you preserved, and the exact command run to continue (or what's left for the user to do).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.