一键导入
worktree
Create or update a git worktree for a branch
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or update a git worktree for a branch
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create and check out a feature branch when currently on master
Create a git commit with a short, lowercase commit message
Evaluate review comments from the conversation and determine which are valid
Analyze a GitHub issue and develop an implementation plan
Review unstaged git changes for bugs, logic errors, and security problems
Clean up worktrees for branches that have been merged and deleted
基于 SOC 职业分类
| name | worktree |
| description | Create or update a git worktree for a branch |
| disable-model-invocation | true |
The user wants to work on a branch in a separate worktree. The argument is provided as: $ARGUMENTS.
If no argument was provided, ask the user which branch or issue they want.
Follow these steps:
Fetch latest from remote by running git fetch origin.
Determine the branch name:
git branch -a), use it as-is.#82 or 82), generate a descriptive branch name in the format <number>-short-descriptive-kebab-case-name. Use context from the issue (fetch it with gh issue view <number>) to pick a short but descriptive name. For example, issue #82 titled "Unify not-found and unauthorized responses" could become 82-unify-not-found-responses.Determine the worktree path: ../ordning-<branch-name> (relative to the repo root). For example, branch azure-session-lifetime-management becomes ../ordning-azure-session-lifetime-management.
Check if the worktree already exists by running git worktree list and checking if the path is already listed.
Ask the user for confirmation before creating or updating the worktree. Show the branch name and worktree path and ask if they want to proceed.
If the worktree does NOT exist:
git worktree add ../ordning-<branch-name> <branch-name> to create it.git worktree add -b <branch-name> ../ordning-<branch-name> origin/<branch-name> to create a local branch tracking the remote.git worktree add -b <branch-name> ../ordning-<branch-name> origin/master.If the worktree ALREADY exists:
git -C ../ordning-<branch-name> pull to get the latest changes.Copy gitignored files to the new worktree (only when a new worktree was created, not when updating an existing one) by running the wi CLI tool:
wi init <absolute-path-to-this-repo> <absolute-path-to-new-worktree>
This copies build outputs, .env files, and other gitignored files from the current repo to the new worktree so it's ready to build and run. Use absolute paths for both arguments. Run wi help for more details on usage.
Tell the user how to start working there. Print a message like:
Worktree ready! To start Claude in the worktree, run:
cd ../ordning-<branch-name> && claude