keep-tidy
Continuous “clean as you go” for agent sessions. Complements (does not replace):
/cleanup+ APPLY CLEANUP — deep audit / MERGE / scripts consolidationmigration-and-doc-consolidation— migrations and canonical runbook moves- agent
hygiene/ verifier hygiene pass — post-work proposals
Deterministic enforcement (when configured): hooks/stop_hygiene_nudge.py on
stop, hooks/session_end_hygiene_audit.py on sessionEnd.
Activation gate
Activate if any of:
- Implementing or editing files (Write / multi-file diffs)
- Running shells that create artifacts
- Declaring work done / DoD / verify-before-done
- User asks to keep tidy, avoid clutter, or clean as you go
Skip for pure Q&A with no file or env side effects.
Must rules
- Prefer editing canonical files (
docs/,README*, existing modules). Do not create root orphans:*_analysis.md,*_notes.md,fix-*.md,TEMP*.md,debug*.md,scratch*,tmp_*. - Scratch / experiments →
.agent-scratch/ortmp/agent-<id>/(gitignored). Delete that scratch before declaring done. - After a tool batch that creates files:
git status --porcelain— remove or merge your own clutter before continuing. - Do not touch
.env*, lockfiles,node_modules/, or commit caches (__pycache__/,.next/,dist/, coverage). - Do not run global environment prune (
docker system prune, wiping OS%TEMP%//tmpoutside the session scratch dir, global npm/pip cache wipe) unless the user explicitly asks. - Before “done”: hygiene pass (delete/merge orphans you created). If MERGE target
is unclear → point to
/cleanupinstead of inventing a new report file. - Large/experimental work: prefer an isolated git worktree over littering the main checkout.
Mini-check (cheap)
git status --porcelain
Act on untracked/modified paths matching scratch patterns or living only under
.agent-scratch/ / tmp/agent-*.
Relation to hooks
- stop nudge may
followup_messagelisting remaining clutter — fix it, then stop. - sessionEnd may wipe allowlisted scratch dirs only; it does not replace this skill.
- Uncertain consolidations still need
/cleanup+ APPLY CLEANUP.
Output when activated mid-task
- Brief note of what was removed/merged (paths), or “workspace tidy”.
- If blocked: list UNCERTAIN paths and recommend
/cleanup.