worktree-init
Create a git worktree for a bd issue. Use when spawning a worker agent for an issue. Keywords: worktree, worker, spawn, parallel, issue.
When & Why to Use This Skill
The worktree-init skill automates the creation and configuration of Git worktrees specifically designed for Claude Code agents. It streamlines parallel development by setting up isolated environments with standardized branch naming, symlinked configurations, and environment variables, enabling developers to spawn worker agents for specific issues without manual setup overhead.
Use Cases
- Parallel Task Management: Efficiently handle multiple bug fixes or feature requests simultaneously by creating isolated Git worktrees, avoiding the need to stash changes or switch branches in the main directory.
- AI Agent Orchestration: Automatically initialize a dedicated workspace for a sub-agent to resolve a specific issue, ensuring the agent has immediate access to necessary tools, MCP servers, and environment settings.
- Standardized Development Workflows: Enforce consistent branch naming conventions (feat/, fix/, chore/) and environment configurations across a project to reduce onboarding time and configuration errors.
| name | worktree-init |
|---|---|
| description | "Create a git worktree for a bd issue. Use when spawning a worker agent for an issue. Keywords: worktree, worker, spawn, parallel, issue." |
worktree-init
Creates a git worktree configured for Claude Code agents to work on a bd issue.
Workflow
When asked to spawn a worker or create a worktree for an issue:
Get issue details:
bd show <issue-id>Create branch name from issue type + title slug:
- bug →
fix/short-description - feature →
feat/short-description - task, chore, epic →
chore/short-description
Example: Issue "Add dark mode toggle" (feature) →
feat/dark-mode-toggle- bug →
Create worktree:
worktree-init feat/dark-mode-toggleOutput for user - provide the command to start the worker:
cd ../mentorfy-feat/dark-mode-toggle && claude "bd show mt-xyz && work on this issue"
What worktree-init creates
../<project>-<branch> with:
- Beads redirect (shared issue database)
- Symlinked
.mcp.json(MCP servers) - Symlinked
.claude/(settings & skills) - Copied
.env*files
Cleanup
bd worktree remove ../<worktree-path> --force