用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SocketDev/action --skill tidying-worktrees命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | tidying-worktrees |
| description | Sweep spent clean worktrees whose branches merged or vanished; preserve dirty or unpushed work. |
| user-invocable | true |
| allowed-tools | Bash(node:*), Bash(git worktree:*), Bash(git branch:*), Bash(git fetch:*), Bash(pnpm i:*), Read |
| model | claude-haiku-4-5 |
| context | fork |
| metadata | {"internal":true} |
Interrupted cascade waves and finished tasks leave spent worktrees scattered
across the fleet (chore/wheelhouse-<sha> leftovers, merged feature branches,
abandoned ci-cascade-layer trees). Cleaning each by hand is friction. This
skill is the fleet-wide, conservative, no-prompt sweep — safe to run unattended.
It is the fleet-wide sibling of managing-worktrees (which prunes the current
repo). Both share one removability predicate (decideWorktree in
lib/tidy-worktrees.mts); this engine iterates the canonical roster.
/loop so worktree clutter never accumulates.# Dry-run (default): report what WOULD be removed, mutate nothing.
node .claude/skills/fleet/tidying-worktrees/lib/tidy-worktrees.mts
# Act: remove spent worktrees fleet-wide.
node .claude/skills/fleet/tidying-worktrees/lib/tidy-worktrees.mts --fix
# Restrict to one repo.
node .claude/skills/fleet/tidying-worktrees/lib/tidy-worktrees.mts --fix --repo socket-cli
The engine reads the canonical roster from
cascading-fleet/lib/fleet-repos.txt (1 path, 1 reference — never a second
roster) and resolves sibling repos under $PROJECTS (default ~/projects).
For background care, drive it with /loop:
/loop 6h /fleet:tidying-worktrees --fix
Every 6 hours it sweeps the fleet and removes only provably-spent worktrees.
Nothing to remove → it says so and exits. It never prompts: the conservative
predicate means an unattended --fix can only ever remove worktrees with no
work to lose.
A non-primary worktree is removed ONLY when its tree is clean AND it has nothing left to land, where "nothing to land" means EITHER:
origin/<base> (every commit is already
an ancestor — spent), OREverything else is kept:
git worktree remove refuses a worktree containing
submodules even when clean. The engine passes --force only after the
clean-tree check, so it clears the submodule guard without discarding work.git worktree remove can dangle the primary
checkout's node_modules symlinks. After a --fix that removed anything, run
pnpm i in each affected repo's primary checkout — the engine names them.git symbolic-ref refs/remotes/origin/HEAD → main → master. Never
hard-coded.main → master.managing-worktrees and this skill share them.