agentleFS
selamy-labsselamy-labs/agent-skills/skills/merge-conflict-discipline/SKILL.md

merge-conflict-discipline

Skill0 starsChanged 8 days agoMITView on GitHub

Resolve merge conflicts by intent (never blind accept-ours/theirs) AND prevent them structurally — integrate, never clobber.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    They updated it differently from you: ask the same *why*; reconcile by INTENT — combine both where compatible.

    line 20
  2. Distinctive:

    If you keep hitting real overlap, ask: are we not using best practices — a consistent formatter?

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

merge-conflict-discipline

The core rule: respect every change up to this point WHILE contributing your own — integrate, never clobber. Blind accept-ours/accept-theirs is almost always wrong; it silently discards someone's intent. Deep thought is required only on LEGIT overlap (both sides touched the same thing for incompatible reasons).

This skill has two halves: resolution (a conflict is here now) and prevention (stop them recurring).

PART A — RESOLUTION (semantic, intent-first)

  1. Understand the intent of BOTH sides first. Hardest when you authored neither. Use the 3-way view — ours / theirs / common ANCESTOR (git config merge.conflictstyle zdiff3). Get the why: read the commit message, PR, issue, and author for the other side. "Get more context into why they deleted it" before you re-add it.
  2. Clean text merge ≠ correct merge. Git cannot detect a SEMANTIC conflict — when one branch's intent isn't applied to lines the other branch added. A textually clean merge can be logically broken. Resolution always ends by re-running build + the full test suite. "It merged cleanly" is not done.
  3. Decision frameworks for legit overlap:
    • They deleted what you meant to change (it's gone in latest): find out WHY it was deleted; confirm retaining it isn't at odds with the platform/north-star direction; then re-add, adapt, or drop your change. Default to the platform direction over local intent.
    • They updated it differently from you: ask the same why; reconcile by INTENT — combine both where compatible; if truly mutually exclusive, pick the one serving the north-star. Then ask the prevention question: why did we collide here at all?
    • Both added independent edits (the classic third case): standard 3-way integrate-both.
  4. Feed conflicts back into prevention. A conflict CLASS that recurs is a signal, not bad luck — add a prevention control (below) so it can't recur (regression-ratchet discipline).

PART B — PREVENTION (legit overlap is usually a design/hygiene smell)

If you keep hitting real overlap, ask: are we not using best practices — a consistent formatter? canonical sorting? leaning on open source enough?

  • Deterministic formatters, fleet-wide (prettier / gofmt / ruff / black / buildifier / …): canonical layout → minimal diffs → fewer collisions. Enforce as a REQUIRED CI check so every PR arrives pre-canonicalized.
  • Canonical / alphabetical sorting of imports, deps, enums, lists, config keys. Combine with one-item-per-line + a magic trailing comma so additions are appends, not line-edits two people fight over.
  • Custom merge drivers via .gitattributes for trivial/generated classes (lockfiles: pnpm/poetry/composer, generated code) → auto-resolve the busywork.
  • Modular design (SRP, small focused files, "things that change together live together") → fewer same-section edits. Repeated overlap in one file is a structural signal to split it.
  • Short-lived branches: small frequent PRs + frequent rebase off main → conflicts stay small and incremental.

DONE means

Build + tests green after resolution (not just "merged clean"); the resolution preserved both intents (or chose the north-star one deliberately, with the why recorded); and if the conflict class recurred, a prevention control was added.

Sources: git-scm gitattributes; semantic-conflict awareness (Fowler); standard merge-prevention practice.

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.