Use when the user wants to audit local git worktrees against origin/x, choose by number or A, and decide whether stale worktree directories, already-merged worktrees, or no-delta worktrees can be cleaned up. Triggers on "worktree clean", "worktree 合并到 x", "检测哪些 worktree 已进 x".
79
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill to list local worktrees, surface clean or dirty state, and judge whether selected committed branch code has already landed in origin/x by actual code content, not by merge commits alone.
1, 2,4, or A.origin/x before running the check.origin/x.gh when available; if auth or network is unavailable, report that explicitly and continue the local git-based check..worktree/ but are no longer registered by git worktree listMERGED_TO_ORIGIN_X_BY_CODE or NO_BRANCH_CODE_DELTA_FROM_COMMON_BASE, clean, and are neither the main worktree nor the current worktreeRun:
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh listThen present the choices to the user and append:
请回复编号,例如 `1`、`2,4` 或 `A`。List output should include, for each worktree:
Run:
rtk git fetch origin xIf sandboxing blocks the fetch, request approval and rerun it.
Run one of:
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh check 1
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh check 1,3
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh check ARun the matching cleanup-candidate command with the same selection:
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh cleanup-candidates 1
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh cleanup-candidates 1,3
rtk proxy bash .skillshare/skills/1k-worktree-clean/scripts/1k-worktree-clean.sh cleanup-candidates AThen summarize:
MERGED_TO_ORIGIN_X_BY_CODE or NO_BRANCH_CODE_DELTA_FROM_COMMON_BASE)If there is at least one cleanup candidate, append:
如需继续清理,请回复:
`stale`:只删残留目录
`merged 2,4`:只删这些可移除且 clean 的 worktree
`all`:两类都清理
`no`:不清理If there are no cleanup candidates, say so explicitly.
If the user confirms cleanup:
rtk git worktree remove <path>rtk proxy rm -rf <path>MERGED_TO_ORIGIN_X_BY_CODE: every branch-side candidate file now matches origin/x.NOT_FULLY_MERGED_TO_ORIGIN_X_BY_CODE: at least one branch-side candidate file still differs from origin/x.NO_BRANCH_CODE_DELTA_FROM_COMMON_BASE: the worktree has no committed branch-only code delta relative to the common base with origin/x. If it is also clean and is neither the main worktree nor the current worktree, treat it as a removable cleanup candidate.Working tree: dirty: show the dirty files and state that current local edits still need separate review.已合并到远端 x(按代码内容判断).NO_BRANCH_CODE_DELTA_FROM_COMMON_BASE, explicitly say it has no committed branch delta relative to origin/x, and that it is removable when it is also clean and not the main/current worktree.e0fcee5
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.