Skip to content
Back to skills

Resolving Merge Conflicts

ASecurity

Resolve an in-progress git merge or rebase conflict while preserving both sides' intent. Use when a merge/rebase is blocked on conflicts, or the user asks to finish a conflicted merge or rebase.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentsgophpgit

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add leek/agent-skills --skill resolving-merge-conflicts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Resolving Merge Conflicts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Resolving Merge Conflicts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leek-resolving-merge-conflicts/badge)](https://www.skillsdirectory.com/skills/leek-resolving-merge-conflicts)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: resolving-merge-conflicts
description: Resolve an in-progress git merge or rebase conflict while preserving both sides' intent. Use when a merge/rebase is blocked on conflicts, or the user asks to finish a conflicted merge or rebase.
---

# Resolving Merge Conflicts

1. **See the current state** of the merge/rebase. Check git history and the conflicting files.

2. **Find the primary sources** for each conflict. Understand deeply why each change was made, and what the original intent was. Read the commit messages, check the PRs, check original issues/tickets.

   **Superseded scratch commits.** In a rebase, a local commit that touches only `.scratch/<slug>/` often conflicts (add/add) because a merged PR carried the same files upstream and went on changing them. Compare the two: `git diff <upstream sha> <local sha> -- .scratch/<slug>`. When upstream holds everything the local commit has (closed tickets, added Resolutions, renumbered files), take upstream for every file and `git rebase --skip` the emptied commit, without asking. When the local side holds content upstream lacks, resolve it as any other hunk.

3. **Resolve each hunk.** Preserve both intents where possible. Where the two intents truly cannot both be kept, ask the user to choose instead of picking silently (a structured question ([harness-tools](../harness-tools/SKILL.md)): ours and theirs as options, plus a combined one if it makes sense, each hunk in its option's `preview`, the one matching the merge's stated goal first and marked recommended; otherwise quote both hunks in chat and ask). Do **not** invent new behaviour. Always resolve; never `--abort` unless the user explicitly asks to abort.

4. **Check what the merge touched; leave the suite to CI.** The conflict is resolved when both intents are in the file, the conflict markers are gone, and the resolved files still parse. Run one quick check scoped to the resolved files: the project's static analysis or linter on those paths, or a syntax check (`php -l`, `tsc --noEmit`) when none is configured. Then search the tree for every symbol either side renamed or removed (`rg <old name>`), because a merge with no textual conflict can still call what the other side deleted. Fix what the merge broke. The full test suite and formatter run in CI.

5. **Finish the merge/rebase.** Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.

Files in this skill

  • SKILL.md1.8 KB
  • agents/openai.yaml208 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.