agentleFS
vadimvitvickiyvadimvitvickiy/vv-agent-kit/skills/resolving-conflicts/SKILL.md

resolving-conflicts

Skill0 starsChanged 50 days agoMITView on GitHub

Use when a merge, rebase or cherry-pick stops on a conflict, or when integrating a branch across a rename, move or other refactor made on the other side.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Look for a refactor: R, a D beside an A, a deleted file, a subject saying rename, extract, move or replace.

    line 23
  2. Very specific:

    Do the same for "$fork"..HEAD — when your branch refactored, the base may have gained code in the old shape.

    line 25
  3. Very specific:

    Use git -c merge.conflictStyle=zdiff3 <merge|rebase> ….

    line 30
  4. Very specific:

    Leave no broken commit for a later bisect.

    line 67
  5. Distinctive:

    Adapting one side takes more change than that side made: stop and say so. That is work to redo on top of the refactor, and the human …

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Resolving conflicts

A conflict is two intents meeting, not two texts. Picking a side per line, or pasting both halves, produces code neither author wrote. Work out what each side meant, and write code that does both.

The hard case is a refactor on one side: it causes the hardest conflicts, and also breaks code git merges without a word.

Read what the other side did first

fork=$(git merge-base <base> HEAD)
git log --oneline "$fork"..<base>
git diff -M --name-status "$fork" <base>
  • Look for a refactor: R, a D beside an A, a deleted file, a subject saying rename, extract, move or replace. Write down each old name with its new one.
  • Do the same for "$fork"..HEAD — when your branch refactored, the base may have gained code in the old shape.

Know which side is which

Use git -c merge.conflictStyle=zdiff3 <merge|rebase> …. The middle part, after |||||||, is the common ancestor: middle→top is one side's change, middle→bottom the other's.

OperationTop (HEAD)BottomThe incoming commit
Merging the base into a branchthe branchthe baseMERGE_HEAD
Rebasing a branch onto the basethe base, plus the commits replayed so farthe commit being replayedREBASE_HEAD
Cherry-pickingthe current branchthe picked commitCHERRY_PICK_HEAD

A rebase swaps the sides. "Ours" there keeps the base and drops your change.

Resolve onto the refactored side

  • Find the refactor's commit: git log -p "$fork"..<base> -- <file>, or git log -S'<old name>' "$fork"..<base>.
  • Start from the refactored side and re-apply the other side's intent in the new shape — new name, signature, location. Restoring the old shape to make a hunk fit leaves two conventions.
  • Follow moved code. The change goes where the code lives now, maybe a file with no markers. A file the other side deleted or moved is not re-added at its old path.
  • Unclear resolution: stop and ask. A guessed resolution reads as deliberate in every later diff.

A clean merge can still be wrong

Git compares text. A new call to a renamed function, a subclass of a moved type, a file in a deleted directory — none conflict, all break. In a scratch repo, a new file calling a renamed function passed both merge and rebase without a conflict and failed on import.

  • For every old name on your list: git grep -n '<old name>'. Every hit outside comments and changelogs is code to update, whichever side wrote it.
  • Then build and test the integrated tree — vvkit:verifying-changes. The grep finds renames only, not a changed default, a reordered argument, a call that now happens twice.
OperationThe fix lands in
MergeThe merge commit itself — merge with --no-commit, so the merge commit builds
RebaseThe branch commit it belongs to: git commit --fixup <commit>, then GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <base>
  • Leave no broken commit for a later bisect. git rebase --exec '<build command>' <base> stops at the first commit that fails to build.
  • Adapting one side takes more change than that side made: stop and say so. That is work to redo on top of the refactor, and the human decides.

Source for the term: Martin Fowler, "SemanticConflict".

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.