Git Worktree Creator

VerifiedSafe

Automatically creates an isolated Git worktree for parallel feature development. Copies environment files (`.env`, `.envrc`) from the root directory and runs `make setup` to prepare the development environment. Useful after planning to work on a feature without interfering with the main branch.

Sby Skills Guide Bot
DevelopmentIntermediate
906/2/2026
Claude Code
#git#worktree#feature-development#environment-setup

Recommended for

Our review

Creates a Git worktree for parallel feature development, automatically copying necessary environment files.

Strengths

  • Full isolation for feature development
  • Automatic copying of environment configuration files (env, envrc)
  • Seamless integration with Claude Code planning workflow

Limitations

  • Requires prior understanding of Git worktrees
  • Does not handle inter-feature dependencies
  • Environment setup must be standardized
When to use it

Use this skill after planning a new feature to set up a clean, isolated development environment.

When not to use it

Avoid this skill for simple changes that don't require isolation or when working on a shared branch without worktrees.

Security analysis

Safe
Quality score88/100

The skill runs a bash script to create a git worktree and copy local environment files, with no network activity, destructive operations, or secret exfiltration. Allowed tools are for file management and project setup only.

No concerns found

Examples

Create worktree for user-auth feature
Create a git worktree for the 'user-auth' feature with all environment files.
Isolated environment for payment feature
Set up a new worktree for the 'add-payment' feature, copying .env and .envrc files.

name: create-worktree description: Creates a git worktree for parallel feature development. Use after planning to prepare an isolated development environment with all necessary environment files. allowed-tools: Bash(git:), Bash(mkdir:), Bash(cp:), Bash(chmod:), Bash(bash:), Bash(make:)

Git Worktree Creator

planモード終了後、feature開発用の独立したworktree環境を自動作成します。

概要

このSkillは以下を自動で実行します:

  1. .worktrees/<feature-name>/ ディレクトリにworktreeを作成
  2. feature/<feature-name> ブランチを新規作成
  3. 環境変数ファイル(.env, .envrc など)を自動コピー
  4. make setup で開発環境をセットアップ

使用方法

基本的な使い方

# スクリプトを実行
bash .claude/skills/create-worktree/scripts/create_worktree.sh <feature-name>

# 例: user-auth 機能を開発する場合
bash .claude/skills/create-worktree/scripts/create_worktree.sh user-auth

実行結果

.worktrees/user-auth/     # worktreeディレクトリ
├── .env                  # ルートからコピー
├── .envrc                # ルートからコピー
├── modules/
│   ├── frontend/.env*    # frontendの環境変数
│   ├── backend/.env      # backendの環境変数
│   └── agent/.env        # agentの環境変数(あれば)
└── ...(その他のファイル)

コピーされる環境変数ファイル

  • ルート: .env, .envrc
  • frontend: .env, .env.local, .env.dev, .env.prd, .env.test
  • backend: .env
  • agent: .env(存在する場合)

作業完了後

PR作成とworktree削除を同時に行う(推奨)

pr-and-cleanup スキルを使用すると、PR作成とworktree削除を自動で行えます:

cd .worktrees/<feature-name>
bash ../../.claude/skills/pr-and-cleanup/scripts/pr_and_cleanup.sh

詳細は pr-and-cleanup スキル を参照してください。

手動でworktreeを削除する場合

git worktree remove .worktrees/<feature-name>

詳細

詳細については REFERENCE.md を参照してください。

Related skills