界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

worktree

worktree

【开发与工程】Use for non-trivial or parallel work that should happen in a separate git worktree.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: worktree description: Use for non-trivial or parallel work that should happen in a separate git worktree.

Worktree

If topology=multi-module (triage announcement or coordinator spec/plan declaration), read ../references/multi-module.md. Treat each repository as an independent Git and worktree boundary; never run a workspace-wide Git mutation from their common parent.

Before creating worktrees, resolve each registered repository and verify status and baseline. Map paths in the coordinator plan and use the change-set ID in names. A missing repo, unrelated dirty change, or red baseline blocks the change. Detached HEAD is allowed for read-only integration, not implementation. Do not clone or clean automatically.

git worktree add ../<repo>-<topic> -b <type>/<topic>   # <type>: feat | fix | chore | ...
cd ../<repo>-<topic> && <setup> && <run tests>

Baseline must be green in every participating repository. If red, STOP - don't build on broken ground. Done → ship.

Tool scope

Worktrees are separate directories from the main repo. Semantic indexing (code graph, symbol search) covers the original repo, not the worktree. File tools (read, grep, glob) work normally. For short-lived worktrees this is acceptable; for long sessions, note this limitation to the agent at dispatch.

我的收藏