resolve-merge-conflicts
Skill1 starsChanged 2 months agoMITView on GitHub
Use when git merge, rebase, or cherry-pick halts on conflict markers, unmerged paths, or merge conflicts in source files or lockfiles.
- Deletes or force-pushes
12 other projects use a version of this.
Adopted by
Most recently taken up by
- warpdotdev/common-skillstheir own version, first seen Oct 20, 2026
- Ronnasayd/aipptheir own version, first seen Oct 20, 2026
- Ionate-Technologies/indium-agentkittheir own version, first seen Oct 20, 2026
- zhouycheng/skillstheir own version, first seen Oct 13, 2026
- stealth-factory/skillstheir own version, first seen Oct 13, 2026
- tejastn10/workbenchtheir own version, first seen Oct 13, 2026
Used with
Projects with it also use diagnose-ci-failures, write-product-spec and 6 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.
zerx-labSkilldiagnose-ci-failures
Diagnose CI failures for a PR using the GitHub CLI, extract error logs, and generate a plan to fix them. Use when the user asks to check CI status, pull CI issues, triage test failures, or investigate PR build failures.
Also in 3 projects that use this
zerx-labSkillwrite-product-spec
Write a PRODUCT.md spec for a significant user-facing feature in Zap, focused on detailed behavior and validation. Use when the user asks for a product spec, desired behavior doc, or PRD, wants to define feature behavior before implementation, or when the feature is substantial or behaviorally ambiguous enough that a written spec would improve implementation or review.
Also in 3 projects that use this
charlesmatteSkillwrite-tech-spec
Generate a technical specification document from an existing PRD through relentless technical interview and codebase exploration. Use when user wants to write a tech spec, technical specification, technical design document, TDD (technical design doc), or go deeper on the technical details of a PRD.
Also in 3 projects that use this
gitpod-ioSkillfix-errors
Guidelines for fixing unhandled errors from the VS Code error telemetry dashboard. Use when investigating error-telemetry issues with stack traces, error messages, and hit/user counts. Covers tracing data flow through call stacks, identifying producers of invalid data vs. consumers that crash, enriching error messages for telemetry diagnosis, and avoiding common anti-patterns like silently swallowing errors.
Also in 3 projects that use this
busybutlazySkillupdate-skill
Use this skill when the user wants to modify an existing public skill in this repository's canonical-skills, revise its workflow, or update its package metadata and version.
Also in 3 projects that use this
DockerSkillreview-pr
Review one or more incoming Docker documentation pull requests as a maintainer. Independently validate technical claims, assess editorial fit and information architecture, choose a verdict, and draft exact inline or PR-wide feedback behind a confirmation gate. Use for requests such as "review PR 123", "is this PR correct?", "does this information belong here?", "validate this PR", or "help review backlog PRs". Do not use to maintain or fix a PR you own; use maintain-pr for that.
Also in 3 projects that use this
- +2 more from zerx-lab
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- github/gh-aw★ 5.6ksame name
- zerx-lab/warp★ 2.1ksame name
- zerx-lab/zap★ 2.1ksame name
- warpdotdev/common-skills★ 630same name
- Indium-AI-Labs/indium-agentkit★ 18same name
- Ionate-Technologies/indium-agentkit★ 17same name
- stealth-factory/skills★ 5same name
- igorkulman/pi-skills★ 3same name
- khgouldy/skills★ 1same name
- Ronnasayd/aipp★ 1same name
2 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 repository17 other files it gives its agents.
- check-drySkill
- check-testsSkill
- create-commit-messageSkill
- create-unit-testsSkill
- deslop-proseSkill
- deslopSkill
- fanout-reviewSkill
- fix-security-auditSkill
- framework-upgrade-guideSkill
- generate-adrSkill
- learnSkill
- optimizeSkill
- pr-descriptionSkill
- security-checkSkill
- ship-itSkill
- takeawaysSkill
- update-claude-mdSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 14 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Distinctive: line 47
Run git status to determine:
- Very specific: line 50
If in a rebase, note the rebase target (onto) and the commit being applied.
- Distinctive: line 63
Run the package manager's install command to recalculate the lockfile graph deterministically:
- Distinctive: line 69
Verify the lockfile updated cleanly and stage both the manifest and the lockfile.
- Distinctive: line 85
If both added imports or dependencies, keep both (sorted, deduplicated).
- Distinctive: line 86
If one updated a function signature and the other added call sites, update the call sites to match the new signature.
- Distinctive: line 87
If both edited the same configuration block, merge keys without dropping either side's new settings.
- Very specific: line 88
Remove all conflict markers (<<<<<<<, =======, >>>>>>>).
- Distinctive: line 95
Check for leftover markers:
- Distinctive: line 99
If any marker remains, Git prints the file and line number.
- Distinctive: line 100
Run language typechecking and linting:
- Distinctive: line 105
Run affected test suites to verify that both features still work together.
- Distinctive: line 117
Ensure no unmerged paths remain.
- Distinctive: line 119
If merging: git commit (or git merge --continue).
- Distinctive: line 122
If rebasing across multiple commits, repeat Steps 1 to 5 for each conflicting commit until the rebase completes.
“Common” is measured: kept by at least 6 in 10 of the 12 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
Resolve Merge Conflicts
Overview
A merge conflict occurs when two branches make conflicting assumptions about the same lines or files. Resolving a conflict means understanding the intent of both changes, reconciling them into a coherent whole, and verifying syntactic and semantic correctness before continuing.
When to Use
Use this skill when:
- Git stops during
merge,rebase,cherry-pick, orstash popwithCONFLICT (content)or unmerged paths. - Files contain conflict markers (
<<<<<<<,=======,>>>>>>>). - Machine-generated lockfiles (
package-lock.json,pnpm-lock.yaml,Cargo.lock) conflict after dependency updates. - Git status reports unmerged paths (
UU,AA,UD,DU).
Quick Reference
| Task | Command | Caveat |
| List unmerged files | git status --short (look for UU, AA, UD) | Run first before touching code |
| Show conflict markers | git diff --check | Detects leftover <<<<<<< markers |
| View 3-way diff | git diff | Shows conflict blocks with local vs incoming |
| View base, ours, theirs | git show :1:<file> (base), :2:<file> (ours), :3:<file> (theirs) | Inspect original shared ancestor |
| Stage resolved file | git add <file> | Only after verifying syntax and tests |
| Continue operation | git merge --continue or git rebase --continue | Never commit directly during rebase |
| Abort safely | git merge --abort or git rebase --abort | Returns working tree to clean pre-op state |
The Rebase Inversion Trap
The meaning of --ours and --theirs depends on the operation:
| Operation | HEAD represents | --ours refers to | --theirs refers to |
git merge | Current branch | Current branch (target) | Incoming branch (source) |
git rebase | Upstream target commit | Upstream branch (rebase target) | Your feature branch (commit being replayed) |
In a rebase, Git checks out the upstream target and replays feature commits on top. Running git checkout --ours during a rebase discards your feature branch changes and retains upstream. Running git checkout --theirs keeps your feature branch and discards upstream.
Resolution Protocol
Step 1: Identify and Orient
- Run
git statusto determine:- Operation type: merge, rebase, cherry-pick, or revert.
- List of unmerged paths.
- If in a rebase, note the rebase target (
onto) and the commit being applied. - Identify file categories:
- Source code files (require surgical reconciliation).
- Lockfiles and generated files (require manifest resolution followed by regeneration).
- Deleted files (one side deleted, one side modified).
Step 2: Separate Code from Lockfiles
Never manually edit conflict markers in generated lockfiles (pnpm-lock.yaml, package-lock.json, yarn.lock, Cargo.lock, poetry.lock).
For lockfiles:
- Reconcile the human-edited manifest first (
package.json,Cargo.toml,pyproject.toml). - Accept one version of the lockfile temporarily (e.g.
git checkout --ours -- <lockfile>). - Run the package manager's install command to recalculate the lockfile graph deterministically:
- pnpm:
pnpm install - npm:
npm install - yarn:
yarn install - cargo:
cargo generate-lockfile(orcargo check) - poetry:
poetry lock --no-update
- pnpm:
- Verify the lockfile updated cleanly and stage both the manifest and the lockfile.
Step 3: Surgically Reconcile Source Files
- Open each conflicting file and locate every conflict block:
<<<<<<< HEAD current changes ======= incoming changes >>>>>>> branch-or-commit - Understand the intent of both sides:
- Why did branch A make this change?
- Why did branch B make this change?
- Combine the changes so both intents survive:
- If both added imports or dependencies, keep both (sorted, deduplicated).
- If one updated a function signature and the other added call sites, update the call sites to match the new signature.
- If both edited the same configuration block, merge keys without dropping either side's new settings.
- Remove all conflict markers (
<<<<<<<,=======,>>>>>>>). - Touch only the conflicting lines and necessary call sites. Do not reformat or refactor adjacent code.
Step 4: Verify Syntactic and Semantic Correctness
Removing conflict markers is only textual reconciliation. You must verify semantics:
- Check for leftover markers:
If any marker remains, Git prints the file and line number. Fix immediately.git diff --check - Run language typechecking and linting:
- TypeScript/JavaScript:
npm run typecheckornpx tsc --noEmit - Python:
mypy .or python syntax checkpython -m py_compile <file> - Go:
go vet ./... - Rust:
cargo check
- TypeScript/JavaScript:
- Run affected test suites to verify that both features still work together.
Step 5: Stage and Conclude
- Stage resolved files:
git add <resolved-file> - Check status:
Ensure no unmerged paths remain.git status - Conclude the step:
- If merging:
git commit(orgit merge --continue). - If rebasing:
git rebase --continue. - If cherry-picking:
git cherry-pick --continue.
- If merging:
- If rebasing across multiple commits, repeat Steps 1 to 5 for each conflicting commit until the rebase completes.
Rationalization Table
| Excuse | Reality |
| "Deploy window closes soon, take ours to make it fast" | Discarding either side breaks production functionality or compliance. Fast bad merges cause immediate production outages. Reconcile both or abort. |
| "I will resolve the text now and fix compilation in a follow-up commit" | Half-merged commits break git bisect, fail CI gates, and risk shipping broken code. Verify before continuing. |
| "The conflict was only 2 lines, running tests is unnecessary" | Two-line changes in signatures or configs cause runtime exceptions. Always run compiler checks or tests. |
"Teammate said run checkout --ours" | During rebase, --ours is the upstream branch, not your feature branch. Blind checkout silently deletes feature code. |
| "I can hand-edit the 200 lines of conflict in pnpm-lock.yaml" | Hand-edited lockfiles corrupt dependency trees and checksums. Reconcile package.json and run the package manager install command. |
| "Git status shows no markers, so the merge succeeded" | Removing markers resolves text layout, not semantic compatibility. New calls to changed signatures still fail. |
Red Flags: STOP and Review
- Using
git checkout --oursorgit checkout --theirson whole source files without line-by-line inspection. - Staging files before running
git diff --check. - Running
git rebase --continueorgit commitwithout running typechecks or tests. - Manually editing YAML or JSON in lockfiles.
- Running
git reset --hardor deleting files when confused by rebase state (use--abortinstead). - Refactoring lines outside the conflict region during resolution.
Common Mistakes
| Mistake | Symptom | Fix |
| Direct commit during rebase | Detached HEAD or nested commit loop | Stage with git add <file> and run git rebase --continue |
| Dropping settings in configs | Missing feature flag or key | Combine all new keys into the config dictionary |
Deleted vs Modified (UD/DU) | CONFLICT (modify/delete) | Run git add <file> to retain or git rm <file> to delete |
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.

