git-worktree-manager
Installation
SKILL.md
Git Worktree Manager
Manage parallel development workflows using Git worktrees with deterministic naming, automatic port allocation, environment file synchronization, dependency installation, and cleanup automation. Optimized for multi-agent workflows where each agent or terminal session owns an isolated worktree with its own ports, environment, and running services.
Core Capabilities
- Worktree lifecycle — create worktrees from new or existing branches with deterministic naming, copy
.envfiles, install dependencies by lockfile detection, list with clean/dirty + ahead/behind status, and safely remove with uncommitted-change detection. - Port allocation — deterministic per-worktree assignment (
base + index * stride), collision detection against running processes, persistent map in.worktree-ports.json, and Docker Compose override generation. - Multi-agent isolation — one branch per worktree, one agent per worktree, no shared state, conflict-free parallel execution, task-ID mapping for traceability.
- Cleanup automation — stale detection by age, merged-branch detection for safe removal, dirty-state warnings, and bulk cleanup with safety confirmations.
When to Use
- You need 2+ concurrent branches open with running dev servers.
- You want isolated environments for feature work, hotfixes, and PR review.
- Multiple AI agents need separate workspaces that do not interfere.
- Your current branch is blocked but a hotfix is urgent.
- You want automated cleanup instead of manual
rm -rfoperations.