en un clic
liam-worktree
创建隔离git worktree用于并行开发或PR审查。触发词: worktree, 并行开发.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
创建隔离git worktree用于并行开发或PR审查。触发词: worktree, 并行开发.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
迭代收敛(太虚二转·澄源):链式分析自动循环至稳定。触发词: 收敛, 黑格尔, hegel.
提交推送开PR,自适应描述。触发词: commit and PR, ship this.
多角色并行审查需求/计划文档。触发词: 审文档, doc review.
创建清晰传达价值的git commit。触发词: commit, save changes.
发散思维(太虚一转·散怀):想法量、SCAMPER、Stakeholder轮转。触发词: 发散, 开脑洞, 奥斯本. Divergent thinking (太虚一转·散怀): volume of ideas, SCAMPER, stakeholder rotation → idea-pool.md. Use when user says "发散", "开脑洞", "奥斯本", "osborn". 即便用户未明确说"用 osborn",当对话出现以下信号时也应主动建议使用:方案只有一条路想扩空间、 团队讨论在同一批想法里打转、方向定了但觉得可能有更好的选择、用户说"还有别的思路吗""帮我想想还有什么可能"。 不要等用户说出触发词才启动——识别意图比匹配关键词更重要。
Fact verification (太虚三转·叩实): decompose conclusion → testable predictions → external data validation. Use when user says "验证", "贝叶斯", "bayes", "靠谱吗".
| name | liam-worktree |
| description | 创建隔离git worktree用于并行开发或PR审查。触发词: worktree, 并行开发. |
| version | 1.0.0 |
| last_updated | 2026-06-12 |
| allowed-tools | Bash(bash *worktree-manager.sh) |
Create a worktree under .worktrees/<branch> with branch-specific setup that git worktree add alone does not handle:
.env, .env.local, .env.test, etc. from the main repo (skips .env.example)mise/direnv configs, with branch-aware safety rules so review branches do not auto-grant trust to untrusted .envrc content.worktrees to .gitignore if not already ignoredfrom-branch is fetched, not checked outInvoke the bundled script via the runtime Bash tool. On Claude Code, ${CLAUDE_SKILL_DIR} resolves to the skill's own directory across both marketplace-cached installs and claude --plugin-dir local development; the runtime Bash tool's CWD is the user's project, not the skill directory, so a bare bash scripts/worktree-manager.sh fails. On other targets (Codex, Gemini, Pi, etc.) ${CLAUDE_SKILL_DIR} is unset and the :-. fallback yields the bare relative path those harnesses expect.
bash "${CLAUDE_SKILL_DIR:-.}/scripts/worktree-manager.sh" create <branch-name> [from-branch]
Defaults:
from-branch defaults to origin's default branch (or main if that cannot be resolved)origin/<from-branch> (or the local ref if the remote is unavailable)Examples:
bash "${CLAUDE_SKILL_DIR:-.}/scripts/worktree-manager.sh" create feat/login
bash "${CLAUDE_SKILL_DIR:-.}/scripts/worktree-manager.sh" create fix/email-validation develop
After creation, switch to the worktree with cd .worktrees/<branch-name>.
Use git directly — no wrapper is needed and none is provided:
git worktree list # list worktrees
git worktree remove .worktrees/<branch> # remove a worktree
cd .worktrees/<branch> # switch to a worktree
cd "$(git rev-parse --show-toplevel)" # return to main checkout
To copy .env* files into an existing worktree created without them, run this from the main repo (not from inside the worktree, since branch names often contain slashes like feat/login):
cp .env* .worktrees/<branch>/
When mise or direnv configs are present, the script attempts to trust them so hooks and scripts do not block on interactive prompts. Trust is baseline-checked against a reference branch:
main, develop, dev, trunk, staging, release/*): the new worktree's configs are compared against that branch; unchanged configs are auto-trusted. direnv allow is permitted.direnv allow is skipped regardless, because .envrc can source files that direnv does not validate.Modified configs are never auto-trusted. The script prints the manual trust command to run after review.
Create a worktree when:
Do not create a worktree for single-task work that can happen on a branch in the main checkout.
liam-work and liam-code-review offer this skill as an option. When the user selects "worktree" in those flows, invoke bash "${CLAUDE_SKILL_DIR:-.}/scripts/worktree-manager.sh" create <branch> with a meaningful branch name derived from the work description (e.g., feat/crowd-sniff, fix/email-validation). Avoid auto-generated names like worktree-jolly-beaming-raven that obscure the work.
"Worktree already exists": the path is already in use. Either switch to it (cd .worktrees/<branch>) or remove it (git worktree remove .worktrees/<branch>) before recreating.
"Cannot remove worktree: it is the current worktree": cd out of the worktree first, then git worktree remove.
Dev tool trust was skipped: the script prints the manual command. Review the config diff (git diff <base-ref> -- .envrc), then run the printed command from the worktree directory.