一键导入
git-worktree
Create isolated Git worktrees for parallel branch work with efficient naming, base selection, and safety checks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create isolated Git worktrees for parallel branch work with efficient naming, base selection, and safety checks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate a local static interactive D3 walkthrough of a pull request. Use when the user wants a zoomable PR map, graph/canvas PR orientation, or alternate visualization of PR system components, data flow, code dependencies, and user actions.
Bootstrap the issue triage configuration for a repository by analyzing existing issues, labels, and contributors to generate `.github/issue-triage/config.json` and `.github/CODEOWNERS`. Use when setting up triage automation on a new or existing repository for the first time.
Compare a pull request's implementation against spec context in spec_context.md and feed any material mismatches into review.json. Use during PR review when approved or repository spec context is available.
Create a product spec from a GitHub issue in this repository by applying the local shared `write-product-spec` workflow with issue context and output paths. Use when an issue should be turned into a product spec artifact stored under `specs/issue-<issue-number>/product.md` and the agent should prepare file changes only, without creating commits or pull requests itself.
Create a technical spec from a GitHub issue in this repository by applying the local shared `write-tech-spec` workflow with issue context and output paths. Use when an issue should be turned into a tech spec artifact stored under `specs/issue-<issue-number>/tech.md` and the agent should prepare file changes only, without creating commits or pull requests itself.
Repo-specific dedupe guidance . Only the categories declared overridable by the core dedupe-issue skill may be specialized here.
| name | git-worktree |
| description | Create isolated Git worktrees for parallel branch work with efficient naming, base selection, and safety checks. |
Create a separate worktree without disturbing the current one, then use the new directory for subsequent Codex tool calls. This does not change the user's existing shell; report the cd command.
git-branch.<type>/<short-desc>-<issueID>..worktrees/<branch-name>, for example .worktrees/feat/search-123.Fetch issue metadata only when an issue ID is given:
gh issue view <issueID> --json title,body,number
Validate:
git check-ref-format --branch <branch-name>
Use one tool call for local state:
git status --short
git branch --show-current
git worktree list --porcelain
git branch --list <branch-name>
test -e .worktrees/<branch-name>
Add remote/freshness checks only when they matter:
git branch --remotes --list '*/<branch-name>'
git fetch origin <base>
git rev-list --left-right --count <base>...origin/<base>
Base policy:
<base> to main unless repo guidance or the user names another base.origin/<base>, then local <base>.upstream/<base> only for fork workflows or explicit guidance.<base> is stale but origin/<base> is selected, proceed and report that local <base> was not updated.Stop only if branch/worktree/path exists, base selection is unsafe or stale for the work, or dirty current changes make intent ambiguous. Otherwise report that dirty current changes, if any, are excluded.
Create the parent directory when the branch name contains /, then add the worktree:
mkdir -p .worktrees/<type>
git worktree add --no-track -b <branch-name> .worktrees/<branch-name> <base-ref>
For same-repo work, <base-ref> is normally origin/main when available. Keep --no-track; git-push sets the branch upstream when published.
Verify in one call:
git worktree list --porcelain
git -C .worktrees/<branch-name> branch --show-current
git -C .worktrees/<branch-name> status --short
pwd
Run pwd from inside the new worktree.
Report branch, path, base ref, whether dirty changes were excluded, current directory, and the user's cd .worktrees/<branch-name> command.
git worktree remove, git worktree prune, rm, git reset, git stash, git push, or force commands unless explicitly asked..worktrees/ ignored by Git.