Agent skill
worktree-create
新しいブランチとworktreeを作成し、開発作業を開始するためのスキル。タスク着手時に「worktreeを作成」「ブランチを作成して作業開始」「/worktree-create <branch-name>」などで使用。
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/worktree-create
SKILL.md
Worktree Create
新規タスクの作業を開始する際に、ブランチとworktreeを作成するスキル。
使用タイミング
- 新しいタスクに着手する時
- 機能開発やバグ修正を開始する時
- 独立した作業ディレクトリが必要な時
引数
/worktree-create <branch-name>
<branch-name>: 作成するブランチ名(例:feature/add-user-auth,fix/login-bug)
ブランチ命名規則
| プレフィックス | 用途 |
|---|---|
feature/ |
新機能 |
fix/ |
バグ修正 |
refactor/ |
リファクタリング |
docs/ |
ドキュメント |
実行手順
1. 現在の状態を確認
# 現在のブランチと未コミットの変更を確認
git status
git worktree list
2. Worktreeを作成
# mainブランチから新しいworktreeを作成
git worktree add ../Lorepedia-<branch-name> -b <branch-name> main
3. 環境変数ファイルのシンボリックリンク作成
worktree間で.envを共有するため、メインリポジトリの.envへシンボリックリンクを作成:
cd ../Lorepedia-<branch-name>
# メインリポジトリ(最初のworktree)のパスを動的に取得してリンク
MAIN_REPO=$(git worktree list --porcelain | grep "^worktree " | head -1 | sed 's/worktree //')
ln -s "$MAIN_REPO/.env" .env
4. 依存関係のインストール
worktreeディレクトリではnode_modulesが共有されないため、必要に応じてインストール:
pnpm install
5. 作業開始の案内
worktree作成後、以下を案内する:
- 作業ディレクトリのパス
- 次のステップ(実装開始)
注意事項
- 未コミットの変更がある場合は、先にコミットまたはスタッシュする
- 同名のブランチが既に存在する場合はエラーになる
- worktree作成後は新しいディレクトリで作業を継続する
実行例
User: /worktree-create feature/add-world-list
Assistant:
- git status で現在の状態を確認
- git worktree add ../Lorepedia-feature-add-world-list -b feature/add-world-list main を実行
- ln -s でメインリポジトリの.envへシンボリックリンクを作成
- pnpm install を実行
- 作業ディレクトリ: /path/to/Lorepedia-feature-add-world-list 次のステップ: 実装を開始してください
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?