using-git-worktrees
Installation
SKILL.md
使用 Git Worktrees
概览
确保工作发生在隔离 workspace 中。优先使用你所在平台的原生 worktree 工具。只有在没有原生工具可用时,才 fallback 到手动 git worktrees。
核心原则: 先检测现有隔离。然后使用原生工具。然后 fallback 到 git。绝不对抗 harness。
开始时宣布: "I'm using the using-git-worktrees skill to set up an isolated workspace."
Step 0: 检测现有隔离
创建任何东西之前,检查你是否已经在隔离 workspace 中。
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
BRANCH=$(git branch --show-current)