merge-worktree

Installation
SKILL.md

Skill: merge-worktree

Purpose

Automates the batch worktree lifecycle from the main repo: scan all active linked worktrees, let the user select which to merge, verify all selected are clean, merge and push each in sequence, then remove all successfully-merged worktrees together. Eliminates the need to cd into each worktree directory and invoke a merge operation separately.


Core Objective

Primary goal: From the main repo, land all selected worktree branches onto main, deliver them to origin, and clean up — leaving the repository in a clean state.

Success Criteria (all must be satisfied):

  1. Invocation context verified: CWD is the main repo root, not inside a linked worktree
  2. All linked worktrees discovered: git worktree list parsed; non-main worktrees presented to user
  3. Pre-flight completed before any merge: All selected worktrees checked for clean working tree; all dirty ones reported upfront
  4. Batch merge + push: Each selected clean worktree merged with --no-ff and pushed; per-worktree status (succeeded/failed) recorded
  5. Unified cleanup: All succeeded worktrees removed together; no failed worktree is deleted
Related skills
Installs
21
GitHub Stars
7
First Seen
Apr 7, 2026