plugins/developer-toolkit/skills/git/merge-conflict-surgeon/SKILL.md
Use this skill when resolving Git merge conflicts. Activate when the user mentions merge conflicts, conflicting changes, failed merges, "both modified", HEAD markers, conflict markers (<<<<<<<, =======, >>>>>>>), or asks how to resolve conflicts between branches. Also use when git merge or git rebase fails due to conflicts.
npx skillsauth add latestaiagents/agent-skills merge-conflict-surgeonInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Resolve Git merge conflicts systematically and safely.
git merge or git rebase fails with conflicts<<<<<<<, =======, >>>>>>>) in filesgit status shows "both modified" files# See all conflicted files
git status
# See the full diff of conflicts
git diff --name-only --diff-filter=U
List all conflicted files and categorize them:
For each conflicted file, understand:
# See what YOUR branch changed
git diff HEAD~1 -- <file>
# See what the OTHER branch changed
git diff MERGE_HEAD~1 -- <file>
# See common ancestor
git show :1:<file> # Base version
git show :2:<file> # Ours (current branch)
git show :3:<file> # Theirs (merging branch)
For simple conflicts (different functionality):
For overlapping conflicts (same code, different changes):
For delete/modify conflicts:
# Mark as resolved
git add <resolved-file>
# Verify no remaining conflicts
git diff --check
# Run tests before completing
npm test # or your test command
# Complete the merge
git commit # or git rebase --continue
<<<<<<< HEAD
function processUser(user) {
validateUser(user);
=======
function processUser(user) {
logUserAccess(user);
>>>>>>> feature-branch
Resolution: Keep both - they're independent additions
function processUser(user) {
validateUser(user);
logUserAccess(user);
<<<<<<< HEAD
const result = items.filter(x => x.active).map(x => x.name);
=======
const result = items.reduce((acc, x) => x.active ? [...acc, x.name] : acc, []);
>>>>>>> feature-branch
Resolution: Choose based on readability/performance needs. The filter().map() is clearer.
<<<<<<< HEAD
const API_URL = 'https://api.prod.example.com';
=======
const API_URL = 'https://api.staging.example.com';
>>>>>>> feature-branch
Resolution: This is environment-specific. Use environment variables instead:
const API_URL = process.env.API_URL || 'https://api.prod.example.com';
# Use a merge tool (if configured)
git mergetool
# Abort if things go wrong
git merge --abort
git rebase --abort
# Accept all of one side (use carefully)
git checkout --ours <file> # Keep your version
git checkout --theirs <file> # Keep their version
# If you messed up the resolution
git checkout -m <file> # Restore conflict markers
# If you committed a bad resolution
git reset --soft HEAD~1 # Undo commit, keep changes
# Then resolve again
# Nuclear option: start over
git merge --abort # or git rebase --abort
development
Test skills for correct activation, content quality, and regression — both automated checks (frontmatter validity, lint) and manual verification (query-suite activation testing). Covers CI integration and how to catch skill regressions before users do. Use this skill when adding skills to a repo, setting up CI for a skill library, or debugging "the skill exists but doesn't work". Activate when: test skills, validate skills, skill CI, skill linting, skill activation test, skill regression.
documentation
Write the YAML frontmatter for a SKILL.md file so it activates reliably — name, description, and activation keywords that the model matches against. Covers length, tone, and the most common frontmatter mistakes. Use this skill when authoring a new skill, fixing a skill that isn't auto-activating, or reviewing skills for publication. Activate when: SKILL.md frontmatter, skill description, skill activation, skill YAML, write a skill, author a skill.
development
Design skills that fire at the right moment — neither over-eager (noise) nor under-eager (silent). Covers activation specificity, trigger phrases, disambiguation between overlapping skills, and debugging activation. Use this skill when multiple skills could fire on the same query, a skill never fires, or a skill fires too often. Activate when: skill won't activate, skill over-activates, overlapping skills, skill triggers, skill selection, skill disambiguation.
development
Structure SKILL.md content so the model reads just enough — concise summary up front, progressively deeper detail, examples on demand. Covers section ordering, length budgets, when to split into multiple skills. Use this skill when writing or refactoring a skill body, one skill has grown too long, or a skill is wordy but not useful. Activate when: SKILL.md structure, skill content, skill too long, split skill, progressive disclosure, skill body.