
Principle make operations idempotent
Makes agents design state-changing steps that converge safely after crashes and retries
Principle make operations idempotent is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 5.1K
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Principle make operations idempotent
This skill guides an agent to structure commands, lifecycle steps and processing loops so that running them again, or after a crash partway through, still lands on the correct end state. The core method is to read the current state, compare it with the goal, and apply only the missing difference rather than replaying what a previous run intended to do.
It also covers leftovers from interrupted runs such as locks, temporary files, half-written records and claimed jobs. The guidance asks that each leftover be recognizable as stale by a later run no matter where the earlier run stopped, and suggests writing to a temporary path and renaming it into place. When the outcome of a rerun depends on what was left behind, the skill tells the agent to add a reconciliation step.
The skill is instruction-only: it has no scripts and no tool requirements, and it is meant to shape how the agent writes code and designs workflows. It is user-invocable false, so it is loaded automatically when the task matches.
When your agent uses it
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.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 2 files (1 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the pstack plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claudeOr copy only this skill to ~/.claude/skills/principle-make-operations-idempotent:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-make-operations-idempotent &&
cp -R "$tmp/plugins/pstack/skills/principle-make-operations-idempotent" ~/.claude/skills/principle-make-operations-idempotent &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/principle-make-operations-idempotent inside it instead.
Copy the skill folder to ~/.agents/skills/principle-make-operations-idempotent to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-make-operations-idempotent &&
cp -R "$tmp/plugins/pstack/skills/principle-make-operations-idempotent" ~/.agents/skills/principle-make-operations-idempotent &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/principle-make-operations-idempotent inside it instead.
Copy the skill folder to ~/.cursor/skills/principle-make-operations-idempotent to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-make-operations-idempotent &&
cp -R "$tmp/plugins/pstack/skills/principle-make-operations-idempotent" ~/.cursor/skills/principle-make-operations-idempotent &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/principle-make-operations-idempotent inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-make-operations-idempotentOr copy the folder to ~/.gemini/skills/principle-make-operations-idempotent yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/principle-make-operations-idempotent:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-make-operations-idempotent &&
cp -R "$tmp/plugins/pstack/skills/principle-make-operations-idempotent" ~/.copilot/skills/principle-make-operations-idempotent &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/principle-make-operations-idempotent inside it instead.
Get the folder:
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.gitThen copy pstack-claude/plugins/pstack/skills/principle-make-operations-idempotent into your agent's skills folder as principle-make-operations-idempotent. Agents that support SKILL.md read one folder per skill.
What it does
- Current-state reconciliation
- Compares the existing state with the goal and applies only the difference on each run.
- Crash-point analysis
- Asks what happens if a run stops at every possible point and whether a rerun is safe.
- Stale artifact detection
- Makes locks, temp files and claimed jobs identifiable as stale by later runs.
- Atomic write pattern
- Recommends writing to a temporary path and renaming it into place.
- Reconciliation step guidance
- Directs adding a reconciliation step when outcomes depend on leftover state.
Good for
- Make a database migration script safe to rerun after it fails midway
- Design a job-processing loop that recovers claimed jobs after a worker crashes
- Write a deploy command that can be retried without duplicating resources
- Review a lifecycle setup routine for behavior under restarts
Principle make operations idempotent FAQ
When does Principle make operations idempotent apply?
It applies when designing commands, lifecycle steps or processing loops that may run amid crashes, restarts and retries.
Does Principle make operations idempotent need scripts or special tools?
No. It has no scripts and does not set allowed tools; it is a set of design guidelines.
What does Principle make operations idempotent tell the agent to do about leftover files or locks?
Leftovers should be recognizable as stale by the next run, and writes should go to a temporary path before being renamed into place.
How do I install Principle make operations idempotent in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/principle-make-operations-idempotent to use it in all your projects, or to .claude/skills/principle-make-operations-idempotent in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.
Does Principle make operations idempotent run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Principle make operations idempotent?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Principle make operations idempotent?
The closest alternatives to Principle make operations idempotent are Principle outcome oriented execution, Principle never block on the human, Agent introspection debugging, Principle foundational thinking and Principle prove it works.
Where this comes from
- Description: from the skill's own SKILL.md.
More from michael-denyer/pstack-claude

Makes the agent read pstack's poteto-mode skill first and follow its routing
- Open source
- 5.1K GitHub stars
- Developer tools

Has the agent restate your goals and the problem you're solving in its own words
- Open source
- 5.1K GitHub stars
- Productivity

Prototype 2-3 competing designs and compare them before committing to one
- Open source
- 5.1K GitHub stars
- Developer tools

Sketches types, signatures and module layout before the agent writes code
- Open source
- 5.1K GitHub stars
- Developer tools

Runs parallel candidate attempts at a task, then merges the best parts into one artifact
- Open source
- 5.1K GitHub stars
- Developer tools

Drafts a personal working-style skill from your past agent conversations
- Open source
- 5.1K GitHub stars
- Developer tools


