Detect, classify, and resolve git merge conflicts through structured analysis of conflict markers, per-file strategy selection, and post-resolution verification. Use when a branch has conflicts with its merge target or when rebasing onto an updated base.
From flownpx claudepluginhub synaptiai/synapti-marketplace --plugin flowThis skill is limited to using the following tools:
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Domain skill for detecting, classifying, and resolving git merge conflicts systematically.
NEVER silently drop changes. Every conflict resolution must account for both sides. If lines from either side are excluded, the rationale must be documented. When in doubt, ask the user rather than guess.
Detect conflicted files and their conflict types:
# List files with unmerged entries
git diff --name-only --diff-filter=U
# Full status with conflict markers
git status --porcelain
Classify each file by its porcelain status prefix.
| Status | Type | Description |
|---|---|---|
| UU | Content | Both sides modified the same file |
| AA | Add-add | Both sides added a file with the same name |
| UD | Delete-modify (ours deleted) | We deleted, they modified |
| DU | Delete-modify (theirs deleted) | They deleted, we modified |
| AU | Rename-related (add/unmerged) | Rename collision |
| UA | Rename-related (unmerged/add) | Rename collision |
Assess each conflicted file's complexity before choosing a strategy:
| Complexity | Description | Example |
|---|---|---|
| Trivial | Non-overlapping changes in different sections | Import added at top + function added at bottom |
| Semantic | Changes to the same logical unit | Both sides modify the same function |
| Structural | File was refactored on one side | Moved code, renamed variables, changed structure |
| Delete-modify | One side deleted what the other modified | Feature removed vs feature enhanced |
| Strategy | When to Use | Risk | Autonomy |
|---|---|---|---|
| accept-ours | Their change is superseded by ours | Low | Tier 1 for trivial |
| accept-theirs | Our change is superseded by theirs | Low | Tier 1 for trivial |
| manual-merge | Both changes are needed | Medium | Tier 2 — show rationale |
| rebase | Clean linear history needed, few conflicts | Medium | Tier 2 — show rationale |
For each conflict hunk in a file:
<<<<<<< to =======) and theirs block (======= to >>>>>>>)When one side deletes a file (or section) that the other side modifies:
After resolving all conflicts, run these checks in order:
# Must return zero results
grep -rn '<<<<<<<\|=======\|>>>>>>>' --include='*' . 2>/dev/null | grep -v '.git/' | grep -v 'node_modules/'
If any markers remain, resolution is incomplete. Fix before proceeding.
# Stage resolved files
git add <resolved-files>
# Complete the merge or rebase
git merge --continue # or git rebase --continue
Run the project's quality commands (lint, test, typecheck) to verify the resolution didn't break anything. Use capability-discovery to find available commands.
Show a summary of what was resolved:
# Show what changed in the resolution
git diff HEAD~1 --stat
Watch for these shortcuts that lead to incorrect resolutions:
| Rationalization | Correct Response |
|---|---|
| "Just take ours for everything" | Analyze each conflict individually — theirs may contain important changes |
| "Too complex, just reset and start over" | Read both sides first — most conflicts are simpler than they appear |
| "Tests pass so the resolution is correct" | Review the diff too — passing tests don't guarantee semantic correctness |
| "This file isn't important" | Every file in the conflict list matters — verify or explicitly document why it's safe to skip |
| "Same change on both sides" | Verify they're truly identical — similar-looking changes may have subtle differences |