<< All versions

Skill v1.0.2

currentAutomated scan100/100
g1eny0ung/pstack-codex/principle-make-operations-idempotent

~2 modified

──Details
PublishedNovember 26, 2026 at 06:54 PM
Content Hashsha256:34b1bda3af25110e...
Git SHAfc9d103daa70
Bump Typepatch
Compare with v1.0.1
──Files
Files (1 file, 1.0 KB)
SKILL.md1.0 KBactive
SKILL.md · 17 lines · 1.0 KB

name: principle-make-operations-idempotent description: "Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs." metadata: version: "1.0.2"


Make Operations Idempotent

Design every state-changing operation to converge to the correct state however many times it runs and wherever the previous run stopped.

Derive each step from the state that exists, not from what the previous run meant to do. Read the current state, compare it to the goal, and apply only the difference.

Anything a run leaves behind (a lock, a temporary file, a half-written record, a claimed job) must be recognizable as stale by the next run, by evidence that holds wherever the previous run could have stopped. Write to a temporary path and rename it into place.

The test: what happens if this runs twice? What if the previous run crashed at every possible point? If the answer depends on what was left behind, add a reconciliation step.

← v1.0.1All versions