Agent skill

Worktree Merge

by coleam00 in coleam00/skills

Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main…

MITAuto-check passedDevelopment

Install Worktree Merge

skills CLI
$ npx skills add coleam00/skills --skill worktree-merge -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install coleam00/skills worktree-merge --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/coleam00/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/worktree-merge .claude/skills/worktree-merge && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
worktree-merge
GitHub stars
676
Token cost
~931 tokens
SKILL.md length
464 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
MIT

At a glance

Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main…

  • Works in 6 steps: Preconditions. Confirm you're at the… → Create one integration branch off the… → Merge each branch in order, --no-ff.… → …
  • Parallel worktree development is done and the branches need to be merged
  • SKILL.md covers Input, Detect the validation commands…, Steps and Report, plus 1 more section
  • Calls git

What it does

Worktree Merge is an agent skill from coleam00/skills. Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main line. Use when parallel worktree development is done and the branches need to be merged, or when the user says "merge my worktrees", "integrate these branches", or invokes /worktree-merge.

Its SKILL.md is about 930 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: The agent skills I actually use to build software with coding agents. The PIV loop, planning, worktrees, and the meta-skills for building your own AI Layer. The licence is MIT.

When your agent uses it

  • Parallel worktree development is done and the branches need to be merged
  • The user says merge my worktrees
  • Integrate these branches
  • Invokes /worktree-merge

