| name | aico-worktree |
| description | Create isolated git worktree for feature development. Handles directory selection, gitignore verification, project setup, and baseline test verification.
Use this skill when:
- Starting feature work that needs isolation from current workspace
- Before executing implementation plans on a new branch
- Want to work on multiple branches/features simultaneously
- User asks to "create worktree", "isolate this work", "separate branch"
- Need clean baseline before starting major changes
Safety: ALWAYS verify worktree directory is gitignored before creating.
Process: Check directory โ Verify ignored โ Create worktree โ Run setup โ Verify baseline tests
|
Git Worktree
Process
- Check existing directories:
.worktrees/ or worktrees/
- Verify gitignored: MUST verify before creating
- Create worktree:
git worktree add <path> -b <branch>
- Run project setup: Auto-detect (npm/pip/go/cargo)
- Verify baseline tests: Run tests, report status
Directory Selection
| Priority | Check |
|---|
| 1 | Existing .worktrees/ |
| 2 | Existing worktrees/ |
| 3 | Project config/docs |
| 4 | Ask user |
Safety Verification
For project-local directories:
git check-ignore -q .worktrees 2>/dev/null
If NOT ignored โ Add to .gitignore first.
Creation Steps
git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
cd ".worktrees/$BRANCH_NAME"
if [ -f package.json ]; then npm install; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
npm test / pytest / go test ./...
Report Format
Worktree ready at <full-path>
Branch: <branch-name>
Tests: <N> passing
Ready to implement <feature-name>
Worktree Management
git worktree list
git worktree remove <path>
git worktree prune
Key Rules
- ALWAYS verify directory is gitignored for project-local
- MUST run baseline tests before reporting ready
- If tests fail โ Report failures, ask whether to proceed
- ALWAYS auto-detect and run project setup
Common Mistakes
- โ Skip ignore verification โ โ
Always verify gitignored
- โ Skip baseline tests โ โ
Verify clean starting point
- โ Proceed with failing tests โ โ
Ask user first
- โ Leave stale worktrees โ โ
Remove after merge