resolving-merge-conflicts
Skill8 starsChanged 2 months agoMITView on GitHub
Resolve in-progress git merge or rebase conflicts by intent traced to primary sources. Use when hit with merge conflicts, CONFLICT markers in files, rebase pauses, or when git prompts to resolve conflicted hunks — even if the user just says \"fix this merge\". Do NOT use for creating new branches or routine rebasing without conflicts.
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
5
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
- Very specific: line 16
Zero Orphaned Conflict Markers: Verify that all <<<<<<<, =======, and >>>>>>> markers are completely eliminated before staging.
- Distinctive: line 39
Action: Run git status to enumerate all conflicted files and inspect recent commit logs on both branches:
- Distinctive: line 49
Key Point: If both branches added new imports, dependencies, or routes, combine them cleanly without duplicates.
- Distinctive: line 56
Action: Run the repository's typechecker, linter, and test suite across the resolved working tree.
- Distinctive: line 57
Key Point: If tests fail, investigate whether resolving the conflict broke subtle runtime assumptions.
- Distinctive: line 64
Key Point: Check git status to ensure the working tree is clean.
“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
Resolving Merge Conflicts
Systematically resolve in-progress Git merge and rebase conflicts by identifying the semantic intent of both branches and verifying integration integrity with automated test gates.
Core Invariants
- 3-Way Intent Reconstruction: Understand the common merge-base ancestor, the incoming changes (
THEIRS), and the target branch changes (OURS) before altering conflicted code. - Never Blindly Choose Ours or Theirs: Inspect every conflict hunk individually; synthesize solutions that preserve the functional requirements of both branches.
- Zero Orphaned Conflict Markers: Verify that all
<<<<<<<,=======, and>>>>>>>markers are completely eliminated before staging. - Non-Destructive Resolution: Preserve adjacent unchanged code, comments, and docstrings; avoid accidental line deletions outside conflict hunks.
- Mandatory Post-Resolution Test Pass: Execute the full build, typecheck, and test suite before concluding the merge (
git commit) or rebase (git rebase --continue).
Architecture & Map of Content (MOC)
[ Merge/Rebase Conflict Detected ] ──► [ Identify 3-Way Merge Base & Commits ] ──► [ Hunk-by-Hunk Semantic Synthesis ] ──► [ Build & Test Gate ]| Phase | Responsibility | Verification Command | |
| Conflict Discovery | Identify all unmerged files | `git status --porcelain | grep "^UU|^AA|^DU|^UD"` |
| Ancestor Inspection | View base version of conflicted file | git show :1:<file> (Base), :2:<file> (Ours), :3:<file> (Theirs) | |
| Integration Gate | Run compiler, linter, and unit tests | Project build / test command |
Step-by-Step Procedure (TWI)
Step 1: Identify Conflicted Files and Merge Context
- Action: Run
git statusto enumerate all conflicted files and inspect recent commit logs on both branches:git log --oneline -n 5 HEAD git log --oneline -n 5 MERGE_HEAD # or REBASE_HEAD - Key Point: Determine what feature or bug fix each branch was attempting to deliver.
- Why: Understanding developer intent prevents resolving conflicts with syntax-valid but semantically broken hybrids.
Step 2: Resolve Conflicting Hunks Semantically
- Action: Open each conflicted file, analyze the diff hunks between
HEAD(Ours) and incoming (Theirs), and rewrite the block to satisfy both requirements. - Key Point: If both branches added new imports, dependencies, or routes, combine them cleanly without duplicates.
- Inline Checklist:
- All conflict markers (
<<<,===,>>>) removed - Duplicate imports and exports deduplicated
- New functionality from both branches retained
- All conflict markers (
Step 3: Verify with Build & Test Suite
- Action: Run the repository's typechecker, linter, and test suite across the resolved working tree.
- Key Point: If tests fail, investigate whether resolving the conflict broke subtle runtime assumptions.
- Why: Many merge conflicts compile cleanly but introduce logical regressions that only tests catch.
Step 4: Stage and Conclude Merge/Rebase
- Action: Stage the resolved files (
git add <files>) and complete the operation:- For merge:
git commit(preserving standard merge commit message). - For rebase:
git rebase --continue.
- For merge:
- Key Point: Check
git statusto ensure the working tree is clean. - Why: Clean conclusion ensures upstream CI pipelines can build the merged branch without human intervention.
Anti-Rationalization Guardrails
| Tempting Rationalization | Binding Rule | Engineering Rationale |
"Accept 'ours' or 'theirs' completely with git checkout --ours to be fast." | Forbidden on semantic conflicts. | Blanket checkouts overwrite valid work and revert critical bug fixes from one branch. |
| "Delete the failing test to get the merge commit through." | Fix the code to make tests pass. | Deleting tests lowers coverage and introduces regressions into production. |
| "Assume the code is fine without running the full test suite." | Mandatory test pass before committing merge. | Resolving conflicts manually frequently introduces syntax errors and broken imports. |
Other versions134 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 134
- QuivrHQ/quivr★ 40ksame name
- bestofjs/bestofjs★ 3.1ksame name
- crbnos/carbon★ 2.8ksame name
- CelestoAI/SmolVM★ 1.1ksame name
- moeru-ai/xsai★ 665same name
- nodetool-ai/nodetool★ 603same name
- stevesolun/ctx★ 583same name
- aws/graph-explorer★ 489same name
- udecode/better-convex★ 452same name
- hcloud-talos/terraform-hcloud-talos★ 362same name
124 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.
Used alongsideProjects with it also use decision-mapping, claude-handoff and 2 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
ryotaroh180105Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 26 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 31 projects that use this
simo97Skillgit-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
Also in 38 projects that use this
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-data-remediationSkill
- ai-engineeringSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- engineering-workflow-guideSkill
- git-safety-guardrailsSkill
- goalSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- j-spaceSkill
- migrate-to-shoehornSkill
- ml-best-practicesSkill
- prototypeSkill
- researchSkill
- retroSkill
- scaffold-exercisesSkill
- setup-engineering-workflowsSkill
- setup-pre-commitSkill
- setup-ts-deep-modulesSkill
- skill-conductorSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- workflow-designerSkill
- writing-beatsSkill
- writing-for-agentsSkill
- writing-fragmentsSkill
- writing-shapeSkill
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.

