agentleFS
rpraharajrpraharaj/ai-engineer/skills/resolve-conflicts/SKILL.md

resolve-conflicts

Skill1 starsChanged 15 days agoMITView on GitHub

Resolve an in-progress git merge or rebase conflict hunk by hunk from each side's intent, then run this repo's checks and finish the operation. Use when git is mid-merge or mid-rebase, or the user asks to resolve conflicts. Do not invent behavior. Do not abort unless the user asks.

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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    If git is missing, stop.

    line 15
  2. Distinctive:

    Read the conflicting files and the surrounding history:

    line 26
  3. Very specific:

    Run AGENTS.md Typecheck, Test, then Lint if known.

    line 46
  4. Distinctive:

    Do not force-push unless the user asked and the branch is not a shared default branch.

    line 53

“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

Finish a merge or rebase that is already in progress. Do not start a new feature. Do not --abort unless the user explicitly asked to abandon the operation.

If git is missing, stop.

Step 1 — See the state

git status
git diff --name-only --diff-filter=U

Detect merge vs rebase (MERGE_HEAD vs REBASE_HEAD / .git/rebase-merge). If there are no unmerged paths, say so and stop (or continue an already-clean rebase if that is what status asks).

Read the conflicting files and the surrounding history:

git log --oneline --merge
git log -1 --format='%s%n%n%b' MERGE_HEAD 2>/dev/null || true
git log -1 --format='%s%n%n%b' REBASE_HEAD 2>/dev/null || true

Step 2 — Intent per hunk

For each conflict, find why each side changed (commit message, nearby PR/issue if a host CLI works, the code around the markers). Preserve both intents when they do not contradict.

Where they contradict, pick the side that matches the operation's goal (the branch being merged in, or the commit being replayed) and write the trade-off in the final report. Do not invent a third behavior that neither side had.

Step 3 — Resolve

Edit until conflict markers are gone. git add each resolved path. Do not git add . if unrelated dirty files exist.

Step 4 — Prove

Run AGENTS.md Typecheck, Test, then Lint if known. Fix breakages the merge introduced. Load engineering-bar (paths in that skill) on those fixes.

Step 5 — Finish

  • Merge: git commit only to complete the merge (use the default merge message unless this repo's log shows a different habit). Do not add extra files.
  • Rebase: git rebase --continue until the rebase completes or the next conflict. Repeat from Step 1 for the next commit.

Do not force-push unless the user asked and the branch is not a shared default branch.

Done

  1. Merge or rebase, and whether it completed
  2. Files resolved
  3. Any intent trade-off
  4. Commands run and results

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.