← ClaudeAtlas

03-core-back-up-and-prove-restore-before-modify-or-destroylisted

CORE — never delete. Trigger whenever you are about to DELETE, OVERWRITE, TRUNCATE, force-push, drop/truncate a DB table, run a destructive migration, force-recreate a container, or otherwise MODIFY-IN-PLACE or DESTROY anything that holds data or state (files, dirs, DBs, volumes, prod config). A backup is worthless if it can't be restored — this skill defines the mandatory back-up-AND-prove-restore protocol and the gates that physically enforce it.
markkennethbadilla/public-agent-provisioning · ★ 0 · AI & Automation · score 72
Install: claude install-skill markkennethbadilla/public-agent-provisioning
# Back Up AND Prove It Restores — Before Any Modify or Destroy **Doctrine:** A backup is worthless if it can't be restored. Every destruction OR in-place modification of stateful things requires (1) a faithful backup AND (2) a *proven* restore — not a hopeful copy. Copying somewhere is half the job; the half that matters is that the copy actually comes back. **Two distinct locations — never conflate them:** - `TRASHBIN` (resolver name: `TRASHBIN_DIR`) — the agent recycle bin. DELETE-only. To delete anything, MOVE it here (never shell-delete). The move IS the removal AND its recoverable copy. - `BACKUPS` (resolver name: `BACKUPS_DIR`) — the canonical backup location. Restore point for in-place MODIFY. Copy the target here BEFORE overwriting/migrating it; it survives independently of the source. Both locations live on the canonical data drive. Reference them via the paths resolver (`agent-provisioning-toolkit/config/paths.mjs` or `paths.ps1`) — never a literal drive letter. ## The protocol (every destructive/modifying op) 1. **Back up first** — before touching the target: - DELETE: MOVE the target into `TRASHBIN_DIR` (the move IS the removal AND the recoverable copy — rule 18). - In-place MODIFY (overwrite/migrate/force-recreate): copy the target into `BACKUPS_DIR`. The copy survives independently. - DB: dump with `pg_dump` into `BACKUPS_DIR` before any destructive query. 2. **PROVE it restores** — run the verifier; it actually extracts archives / restores dumps