agentleFS
marinvchmarinvch/Cortex/skills/resolve-conflicts/SKILL.md

resolve-conflicts

Skill1 starsChanged 18 days agoMITView on GitHub

Resolve a merge conflict or a stuck rebase hunk by hunk, by each side's intent, and finish the merge. Never aborts. Triggers — "resolve these conflicts", "the rebase is stuck", "CONFLICT (content)".

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use worktree, worktrees and 10 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.
  • MicrosoftSkill

    worktree

    Create, reuse or clean up a dedicated git worktree for working on a pull request or a private branch. Use from any PR-scoped workflow that needs an isolated checkout to keep current code and build output untouched.

    Also in 5 projects that use this

  • nilecuiSkill

    worktrees

    Guide for using git worktrees to parallelize development with coding agents. Use this skill when the user requests to work in a new worktree or wants to work on a separate feature in isolation (e.g., "Work in a new worktree", "Create a worktree for feature X").

    Also in 3 projects that use this

  • johnlindquistSkill

    diagram

    Maintain and synchronize Unified Impact Diagrams following Diagram Driven Development (DDD) methodology. Create, update, and manage diagrams that connect user value to technical implementation.

    Also in 3 projects that use this

  • nicolasestremSkill

    document

    Create focused documentation for specific components or features

    Also in 3 projects that use this

  • AWSSkill

    wizard

    Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

    Also in 4 projects that use this

  • sunnyclinches44Skill

    explain

    Explains code using real-world analogies and ASCII diagrams

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 3

    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. Distinctive:

    If you cannot say what a side was trying to do, do not resolve that hunk.

    line 33
  2. Distinctive:

    When they cannot,: keep the one that serves the purpose from step 1, and state what the other side loses.

    line 41
  3. Very specific:

    Before leaving a file, search it for <<<<<<<, ======= and >>>>>>>.

    line 47
  4. Distinctive:

    Do not abort. If a conflict truly cannot be resolved, stop with the conflict still in place and hand it back to the user with what you …

    line 61

“Common” is measured: kept by at least 6 in 10 of the 16 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 — keep what each side meant, then finish

Each side of a conflict was written to achieve something. The resolution has to keep both of those aims, or drop one on purpose and say so. The two ways this goes wrong are choosing whichever side reads more cleanly, and running --abort, which throws away the work in progress.

1. Establish what is being merged, and why

git status
git log --oneline --graph -20
git diff --name-only --diff-filter=U     # the files still in conflict

Work out which branch is going into which, and what the merge is meant to achieve. That purpose settles every case below where both sides cannot be kept.

2. Find out what each side intended

For every conflicting hunk, read why each side changed it: git log -p --merge -- <file> for the commits involved, then their PRs and linked issues. If the repo has a CONTEXT.md or ADRs (see [[define-terms]]), check the hunk against them. When one side breaks a recorded decision, that side is wrong; do not meet it halfway.

If you cannot say what a side was trying to do, do not resolve that hunk. Say which one it is and ask.

3. Resolve, hunk by hunk

Go file by file and hunk by hunk.

  • Keep both aims when they can coexist. This is the usual case.
  • When they cannot, keep the one that serves the purpose from step 1, and state what the other side loses.
  • Write no new behaviour. The result is one side, the other, or both combined. If the correct code is something neither side wrote, resolve the conflict first and make that change as a separate commit afterwards.

Before leaving a file, search it for <<<<<<<, ======= and >>>>>>>.

4. Run the repo's checks

Find the checks the project runs (the scripts in its manifest, its CI workflow, its AGENTS.md) and run them: usually the type check, then the tests, then the formatter. A merge that does not build is not resolved. Fix what the merge broke and nothing beyond it.

5. Complete the operation

Stage the resolved files and commit, following the repo's own conventions for hooks and for how changes reach the default branch. During a rebase, run git rebase --continue and go back to step 1 for each commit that stops, until the rebase finishes.

Do not abort. If a conflict truly cannot be resolved, stop with the conflict still in place and hand it back to the user with what you found. Abandoning the merge is their decision.

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.