agentleFS
fmindfmind/dot/skills/resolve-conflicts/SKILL.md

resolve-conflicts

Skill10 starsChanged 56 days agoMITView on GitHub

Resolve Git merge or rebase conflicts by both sides' intent; verify the result.

  • Deletes or force-pushes
  • Commits and pushes

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

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Prove it: Run the repository's owning gate (e.g.

    line 40
  2. Distinctive:

    Stop when unsure: if intent cannot be recovered from history, ask the user for the decision.

    line 49

“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

Resolve Conflicts

Finish a stopped git merge or git rebase by understanding what each side meant, not by picking a side. If the operation targets the wrong base or cannot safely continue, preserve existing resolutions and report the problem before an authorized abort; aborting can discard conflict-resolution work. Never "take ours" unless history shows the incoming change is obsolete.

Workflow

  1. Map the state: identify which operation stopped, the current and incoming commits, and every conflicted file before editing.
    git status --short                    # UU both modified; AU, UA, DU, UD: added or deleted on one side
    git diff --name-only --diff-filter=U
    git rev-parse -q --verify MERGE_HEAD  # merge only
    git rev-parse -q --verify REBASE_HEAD # rebase only
  2. Read both intents: inspect the available index stages and operation-specific history before touching a hunk. Add/delete conflicts legitimately lack one or more stages; a missing stage is evidence, not a reason to restore a deleted file. During a rebase, ours is the branch being rebased onto and theirs is the commit being replayed.
    git show :1:<file>                    # common ancestor
    git show :2:<file>                    # ours; rebase target during a rebase
    git show :3:<file>                    # theirs; replayed commit during a rebase
    git log --merge --oneline -- <file>   # both sides' commits touching the file; Git 2.45+ also covers rebase, cherry-pick, revert
    git show REBASE_HEAD -- <file>        # rebase: the commit currently being replayed
  3. Resolve semantically: write the code that satisfies both intents (renamed function plus new caller, both new tests, merged config keys). When intents are incompatible, keep the one matching the merge's goal and record the trade-off in the commit body. Do not invent new behavior, and remove every <<<<<<<, =======, >>>>>>> marker.
  4. Continue: stage the resolved files and resume; repeat per commit during a rebase.
    git add <file>...
    git rebase --continue   # or: git merge --continue
  5. Prove it: Run the repository's owning gate (e.g. mise run all); when the tree carries unrelated changes, apply the dirty-tree rule. Fix what the merge broke before pushing.
  6. Push only when already authorized: a rewritten private branch may need git push --force-with-lease; resolving conflicts alone does not authorize that history update, and never force-push a shared branch (main, or one others build on), merge into it instead.

Gotchas

  • Show the ancestor: git config merge.conflictStyle zdiff3 puts the base version inside the markers so both sides' edits are visible.
  • Regenerate lockfiles and generated code: resolve source manifests first, use either generated side only as a starting point, then run uv lock or the owning generator and review the regenerated diff.
  • Investigate one-sided deletions first: DU or UD means one side removed the file; find out why before restoring it.
  • Enable rerere from the rebase start: the same hunk can conflict on several commits. Start the rebase with git -c rerere.enabled=true rebase <base> and repeat the -c on every --continue; enabling it only at --continue does not record the conflict already stopped on. Either form creates $(git rev-parse --git-path rr-cache), which keeps rerere active while rerere.enabled is unset, so remove that directory afterwards if it did not exist before. Persisting rerere through git config or that directory changes repository configuration and needs consent.
  • Stop when unsure: if intent cannot be recovered from history, ask the user for the decision; contacting the author requires authorization.

Documentation

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.