| name | git-workflow |
| description | Use when starting feature work needing isolation or when completing a development branch — covers worktree creation, setup, and branch finishing. |
Git Workflow
Part 1: Setting Up an Isolated Workspace
Directory Selection
Follow this priority:
-
Check existing directories:
ls -d .worktrees 2>/dev/null
ls -d worktrees 2>/dev/null
If found, use it. .worktrees wins if both exist.
-
Check project docs for worktree directory preference.
-
Ask the user if neither exists.
Safety Verification
For project-local directories: Verify the directory is git-ignored:
git check-ignore -q .worktrees 2>/dev/null
If NOT ignored: Add to .gitignore and commit before proceeding.
Creation Steps
git worktree add <path> -b <branch-name>
cd <path>
<test command>
If tests fail: Report failures, ask whether to proceed or investigate.