.claude/skills/speckit-worktree-clean/SKILL.md
Remove stale or merged worktrees and reclaim disk space
npx skillsauth add pradeepmouli/rune-langium speckit-worktree-cleanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Remove worktrees for branches that have been merged or are no longer needed. Safely cleans up .worktrees/ directory entries and reclaims disk space.
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). The user may specify a branch name to clean (e.g., "005-api-gateway"), "merged" to clean all merged worktrees, or "all" to clean everything.
.specify/ directory.worktrees/ directory exists and contains worktreesScan worktrees: List all worktrees and classify them:
Build cleanup plan: Based on user input, determine what to remove:
| User Input | Action |
|-----------|--------|
| Specific branch name | Remove that worktree only (with confirmation) |
| merged | Remove all merged worktrees |
| stale | Remove all stale worktrees (30+ days inactive) |
| all | Remove all worktrees except main (with strong warning) |
| No input | Remove merged and orphaned only (safest default) |
Present cleanup plan: Show a preview before making any changes:
# Worktree Cleanup Plan
| # | Branch | Status | Action | Disk Size |
|---|--------|--------|--------|-----------|
| 1 | 005-api-gateway | ✅ Merged | Remove | ~45 MB |
| 2 | 002-old-feature | ❌ Orphaned | Remove | ~32 MB |
| 3 | 004-chat-system | 🟡 Idle | Keep (not merged) | ~41 MB |
**Will remove**: 2 worktrees (~77 MB)
**Will keep**: 1 worktree
Confirm with user: Ask for explicit confirmation before proceeding. Removing worktrees with uncommitted changes is destructive.
Check for uncommitted changes: Before removing each worktree:
git -C .worktrees/{branch}/ status --porcelain to check for uncommitted workExecute cleanup: For each worktree to remove:
git worktree remove .worktrees/{branch-name} to safely removegit worktree unlock .worktrees/{branch-name} first.worktrees/ directorygit worktree prune after all removals to clean up stale referencesReport: Output a summary:
.worktrees/git worktree prune to clean up stale administrative filestools
Router skill for the rune-langium monorepo. Use it to choose the right package skill before working in core, cli, lsp-server, codegen, or visual-editor.
tools
Router skill for the rune-langium monorepo. Use it to choose the right package skill before working in core, cli, lsp-server, codegen, or visual-editor.
tools
Langium port for Rune DSL tooling Use when working with rune, rosetta, dsl, langium, cdm, isda, drr, finos, language-server, lsp, visual-editor, reactflow.
tools
Langium port for Rune DSL tooling Use when working with rune, rosetta, dsl, langium, cdm, isda, drr, finos, language-server, lsp, visual-editor, reactflow.