# Resolve merge conflicts

> Resolve merge conflicts is an open-source agent skill for developer tools. Guides an agent through resolving merge conflicts by intent, then verifying and pushing. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/tonyghiani/ai-essentials/tree/main/skills/resolve-merge-conflicts
- **Repository:** https://github.com/tonyghiani/ai-essentials
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** resolve-merge-conflicts
- **Collection:** https://github.com/tonyghiani/ai-essentials
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill walks an agent through merging a PR's base branch into the current branch and resolving the resulting conflicts. For each conflicted file it compares what both sides changed and which PR introduced each change, then picks a strategy based on the conflict shape, such as keeping the base's structure and reapplying the local change, handling modify/delete cases, or regenerating generated artifacts instead of hand-merging them.

The workflow favors merge over rebase, avoids stash and hard-reset commands mid-merge, and limits verification to the packages the merge touched: marker checks, scoped Jest runs, type checks and lint on resolved files. It also asks the agent to check whether failing tests already failed before the merge, and to report skipped checks and the pushed commit.

It expects a git repository with the GitHub CLI available for reading PR metadata, and it refers to a project's own jest config, type-check script or an ai-verify contract when one exists.

## When your agent uses it

> Resolve a conflicted merge (typically a long-lived epic or integration branch against its PR base), explain why each conflict exists, fix it by intent, verify scoped checks, then commit the merge and push. Use when a PR shows conflicts against its base, when the user says "fix the conflicts", "merge main into this branch", or "resolve merge conflicts".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/tonyghiani/ai-essentials/tree/HEAD/skills/resolve-merge-conflicts)
- [License: MIT](https://github.com/tonyghiani/ai-essentials/tree/HEAD/skills/resolve-merge-conflicts)

## Features

- **Merge base into branch:** Fetches the PR base and merges it into the current branch while preserving merge history.
- **Intent-based conflict analysis:** Compares both sides' changes and their originating PRs before editing each conflicted file.
- **Strategy by conflict shape:** Offers different resolutions for overlapping edits, modify/delete cases, generated files and duplicate fixes.
- **Lockfile and artifact handling:** Takes the base's lockfile and reinstalls, and avoids hand-merging generated artifacts.
- **Scoped verification:** Runs marker checks, related Jest suites, type checks and lint limited to affected areas.
- **Commit, push and report:** Writes a merge commit message, pushes without force and summarizes each resolved file.

## Good for

- Fix the conflicts on my epic branch against main
- Merge main into this feature branch and resolve the conflicts
- Resolve the merge conflicts blocking this pull request
- Explain why each conflicted file clashed and resolve it

## Install

### Claude Code

This skill ships in the `ai-essentials` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add tonyghiani/ai-essentials
/plugin install ai-essentials@ai-essentials
```

Or copy only this skill to `~/.claude/skills/resolve-merge-conflicts`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/resolve-merge-conflicts &&
cp -R "$tmp/skills/resolve-merge-conflicts" ~/.claude/skills/resolve-merge-conflicts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/resolve-merge-conflicts` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/resolve-merge-conflicts` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/resolve-merge-conflicts &&
cp -R "$tmp/skills/resolve-merge-conflicts" ~/.agents/skills/resolve-merge-conflicts &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/resolve-merge-conflicts` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/resolve-merge-conflicts` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/resolve-merge-conflicts &&
cp -R "$tmp/skills/resolve-merge-conflicts" ~/.cursor/skills/resolve-merge-conflicts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/resolve-merge-conflicts` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/tonyghiani/ai-essentials.git --path skills/resolve-merge-conflicts
```

Or copy the folder to `~/.gemini/skills/resolve-merge-conflicts` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/resolve-merge-conflicts`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/resolve-merge-conflicts &&
cp -R "$tmp/skills/resolve-merge-conflicts" ~/.copilot/skills/resolve-merge-conflicts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/resolve-merge-conflicts` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git
```

Then copy `ai-essentials/skills/resolve-merge-conflicts` into your agent's skills folder as `resolve-merge-conflicts`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Resolve merge conflicts trigger?

When a PR shows conflicts against its base, or when the user says things like "fix the conflicts", "merge main into this branch" or "resolve merge conflicts".

### Does Resolve merge conflicts rebase the branch?

No. It merges the base into the branch and avoids rebasing unless the user asks, since a rebase would need a force push.

### Does Resolve merge conflicts require any scripts or tools?

It uses git and the GitHub CLI for PR details. It refers to the project's jest config, type-check script or ai-verify contract when present. The skill bundles no scripts.

### What does Resolve merge conflicts do if a test fails after the merge?

It checks whether the test already failed on the pre-merge HEAD and reports the result either way.

### How do I install Resolve merge conflicts in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/resolve-merge-conflicts to use it in all your projects, or to .claude/skills/resolve-merge-conflicts in one project. Or install the ai-essentials plugin, which includes it: /plugin marketplace add tonyghiani/ai-essentials, then /plugin install ai-essentials@ai-essentials.

### Does Resolve merge conflicts run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Resolve merge conflicts?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Resolve merge conflicts?

The closest alternatives to Resolve merge conflicts are Fix merge conflicts, Git merge, Merge PR, Conflicted PR starts no ci run push resolution first and Gha PR merge ref shows upstream changes.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Fix merge conflicts](https://ai-powered.com/skills/fix-merge-conflicts): Fix merge conflicts is an open-source agent skill for developer tools.
- [Git merge](https://ai-powered.com/skills/git-merge): Git merge is an open-source agent skill for developer tools.
- [Merge PR](https://ai-powered.com/skills/merge-pr): Merge PR is an open-source agent skill for developer tools.
- [Conflicted PR starts no ci run push resolution first](https://ai-powered.com/skills/conflicted-pr-starts-no-ci-run-push-resolution-first): Conflicted PR starts no ci run push resolution first is an open-source agent skill for developer tools.
- [Gha PR merge ref shows upstream changes](https://ai-powered.com/skills/gha-pr-merge-ref-shows-upstream-changes): Gha PR merge ref shows upstream changes is an open-source agent skill for developer tools.
- [Gh PR merge worktree checkout trap](https://ai-powered.com/skills/gh-pr-merge-worktree-checkout-trap): Gh PR merge worktree checkout trap is an open-source agent skill for developer tools.
- [Git post merge cleanup](https://ai-powered.com/skills/git-post-merge-cleanup): Git post merge cleanup is an open-source agent skill for developer tools.
- [Commit push PR](https://ai-powered.com/skills/commit-push-pr-redpanda-data): Commit push PR is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/resolve-merge-conflicts