Example prompts

  • “merge my worktrees”
  • “integrate these branches”
  • “/worktree-merge”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Preconditions. Confirm you're at the repository root, not inside worktrees/
  2. Create one integration branch off the current branch, named for the set (e.g. integration-, with a
  3. Merge each branch in order, --no-ff. After each merge, run the detected test command so a break
  4. Full validation once all branches are merged: run the project's complete detected suite (tests + type
  5. Merge the integration branch into the original branch (--no-ff), then delete the integration branch.
  6. Offer cleanup with AskUserQuestion: remove the N worktrees and delete their feature branches, or keep them.

What it can do on your machine

Read from SKILL.md and the folder at commit 847be08. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Worktree Merge loads about 931 tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 464 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~931

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from coleam00/skills at commit 847be08, republished under its MIT licence (© coleam00). 464 words, ~931 tokens.

Download SKILL.mdSave it as .claude/skills/worktree-merge/SKILL.md (or your agent's skills folder).
name
worktree-merge
description
Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main line. Use when parallel worktree development is done and the branches need to be merged, or when the user says "merge my worktrees", "integrate these branches", or invokes /worktree-merge.
argument-hint
[branch ...] (two or more branch names; blank = ask)

Worktree Merge

Integrate any number of feature branches into your working branch through a single throwaway integration branch, so nothing lands on the main line until every branch is merged and the whole suite passes. Validation commands are detected from the repo, never assumed.

Input

$ARGUMENTS is the list of branches to integrate.

  • Fewer than two → ask which branches to integrate. Don't guess.
  • Two or more → integrate them in the given order.

Detect the validation commands ONCE

Find the commands that prove this project works, preferring what CI already runs: read .github/workflows/*, a Makefile, or the manifest's test/lint scripts, and reuse those exact commands (test runner, type checker, linter). Do not hardcode pytest/mypy/pyright — use whatever this repo actually uses.

Steps

  1. Preconditions. Confirm you're at the repository root, not inside worktrees/ ([[ $(pwd) =~ /worktrees/ ]] → error). Store the current branch. Verify every branch in the list exists (git rev-parse --verify <branch>). Abort early with a clear message if any check fails.

  2. Create one integration branch off the current branch, named for the set (e.g. integration-<first>, with a short suffix if there are several — keep it filesystem-safe). This is where merges are tested; the main line stays untouched until the end.

  3. Merge each branch in order, --no-ff. After each merge, run the detected test command so a break is localized to the branch that caused it.

    • On conflict: stop, name the conflicting branch and files, and give resolution steps (resolve → git add → git commit → re-run the skill). Don't attempt automatic resolution.
    • On test failure: stop, report which tests failed, and give the rollback (git checkout <original> → git branch -D <integration>).
  4. Full validation once all branches are merged: run the project's complete detected suite (tests + type checks + lint). Any failure → report it and roll back; nothing reaches the main line red.

  5. Merge the integration branch into the original branch (--no-ff), then delete the integration branch.

  6. Offer cleanup with AskUserQuestion: remove the N worktrees and delete their feature branches, or keep them. On yes, for each branch: git worktree remove worktrees/<branch> and git branch -d <branch>.

Show full SKILL.md (118 more words)Show less

Report

  • Success: the integration branch used, each branch merged (with its post-merge test result), the full validation result, the merge into <original>, and cleanup status (worktrees kept or removed, with the manual cleanup commands if kept).
  • Failure: the step and branch that failed, the current branch state, and exact rollback commands (git checkout <original> → git branch -D <integration>), plus how to continue after fixing (re-run with the same branch list).

Notes

  • --no-ff preserves each feature branch's history.
  • The integration branch is disposable — the original branch only moves after every merge and the full suite pass.
  • Prefer opening a PR per branch when you're on a team; this skill is for fast local integration when you own the merge.

© coleam00, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/worktree-merge of coleam00/skills.

Open the folder on GitHubat commit 847be08

Compare with similar skills

Worktree Merge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Worktree Merge compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Worktree Merge this skillcoleam00/skills676—~931Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from coleam00/skills

All 34 skills in this repo
  • Ablate AI Layer

    coleam00/skills

    Measure whether a repository's AI instructions still earn their place, by running the same real task many times with the layer intact and with it stripped, then grading every rule against what…

    676 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed
  • Build Dark Factory

    coleam00/skills

    Take a PRD and build a dark factory around it - a repository that takes work in as an issue and ships validated code out with nobody at the keyboard - one component at a time, into the user's actual…

    676 GitHub stars~12k tokensUpdated 2 days ago
    Auto-check passed
  • Drive Screen

    coleam00/skills

    Take real control of the desktop - list and focus windows, type, paste, click, scroll, and screenshot - on Windows, macOS or Linux, and drive other coding-agent sessions running in terminals.

    676 GitHub stars~5.4k tokensUpdated 2 days ago
    Auto-check passed
  • Second Brain Audit

    coleam00/skills

    Audit any second brain, notes folder, or agent memory for facts that have quietly stopped being true, then fix the worst one so it stops recurring.

    676 GitHub stars~4.6k tokensUpdated 2 days ago
    Auto-check passed
  • Build Signal Engine

    coleam00/skills

    Build a personal signal engine from scratch - a system that reads every source someone cares about each day (changelogs and release notes, communities, feeds, videos, papers), makes a quick decision…

    676 GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • Worktree Create

    coleam00/skills

    Create one or more git worktrees for parallel development, each on its own branch with gitignored config copied in, dependencies installed, and a health check, by fanning out a setup subagent per…

    676 GitHub stars~958 tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Worktree Merge

What does Worktree Merge do?

Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main…. Worktree Merge is an agent skill from coleam00/skills. Integrate any number of feature branches from parallel worktrees through one safe integration branch, validating after each merge and running the project's full check suite before touching the main line.

When should I use Worktree Merge?

Worktree Merge fits situations like: parallel worktree development is done and the branches need to be merged; the user says merge my worktrees; integrate these branches; invokes /worktree-merge.

How do I install Worktree Merge in Claude Code?

Run `npx skills add coleam00/skills --skill worktree-merge -a claude-code`. Or copy the skill folder (.claude/skills/worktree-merge in coleam00/skills) into .claude/skills/worktree-merge in your project. Claude Code loads it when a task matches its description.

How do I install Worktree Merge in Codex?

Run `npx skills add coleam00/skills --skill worktree-merge -a codex`. Or copy the skill folder (.claude/skills/worktree-merge in coleam00/skills) into .agents/skills/worktree-merge in your project. Codex loads it when a task matches its description.

Can I use Worktree Merge in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add coleam00/skills --skill worktree-merge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/worktree-merge, .gemini/skills/worktree-merge, .github/skills/worktree-merge and .opencode/skills/worktree-merge in your project.

What does Worktree Merge need to run?

Going by SKILL.md and its folder, Worktree Merge needs the command-line tools its instructions call (git).

Does Worktree Merge access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Worktree Merge safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Worktree Merge use?

Worktree Merge is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Worktree Merge use?

About 931 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Worktree Merge?

Skills that share tags, products or a category with Worktree Merge: Finishing a Development Branch (obra/superpowers, 297k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Worktree Merge?

coleam00 (a GitHub user) maintains it in coleam00/skills, which has 676 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 7, 2026.

Source: coleam00/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.