skills/git-worktree-tidy/SKILL.md
Fetch latest from origin, prune remote-tracking refs, delete stale local branches and worktrees, and fast-forward important branches. Use when tidying up a worktree-based repo layout.
npx skillsauth add awfixers-stuff/opencode-config git-worktree-tidyInstall 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.
Routine hygiene for bare-repo + worktree layouts. Fetches origin, prunes gone branches and orphaned worktrees, and fast-forwards important local branches.
User asks to "fetch prune", "clean up stale branches/worktrees", or "update main/dev to latest" in a worktree-based repo.
--ff-only when updating branches. If ff-only fails, stop and ask..bare directory (or repo root) for branch/worktree
management commands.Determine the bare repo directory:
.bare/, use itgit rev-parse --git-common-dirAll branch and worktree management commands run from this directory.
git fetch --prune origin
Report what was pruned (deleted remote-tracking branches, updated refs).
git branch -vv | grep ': gone]'
Collect branch names whose upstream is gone.
git worktree list
git worktree prune --dry-run
Cross-reference worktrees against the gone-branch list. Check each stale worktree for dirty state:
cd <worktree-path> && git status --short
Categorize:
Present a summary table:
Stale worktrees to remove:
<path> (<branch>) [clean]
<path> (<branch>) [dirty — N uncommitted changes]
Stale branches to delete:
<branch>
Prunable worktree metadata:
<entry>
Wait for user confirmation before proceeding.
For each confirmed worktree:
git worktree remove <name>
If removal fails (dirty), report and skip unless user approved force.
git branch -D <branch1> <branch2> ...
git worktree prune -v
Identify which branches have dedicated worktrees for main, dev, or
other important branches (user may specify). For each:
cd <worktree-path> && git pull --ff-only origin <branch>
If ff-only fails, report the divergence and ask for guidance.
Show a summary: what was removed, what was updated, any items skipped.
development
Use when starting dev servers, watchers, tilt, or any process expected to outlive the conversation. Provides zmx session management patterns for long-lived processes.
development
Zig testing skill for writing and running tests. Use when using zig build test, writing comptime tests, using test filters, working with test allocators to detect leaks, or using Zig's built-in fuzz testing (0.14+). Activates on queries about Zig tests, zig test, zig build test, comptime testing, test allocators, Zig fuzz testing, or detecting memory leaks in Zig tests.
development
Zig debugging skill. Use when debugging Zig programs with GDB or LLDB, interpreting Zig runtime panics, using std.debug.print for tracing, configuring debug builds, or debugging Zig programs in VS Code. Activates on queries about debugging Zig, Zig panics, zig gdb, zig lldb, std.debug.print, Zig stack traces, or Zig error return traces.
tools
Zig cross-compilation skill. Use when cross-compiling Zig programs to different targets, using Zig's built-in cross-compilation for embedded, WASM, Windows, ARM, or using zig cc to cross-compile C code without a system cross-toolchain. Activates on queries about Zig cross-compilation, zig target triples, zig cc cross-compile, Zig embedded targets, or Zig WASM.