← ClaudeAtlas

using-snapshot-draftlisted

Use whenever you mutate a piece's composition or when the user asks to "go back," "undo," "save," "discard," or talks about prior versions. Teaches the snapshot/draft mental model: every edit lands in the draft; commit promotes to snapshot; discard reverts; restore_snapshot recovers a prior committed state.
Nagellabs/libi · ★ 2 · AI & Automation · score 72
Install: claude install-skill Nagellabs/libi
# Using Snapshot / Draft Every piece has two states: - **Snapshot** — the committed, trusted version. The user's safety net. - **Draft** — the working copy. All edits (yours and the user's) land here. `composition.json` IS the draft (when one exists). The snapshot lives at `snapshots/current.json`. You don't think about file paths — you call MCP tools. ## The five tools - `libi.get_piece_state({ pieceId })` — check `hasDraft` + see the last 10 snapshots - `libi.commit_draft({ pieceId, summary? })` — promote draft to snapshot. Provide a one-line summary. - `libi.discard_draft({ pieceId, confirm: true })` — drop the draft, return to snapshot - `libi.restore_snapshot({ pieceId, snapshotId, confirm: true })` — promote a prior snapshot - `libi.compare_states({ pieceId })` — structured diff between snapshot and draft ## Rules ### Rule 1 — Edits always land in the draft. You don't need to do anything. Every existing mutation tool (`add_overlay (kind "text" / "video" / "code")`, `update_overlay`, `add_audio_clip`, etc.) writes to the draft automatically. You don't call any snapshot/draft tool to make edits work. Just use the tools you already use. ### Rule 2 — Before starting fundamentally new work, check for existing draft. ``` call libi.get_piece_state({ pieceId }) if response.hasDraft and the user's new request is unrelated to in-progress work: ask: "You have uncommitted changes from earlier (use compare_states to summarize them). Want to save them as a snapsho