Resolving Merge Conflicts
This skill resolves active merge and rebase conflicts without blindly choosing a side or losing either change's intent.
When to Use
git statusshows an in-progress merge or rebase withUnmerged paths- The working tree contains conflict markers from an active merge or rebase
- User asks to resolve, continue, or finish a conflicted merge or rebase
When NOT to Use
- No merge or rebase is in progress — this skill resolves an existing operation; it does not start one
- A trivial conflict is already fully understood and intent tracing would be pure overhead — still run a quick sanity check
Core Principle
Intent-Traced Resolution
- For each conflicting hunk, find the primary source for each side's change: commit message, PR or issue description, linked ticket
- Understand why each change was made before choosing a resolution
- Never pick
oursortheirsblindly
Resolution Process
Use the checklist below and track your progress:
Merge conflict resolution progress:
- [ ] Step 1: Assess operation state and list conflicted files
- [ ] Step 2: Read each conflicted hunk and trace both sides' intent
- [ ] Step 3: Resolve each hunk without inventing behavior
- [ ] Step 4: Run relevant automated checks after each file is resolved
- [ ] Step 5: Stage resolved files and continue the operation
Step 1 — Assess current state
- Run
git status - List conflicted files:
git diff --name-only --diff-filter=U - Confirm whether the active operation is a merge or rebase
Step 2 — Trace intent hunk by hunk
- Read both sides of every conflicting hunk
- Find each side's primary source: commit message, PR or issue description, linked ticket
- Record why each side changed the code before resolving the hunk
Step 3 — Resolve deliberately
- Preserve both intents where possible
- Where intents are genuinely incompatible, choose the one matching the merge's stated goal
- Explicitly note the trade-off in a code comment or merge commit message
- Never silently discard the other side's work
- Do not invent behavior beyond what either side already expressed
Step 4 — Verify resolved files
- After all hunks in a file are resolved, discover relevant checks through
technical-context-discovery - Run the applicable typecheck, tests, and formatting checks; do not guess commands
Step 5 — Complete the operation
- Stage resolved files
- Run
git merge --continueorgit rebase --continue, matching the active operation - Never run
git merge --abortorgit rebase --abort - If genuinely stuck, stop and ask the user rather than aborting
Anti-Patterns to Avoid
| Anti-Pattern | Instead Do |
|---|---|
Picking ours or theirs without checking intent |
Trace both sides to their primary sources first |
Running --abort to escape a hard conflict |
Stop and ask the user when resolution cannot proceed |
| Resolving conflicts without running checks | Run the relevant project checks after each resolved file |
| Silently discarding one side's work | Preserve both intents or explicitly note the trade-off |
| Inventing behavior neither side expressed | Resolve only from behavior already present on either side |
Connected Skills
technical-context-discovery— discover the correct project checks before running themcode-review— review non-trivial conflict resolutions after the operation finishes