destructive-sweeps-lean-to-keep

Constrains destructive cleanup operations to allow-lists of positively proven disposable items.

96|11|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/thefrederiksen/devthrottle --skill destructive-sweeps-lean-to-keep-thefrederiksen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: destructive-sweeps-lean-to-keep
Source: https://github.com/thefrederiksen/devthrottle/tree/main/plugins/agent-discipline/skills/destructive-sweeps-lean-to-keep
Command: npx skills add https://github.com/thefrederiksen/devthrottle --skill destructive-sweeps-lean-to-keep-thefrederiksen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Destructive sweeps, purges, and cleanup scripts can permanently delete live data when they rely on deny-lists or stale safety signals. This Skill prevents unrecoverable data loss by forcing every deletion to be positively justified and every safety signal to be refreshed on real use. ## Core Features & Use Cases - Allow-list enforcement: Enumerate exactly what to DELETE using positively validated canonical identifiers, never what to skip, so unknown shapes survive by default. - Safety signal discipline: Require the liveness signal to be touched on every successful operation, closing the race where an actively resuming upload ages out mid-use. - Pre-run checklist: Canonicalize identifiers, take backups in the same breath as the delete, check for other live processes, and prefer reversible moves like quarantine directories or backup refs. - Use Case: When writing a retention sweep for aged upload directories, apply this Skill so only directories whose names are canonical 32-hex upload ids are deleted, while malformed names, partitions, and in-progress uploads all survive. ## Quick Start Review my cleanup script with the destructive-sweeps-lean-to-keep skill before I run it against the uploads directory.

Frequently Asked Questions about destructive-sweeps-lean-to-keep

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a safe cleanup script that deletes old files?▼

Enumerate what to delete with an allow-list of positively validated identifiers, never a deny-list of names to skip. Take the backup in the same breath as the delete, check for other live processes first, and prefer reversible moves like quarantine directories over removal.

Why did my retention sweep delete files that were still in use?▼

Sweeps fail when the staleness signal is not refreshed on every successful operation, so active work ages out silently. Idempotent operations that write nothing must still touch the liveness signal, and the sweep must not race a resume between its age check and its delete.

What is the difference between an allow-list and deny-list for deletion?▼

A deny-list deletes everything except listed names and fails open for any shape nobody thought to list. An allow-list deletes only what it can positively prove is disposable, so malformed names, partials, and unknown items survive by default.

When should a cleanup operation keep files instead of deleting them?▼

Keep whenever an item cannot be positively proven disposable, because a false delete is unrecoverable while a false keep only costs disk. If the one-line test 'could I get this back' answers no, everything unclassifiable must survive.

How do I make a destructive operation reversible?▼

Push a backup ref, move items to a quarantine directory, or rename rather than remove. Take the snapshot in the same breath as the delete so no gap exists where another writer can fill the window.