Approved catalog listing
SKILL #4294
skillshunter.net
Home / Software & Development / Principle Make Operations Idempotent
Listing Approved Approved on: December 2, 2026

Principle Make Operations Idempotent

Design state-changing operations to converge to the correct state regardless of how many times they run or where the previous run stopped. Ensure any leftover artifacts from a failed run are recognizable as stale and can be safely cleaned up.

Rate this skill

No ratings yet

Editor's Note

Operations should write to a temporary path and rename files into place to ensure idempotency. This approach helps avoid leaving stale artifacts that could interfere with subsequent runs.

When to Use It

  • Implementing retry logic in deployment scripts
  • Ensuring data consistency in batch processing jobs
  • Designing idempotent API endpoints for safe retries

SKILL.md

SkillsHunter provides this listing for informational purposes only. Review the skill’s source, license, and required permissions before use. You are responsible for deciding whether to install or run it. Terms of Use

↓ Download .md
---
name: principle-make-operations-idempotent
description: For steps that retry after crashes, make every rerun reach one end state.
disable-model-invocation: true
---

# 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.

Community Reviews & Field Notes

Tried this skill on your own project? Share the model you used and the results you got.

Add Your Review

Approved reviews appear publicly with the name or role you enter. See the Privacy Notice.