Imported from onurmicoogullari/agent-tools (
codex/skills/create-worktree/SKILL.md). Install upstream withnpx skills add onurmicoogullari/agent-tools --skill create-worktree. Copyright stays with the author.
Create Worktree
Rules
- Use a worktree before writing code for non-trivial features, fixes, or refactors unless the user explicitly says not to.
- Check existing worktrees first and reuse one when it clearly matches the task.
- Keep all planning, coding, searching, and testing scoped to the selected worktree after creation.
Workflow
- Check existing worktrees:
git worktree list. - If relevant worktrees exist, list them with branch names and ask whether to resume or create a new one.
- Gather missing basics only: work type (
fix,feat,refact) and a short task description. - Derive a kebab-case branch:
<type>/<description>, for examplefix/auth-timeout. - Create the worktree under
.worktrees/<branch-name>from the default base branch. - Ensure
.worktrees/is ignored if the repo does not already ignore it. - Continue from inside the worktree path.
Fallback Command
mkdir -p .worktrees
Use the repo's actual base branch instead of origin/main when different.