merge-worktree
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):
- ✅ Invocation context verified: CWD is the main repo root, not inside a linked worktree
- ✅ All linked worktrees discovered:
git worktree listparsed; non-main worktrees presented to user - ✅ Pre-flight completed before any merge: All selected worktrees checked for clean working tree; all dirty ones reported upfront
- ✅ Batch merge + push: Each selected clean worktree merged with
--no-ffand pushed; per-worktree status (succeeded/failed) recorded - ✅ Unified cleanup: All
succeededworktrees removed together; no failed worktree is deleted
More from nesnilnehc/ai-cortex
review-codebase
Review given file/dir/repo for current-state code organization: module boundaries, design patterns, cross-module dependencies, tech debt, and interface stability. Scope-only atomic skill; output is a findings list.
106review-vue
Review Vue 3 code for Composition API, reactivity, components, state (Pinia), routing, and performance. Framework-only atomic skill; output is a findings list.
94review-diff
Review only git diff for impact, regression, correctness, compatibility, and side effects. Scope-only atomic skill; output is a findings list for aggregation.
91review-java
Review Java code for language and runtime conventions: concurrency, exceptions, try-with-resources, API versioning, collections and Streams, NIO, and testability. Language-only atomic skill; output is a findings list.
84review-architecture
Review code for architecture: module and layer boundaries, dependency direction, single responsibility, cyclic dependencies, interface stability, and coupling. Cognitive-only atomic skill; output is a findings list.
83review-security
Review code for security: injection, sensitive data, auth, dependencies, config, and crypto. Atomic skill; output is a findings list.
74