manage-worktree
Manage git worktrees: create, move branches into, or remove worktrees. Simplifies parallel development, context switching, and cleanup for Apartment-based Rails projects.
Introduction
This skill acts as a specialized assistant for developers managing parallel git worktrees in Rails-on-Services Apartment projects. It streamlines complex git operations by automating the setup and cleanup of sibling repository directories, allowing you to work on multiple feature branches simultaneously without repeatedly stashing or switching branches in a single directory. It is intended for software engineers, particularly those working on multitenant architectures where isolation verification requires testing different schema configurations in parallel. By using this agent, you reduce the overhead of manual directory management, branch tracking, and environment setup.
-
Automatically creates new git worktrees as siblings to the main repository path, ensuring clean path resolution.
-
Executes project-specific setup tasks like 'bin/dev/setup-worktree' to configure files such as .claude, .bundle, and .vscode, plus Peacock color settings.
-
Seamlessly handles stash operations to preserve uncommitted work when transitioning into or out of a worktree.
-
Implements mode detection to interpret whether to create a new branch, move an existing branch, or perform cleanup/teardown.
-
Validates developer prefixes (e.g., man/ or feature-specific tags) to maintain repository naming conventions.
-
Automates branch removal and cleanup using internal project scripts ('bin/dev/remove-worktree') to ensure no orphaned databases or schemas persist.
-
The skill expects input like a branch name or intent (e.g., 'remove', 'move', 'create').
-
It resolves the worktree base path dynamically using 'git worktree list --porcelain' to prevent issues when executed from within existing worktrees.
-
Always performs a safe check of existing branches before attempting a move operation to avoid data loss.
-
Use this tool when you need to switch contexts quickly, test different tenant strategies, or manage independent development environments for Apartment-based Rails applications.
-
Note that this skill requires direct access to bash-based git commands and project-specific bin scripts defined in the repository structure.
Repository Stats
- Stars
- 484
- Forks
- 181
- Open Issues
- 13
- Language
- Ruby
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 10:16 PM