.claude/skills/speckit-worktree-clean/SKILL.md
Remove stale or merged worktrees and reclaim disk space
npx skillsauth add pradeepmouli/zod-to-form 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
Use when working with zod-to-form (core, react, cli, codegen, vite).
tools
Vite plugin for zod-to-form — transforms ?z2f imports into generated form components and optionally replaces <ZodForm> JSX call sites with generated components at build time Use when: You want `import SignupForm from './signup.schema?z2f'` to Just Work in a.... Also: vite, vite-plugin, zod, zod-v4, codegen, forms, form-generation, schema-driven, react-hook-form, build-plugin, jsx-transform.
development
Runtime <ZodForm> renderer for Zod v4 schemas Use when: You need form rendering in storybook, playgrounds, or low-traffic admin UIs —.... Also: zod, zod-v4, react, forms, form-generation, react-hook-form, schema-driven, dynamic-forms, form-renderer, hookform-resolver, zod-form-renderer.
development
Schema walker and processor registry for Zod v4 form generation Use when: You want per-field validation instead of whole-form validation. Also: zod, zod-v4, forms, form-generation, schema, schema-walker, processor-registry, react-hook-form, schema-driven, form-schema, zod-registry.