03-core-back-up-and-prove-restore-before-modify-or-destroylisted
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