بنقرة واحدة
speckit-worktrees-create
Spawn an isolated git worktree for a feature branch (default-on, configurable layout)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Spawn an isolated git worktree for a feature branch (default-on, configurable layout)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | speckit-worktrees-create |
| description | Spawn an isolated git worktree for a feature branch (default-on, configurable layout) |
| compatibility | Requires spec-kit project structure with .specify/ directory |
| metadata | {"author":"github-spec-kit","source":"worktrees:commands/speckit.worktrees.create.md"} |
Spawn an isolated git worktree for a feature branch so you can work on multiple features — or run multiple agents — in parallel without switching branches.
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). The user may specify:
005-user-auth)current to create a worktree for the current branch--in-place or --no-worktree to skip worktree creation entirelygit rev-parse --show-toplevel)git worktree is available (git worktree list succeeds)Git extension (optional): The Spec Kit Git extension’s before_specify → speckit.git.feature checks out the feature branch on the current tree. For parallel agents on one primary clone, maintainers recommend disabling that hook in .specify/extensions.yml and relying on git worktree add -b (this script) so the primary HEAD stays put. See the extension README Parallel agents and the Git extension.
Read configuration from .specify/extensions/worktrees/worktree-config.yml if it exists. Defaults apply when the file is absent.
| Key | Default | Description |
|---|---|---|
layout | nested | nested — worktree at .worktrees/<branch>/ inside repo (self-contained); sibling — at ../<repo>--<branch> (IDE-friendly) |
auto_create | true | When true, the after_specify hook creates a worktree without prompting |
sibling_pattern | {{repo}}--{{branch}} | Name pattern for sibling directories |
dotworktrees_dir | .worktrees | Subdirectory name for nested layout |
Environment variable SPECIFY_WORKTREE_PATH overrides the computed path entirely.
Determine target branch:
current, use the output of git branch --show-currentafter_specify hook call, use the branch that /speckit.specify just created (read from SPECIFY_FEATURE env var or the most recent feature branch)Invoke the script: Run the deterministic bash script shipped with this extension:
bash "$(dirname "$0")/../scripts/bash/create-worktree.sh" \
--json \
[--layout sibling|nested] \
[--base-ref HEAD|main|origin/main|…] \
[--path <override>] \
[--in-place] \
[--dry-run] \
"$BRANCH_NAME"
The script reads worktree-config.yml automatically and outputs JSON:
{"branch":"005-user-auth","worktree":true,"path":"/Users/me/code/MyProject--005-user-auth","layout":"sibling"}
If the script is unavailable (e.g., non-bash environment), perform the equivalent operations directly:
git worktree add -b <branch> <path> <base-ref> (new branch) or git worktree add <path> <branch> (existing branch).worktrees/ is in .gitignoreVerify spec artifacts: Prefer specs/<branch>/ in the worktree when using a worktree-first workflow. If /speckit.specify ran on the primary checkout first (after_specify hook order), artifacts may still be under the primary tree — report where they actually are.
Report: Output a summary:
## Worktree Created
| Field | Value |
|-------|-------|
| **Branch** | 005-user-auth |
| **Layout** | sibling |
| **Worktree path** | /Users/me/code/MyProject--005-user-auth |
| **Spec artifacts** | spec.md, plan.md |
**Next steps:**
- Open the worktree directory in your IDE or a new terminal
- Run `/speckit.implement` from the worktree root
- Run `/speckit.worktrees.list` to see all active worktrees
--in-place or --no-worktree, or auto_create is false in config and this is a hook calldotworktrees_dir value if not presentgit worktree add -b creates it from the configured base ref; if it already exists, the worktree attaches to it. Do not assume the Git extension ran speckit.git.feature first (it may be disabled for parallel worktrees)Generate a custom checklist for the current feature based on user requirements.
Identify underspecified areas in the current feature spec by asking up
Run a budget-aware exploration loop that externalizes every finding into the harness state files
Initialize externalized harness state (budget, candidates, curated set, evidence, verification, observations) for the active feature
Synthesize curated evidence and verification records into the feature's research.md with a coverage table
Render a compact, budget-aware slice of the harness state with a recommended next action