# Fix merge conflicts

> Fix merge conflicts is an open-source agent skill for developer tools. Resolves git merge conflicts non-interactively and checks the build and tests pass. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/fix-merge-conflicts
- **Repository:** https://github.com/michael-denyer/pstack-claude
- **GitHub stars:** 5,057
- **License:** MIT
- **Skill name:** fix-merge-conflicts
- **Collection:** https://github.com/michael-denyer/pstack-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill walks an agent through clearing unresolved merge conflicts on a branch. It starts by finding every conflicting file from git status and conflict markers, then edits each conflict with small, correctness-first changes. Where it is safe, both sides are kept; otherwise the agent picks the variant that compiles and leaves public behavior unchanged.

After the edits, the agent regenerates lockfiles with the package manager rather than editing them by hand, runs compile, lint and relevant tests, and stages the resolved files. Guardrails keep the changes minimal, forbid leaving conflict markers behind, avoid broad refactors, and prohibit pushing or tagging during the process.

The skill expects a git repository in a conflicted state and access to the project's build, lint and test commands. It finishes with a short report listing the resolved files, notable resolution choices and the build and test outcome.

## When your agent uses it

> Resolve merge conflicts non-interactively, validate build and tests, and finalize conflict resolution

## What it can access

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

- [Instructions only, no scripts](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/fix-merge-conflicts)
- [License: MIT](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/fix-merge-conflicts)

## Features

- **Conflict detection:** Finds all conflicting files using git status and conflict markers.
- **Minimal resolution edits:** Applies small, correctness-first changes to each conflict.
- **Lockfile regeneration:** Rebuilds lockfiles with package manager tools instead of manual edits.
- **Build and test validation:** Runs compile, lint and relevant tests after resolving.
- **Resolution summary:** Reports resolved files, key decisions and the build outcome.
- **Safety guardrails:** Blocks leftover conflict markers, broad refactors, and pushing or tagging.

## Good for

- Resolve the merge conflicts on my feature branch so it builds again
- Fix the conflicted package-lock.json after merging main
- Clean up conflict markers in these files and run the tests
- Finish a rebase conflict and stage the resolved files

## Install

### Claude Code

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

```sh
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude
```

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/fix-merge-conflicts &&
cp -R "$tmp/plugins/pstack/skills/fix-merge-conflicts" ~/.claude/skills/fix-merge-conflicts &&
rm -rf "$tmp"
```

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

### Codex

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/fix-merge-conflicts &&
cp -R "$tmp/plugins/pstack/skills/fix-merge-conflicts" ~/.agents/skills/fix-merge-conflicts &&
rm -rf "$tmp"
```

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

### Cursor

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/fix-merge-conflicts &&
cp -R "$tmp/plugins/pstack/skills/fix-merge-conflicts" ~/.cursor/skills/fix-merge-conflicts &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/fix-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/michael-denyer/pstack-claude.git --path plugins/pstack/skills/fix-merge-conflicts
```

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

### VS Code

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

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/fix-merge-conflicts &&
cp -R "$tmp/plugins/pstack/skills/fix-merge-conflicts" ~/.copilot/skills/fix-merge-conflicts &&
rm -rf "$tmp"
```

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

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git
```

Then copy `pstack-claude/plugins/pstack/skills/fix-merge-conflicts` into your agent's skills folder as `fix-merge-conflicts`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It needs a branch with unresolved merge conflicts and the project's compile, lint and test commands available to the agent.

### Does Fix merge conflicts push or tag my changes?

No. Its guardrails explicitly forbid pushing or tagging during conflict resolution.

### How does Fix merge conflicts handle lockfile conflicts?

It regenerates lockfiles with the package manager tools instead of hand-editing them.

### What does Fix merge conflicts report when finished?

The resolved files, notable resolution choices, and the build and test outcome.

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

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

### Does Fix 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 Fix merge conflicts?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

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

The closest alternatives to Fix merge conflicts are Git commit, Intent drift, Project review, Code review expert and Ci.

## Where this comes from

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

## Alternatives

- [Git commit](https://ai-powered.com/skills/git-commit): Git commit is an open-source agent skill for developer tools.
- [Intent drift](https://ai-powered.com/skills/intent-drift): Intent drift is an open-source agent skill for developer tools.
- [Project review](https://ai-powered.com/skills/project-review): Project review is an open-source agent skill for developer tools.
- [Code review expert](https://ai-powered.com/skills/code-review-expert): Code review expert is an open-source agent skill for developer tools.
- [Ci](https://ai-powered.com/skills/ci-chachamaru127): Ci is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Make PR easy to review](https://ai-powered.com/skills/make-pr-easy-to-review): Make PR easy to review is an open-source agent skill for developer tools.
- [Rebase current branch](https://ai-powered.com/skills/rebase-current-branch): Rebase current branch is an open-source agent skill for developer tools.

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