# Principle Pre Image First

> Requires a recoverable baseline before destructive changes. Apply before deletion or history rewriting.

- Skill: `bostonaholic/principle-pre-image-first` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add bostonaholic/principle-pre-image-first`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bostonaholic/principle-pre-image-first/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bostonaholic (https://skillmd.com/u/bostonaholic)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bostonaholic/principle-pre-image-first

---


# Pre-image First

Before mutation, capture the untouched baseline and a recovery anchor or pre-image; No pre-image, no destructive write.

- Run checks BEFORE the operation so later failures classify as pre-existing or introduced.
- Capture the recovery anchor before rewrites and report it on success and failure; preserve `git reset --hard <sha>` recovery where applicable.
- Cache bodies before composing replacements for rewrite, close, or overwrite operations.
- Compare the target with its pre-image at write time; skip and report drift.
- Apply `principle-idempotent-reruns` to this comparison on re-run.
- A baseline that could not run is UNKNOWN and never proves preservation.

