Extract implementation stages from plans and create git worktrees for parallel development.
Creates git worktrees for each stage in a plan file, enabling parallel development in isolated branches. Use when user wants to set up worktrees for a plan or work on specific stages in isolation.
/plugin marketplace add grumps/claude-dotfiles/plugin install gdf@gdf-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Extract implementation stages from plans and create git worktrees for parallel development.
This skill works with plans that follow the stage-based template (see .claude/prompts/plan.md). It:
The plan file must follow the stage-based template with JSON metadata block:
{
"plan_id": "2025-11-17-my-feature",
"status": "draft",
"stages": [
{
"id": "stage-1",
"name": "Component Name",
"branch": "feature/plan-id-stage-1",
"worktree_path": "../worktrees/plan-id/stage-1",
"status": "not-started",
"depends_on": []
}
]
}
# List all available plans
just plan-ls
# Validate plan metadata
just plan-validate .claude/plans/YYYY-MM-DD-feature.md
# List all stages in a plan
just plan-list .claude/plans/YYYY-MM-DD-feature.md
# Setup all worktrees
just plan-setup .claude/plans/YYYY-MM-DD-feature.md
# Setup single stage
just plan-stage .claude/plans/YYYY-MM-DD-feature.md stage-1
# Show status
just plan-status .claude/plans/YYYY-MM-DD-feature.md
# View all active worktrees
just plan-worktrees
# Remove a worktree
just plan-remove ../worktrees/plan-id/stage-1
# Prune deleted worktrees
just plan-prune
# List stages
uv run scripts/planworktree.py list .claude/plans/YYYY-MM-DD-feature.md
# Setup all stages
uv run scripts/planworktree.py setup-all .claude/plans/YYYY-MM-DD-feature.md
# Setup single stage
uv run scripts/planworktree.py setup .claude/plans/YYYY-MM-DD-feature.md stage-1
# Show status
uv run scripts/planworktree.py status .claude/plans/YYYY-MM-DD-feature.md
When a user wants to set up worktrees for a plan:
.claude/plans/just plan-validate .claude/plans/YYYY-MM-DD-feature.md
Run the list command to show the user what stages will be created:
just plan-list .claude/plans/YYYY-MM-DD-feature.md
Display:
Based on user preference, either:
just plan-setup .claude/plans/YYYY-MM-DD-feature.md
just plan-stage .claude/plans/YYYY-MM-DD-feature.md <stage-id>
The script will:
.claude/plans/CURRENT_STAGE.md symlink to the planShow the user what was created:
just plan-status .claude/plans/YYYY-MM-DD-feature.md
Also show all active worktrees:
just plan-worktrees
Tell the user:
cd ../worktrees/plan-id/stage-1.claude/plans/CURRENT_STAGE.md in each worktreeAfter worktrees are created, the development workflow is:
Work in isolation: Each stage has its own worktree
cd ../worktrees/plan-id/stage-1
# Make changes, run tests
git add . && git commit -m "Implement stage 1"
Reference the plan: Plan is symlinked in each worktree
cat .claude/plans/CURRENT_STAGE.md
Check stage status: Update plan metadata as stages progress
# In main repo, update plan frontmatter:
# Change status from "not-started" to "in-progress" to "complete"
Merge stages: When stage is complete, merge to main
cd /path/to/main/repo
git merge feature/plan-id-stage-1
Handle dependencies: Merge stages in dependency order
# If stage-2 depends on stage-1:
git merge feature/plan-id-stage-1 # First
git merge feature/plan-id-stage-2 # Second
Clean up: Remove worktrees when done
git worktree remove ../worktrees/plan-id/stage-1
After setup, the structure looks like:
project/
├── .git/
├── .claude/
│ └── plans/
│ └── 2025-11-17-my-feature.md # Original plan
├── src/
└── ...
worktrees/
└── 2025-11-17-my-feature/
├── stage-1/ # Worktree for stage 1
│ ├── .git # Points to main .git
│ ├── .claude/
│ │ └── plans/
│ │ └── CURRENT_STAGE.md -> symlink to plan
│ └── src/ # Same source tree
└── stage-2/ # Worktree for stage 2
└── ...
Handle these common issues:
feature/{plan-id}-{stage-id}../worktrees/{plan-id}/{stage-id} to keep separate from main repoThis skill includes Just recipes in justfiles/plans.just. Include it in your project's justfile:
import? 'justfiles/plans.just'
Available recipes:
plan-ls - List all plansplan-validate - Validate plan metadataplan-list - List stages in a planplan-setup - Setup all worktreesplan-stage - Setup specific stageplan-status - Show plan statusplan-worktrees - View active worktreesplan-remove - Remove a worktreeplan-prune - Prune deleted worktrees# List stages
just plan-list .claude/plans/2025-11-17-notification-hooks.md
# Output shows rich table with:
# ID | Name | Status | Branch | Dependencies
# stage-1 | Linux Implementation | not-started | feature/... | None
# stage-2 | macOS Documentation | not-started | feature/... | stage-1
# Setup all at once
just plan-setup .claude/plans/2025-11-17-notification-hooks.md
# Work on stage 1
cd ../worktrees/notification-hooks/stage-1
# Implement Linux notification hooks
git commit -am "Implement Linux notification hooks"
# Back to main repo, check status
cd -
just plan-status .claude/plans/2025-11-17-notification-hooks.md
# Merge stage 1
git merge feature/notification-hooks-stage-1
# Now work on stage 2
cd ../worktrees/notification-hooks/stage-2
# Document macOS approach
git commit -am "Document macOS notification approach"
# Merge stage 2
cd -
git merge feature/notification-hooks-stage-2
# Clean up
just plan-remove ../worktrees/notification-hooks/stage-1
just plan-remove ../worktrees/notification-hooks/stage-2
just plan-prune
# Setup only the stage you need
just plan-stage .claude/plans/2025-11-17-feature.md stage-3
# Work on it
cd ../worktrees/feature/stage-3
# ... make changes ...
# Check if dependencies are met before merging
just plan-list .claude/plans/2025-11-17-feature.md
# Rich table shows: stage-3 depends on: stage-1, stage-2
# Make sure those are merged first!
The script creates parent directories automatically. If you get permission errors, check directory ownership.
If the branch exists from previous work:
git branch -D feature/plan-id-stage-1If .claude/plans/CURRENT_STAGE.md is broken:
ln -sf /absolute/path/to/plan.md .claude/plans/CURRENT_STAGE.mdIf git worktree remove fails:
git worktree remove --force if neededgit worktree pruneThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.