From FORSVN Dev
Audit and clean a developer's machine — dotfolders, caches, language toolchains, package globals — with per-target classification and risk surfacing. Produces cleanup records. Not for cleaning code or user files.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forsvn-dev:clean-machine [target: home | caches | runtimes | packages | all][target: home | caches | runtimes | packages | all]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audits a developer's machine state and removes abandoned tools, orphaned caches, and unused toolchains — without breaking active workflows. Capability metadata (route triggers, prerequisites, load map, artifact contract) lives in [`routing.yaml`](routing.yaml). Agent table + execution layers + routing rules: [`references/agent-manifest.md`](references/agent-manifest.md). Methodology: [`referenc...
agents/_template.mdagents/cache-scanner-agent.mdagents/critic-agent.mdagents/dotfolder-scanner-agent.mdagents/orphan-detection-agent.mdagents/package-inventory-agent.mdagents/runtime-scanner-agent.mdagents/safe-nuke-agent.mdreferences/_shared/artifact-contract-template.mdreferences/_shared/before-starting-check.mdreferences/_shared/execution-policy.mdreferences/_shared/manifest-spec.mdreferences/_shared/mode-resolver.mdreferences/_shared/pre-dispatch-protocol.mdreferences/agent-manifest.mdreferences/anti-patterns.mdreferences/auth-credential-patterns.mdreferences/classification-vocabulary.mdreferences/examples/full-machine-walkthrough.mdreferences/playbook.mdAudits a developer's machine state and removes abandoned tools, orphaned caches, and unused toolchains — without breaking active workflows. Capability metadata (route triggers, prerequisites, load map, artifact contract) lives in routing.yaml. Agent table + execution layers + routing rules: references/agent-manifest.md. Methodology: references/playbook.md.
Core question: Is this folder still owned by an installed tool I actively use, or is it leftover state from something I no longer have?
/clean-code.Desktop/, Documents/, Downloads/, Pictures/, Movies/, Music/, Public/, or cloud-mount symlinks — those need human review.NEEDS_CONTEXT first.All 6 fire under --fast, Single-Agent Fallback, and dry-run modes:
Desktop/, Documents/, Downloads/, Pictures/, Movies/, Music/, Public/, and any contents under cloud-mount symlinks (Google Drive, OneDrive, iCloud) are off-limits to bulk action. Surface findings; defer execution to the user.gh auth login, gcloud auth login, vercel login). Filename patterns: references/auth-credential-patterns.md..pid/.sock/-wal file exists), check pgrep for the owning app. Quit cleanly via AppleScript or warn the user before deletion. Never delete files an open SQLite WAL points to..zshenv, .zshrc, .bashrc, .profile, .tcshrc (e.g., . "$HOME/.cargo/env"), comment out or update the offending line. Otherwise every new terminal throws errors.~/.cache/ is throwaway by definition — surface for fast nuke. Anything outside ~/.cache/ requires per-target classification: identify the owning tool, then decide.Session limits: target ~25 deletions per cleanup session. After 10, generate an interim summary. If the user has rejected 5+ recommendations in a row, stop and ask if the scope is wrong.
Critic FAIL: identifies the specific deletion that violated a rule; safe-nuke-agent restores from backup (or instructs reinstall steps); reports. Full critic-FAIL handling + bulk-action pause triggers: references/anti-patterns.md.
Apply references/_shared/before-starting-check.md. Then:
references/_shared/mode-resolver.md). budget: deep. Auto-downgrades to fast for single-folder targets → Single-Agent Fallback. --fast forces single-agent regardless of scope. All 6 Critical Gates fire in every mode.references/_shared/execution-policy.md — session execution profile (single-vs-multi).forsvn/index/manifest.json for prior machine-cleanup runs; surface staleness if a recent run covered this scope.docs/forsvn/experience/technical.md for prior protected-paths list (machine-cleanup excluded paths).Run Pre-Dispatch (references/_shared/pre-dispatch-protocol.md). Needed dimensions: scope (dotfolders / caches / packages / runtimes / all), aggressiveness (conservative / moderate / aggressive), excluded paths.
Read order:
du -sh ~/.*, df -h, package globals (npm/brew/bun/cargo/go/pipx) — see scripts/inventory.sh.docs/forsvn/experience/technical.md for prior protected-paths list.Warm Start + Cold Start prompts: references/pre-dispatch-prompts.md.
docs/forsvn/artifacts/meta-clean-machine-<YYYY-MM-DD>-<slug>.md (flat v2 grammar; stack is meta — machine-cleanup records are meta-stack snapshots).snapshot — dated, immutable record of one cleanup run.skill, version, date, status (DONE / DONE_WITH_CONCERNS / BLOCKED / NEEDS_CONTEXT), stack (=meta), review_surface (=none — snapshot defaults to decision_state: not_required), total_reclaimed, lifecycle, produced_by, provenance. v2 schema in references/_shared/artifact-contract-template.md.clean-artifacts (staleness signal scanning), forsvn (state detection), operator (history audit).Full template + filename conventions + version-increment rule: references/report-template.md.
7 agents in 3 layers — full table + execution diagram + dispatch protocol + routing rules: references/agent-manifest.md.
Single-Agent Fallback (mode downgrades to fast):
references/tool-ownership-heuristics.md.references/classification-vocabulary.md (active / load-bearing / abandoned / orphan / cache / empty / user-data).references/report-template.md.Read references/anti-patterns.md before applying any deletion that smells off — bulk, auth-bearing, mid-process, shell-rc-referenced, package manager + data split. "When NOT to nuke" + bulk-action pause triggers also live there.
total_reclaimed), no orphaned references in shell-rcs.Previous: none | Next: none (standalone). Re-run triggers: new laptop setup, after abandoning many AI tools, disk-full, before passing the machine to someone else.
package-inventory-agent standalone.chezmoi or dotbot.npx claudepluginhub hungv47/meta-skills --plugin forsvn-devCross-drive storage audit and cleanup. Surveys all drives, finds orphaned git worktrees, large AI tool caches, and build artifacts. Produces a prioritized action plan with migration commands.
Reclaims disk space on a Mac dev machine by deleting regenerable caches (Cargo, node_modules, pnpm/npm, OS/app caches) and thinning APFS local snapshots. Invoke with /dev-clean-mac when low on disk.
Identifies and cleans disk hogs like Rust target/, node_modules, Python venvs, git garbage, Docker images, Homebrew caches, and hidden temps. Use when disk space is low or full.