resolving-merge-conflicts
Skill0 starsChanged 2 months agoMITView on GitHub
Use when a Git merge is in progress, a file has merge conflict markers, or the user asks to resolve, resume, or diagnose merge conflicts in any repository. Inspect the merge base, ours, theirs and their intent before choosing; resolve selected files incrementally, preserve unrelated changes, ask about ambiguous hunks, and run the merged checkout's build and tests before proposing an approved commit. Works with Git alone, including after an interrupted merge. For general commit/branch rules, use the `git-conventions` skill if available; follow the repository's own instructions for branch directions.
153 other projects use a version of this.
Adopted by
Most recently taken up by
- UIhoshi/AgentLogictheir own version, first seen Nov 29, 2026
- phant0um/claude-skillstheir own version, first seen Nov 29, 2026
- ctaxnagomi/agent-kd-skilltheir own version, first seen Nov 29, 2026
- mia-cx/skillstheir own version, first seen Nov 29, 2026
- karanmrn/karanagentskillstheir own version, first seen Nov 29, 2026
- karanmrn/kstacktheir own version, first seen Nov 29, 2026
Used with
Projects with it also use decision-mapping, setup-ts-deep-modules 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.
FabienDehopreSkilldecision-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
liufeng1976Skillsetup-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
richard12511Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 30 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 34 projects that use this
LesaniSkillwriting-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
LesaniSkillwriting-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
- +1 more from Lesani
Other versions153 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 153
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- mdiri-ai/SoduWork★ 9.1ksame name
- bestofjs/bestofjs★ 3.1ksame name
- crbnos/carbon★ 2.9ksame name
- CelestoAI/SmolVM★ 2.2ksame name
- moeru-ai/xsai★ 670same name
- nodetool-ai/nodetool★ 669same name
- stevesolun/ctx★ 583same name
- aws/graph-explorer★ 495same name
143 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- authoring-skillsSkill
- creating-toolsSkill
- system-diagramsSkill
- java-spring-standardsSkill
- sql-authoringSkill
- exploring-designs-with-agentsSkill
- ui-authoringSkill
- project-docsSkill
- technical-writingSkill
- coding-standardsSkill
- critical-thinkingSkill
- github-workflowsSkill
- reviewing-codeSkill
- security-practicesSkill
- software-testingSkill
- version-evolutionSkill
- angular-standardsSkill
- git-conventionsSkill
- releasing-android-appsSkill
- coordinating-agentsSkill
- masterSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run this once, when the skill loads and before its other steps.
- Very specific: line 12
Run node <skill dir>/scripts/permissions.mjs check --root <session folder> --host <claude|codex|agy>.
- Very specific: line 13
If node is missing or the command fails, say so, list the needs in <skill dir>/permissions.json and go on with the skill.
- Very specific: line 14
Read hosts.<host> in the output.
- Very specific: line 16
Run the command of the option the person chose, exactly as given.
- Distinctive: line 18
After "Skip for now", do not run this step again in the session.
- Very specific: line 35
If there is no MERGE_HEAD, report the actual state.
- Very specific: line 45
Read the neighboring code, relevant commits (git log --oneline --all -- <path>) and repository instructions.
- Very specific: line 64
If the right behavior, a binary side, a missing stage or a semantic adjustment is ambiguous, stop on that path and show base/ours/theirs …
- Distinctive: line 70
If the merge itself must be abandoned, explain the effect and request separate authorization for git merge --abort.
“Common” is measured: kept by at least 6 in 10 of the 18 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.
Files
Resolving merge conflicts
Step 0 — Permissions this skill uses
Run this once, when the skill loads and before its other steps. It keeps the session from stopping on a prompt for a command this skill is known to run. It is not a security check: the host and its hooks still decide.
- Run
node <skill dir>/scripts/permissions.mjs check --root <session folder> --host <claude|codex|agy>.<skill dir>is the folder of thisSKILL.md;<session folder>is the folder where the session started; the host is the one you run in. - If
nodeis missing or the command fails, say so, list the needs in<skill dir>/permissions.jsonand go on with the skill. - Read
hosts.<host>in the output. Show itsnoticewhen there is one. - Ask each entry of its
questionswith the host's structured question tool, in the person's language: itstext, then its options in the given order, the one markedrecommendedfirst. Low-risk and high-risk needs are separate questions; ask them separately and never recommend allowing a high-risk need. - Run the
commandof the option the person chose, exactly as given. An option without a command writes nothing. Write nothing the person did not choose. - Tell the person the
appliesline of the result: whether the change works now or after a restart. If the command fails, say so and go on. - After "Skip for now", do not run this step again in the session.
Boundary
Resolve a merge already in progress in the affected Git checkout. A request
to start a merge is a separate decision: inspect the branch and ask for its
explicit authorization first. This skill uses Git and the repository's own
instructions and runners; no workspace manager, plugin or particular host
installation is required. Do not resolve a rebase or cherry-pick
as if it were a merge (REBASE_HEAD / CHERRY_PICK_HEAD have different exits).
Inspect before editing
- In the affected checkout, run
git status --short --branch,git status,git rev-parse --git-path MERGE_HEADand check that the returned file exists. Readgit rev-parse HEAD,git rev-parse MERGE_HEAD,git ls-files -uandgit diff --name-only --diff-filter=U. If there is noMERGE_HEAD, report the actual state; if it exists but no unmerged paths remain, resume at the closing checks (not a new merge). git merge-base --all HEAD MERGE_HEADidentifies ancestry. Several bases mean the index's:1:may be Git's virtual base: inspect each base withgit show <base>:<path>where present, and ask if their intent is unclear. With one base,git show :1:<path>is the index base. For each unmerged path inspectgit ls-files -u -- <path>andgit show :2:<path>(ours, current branch) /git show :3:<path>(theirs, incoming branch); a missing stage denotes add/delete and cannot be selected as a file. Binary paths need explicit evidence for retaining an intact side or deleting the file.- Read the neighboring code, relevant commits (
git log --oneline --all -- <path>) and repository instructions. Identify what each side intended, including a rename or a deletion; never choose a whole side just because it is shorter. Inventory cleanly merged files that depend on the conflict, plus pre-existing staged, unstaged and untracked work. Name foreign work before any edit; do not overwrite, stash, reset, clean or stage it.
Resolve in small, reversible steps
- For an unambiguous path, edit only that path to integrate both intents;
preserve encoding, line endings and executable mode. A justified intact-side
selection for a binary or add/delete conflict still needs the user's intended
result. Check
git diff --check -- <path>, inspect the file and stage only this resolved path withgit add -- <path>(orgit rm -- <path>for a justified deletion). Never stage all files withgit add .. - A subset is enough: rerun
git ls-files -uandgit statusafter each application. Record what was resolved, what remains and what was untouched; the index plusMERGE_HEADare the resume state after an interruption. Resolve another path later without reapplying work already staged. - If the right behavior, a binary side, a missing stage or a semantic adjustment
is ambiguous, stop on that path and show base/ours/theirs with the
consequence of each plausible choice. Wait for the person's written decision;
leave
MERGE_HEAD, index and files intact. You may continue independent, unambiguous paths first. To change a cleanly merged related file, inspect its staged and worktree versions and establish ownership before editing/staging it. - If the merge itself must be abandoned, explain the effect and request separate
authorization for
git merge --abort; never use it as an automatic recovery.
What a clean auto-merge can still break
Git reporting no conflict does not make the result right.
- An auto-merge can drop an import, a parameter or a method from one side, duplicate a block that the other side moved, or accept a rename on one branch and new calls to the old name on the other. Build the merged tree even when no path conflicted: the compiler is the only detector.
- With crossed bases, a merge can bring back, with no conflict, something one branch deleted. Review the deletions by hand.
- Markers may already be committed in either branch, from an earlier merge or a stash pop. Look for them before trusting the result:
git grep -n -e '^<<<<<<< ' -e '^>>>>>>> ' -- . git checkout --ours -- <path>(or--theirs) leaves the path unmerged: it still needsgit add -- <path>.- Normalize line endings on both sides before measuring one against
:2:or:3:: a CRLF/LF difference makes every line look changed.
Close only after checking the merged checkout
git ls-files -umust be empty;git diff --checkandgit diff --cached --checkmust pass. Readgit status,git diff --cached --statandgit diff --cachedfor the whole merge, including changes Git staged automatically. Identify any unrelated staged files and unstaged/untracked work; do not include somebody else's work. The test runner reads the worktree: if it differs materially from the staged merge, reconcile your own changes and pause on foreign changes rather than claiming the staged result was tested.- Discover the versioned build and test commands of the destination repo (its pipeline, package scripts, wrapper or instructions). Run both on this merged checkout, not on the source branch. If a command is undeclared or cannot run, report the blocker and leave the merge open. If a failure is claimed pre-existing, demonstrate it with the same command on an untouched base separately; do not discard the merge to test that claim. After fixes, rerun affected checks and inspect status and index again.
- Propose the exact included paths, one-line message and results of both
commands. Ask the person to approve the merge commit; do not create it while
awaiting approval. Once explicitly approved, recheck
MERGE_HEAD, branch,git ls-files -uand staged paths, then commit with normal hooks (no--no-verify, amend or push). If state changed, stop and re-inspect instead of using a stale approval. Report the new commit or, if still pending, the remaining paths and next action.
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
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.

