# git-merge-expert-worktree

git-merge-expert-worktree — a Claude Code skill that runs merges and conflict resolution inside a dedicated git worktree. The main tree stays clean, and the skill handles its own cleanup when the operation finishes.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 159 installs · ★ 5 repo stars
- Author: ulpi-io
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ulpi-io/skills/tree/HEAD/git-merge-expert-worktree/SKILL.md
- Updated: 2026-08-31
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/git-merge-expert-worktree

## What it does

Also works in Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. It starts by listing current worktrees and figuring out where it is running. Then it either creates or reuses an isolated workspace for the task at hand.

Before any merge, rebase or cherry-pick, a backup tag is created. Validation follows: `git status`, conflict checks, build or test commands where the project needs them. Cleanup goes through `git worktree remove` and `prune` — never `rm -rf`.

There are hard rules. Non-session branches are never auto-deleted. Force-removing a dirty worktree requires explicit confirmation. The skill will not activate on its own; ask for a worktree merge specifically. For a standard in-place merge, this is the wrong tool.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/git-merge-expert-worktree/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/git-merge-expert-worktree/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/git-merge-expert-worktree/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/git-merge-expert-worktree/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ulpi-io/skills git-merge-expert-worktree
```

2. **Manually: put the files in place**
- File: `.github/skills/git-merge-expert-worktree/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ulpi-io/skills --path git-merge-expert-worktree
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/git-merge-expert-worktree/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ulpi-io/skills/tree/HEAD/git-merge-expert-worktree/SKILL.md

## When to use it
- merge a branch without touching the main tree
- sort out conflicts in a separate checkout
- recover from a broken merge by recreating the worktree
- remove stale worktrees safely
- verify a merge before pushing

## Example prompts
- Merge `feature/payments` into `main` inside a separate worktree
- Resolve conflicts for `release-2.1` in a worktree
- Clean up stale worktrees and confirm main is untouched

## Similar
- [merge_conflict_handling](https://affpapa.org/en/nevibecode/prompts/merge-conflict-handling.md) — prompt · ★ 341 repo stars
- [merge-contributor-pr](https://affpapa.org/en/nevibecode/skills/merge-contributor-pr.md) — skill · ★ 1636 repo stars
- [merge-review](https://affpapa.org/en/nevibecode/skills/merge-review.md) — skill · ★ 937 repo stars
- [merge](https://affpapa.org/en/nevibecode/skills/merge.md) — skill · 1409 installs
- [git-worktree-isolation](https://affpapa.org/en/nevibecode/skills/git-worktree-isolation.md) — skill · 2300 installs
- [git-worktree-runner](https://affpapa.org/en/nevibecode/skills/git-worktree-runner.md) — skill · ★ 1636 repo stars

From the same set: [ulpi-io/skills](https://affpapa.org/en/nevibecode/by/ulpi-io/skills.md) — 49 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
