home / skills / openclaw / skills / ai-merge-resolve

ai-merge-resolve skill

/skills/lxgicstudios/ai-merge-resolve

This skill analyzes and resolves git merge conflicts by understanding code intent and suggesting intelligent resolutions.

npx playbooks add skill openclaw/skills --skill ai-merge-resolve

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.3 KB
---
name: merge-resolve
description: AI-powered git merge conflict resolution
---

# Merge Resolver

Got merge conflicts? This tool understands both versions and picks the right resolution.

## Quick Start

```bash
npx ai-merge-resolve
```

## What It Does

- Finds all merge conflicts in repo
- Analyzes both versions semantically
- Suggests intelligent resolutions
- Can auto-resolve simple conflicts

## Usage Examples

```bash
# Resolve all conflicts
npx ai-merge-resolve

# Resolve specific file
npx ai-merge-resolve ./src/api.ts

# Auto-resolve obvious ones
npx ai-merge-resolve --auto

# Interactive mode
npx ai-merge-resolve --interactive
```

## How It Works

Doesn't just pick "theirs" or "ours". Actually reads the code, understands intent, and merges the functionality properly.

## Output

```
Resolving src/utils.ts...
- Conflict 1: Both added logging → Combined both log statements
- Conflict 2: Different error messages → Kept more descriptive one
āœ“ Resolved 2 conflicts
```

## Requirements

Node.js 18+. OPENAI_API_KEY required. Must have active merge conflicts.

## License

MIT. Free forever.

---

**Built by LXGIC Studios**

- GitHub: [github.com/lxgicstudios/ai-merge-resolve](https://github.com/lxgicstudios/ai-merge-resolve)
- Twitter: [@lxgicstudios](https://x.com/lxgicstudios)

Overview

This skill provides AI-powered git merge conflict resolution that reads both sides of a conflict and suggests or applies sensible merges. It targets code and text conflicts, combining intent-aware changes instead of simply choosing "ours" or "theirs." Use it to speed up merges, reduce manual fixes, and avoid regressions introduced by naive conflict choices.

How this skill works

The tool scans the repository for active merge conflict markers and analyzes both versions of each conflicted section. It semantically compares intents, reconciles differences (for example combining logging or preserving more descriptive messages), and produces suggested resolutions. Options include interactive review, file-specific runs, and an auto-resolve mode for straightforward conflicts.

When to use it

  • After pulling or merging branches that produce conflict markers
  • When conflicts involve code or text where intent matters (logic, messages, API changes)
  • Before committing a merge to catch subtle behavioral regressions
  • When you want to speed up conflict resolution without losing context or intent

Best practices

  • Run on a clean working tree with no unstaged changes to avoid accidental overwrites
  • Review AI suggestions in interactive mode for complex or security-sensitive code
  • Use file-specific checks to focus on high-risk modules first
  • Combine auto-resolve for trivial issues with manual review for business logic changes
  • Keep backups or a temporary branch before bulk auto-resolving multiple files

Example use cases

  • Resolve conflicts across a large repo where many small edits overlap (e.g., combined logging or formatting changes)
  • Handle divergent API string updates by preserving the most descriptive or compatible message
  • Auto-resolve trivial formatting or whitespace conflicts across many files
  • Interactively reconcile competing logic changes in a critical module with guided suggestions
  • Run on a single file after a focused feature merge to quickly finalize the change

FAQ

What prerequisites are required to run this skill?

Node.js 18+ and a valid OPENAI_API_KEY. Run from a repo that currently contains merge conflict markers.

Can it safely auto-resolve all conflicts?

It can auto-resolve obvious, low-risk conflicts. For complex or security-sensitive logic, use interactive review to validate AI suggestions.