Manages Git Worktree parallel development. Required when starting new work. Creates worktrees with wt- prefix for parallel development. User confirmation required before creation.
Manages Git Worktrees for parallel development. Triggers when starting new work to create isolated environments with the `wt-` prefix. Requires user confirmation and handles submodule scenarios by creating worktrees inside submodules, never in the parent repository.
/plugin marketplace add sumik5/sumik-claude-plugin/plugin install sumik@sumikThis skill inherits all available tools. When active, it can use any tool Claude has access to.
CONCEPTS.mdNAMING.mdTROUBLESHOOTING.mdWORKFLOWS.mdGit Worktreeを使用した並行開発の完全ガイドです。複数のブランチを同時に作業でき、Claude Codeの制約を考慮した実用的な運用方法を提供します。
新しい、今までの作業と関係ない作業だと判断した場合:
ls -la .gitmodules
git submodule status
通常のworktree作成フローに従う:
wt-xxxを作成⚠️ 絶対ルール: submodule内のコードを変更する場合、親gitにworktreeを作成してはいけない
変更対象を厳密に明確化すること
変更対象に基づいてworktree作成場所を決定
submodule名/wt-xxx形式必ずユーザーに確認を取ってから実行すること
現在作業しているworktreeでの作業であれば確認不要
このworktreeを使った作業フローは絶対に遵守すること
新しいタスク受信
↓
現在の作業と関連?
├─ Yes → 現在のworktreeで作業継続(確認不要)
└─ No → 新規worktree必要
↓
Step 1: Submoduleの有無を確認
├─ Submoduleなし → AskUserQuestionで作業場所を確認
└─ Submoduleあり → AskUserQuestionで変更対象と作業場所を確認
すべてのworktree確認はAskUserQuestion形式の選択肢で行う
AskUserQuestion(
questions=[{
"question": "新しい作業を開始します。作業場所を選択してください",
"header": "作業場所",
"options": [
{
"label": "現在のブランチで作業",
"description": f"現在のブランチ `{current_branch}` で直接作業を開始"
},
{
"label": "新規worktreeを作成",
"description": "独立したworktreeで作業(並行開発向け)"
}
],
"multiSelect": False
}]
)
AskUserQuestion(
questions=[{
"question": f"worktree `wt-{feature_name}` を作成しますか?",
"header": "Worktree作成",
"options": [
{
"label": "作成する",
"description": f"ブランチ `feature/{feature_name}` を作成して作業開始"
},
{
"label": "作成しない",
"description": "現在のブランチで作業を継続"
}
],
"multiSelect": False
}]
)
AskUserQuestion(
questions=[{
"question": "変更対象を選択してください",
"header": "変更対象",
"options": [
{
"label": "親git側のコード",
"description": "プロジェクトルートの設定ファイルや親gitのソースコード"
},
{
"label": f"Submodule: {submodule_name}",
"description": f"{submodule_name}内のコードを変更"
}
# 複数submoduleがある場合は各submoduleを選択肢として追加
],
"multiSelect": False
}]
)
AskUserQuestion(
questions=[{
"question": f"{submodule_name}内にworktreeを作成しますか?",
"header": "Submodule Worktree",
"options": [
{
"label": "作成する",
"description": f"{submodule_name}/wt-{feature_name} を作成(親gitには作成しません)"
},
{
"label": "作成しない",
"description": f"{submodule_name}の現在のブランチで作業"
}
],
"multiSelect": False
}]
)
複数の確認を1回で行う場合:
AskUserQuestion(
questions=[
{
"question": "作業場所を選択してください",
"header": "作業場所",
"options": [
{"label": "現在のブランチ", "description": f"`{current_branch}` で作業"},
{"label": "新規worktree", "description": "独立した作業環境を作成"}
],
"multiSelect": False
},
{
"question": "変更対象を選択してください(worktree作成時のみ)",
"header": "変更対象",
"options": [
{"label": "親git", "description": "親リポジトリのコード"},
{"label": f"{submodule_name}", "description": "Submodule内のコード"}
],
"multiSelect": False
}
]
)
## 📚 詳細ドキュメント
### [基本概念と制約](./CONCEPTS.md)
- Git Worktreeとは
- Claude Codeの制約と解決策
- 推奨ディレクトリ構造
- Agent階層との統合
### [ワークフロー](./WORKFLOWS.md)
- Worktreeの作成方法
- Worktreeでの作業手順
- Worktreeの管理と削除
- 実践的な操作コマンド
### [命名規則](./NAMING.md)
- 基本フォーマット
- カテゴリ別の命名例
- パラメータの詳細説明
- 命名のベストプラクティス
### [トラブルシューティング](./TROUBLESHOOTING.md)
- よくある問題と解決方法
- ベストプラクティス(DO/DON'T)
- serena連携の設定
- gwqツールの活用
## 🚀 クイックスタート
### 0. 変更対象の確認(最重要)
```bash
# 何を変更するか明確化
# - 親git側のコード変更?
# - Submodule内のコード変更のみ?
# Submoduleの有無を確認
ls -la .gitmodules
git submodule status
# 親gitルートで実行
# 既存worktreeを確認
git worktree list
# 新規worktreeを作成(ユーザー確認後)
git worktree add -b feature/new-feature wt-feat-new-feature main
# ⚠️ 重要: 親gitにはworktreeを作らない
# 対象submodule内でworktreeを作成(ユーザー確認後)
cd submodule1
git worktree add -b feature/new-feature wt-feat-new-feature main
# 作業対象のsubmoduleのworktreeに移動
cd wt-feat-new-feature
# 親gitのworktreeに移動
cd wt-feat-new-feature
# 環境設定をコピー
cp ../.env .env
cp -r ../.serena .serena
# 開発作業
git status
git add .
git commit -m "feat: implement new feature"
# 対象submoduleのworktreeに移動(既に移動済みの場合はスキップ)
cd submodule1/wt-feat-new-feature
# 環境設定をコピー(submoduleの親ディレクトリから、必要に応じて)
cp ../.env .env 2>/dev/null || echo "No .env in submodule"
cp -r ../.serena .serena 2>/dev/null || echo "No .serena in submodule"
# 開発作業
git status
git add .
git commit -m "feat: implement new feature in submodule"
# 親gitルートに戻る
cd ..
# Worktree削除(ユーザーまたはManagerが実行)
git worktree remove wt-feat-new-feature
# submoduleのルートに戻る
cd .. # submodule1/wt-feat-new-feature から submodule1 へ
# submodule内のWorktree削除(ユーザーまたはManagerが実行)
git worktree remove wt-feat-new-feature
# プロジェクトルートに戻る
cd ..
wt-プレフィックスを使用submodule名/wt-xxx).envと.serenaをコピーwt-xxx(親gitルート直下)
submodule名/wt-xxx../)への作成新規worktree作成時:
.gitmodulesとgit submodule status)wt-プレフィックスで命名git worktree addで作成
submodule名/wt-xxx.envをコピー(必要に応じて).serenaをコピー作業完了時:
次のステップ: 基本概念と制約で詳細を確認してください。
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.