agentleFS
Lethe044Lethe044/agentskill-kit/skills/git-conflict-resolver/SKILL.md

git-conflict-resolver

Skill50 starsChanged 21 days agoMITView on GitHub

Resolves git merge and rebase conflicts by reading both sides, keeping the intent of each change and verifying the result with tests. Use when a merge, rebase or cherry-pick stops with conflict markers, or when the user asks how to fix conflicts safely.

2 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

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    See the scope: Run git status and list the files marked as both modified.

    line 24
  2. Very specific:

    Remove every marker: Run git grep -n -E '^(<<<<<<<|=======|>>>>>>>)' and expect no output.

    line 34
  3. Distinctive:

    Verify: Run the build and the tests.

    line 35
  4. Very specific:

    Do not use git checkout --theirs .

    line 41
  5. Distinctive:

    Do not force push after a rebase on a shared branch without telling the user.

    line 42
  6. Distinctive:

    If the intent of one side is unclear, ask the user or the author of the change instead of guessing.

    line 52

≈ “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

Git conflict resolver

A conflict means two people changed the same lines. The goal is to keep what both wanted, not to make the markers disappear.

When to use

  • git merge, git rebase or git cherry-pick stops with "CONFLICT".
  • A file contains <<<<<<<, ======= and >>>>>>> markers.
  • The user is unsure whether to keep "ours" or "theirs".

Steps

  1. See the scope. Run git status and list the files marked as both modified. Note whether this is a merge or a rebase, because "ours" and "theirs" swap meaning during a rebase.
  2. Understand both changes. For each file, run git log --merge -p -- <file> or compare the two branches, and write one sentence for what each side was trying to do.
  3. Resolve by intent. Combine the changes when both are needed. Pick one side only when the other is obsolete, and say why. Never delete a side silently.
  4. Handle special files.
    • Lock files and generated files: do not edit by hand. Take one side, then regenerate with the package manager.
    • Renames and deletes: check git status for "deleted by us" or "deleted by them" and decide on purpose.
    • Whitespace-only conflicts: keep the project's formatter output.
  5. Remove every marker. Run git grep -n -E '^(<<<<<<<|=======|>>>>>>>)' and expect no output.
  6. Verify. Run the build and the tests. A conflict that compiles can still be wrong.
  7. Finish. git add <files>, then git merge --continue or git rebase --continue. If it went badly, git merge --abort or git rebase --abort returns to the starting point.

Rules

  • Do not use git checkout --theirs . or --ours . on the whole tree.
  • Do not force push after a rebase on a shared branch without telling the user.
  • Show the user the resolved hunks for any file where behavior changed.

Example

Both branches edited a function. One added a timeout parameter, the other renamed a variable. The resolution keeps the rename and the new parameter, and the test that covers the function is run before git add.

Errors

If the intent of one side is unclear, ask the user or the author of the change instead of guessing.

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.