worktree-isolationlisted
Install: claude install-skill Silex-Research/DontPanic
# Worktree Isolation — Clean Branches for Every Task
Use git worktrees to isolate development tasks. Each task gets its own working
directory with its own branch, keeping `main` and the primary worktree clean.
## When to Use
- Multi-step feature work that might need to be abandoned
- Parallel tasks that touch overlapping files
- Experimental changes you want to evaluate before merging
- Subagent-driven development (each subagent gets a worktree)
- Any change where "undo everything" should be trivial
## When to Skip
- Single-file edits or config changes
- Changes you're confident about (bug fix with known root cause)
- The repo doesn't use git
## Protocol
### 1. Create Worktree
```bash
# From the repo root
git worktree add -b feature/<task-name> ../worktrees/<repo>-<task-name>
```
Naming convention:
- Branch: `feature/<task-name>` or `fix/<task-name>`
- Directory: `../worktrees/<repo-name>-<task-name>`
### 2. Bootstrap Environment
Detect and install dependencies:
- `package.json` → `npm install` or `npm ci`
- `Package.swift` → `swift package resolve`
- `pyproject.toml` → `uv sync` or `pip install -e .`
- `Gemfile` → `bundle install`
- `go.mod` → `go mod download`
Run baseline tests to confirm the worktree is healthy before making changes.
### 3. Do the Work
- Make changes in the worktree directory
- Commit frequently with descriptive messages
- Run tests after each significant change
### 4. Verify Before Merging
Before merging back:
1. Run the full test suite i