Agent skill
worktree
Create a git worktree and prime the development environment for a new feature or refactor
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/worktree-incubateur-ademe-benefriches
SKILL.md
Create Git Worktree
Create a new git worktree for isolated feature development.
Instructions
- Parse the branch name from arguments
- Determine if this is a new branch or existing branch
- Run the worktree creation script
- Report the result and next steps
Execution
Run the following command based on the arguments:
# For new branches (default behavior)
./scripts/create-worktree.sh <branch-name> --new-branch
# For existing branches (if user specifies --existing)
./scripts/create-worktree.sh <branch-name>
Branch Naming Convention
If the user provides just a feature name without a prefix, add the appropriate prefix:
- Features:
feat/<name>(default) - Refactors:
refactor/<name>(if user mentions "refactor") - Fixes:
fix/<name>(if user mentions "fix" or "bug") - Chores:
chore/<name>(if user mentions "chore")
Examples
| User Input | Branch Name |
|---|---|
/worktree new-feature |
feat/new-feature |
/worktree refactor auth |
refactor/auth |
/worktree fix/login-bug |
fix/login-bug (keep as-is) |
/worktree feat/my-thing |
feat/my-thing (keep as-is) |
After Execution
Tell the user:
- The worktree location
- How to navigate to it:
cd <worktree-path> - Remind them to start a new Claude Code session in that directory for isolated work
Arguments
$ARGUMENTS
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?