Agent skill
create-worktree
Creates a git worktree with branch and copies environment files (.envrc, .mcp.json)
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/create-worktree
SKILL.md
Create Worktree Skill
CLAUDE: When this skill is invoked with /create-worktree <branch-name>, immediately run:
./.claude/skills/create-worktree/create-worktree.sh <branch-name>
Purpose
Creates a new git worktree with a feature branch, automatically copying environment files that are not tracked in git.
Usage
/create-worktree feature/my-new-feature
What It Does
- Creates a new git worktree at
../pierre_mcp_server-<branch-name> - Creates a new branch with the specified name
- Copies
.envrcfrom main worktree - Copies
.mcp.jsonif present - Runs
direnv allowto activate the environment
Commands
Using the script directly:
./.claude/skills/create-worktree/create-worktree.sh <branch-name> [optional-path]
# Examples:
./.claude/skills/create-worktree/create-worktree.sh feature/new-api
./.claude/skills/create-worktree/create-worktree.sh fix/bug-123 /tmp/quick-fix
Manual steps (if script unavailable):
BRANCH="feature/my-feature"
WORKTREE="../pierre_mcp_server-${BRANCH//\//-}"
git worktree add -b "$BRANCH" "$WORKTREE"
cp .envrc "$WORKTREE/"
cp .mcp.json "$WORKTREE/" 2>/dev/null || true
cd "$WORKTREE" && direnv allow
Cleanup
When done with a worktree:
git worktree remove ../pierre_mcp_server-feature-my-feature
git branch -d feature/my-feature # if merged
Related Skills
finish-worktree- Completes feature branch work with rebase and merge
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?