worktree-first
Installation
SKILL.md
Worktree-First Development
For new substantive implementation work in a project repository—features, nontrivial fixes, and substantial refactors—use a dedicated Git worktree at <repo>/.worktrees/<task-slug>. Read-only investigation and trivial documentation or metadata edits may remain in the current checkout.
Before editing:
- Inspect the repository status, existing branches, and existing worktrees. Reuse a branch or worktree already dedicated to the task.
- Preserve the primary checkout and its uncommitted changes.
- Ensure
.worktrees/is ignored through the repository-local Git exclude file. Avoid changing the project’s committed.gitignoresolely for local worktrees. - Fetch
originand create a dedicated task branch fromorigin/main. Iforigin/mainis unavailable, use localmain; if the repository has nomain, use its default integration branch. Report any fallback. - Follow the repository’s branch-naming convention; otherwise use a descriptive task slug.
- Perform implementation and verification in the task worktree. Report its path, branch, and base revision.
Worktree setup is complete when the task worktree is on the intended branch, .worktrees/ is ignored, and the primary checkout remains unchanged. If safe setup is unavailable, report the blocker and proposed fallback before editing.
Retain the worktree through review and integration. Remove it after the work is safely integrated or Will requests cleanup.