What problem does it solve?
Developers often struggle with context switching between tasks, leading to uncommitted changes, merge conflicts, and a messy workspace. Git worktrees provide isolated environments, but setting them up consistently and safely can be tricky.
Core Features & Use Cases
- Isolated Workspaces: Create separate working directories for different branches, allowing parallel development.
- Smart Directory Selection: Guides on choosing the optimal location for worktrees (project-local vs. global).
- Safety Verification: Mandates
.gitignore checks to prevent accidental commits of worktree contents.
- Automated Setup: Auto-detects and runs project-specific dependency installations (npm, cargo, pip, go mod).
- Clean Baseline Verification: Runs tests after setup to ensure a stable starting point.
- Use Case: When you're working on a new feature but need to quickly switch to a bug fix on another branch without stashing or committing your current work. This skill sets up a clean, isolated environment for the bug fix.
Quick Start
- Announce: "I'm using the Using Git Worktrees skill to set up an isolated workspace."
- The AI will guide you through directory selection and
.gitignore verification.
- The AI will create the worktree:
git worktree add .worktrees/feature-branch -b feature-branch.
- It will then run project setup (e.g.,
npm install) and verify tests.
- You'll receive a report when the worktree is ready.