merge-conflicts
Skill4 starsChanged 19 days agoMITView on GitHub
Resolve a merge or rebase left half done, hunk by hunk, by the intent of each side and not by what looks right on screen; then run the repo's checks and finish the operation. Use when git leaves unresolved conflicts, when a rebase stops midway, when `<<<<<<<` markers appear in files, or when the user says they have a conflict, don't know which branch wins or have got tangled up in the merge.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- stjarnstrom/spec-systemtheir own version, first seen Oct 15, 2026
- forcedotcom/salesforcedx-vscodetheir own version, first seen Oct 8, 2026
- dimitritholen/1337-claudetheir own version, first seen Sep 23, 2026
- zznabil/lean-agent-skill-collectiontheir own version, first seen Aug 26, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- forcedotcom/salesforcedx-vscode★ 1ksame name
- zznabil/lean-agent-skill-collection★ 1same name
- dimitritholen/1337-claude★ 0same name
- stjarnstrom/spec-system★ 0same name
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 repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-repo-to-docsSkill
- adrSkill
- auth-bypass-localSkill
- before-afterSkill
- bug-huntSkill
- carry-envSkill
- code-healthSkill
- crux-doctorSkill
- crux-initSkill
- css-to-componentsSkill
- deploy-fallbackSkill
- deploy-watchSkill
- device-loopSkill
- drive-browserSkill
- e2eSkill
- end-sessionSkill
- eval-fixturesSkill
- explain-planSkill
- flowSkill
- grillSkill
- motion-videoSkill
- oauth-reauthorizeSkill
- prod-signalsSkill
- promote-to-docsSkill
- prose-checkSkill
- read-documentSkill
- render-loopSkill
- repo-mapSkill
- review-prSkill
- root-causeSkill
- runbookSkill
- security-auditSkill
- share-localSkill
- shipSkill
- skill-auditSkill
- skill-creatorSkill
- teachSkill
- ui-behaviourSkill
- ui-tellsSkill
- visual-diffSkill
- visual-testSkill
- wizardSkill
- workspaceSkill
- write-testsSkill
- x-postsSkill
The file
Files
merge-conflicts
A conflict is not resolved by reading both versions and picking the one that looks better. Both looked fine when they were written. What has to be recovered is why each one was written, and that is not in the hunk.
Never --abort. Aborting throws away the work of understanding the conflict
and leaves it the same for next time. If it truly has to be aborted, the user
decides.
1. See where you are
git status
git log --oneline --graph --left-right HEAD...MERGE_HEAD # merge
git log --oneline REBASE_HEAD # rebase
git diff --name-only --diff-filter=U # conflicted filesIn a rebase, ours and theirs are the opposite of how you read them: ours is
the branch you are rebasing onto, theirs is your commit. Checking this before
resolving anything avoids resolving the whole conflict on the wrong side.
2. Find the primary source for each side
For each conflict, find out what intent each version carried:
git log --oneline -3 <sha-of-that-side> -- <file>
git show <sha> # the full commit, with its message
gh pr list --search <sha> --state all # the PR that brought itThe commit message, the PR and the issue are worth more than the code. If the commit says "fix: the middleware loads on Edge again", that change has a reason that isn't visible in the diff and gets lost if you discard it.
If you can't find one side's intent, ask. Resolving blindly is the way to reintroduce the failure that commit fixed.
3. Resolve hunk by hunk
- Keep both intents whenever possible. Most conflicts are two compatible changes that touched neighbouring lines.
- If they are incompatible, the one that meets the declared goal of the merge wins, and the other is noted as an accepted cost.
- Don't invent new behaviour. A conflict exists so that two changes that already existed survive. Improving the code along the way goes in a separate commit.
- Generated files are not resolved by hand.
package-lock.json, Prisma clients, snapshots: they are regenerated.git checkout --ourson the file and then the command that generates it.
4. Run the repo's checks
A resolved merge compiles but doesn't work more often than it seems: each side was coherent on its own and the union isn't.
Find out what the repo checks and run it, normally in this order: typecheck,
tests, formatting. In a repo with /ship, run it.
5. Finish
git add -A && git commit # merge: don't rewrite the default message
git rebase --continue # rebase: until no commits remainIn a rebase, conflicts can appear in several commits in a row. Go back to step 1 with each one.
Adapted from the resolving-merge-conflicts skill of
mattpocock/skills, MIT license.
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.

