resolving-merge-conflicts
Skill73 starsChanged 11 days agoMITView on GitHub
Use when you need to resolve an in-progress git merge/rebase conflict. Do not use for ordinary code or test failures without unmerged Git paths.
138 other projects use a version of this, 117 of them edited.
Adopted by
Most recently taken up by
- The-Vibe-Company/quivredited, first seen Nov 8, 2026
- dfirmin/compassedited, first seen Nov 8, 2026
- kazemcodes/skill-treeedited, first seen Nov 8, 2026
- ValorVie/custom-skillsedited, first seen Nov 8, 2026
- Tresnanda/kybernedited, first seen Nov 8, 2026
- HarryMtv/create-frontstackedited, first seen Nov 8, 2026
Used with
Projects with it also use setup-ts-deep-modules, decision-mapping and 8 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.
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 28 projects that use this
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
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 33 projects that use this
ryotaroh180105Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 28 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 32 projects that use this
simo97Skillmigrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Also in 35 projects that use this
Other versions138 projects use a version of this.
Word for word · 0
None found.
Edited · 117
- QuivrHQ/quivr★ 40k34% same
- The-Vibe-Company/quivr★ 40k34% same
- bestofjs/bestofjs★ 3.1k34% same
- crbnos/carbon★ 2.8k34% same
- CelestoAI/SmolVM★ 1.2k33% same
- moeru-ai/xsai★ 66734% same
- aws/graph-explorer★ 49034% same
- hcloud-talos/terraform-hcloud-talos★ 36234% same
- ninehills/skills★ 28034% same
- loulanyue/skills★ 23134% same
107 more not listed
Wrote their own version · 21
- nodetool-ai/nodetool★ 615same name
- stevesolun/ctx★ 583same name
- WenWuZhiDao/mattpocock-skills-zh★ 27same name
- PracticalSwan/agent-skills★ 22same name
- svyatov/supermatt★ 20same name
- axiomantic/spellbook★ 11same name
- imMamdouhaboammar/matts-skills-into-chatgpt★ 8same name
- Boom-Vitt/skills-thai★ 5same name
- leek/agent-skills★ 5same name
- dekoza/oh-my-slop★ 4same name
11 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 repository42 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- folder-level/CLAUDE.mdCLAUDE.md
- absorb-packSkill
- agent-authoringSkill
- agent-dispatchSkill
- align-intentSkill
- auto-choiceSkill
- brainstormSkill
- cavemanSkill
- check-my-stackSkill
- debuggingSkill
- domain-modelingSkill
- e2e-contractSkill
- e2e-explore-then-batchSkill
- e2e-routeSkill
- figma-context-budgetSkill
- find-skillsSkill
- gate-authoringSkill
- github-repo-researchSkill
- grill-meSkill
- grill-with-docsSkill
- handoff-implSkill
- implementSkill
- model-onboardSkill
- mutation-testingSkill
- prototypeSkill
- receiving-code-reviewSkill
- research-before-answerSkill
- review-implementSkill
- review-methodSkill
- review-zhSkill
- skill-creatorSkill
- strategic-compactSkill
- tddSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- wayfinderSkill
- wizardSkill
- workflow-hardeningSkill
- write-pr-descriptionSkill
- zoom-outSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this workflow only while Git reports unmerged paths.
- Distinctive: line 22
Keep the list of conflicted paths it reports.
- Distinctive: line 66
Finish the merge/rebase: Commit the completed merge.
“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.
Files
<!-- 本檔在契約測試底下:bash ~/.claude/skills/resolving-merge-conflicts/scripts/tests/resolving-merge-conflicts-contract.test.sh -->Resolving Merge Conflicts
Use this workflow only while Git reports unmerged paths; ordinary code or test failures belong elsewhere.
- Start with a compact summary of the in-progress merge/rebase and every unresolved path.
python3 ~/.claude/skills/resolving-merge-conflicts/scripts/extract_conflict_context.py --repo .Keep the list of conflicted paths it reports; step 7 reviews each of them after they are resolved. If the list is lost once files are staged, git merge-tree --write-tree --name-only HEAD MERGE_HEAD prints it again (or git merge-tree --write-tree --name-only HEAD^1 HEAD^2 when inspecting an already-committed merge).
- Find the primary sources for each conflict. Understand why each change was made and what the original intent was. Read the commit messages, check the PRs, and check original issues/tickets.
- Inspect one conflicted file at a time.
python3 ~/.claude/skills/resolving-merge-conflicts/scripts/extract_conflict_context.py --repo . --file <path>Use the compact hunk or index-stage output first. Read the full file only when the compact output is insufficient to preserve the surrounding behavior or intent. For binary, rename, or submodule conflicts, a missing text preview is not sufficient evidence: inspect the relevant index stages, object modes or commits, and history before choosing a resolution.
- Resolve that file. Preserve both intents where possible. Where they are incompatible on a user-visible behavior (for example, one side narrows, disables, or reverses a behavior the other side added), do not silently drop one side's behavior to satisfy the other side's new test or comment—record the behavioral trade-off so step 7 surfaces it to the user. Do not invent new behavior. Always resolve; never
--abort. Stage that file alone withgit add -- <path>orgit rm -- <path>. - Re-check unresolved conflicts after each file.
python3 ~/.claude/skills/resolving-merge-conflicts/scripts/extract_conflict_context.py --repo .
git diff --name-only --diff-filter=URepeat Steps 2–5 until both commands report no unresolved paths.
- Discover the project's automated checks and run them—typically typecheck, tests, then format. Fix anything the merge broke, and verify no conflict markers remain in resolved text files.
- Review every conflicted file for a side whose change disappeared. Green checks do not cover this: a resolution that keeps one side's refactor and drops the other side's addition stays green whenever nothing tested that addition. Build the three-diff bundle (base to ours, base to theirs, and base to the result) and run the mechanical checks with
prepare_merge_review.py:
# In-progress merge after staging resolved files (MERGE_HEAD present):
python3 ~/.claude/skills/resolving-merge-conflicts/scripts/prepare_merge_review.py --repo . --staged --out /tmp/merge-review-bundle.txt
# Already-committed merge or delegated worker handoff (computes conflicts from HEAD^1 and HEAD^2):
python3 ~/.claude/skills/resolving-merge-conflicts/scripts/prepare_merge_review.py --repo . --commit HEAD --out /tmp/merge-review-bundle.txt(In a rebase where REBASE_HEAD is active instead of a two-parent merge, compute base=$(git merge-base HEAD REBASE_HEAD) and produce git diff "$base" HEAD -- <path>, git diff "$base" REBASE_HEAD -- <path>, and git diff --cached "$base" -- <path> for each path from step 1.)
A file whose conflicts were all mechanical (translation dictionaries, lockfiles, a changelog, or a manifest where only version changed) is checked by a script, not an agent: every key or entry either side added is present in the result, and a key both sides changed or a manifest that also modified scripts or dependencies is kept in REVIEW_FILES_COUNT rather than exempted by filename. Lockfiles are regenerated from the merged manifests rather than checked entry by entry. When REVIEW_FILES_COUNT > 0, give both BUNDLE_PATH and BUNDLE_TOTAL_LINES to a fresh reviewer agent with no conversation context, one file per item, and instruct the reviewer to read BUNDLE_PATH continuously from line 1 through BUNDLE_TOTAL_LINES (starting with limit: 800, and if any Read fails due to token/size limits, never advance offset—retry at the same offset with a smaller limit and continue from the last line actually read so no lines are skipped), requiring one of three verdicts per file:
PASS— every hunk from bothoursandtheirsis preserved, or a hunk was replaced by a structural refactor that keeps the same user-visible behavior on both sides.MISSING— a hunk, parameter, or call fromoursortheirsdisappeared by accident with no conflict trade-off (restore it and re-run step 6).DIVERGENCE— a user-visible behavior fromoursortheirswas narrowed, disabled, or reversed inresult(even when the winning side's code, comment, or test explains why that side wanted the restriction). One side's comment or test proves that side's intent, not that the user chose it over the other side's behavior.
Reading BUNDLE_PATH in the resolving session does not substitute for the fresh reviewer even when REVIEW_FILES_COUNT is 1 or the bundle is short, because the resolver already expects its resolution to be complete. Whether main resolves the merge directly or receives a commit from a delegated worker that cannot spawn subagents, main must obtain that fresh reviewer's per-file verdicts, fix every MISSING item (then re-run step 6), and surface every DIVERGENCE item to the user for a decision before the merge counts as done. Done when every conflicted path has a script or fresh-reviewer verdict, each MISSING hunk is restored, and each DIVERGENCE has the user's explicit decision. Proceed to step 8.
- Finish the merge/rebase. Commit the completed merge. If rebasing, continue until every commit is rebased, repeating the workflow for each new conflict stop.
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.

