ワンクリックで
add-worktree
Create a new worktree for an Issue.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Create a new worktree for an Issue.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Load a GitHub Issue, create a branch, and develop an implementation plan.
Read hachimoku JSONL output and respond to review feedback.
Review and respond to PR review comments.
Commit changes, push to remote, and create a PR in a single workflow.
Wait for PR CI checks to complete, then execute merge.
Ensure complete compliance with code quality standards. Use before commit, before PR creation, or when quality issues are detected.
| name | add-worktree |
| description | Create a new worktree for an Issue. |
Create a new worktree for an Issue.
/add-worktree <issue-number>
| Argument | Type | Required | Description |
|---|---|---|---|
issue-number | integer | Yes | GitHub Issue number |
When the user invokes /add-worktree <number>, follow these steps:
gh issue view <number> --json number,title,body,labels,state
Verify the issue exists and is open.
Same logic as /start-issue:
feat/Branch name:
<prefix>/<issue-number>-<normalized-title>
Worktree directory:
../<project-name>-<branch-name-with-slashes-as-hyphens>
Example:
feat/200-add-feature../my-project-feat-200-add-featureCheck if worktree or branch already exists:
git worktree list
git branch --list <branch-name>
If exists, report error and show existing path.
git worktree add -b <branch-name> <worktree-path>
This creates:
If .hachimoku/ directory exists in the repository root, copy it to the new worktree.
If .hachimoku/ is already present in the worktree (git-tracked), skip the copy. Otherwise copy from the repository root:
if [ ! -d <worktree-path>/.hachimoku ]; then
cp -r .hachimoku/ <worktree-path>/.hachimoku/
fi
Then remove any stale JSONL files if reviews/ exists:
find <worktree-path>/.hachimoku/reviews -name "*.jsonl" -delete 2>/dev/null || true
This preserves project-specific hachimoku agent customizations (agent configs, review settings).
If .hachimoku/ does not exist in the repository root, skip this step silently.
Note: We copy (not 8moku init) to preserve customized agent configurations.
Note: When executed via scripts/add-worktree.sh, this step is handled by the script itself (Claude CLI --allowedTools does not include cp).
Worktree created successfully
Issue: #200 - [Issue title]
Branch: feat/200-add-feature
Directory: ../my-project-feat-200-add-feature
To start working:
cd ../my-project-feat-200-add-feature
Worktree created successfully
Issue: #<number> - <title>
Branch: <branch-name>
Directory: <worktree-path>
To start working:
cd <worktree-path>
Worktree already exists
Issue: #<number> - <title>
Existing path: <existing-path>
To continue working in the existing worktree:
cd <existing-path>
| Error | Action |
|---|---|
| Issue not found | Display error message |
| Branch exists (no worktree) | Suggest creating worktree with existing branch |
| Worktree exists | Show existing path |
| Directory creation failed | Show cause (permissions, path, etc.) |
| Git not in repo | Notify user they're outside a repository |
# List all worktrees
git worktree list
# Remove a worktree
git worktree remove ../my-project-feat-200-add-feature
# Prune stale worktree info
git worktree prune