February 2, 2026
Select agents to install to:
npx add-skill https://github.com/srstomp/pokayokay/blob/main/plugins/pokayokay/skills/worktrees/SKILL.md -a claude-code --skill worktreesInstallation paths:
.claude/skills/worktrees/# Worktrees Skill
Guide for managing git worktrees in pokayokay.
## When Worktrees Are Created
| Task Type | Default | Override |
|-----------|---------|----------|
| feature | Worktree | --in-place |
| bug | Worktree | --in-place |
| spike | Worktree | --in-place |
| chore | In-place | --worktree |
| docs | In-place | --worktree |
| test | Inherits | explicit flag |
## Story-Based Reuse
Tasks within the same story share a worktree:
```
Story 12: User Authentication
├── Task 42: Login form → .worktrees/story-12-user-auth/
├── Task 43: Session handling → .worktrees/story-12-user-auth/ (reused)
└── Task 44: Logout button → .worktrees/story-12-user-auth/ (reused)
```
Benefits:
- Related changes stay together
- No merge conflicts between related tasks
- Single PR for entire story
- Cleaner git history
## Worktree Lifecycle
```
┌─────────────┐
│ Task starts │
└──────┬──────┘
│
▼
┌──────────────────┐ NO ┌──────────────┐
│ Needs worktree? │────────────►│ Work in-place│
└──────┬───────────┘ └──────────────┘
│ YES
▼
┌──────────────────┐ YES ┌──────────────┐
│ Story worktree │────────────►│ Reuse it │
│ exists? │ └──────────────┘
└──────┬───────────┘
│ NO
▼
┌──────────────────┐
│ Create worktree │
│ Install deps │
└──────┬───────────┘
│
▼
┌──────────────────┐
│ Work on task │
└──────┬───────────┘
│
▼
┌──────────────────┐
│ Task complete │
└──────┬───────────┘
│
▼
┌──────────────────┐ YES ┌──────────────┐
│ Part of story? │────────────►│ Continue to │
│ │ │ next task │
└──────┬───────────┘ └──────────────┘
│ NO (or story done)
▼
┌──────────────────┐
│ Completion prompt│
│ merge/PR/keep/ │
│ discard │
└──────────────────┘
```
## Directory Structure
```
project/
├── .worktrees/ # All worktrees (auto-ignored)
│ ├── story-