Agent skill
worktree-manager
Manages the full lifecycle of git worktrees — create, list, update, and remove. Handles environment setup (.env), dependency installation (bun install), and port allocation using setup-dev-env script. Use when the user wants to create a worktree, list worktrees, update a worktree, remove a worktree, or set up a parallel development environment.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/worktree-manager-carere-zaidan
SKILL.md
Worktree Manager
Complete git worktree lifecycle management for parallel development environments with isolated dependencies and configuration.
When to use this skill
Use this skill when the user wants to:
- Create a new worktree for parallel development
- List all worktrees and their status
- Update an existing worktree (pull changes, reinstall deps)
- Remove an existing worktree and clean up
Do NOT use this skill when:
- User wants to manually run git commands directly
- The task is unrelated to worktree management
- User just wants to switch branches (use
git checkoutinstead)
Operations Overview
| Operation | When to Use |
|---|---|
| Create | User wants a new parallel development environment |
| List | User wants to see existing worktrees and their status |
| Update | User wants to refresh a worktree (pull, reinstall deps) |
| Remove | User wants to delete a worktree and clean up |
Decision Tree
1. User wants to CREATE a worktree
Keywords: create, new, setup, make, start, initialize, add Action: Follow the CREATE operation
2. User wants to LIST worktrees
Keywords: list, show, display, what, which, status, check, view Action: Follow the LIST operation
3. User wants to UPDATE a worktree
Keywords: update, refresh, pull, sync, reinstall, rebuild Action: Follow the UPDATE operation
4. User wants to REMOVE a worktree
Keywords: remove, delete, cleanup, destroy, stop, kill, terminate Action: Follow the REMOVE operation
Quick Start
For step-by-step operation instructions, see OPERATIONS.md.
For concrete usage examples, see EXAMPLES.md.
For troubleshooting common issues, see TROUBLESHOOTING.md.
Important Notes
Directory Convention
All worktrees are created under trees/ at the project root:
project/
└── trees/
├── feature-auth/
├── fix-bug-123/
└── refactor-api/
Environment Setup
- The
.envfile from the main project is copied into the worktree - The bundled scripts/setup-dev-env.ts script is used to allocate free ports
- It resolves
.envfromprocess.cwd(), so alwayscdinto the worktree before running it - The
--env-keyflag writes a free port value directly to the worktree.env bun installis run after creation to install dependencies
Do NOT attempt to:
- Create worktrees manually outside the
trees/directory - Skip
bun installafter creating a worktree - Remove worktree directories with
rm -rf(usegit worktree remove) - Manually edit ports when setup-dev-env is available
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?