From wystack-agent-kit
Tidy stale workspace state — prune safely-merged and stale local branches, remove dead worktrees, and prune transient run artifacts from the workspace. Use after finishing work, after a merge, or when the branch list or artifact directory has gotten noisy. Never touches calibration data (the oracle) or decision docs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wystack-agent-kit:cleanupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Prune stale workspace state across git and the filesystem. One verb: tidy up. Default scope is everything; `--scope` narrows it.
Prune stale workspace state across git and the filesystem. One verb: tidy up. Default scope is everything; --scope narrows it.
cleanup [--dry-run] [--scope branches|worktrees|artifacts]
Always report what will be removed before removing it. --dry-run reports and deletes nothing.
Prerequisites. For the artifacts scope, load wystack-agent-kit:workspace to resolve the workspace location. Branches and worktrees are repo-level and need no workspace.
Categorize local branches against the base branch — first match wins:
| Category | Meaning | Action |
|---|---|---|
| WORKTREE | Branch has an active worktree | Skip entirely |
| MERGED | Empty diff against base, squash-merges included | Safe-delete with git branch -d |
| CONFLICTED | Would conflict if rebased on base | Report only |
| STALE | Unmerged, no commits in 14+ days | Present as candidates, ask before deleting |
| ACTIVE | Unmerged, recently touched | Report only |
Detect merges with git diff <base>...<branch> --stat, not git branch --merged — the latter misses squash merges.
Rules: never delete main / master / develop; never force-delete (git branch -D) unless explicitly asked; if a category is unclear, keep the branch.
Prune worktrees whose branch is gone or fully merged.
git worktree list — enumerate.git worktree remove. Skip any with uncommitted changes — report those instead.Rules: never remove a worktree with uncommitted or unpushed work; report it for the user to decide.
Prune transient evidence under the workspace's artifacts/<skill>/ — verify screenshots and GIFs, diverge spike scratch, and similar run-scoped output.
Never touch:
calibration/ — the oracle data; it is meant to accumulate. Deleting it breaks the wystack-agent-kit:retro feedback loop.decisions/ — decision docs are durable deliverables.present output (decision docs, briefings, reports) — the user owns those.If unsure whether something is transient, keep it.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub youhaowei/wystack-agent-kit --plugin wystack-agent-kit