worktree-merge

Merges multiple feature branches from parallel worktrees through one validated integration branch.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/az9713/claude-code-hooks-tutorial --skill worktree-merge-az9713
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree-merge
Source: https://github.com/az9713/claude-code-hooks-tutorial/tree/main/skills/.claude/skills/worktree-merge
Command: npx skills add https://github.com/az9713/claude-code-hooks-tutorial --skill worktree-merge-az9713

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Merging several feature branches developed in parallel git worktrees is risky: conflicts appear late, broken code can land on the main branch, and it is hard to tell which branch caused a failure. This Skill integrates all branches through a single throwaway integration branch, validating after every merge so the main line only moves once everything passes. ## Core Features & Use Cases - Ordered multi-branch integration: Merges any number of branches in sequence with --no-ff onto one disposable integration branch, preserving each feature branch's history. - Per-merge validation: Detects the project's real test, type-check, and lint commands from CI workflows, Makefiles, or manifests, and runs tests after each merge to localize failures to the branch that caused them. - Safe failure handling: On conflicts or test failures it stops, names the offending branch and files, and gives exact rollback commands so nothing red reaches the main branch. - Use Case: After finishing three features developed in parallel worktrees, invoke the skill with the three branch names to merge them in order, run the full suite, fast-forward the original branch, and optionally clean up the worktrees. ## Quick Start Ask the AI to merge your worktree branches by saying "merge my worktrees feature-a, feature-b, and feature-c" and it will integrate and validate them before touching your main branch.

Frequently Asked Questions about worktree-merge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge multiple git worktree branches safely?▼

Merge them through a single throwaway integration branch instead of directly into main. Each branch is merged in order with --no-ff, tests run after every merge, and the original branch only advances once the full suite passes.

How does the skill know which test commands to run?▼

It detects validation commands from the repository itself, preferring what CI already runs: GitHub workflow files, a Makefile, or the manifest's test and lint scripts. It never hardcodes tools like pytest or mypy.

What happens if a merge conflict occurs during integration?▼

The process stops, names the conflicting branch and files, and provides resolution steps: resolve the conflict, git add, git commit, then re-run the skill. It does not attempt automatic conflict resolution.

Can I roll back if tests fail after a merge?▼

Yes. On any test failure the skill reports which tests failed and gives exact rollback commands: git checkout to the original branch and git branch -D to delete the integration branch, leaving the main line untouched.

When should I use pull requests instead of local worktree merging?▼

Use pull requests when working on a team where review and CI gating are required. Local integration through an integration branch is intended for fast merges when you own the merge and work alone.