← スキル一覧に戻る

worktree-cleanup
by mvillmow
Training framework written in Mojo
⭐ 11🍴 4📅 2026年1月24日
SKILL.md
name: worktree-cleanup description: "Remove merged or stale git worktrees. Use after PRs are merged, work is done, or when worktrees are no longer needed." mcp_fallback: none category: worktree
Worktree Cleanup
Remove worktrees safely to free disk space and maintain organization.
When to Use
- PR has been merged
- Worktree no longer needed
- Free disk space
- Maintain clean worktree list
Quick Reference
# Remove single worktree by path
git worktree remove worktrees/ProjectOdyssey-42-feature
# Auto-clean all merged worktrees
./scripts/cleanup_merged_worktrees.sh
Workflow
- Verify state - Check no uncommitted changes:
cd worktrees/ProjectOdyssey-42 && git status - Commit changes - Make sure all changes are committed and the task is finished
- Switch away - Don't be in the worktree you're removing
- Remove worktree - Use git command
- Verify - Run
git worktree listto confirm removal
Safety Checks
Before removing a worktree:
- Branch is merged to main (check GitHub PR status)
- No uncommitted changes (run
git statusin worktree) - Not currently using the worktree (be in different directory)
- PR is actually merged (check "Development" section on issue)
Error Handling
| Error | Solution |
|---|---|
| "Worktree has uncommitted changes" | Commit changes |
| "Not a worktree" | Verify path with git worktree list |
| "Worktree is main" | Don't remove primary worktree |
Scripts Available
scripts/cleanup_merged_worktrees.sh- Auto-clean merged worktrees
References
- See
worktree-createskill for creating worktrees
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です