data-preservationlisted
Install: claude install-skill SVN11X/skills
# data-preservation
Content that was added on purpose stays unless the owner declared its removal.
## Set it up once
Write `docs/preservation.yml` with the owner:
```yaml
protect: ["data/**", "assets/img/**"]
json_ids:
- {file: data/questions.json, path: questions, id: id, min_count: 349}
allow: []
```
Every exception needs a path, a change (delete, modify, delete-ids or any), a reason and an end date. Show the file to the owner, since it is their decision what counts as protected.
## Around every change
1. Before: `python <standard>/scripts/preserve.py snapshot`. The snapshot goes inside the git folder and is never committed.
2. After: `python <standard>/scripts/preserve.py compare`. It fails on deleted or changed protected files, repeated or lost ids, broken JSON and counts under the minimum.
3. A legitimate removal gets an `allow` entry in the same commit, so the reason is reviewed with the change.
`verify.py` runs the comparison by itself when the file and a snapshot exist, and reports NOT_RUN when the snapshot is missing.
## Extractions
- Keep a list of what should exist (ids, URLs or file names) next to the output.
- `python <standard>/scripts/preserve.py coverage --expected expected.txt --found data/items.json --path items --id id --resume-out missing.txt` lists missing, duplicated and extra items and writes the missing ones for the next run.
- Resume from `missing.txt`. Write each item atomically (a temporary file, then a rename) so an interruption never l