agentleFS
phant0umphant0um/claude-skills/skills/resolving-merge-conflicts/SKILL.md

resolving-merge-conflicts

Skill0 starsChanged 22 days agoMITView on GitHub

Use when resolving an in-progress git merge/rebase conflict. See state, find primary sources, preserve both intents, run checks, finish.

153 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use decision-mapping, setup-ts-deep-modules and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • FabienDehopreSkill

    decision-mapping

    Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.

    Also in 5 projects that use this

  • liufeng1976Skill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 30 projects that use this

  • richard12511Skill

    claude-handoff

    Hand the current conversation off to a fresh background agent that picks up the work immediately.

    Also in 30 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 34 projects that use this

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 34 projects that use this

  • LesaniSkill

    writing-fragments

    Grilling session that mines the user for fragments — heterogeneous nuggets of writing (claims, vignettes, sharp sentences, half-thoughts) — and appends them to a single document as raw material for a future article. Use when the user wants to develop ideas before imposing structure, or mentions "fragments", "ideate", or "raw material" for writing.

    Also in 34 projects that use this

The file

Files
SKILL.md

Skill: Resolving Merge Conflicts

Propósito

Resolver conflitos de merge/rebase em andamento, preservando a intenção de ambos os lados.


Quando NÃO usar

  • Sem conflito em andamento — a skill opera dentro de merge; não é revisão preventiva.
  • Conflito trivial de whitespace — resolver direto; skill é para conflitos semânticos.
  • Rebase interativo complexo — merge-conflicts cobre merge; rebase tem fluxo próprio.

Disambiguation: resolving-merge-conflicts resolve conflito em andamento; code-review previne conflitos por qualidade; merge-reconciler não existe — use resolving-merge-conflicts ou code-review.

Condições de Ativação

Ative quando:

  • Git merge/rebase em andamento com conflitos
  • /merge-conflict chamado
  • User reporta "conflict" em merge/rebase

NÃO ative para: conflitos já resolvidos; cherry-pick sem conflito.


Protocolo

1. See the current state

  • git status — identificar arquivos conflitantes
  • git log --oneline -5 — entender onde está no merge/rebase
  • Ler cada arquivo conflitante (markers << ==== >>>)

2. Find the primary sources

Para cada conflito:

  • Ler commit messages dos dois lados
  • Checar PRs e issues referenciadas
  • Entender a intenção original de cada lado
  • Por que cada mudança foi feita — não só o quê mudou

3. Resolve each hunk

  • Preservar ambas as intenções onde possível
  • Onde incompatível: escolher a que matcha o goal do merge
  • Anotar trade-off da escolha
  • NÃO inventar novo behavior — sempre resolve, nunca --abort
  • Sempre fazer resolve (nunca git checkout --theirs/ours cegamente)

4. Run automated checks

  • Typecheck
  • Test suite
  • Format/lint
  • Fix qualquer coisa que o merge quebrou

5. Finish the merge/rebase

  • git add todos arquivos resolvidos
  • git commit (merge) ou git rebase --continue (rebase)
  • Se rebase: continuar até todos commits rebased

Completion

  • Todos arquivos conflitantes identificados e lidos
  • Intenção de ambos os lados entendida (commit messages, PRs, issues)
  • Cada hunk resolvido preservando intenções onde possível
  • Trade-offs anotados para escolhas incompatíveis
  • Typecheck + test suite + format passam
  • Merge/rebase finalizado (commit ou --continue)

Failure modes

  • Blind pick: git checkout --theirs/ours sem ler o conflito → sempre resolver manualmente
  • Invent behavior: criar novo código que nenhum lado tinha → só preservar intents, não inventar
  • Abort: git merge --abort em vez de resolver → sempre resolve
  • Skip checks: não rodar typecheck/test suite → merge pode quebrar código

Self-Improvement

Após cada execução:

  1. Se mesmo tipo de conflito recorre (≥2×) → registrar padrão em 06-GENERATED/tasks/lessons.md
  2. Lições append: - YYYY-MM-DD: [merge-conflict] N arquivos, M hunks, abortado=N

Ver: hill-climb · autoresearch-loop


Restrições

  • NUNCA usar git checkout --theirs/ours cegamente — sempre resolver manualmente
  • NUNCA inventar novo behavior — só preservar intents
  • NUNCA git merge --abort — sempre resolve
  • NUNCA skip typecheck/test suite após resolver

Relacionado

  • implement — implement após merge
  • tdd — TDD pode validar merge
  • matt-pocock-skills-14-analysis — fonte original

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.