git-merge-expert-worktree — Claude Code skill for isolated worktree merges
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.
no license 159 installs ★ 5 updated 2026-08-31
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a claude-codeWhat git-merge-expert-worktree 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.
What it helps with
- 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 for the agent
- Merge
feature/paymentsintomaininside a separate worktree - Resolve conflicts for
release-2.1in a worktree - Clean up stale worktrees and confirm main is untouched
How to install git-merge-expert-worktree
1Skills CLI (Vercel)
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a claude-code2Manually: put the files in place
~/.claude/skills/git-merge-expert-worktree/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/git-merge-expert-worktree/
1Skills CLI (Vercel)
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a codex2Manually: put the files in place
.agents/skills/git-merge-expert-worktree/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a cursor2Manually: put the files in place
.cursor/skills/git-merge-expert-worktree/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ulpi-io/skills git-merge-expert-worktree2Manually: put the files in place
.github/skills/git-merge-expert-worktree/SKILL.md1Skills CLI (Vercel)
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a gemini-cli2Platform CLI
gemini skills install https://github.com/ulpi-io/skills --path git-merge-expert-worktreeManually: put the files in place
.devin/skills/git-merge-expert-worktree/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about git-merge-expert-worktree
How do I install git-merge-expert-worktree in Claude Code?
Run npx skills add ulpi-io/skills --skill git-merge-expert-worktree -a claude-code. The skill lands in ~/.claude/skills/git-merge-expert-worktree/SKILL.md.
How is this different from a regular merge?
Everything happens in a linked worktree, so the main checkout stays untouched until you decide to integrate. The skill never merges in the main tree when worktree isolation was requested.
Does it delete branches?
Only ephemeral session branches, and only after the work is done. User branches are never auto-deleted, and a dirty worktree needs explicit confirmation before force removal.