askill
tidy-your-workspace

tidy-your-workspaceSafety 80Repository

Clean up git branches, worktrees, stale remote refs, and forgotten stashes. Structural housekeeping for the repo.

0 stars
1.2k downloads
Updated 2/22/2026

Package Files

Loading files...
SKILL.md

Tidy Your Workspace

Structural git cleanup. Branches, worktrees, remote refs, stashes.

Announce at start: "I'm using the tidy-your-workspace skill to clean up branches and worktrees."

When to Use

  • Branches are piling up
  • Worktrees are stale
  • User says "tidy up," "clean branches," "prune," "tidy your workspace"
  • User invokes /tidy-your-workspace

Phase 1: Detect Context

git rev-parse --is-bare-repository
git worktree list
ContextBehavior
Bare repo + worktreesScan all worktrees + branches
Standard repoScan branches + remote refs

Phase 2: Gather (parallel)

Run all checks simultaneously:

# Merged branches safe to delete
git branch --merged main | grep -v '^\*\|main$'

# Branches with no remote tracking
git branch -vv | grep ': gone]'

# Stale remote refs
git remote prune origin --dry-run

# Worktrees (if applicable)
git worktree list --porcelain

# Forgotten stashes
git stash list

For worktree repos, check each worktree for:

  • Uncommitted changes (git -C <path> status --porcelain)
  • Branch still exists on remote
  • Branch merged into main

Phase 3: Present Findings

If everything is clean: "Workspace is tidy. Nothing to clean up."

If action is needed, use AskUserQuestion with multiselect. One interaction.

FindingOptionNotes
Merged branchesDelete branch-name (Recommended)Already merged into main
Tracking-gone branchesDelete branch-name (Recommended)Remote branch deleted
Stale remote refsPrune remote refs (Recommended)git remote prune origin
Stale worktreesRemove worktree-path (Recommended)Only if clean
Dirty worktrees[Flag only]Show path + uncommitted count
Stashes[Flag only]Show age + description

Phase 4: Execute

git branch -d <branch>           # Merged/gone branches (safe delete)
git remote prune origin           # Stale remote refs
git worktree remove <path>        # Stale worktrees
git worktree prune                # Final cleanup

Final Summary

Workspace tidied.

  Branches:   3 deleted (feat/old-thing, feat/done-thing, bug/fixed-it)
  Worktrees:  1 removed (pr/123)
  Remote refs: pruned
  Stashes:    2 flagged (consider clearing)

Clean.

Guidelines

  • Current repo only — focused cleanup, not a multi-repo sweep
  • One interaction — the multiselect is the only prompt
  • Never force-deletegit branch -d (safe), not -D
  • Flag dirty worktrees — inform, don't remove worktrees with uncommitted changes

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/24/2026

Well-structured git cleanup skill with clear phases, concrete commands, and safety-conscious design. Covers branches, worktrees, remote refs, and stashes comprehensively. Has clear 'when to use' trigger, structured steps, and tags for discoverability. Uses safe git operations and one-interaction model. General-purpose and reusable."

80
90
85
85
90

Metadata

Licenseunknown
Version-
Updated2/22/2026
Publishercameronsjo

Tags

prompting