1k-worktree-clean

Installation
SKILL.md

Worktree Clean Check

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.

Rules

  • Always start by listing every local worktree with numeric choices.
  • Ask the user to reply with 1, 2,4, or A.
  • Always fetch the latest origin/x before running the check.
  • Use commit graph data only to locate branch-side candidate files. Final judgment must come from content equality between the selected worktree snapshot and origin/x.
  • Surface metadata that helps cleanup decisions: last commit time, upstream branch, PR status, and whether the worktree is nested under another linked worktree.
  • PR status is best-effort only. Use gh when available; if auth or network is unavailable, report that explicitly and continue the local git-based check.
  • If a worktree is dirty, report that separately and make it clear the committed-branch result does not cover uncommitted local edits.
  • After the check result, always surface cleanup candidates:
    • stale directories that exist under .worktree/ but are no longer registered by git worktree list
    • selected worktrees that are MERGED_TO_ORIGIN_X_BY_CODE or NO_BRANCH_CODE_DELTA_FROM_COMMON_BASE, clean, and are neither the main worktree nor the current worktree
  • After surfacing cleanup candidates, always ask whether the user wants to remove stale directories, removable worktrees, both, or neither.
  • Never auto-delete anything before the user explicitly confirms the cleanup action.
Installs
7
GitHub Stars
2.4K
First Seen
Apr 13, 2026
1k-worktree-clean — onekeyhq/app-monorepo