用途:在单一仓库约定根目录下管理隔离的 Git worktree,流程为 inspect -> plan-create(确保被忽略)-> 授权执行 -> 记录。仅支持新建分支模式(--mode new-branch),拒绝接管已有外部 worktree 或为已有分支添加 worktree。
主要能力:inspect 检查解析根、是否已链接、gitignore 覆盖情况;plan-create 生成创建计划并在需要时向仓库 .gitignore 追加一行 <resolved_root>/;record-meta 记录元数据;plan-list 列出;plan-remove 移除自有 worktree;plan-prune 展示清理候选(始终 ok_to_prune=false,需当轮授权后才可运行 git worktree prune)。
使用方式:命令中 <skill-dir> 为技能加载时公布的基目录,需替换为实际路径;Windows 上可用 py -3 替代 python。先 inspect,再 plan-create,仅当 ok_to_create 为 true 时执行其 argv(git worktree add -b <branch> <path> <start-point>),成功后运行 record-meta。移除仅在 ok_to_remove 为 true 时执行。若已存在原生 harness worktree 工具,先运行本助手,仅当 inspect/plan JSON 已含 worktree_path 且 ok_to_create=true 时才调用原生工具。
限制:忽略判定以 git check-ignore -v -z --stdin 为准,仅全局 excludes 或 .git/info/exclude 不够;plan-create 后 gitignore_covers 必须为 true 才能执行;不得添加 --force 或 --ignore-other-worktrees;不得嵌套 worktree;不得自行发明第二个默认根。移除前会检查 git status --porcelain -uall、注册路径精确匹配、锁、进行中的 Git 状态、子模块与所有者。未提供 Production 或 Governed 验证报告时不得声称通过。参考 references/convention.md 与 references/safety.md。