principle-make-operations-idempotent
Installation
SKILL.md
Make Operations Idempotent
Portability (required)
This skill is part of the portable pstack pack.
- Read the
pstackcapability contract and the adapter for the active coding agent before any helper delegation. - Prefer capability verbs (
explore,implement,review,parallel,ask_user,verify,model_role) over vendor tool names. - Resolve models through
model_role. Never require a vendor-specific model identifier. - When helper spawning is unavailable, run the work on the lead agent and state that fan-out was collapsed.
Design operations so they converge to the correct state regardless of how many times they run or where they start from. Every state-mutating operation should answer: "What happens if this runs twice? What happens if the previous run crashed halfway?"
Why: Commands, lifecycle operations, and processing loops run where crashes, restarts, and retries are normal. If partial state changes the next run's outcome, every restart becomes a debugging session.