一键导入
wt
Create or manage a git worktree for isolated parallel development — lets multiple agents work in the repo simultaneously without branch collisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or manage a git worktree for isolated parallel development — lets multiple agents work in the repo simultaneously without branch collisions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Write a structured handoff at session end. Preserves context so the next agent can resume without human briefing. Invoke before ending any feature session longer than 30 minutes.
Multi-perspective code review against project standards with P1/P2/P3 severity classification. Works in Claude Code (Agent + optional GitHub MCP) and Cursor (Task subagents + gh/git). Use when the user invokes /review, asks for a PR or diff review, or wants a standards-aligned review with severity tags.
Multi-perspective code review (P1/P2/P3) for Cursor: inline checklists plus three parallel Task subagents (perf-auditor, security-reviewer, simplicity-reviewer with combined data-integrity prompt). Use when the user invokes /review, asks for a PR review, or wants repo-standard findings with severity.
Create well-formatted git commits following conventional commit standards.
Red→green→refactor discipline for new behavior — forces a failing test before implementation and a passing test before any claim of done.
Create a token-efficient state snapshot for context preservation during long sessions.
| name | wt |
| description | Create or manage a git worktree for isolated parallel development — lets multiple agents work in the repo simultaneously without branch collisions. |
Create a git worktree branched from origin/main at ../<repo>-<name>/ and enter it — no manual cd. Each worktree is a separate working tree on its own branch, so multiple Claude Code sessions (or other agents) can work the repo in parallel without stepping on each other's staging, HEAD, or node_modules.
/wt <name> # Create a new worktree and switch the session into it
/wt list # List active worktrees
/wt remove <name> # Remove a worktree and delete its branch (safe: only if merged)
main for the hotfix; your feature branch stays untouched.Prefer git stash or a throwaway branch for 30-second tasks — worktrees are overkill for those.
When invoked as /wt <name>:
Step 1 — create the worktree on disk:
make wt name=<name>
This runs:
REPO=$(basename $(git rev-parse --show-toplevel))
BRANCH=<name>
WORKTREE_PATH=$(realpath "../${REPO}-${BRANCH}")
git fetch origin main
git worktree add "$WORKTREE_PATH" -b "$BRANCH" origin/main
Compute WORKTREE_PATH deterministically as an absolute path — EnterWorktree below requires a path that matches git worktree list exactly.
Step 2 — enter the worktree:
Call EnterWorktree with path: <WORKTREE_PATH> (the absolute path from step 1). The session's working directory switches into the worktree. No cd required.
Step 3 — personalize (user must run these):
Pick a random color from: red, blue, green, yellow, purple, orange, pink, cyan
Tell the user to run:
/rename <name>
/color <chosen-color>
/renameand/colorare Claude Code built-in commands — skills cannot invoke them.
A distinct session name + color per worktree prevents cross-session mistakes.
Report:
make install and (if needed) make db-start in the new tree. See the runbook below.When work is done in this worktree, call ExitWorktree:
action: "keep" — return the session to the original dir; worktree + branch preserved. Use this before opening a PR (you still want the code to exist).action: "remove" — return to the original dir and delete the worktree + branch. Does not work for worktrees created via make wt (ExitWorktree only removes worktrees it originally created). For those, use action: "keep" followed by make wt-remove name=<name>.If the worktree has uncommitted changes, ExitWorktree action: "remove" refuses unless discard_changes: true. Confirm with the user before passing that flag.
make wt-list
Shows each worktree's path, branch, and HEAD SHA.
make wt-remove name=<name>
Runs:
git worktree remove "../${REPO}-<name>"
git branch -d <name> # safe: only deletes merged branches
If the branch is not merged, git branch -d refuses — either merge it first, PR it, or delete with -D manually once you're sure.
origin/main. You'll tangle two branches' changes..env or secrets in a worktree. The secrets-hygiene rules apply identically; there's no per-worktree exception.supabase db reset against a shared local Supabase instance from one worktree while another worktree is using it. Local Supabase is a singleton — coordinate, or give each worktree its own port via supabase/config.toml per worktree.EnterWorktree with a relative path or with a path that isn't in git worktree list — the tool rejects both. Always compute the absolute path from make wt's output.git worktree list.docs/runbooks/multi-agent-worktrees.md — coordination patterns for multiple parallel agents