Worktree Manager
npx machina-cli add skill smith-horn/product-builder-starter/worktree-manager --openclawWorktree Manager
Manage git worktrees for parallel development with conflict prevention and wave-aware execution strategy.
Execution
When triggered, immediately:
- Read
agent-prompt.mdfrom this skill's directory (./agent-prompt.md) - Spawn a single Task with
subagent_type: "general-purpose"passing the agent-prompt content as the prompt - Include in the prompt: the user's request, current working directory, and any arguments passed
- Wait for the agent to complete
- Present the agent's summary to the user
Do NOT execute the worktree workflow in this session. The subagent handles everything including strategy selection (AskUserQuestion), worktree creation, and Docker setup.
Changelog
v2.0.0
- Refactor: Thin dispatcher pattern — full logic extracted to agent-prompt.md
- Skill runs in isolated subagent context, reducing post-compaction restoration from ~360 lines to ~50 lines
See agent-prompt.md for prior changelog entries.
Source
git clone https://github.com/smith-horn/product-builder-starter/blob/main/skills/worktree-manager/SKILL.mdView on GitHub Overview
Orchestrates git worktrees to enable parallel feature development while avoiding conflicts. It uses a wave-aware execution strategy and coordinates multiple Claude sessions to streamline worktree creation and workflow alignment.
How This Skill Works
On trigger, it immediately reads agent-prompt.md from the skill directory, spawns a single subagent with subagent_type: "general-purpose" and passes the prompt plus the user request, current working directory, and any arguments. The subagent handles the strategy selection (including AskUserQuestion), worktree creation, and Docker setup, returning a summary to present to the user. The parent agent does not execute the worktree workflow in this session.
When to Use It
- Creating feature branches across multiple worktrees for parallel development.
- Starting parallel work sessions to speed feature delivery while preventing conflicts.
- Merging worktree-based PRs into main branches.
- Coordinating multiple Claude sessions to align on a common workflow.
- Managing wave-aware task scheduling to stagger worktree operations and reduce contention.
Quick Start
- Step 1: Trigger Worktree Manager with a request or the explicit /worktree command.
- Step 2: The system reads agent-prompt.md and launches a general-purpose subagent with the prompt plus context.
- Step 3: Review the summary presented by the agent and proceed with follow-up prompts or actions.
Best Practices
- Define clear worktree naming conventions to map branches to worktrees.
- Use a consistent wave ordering to schedule tasks and avoid conflicts.
- Validate status and tests in each worktree before merging PRs.
- Document worktree associations in repository documentation or READMEs.
- Keep agent-prompt.md updated with current workflow steps and constraints.
Example Use Cases
- Spawn separate worktrees for frontend and backend feature work simultaneously.
- Parallelize refactors by dedicating a worktree per module and coordinating merges.
- Handle PRs that touch multiple worktrees by coordinating PRs and merges.
- Coordinate Claude sessions for build, test, and deploy steps in a wave sequence.
- Use /worktree to initiate parallel experiments during sprint planning.
Frequently Asked Questions
Related Skills
webapp-testing
anthropics/skills
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
code-quality-principles
athola/claude-night-market
Provides KISS, YAGNI, and SOLID code quality principles for clean code,
coding-assistant
chinkan/RustFox
Help users write, review, and debug code
Governance
smith-horn/product-builder-starter
Enforces engineering standards and code quality policies. Use during code reviews, before commits, when discussing standards or compliance, for quality audits, and when running retrospectives. Trigger phrases include 'run a retro', 'retrospective', 'code review', 'run review', or 'audit standards'.
development-workflow
athola/claude-night-market
detailed development workflow with modular patterns for git, code review, testing, documentation, and deployment
skill-check
olgasafonova/SkillCheck-Free
Validate Claude Code skills against Anthropic guidelines. Use when user says "check skill", "skillcheck", "validate SKILL.md", or asks to find issues in skill definitions. Contains complete validation knowledge.