pstack-principle-make-operations-idempotent

pstack-principle-make-operations-idempotent is a skill for Claude Code from dmae97/omk. It costs 49 tokens per session (382 once invoked), scanned A, a copy of principle-make-operations-idempotent, MIT.

A way to design commands and processing steps so repeating them reaches the same final state. It accounts for crashes, restarts, and retries halfway through a task.

In plain words
What is it for?
Use it for lifecycle operations, background jobs, file writes, and other state-changing code that may run more than once.
Why use it?
It prevents duplicate work, stale temporary data, and manual repair after an interrupted run.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it for lifecycle operations, background jobs, file writes, and other state-changing code that may run more than once.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dmae97/omk/principle-make-operations-idempotent
View source ↗ dmae97/omk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dmae97/omk --skill principle-make-operations-idempotent
Clone the repo
git clone --depth 1 https://github.com/dmae97/omk

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pstack-principle-make-operations-idempotent

README.md
[![agentmods](https://agentmods.dev/badge/skills/dmae97/omk/principle-make-operations-idempotent/github.svg)](https://agentmods.dev/skills/dmae97/omk/principle-make-operations-idempotent)
Your own site
<a href="https://agentmods.dev/skills/dmae97/omk/principle-make-operations-idempotent"><img src="https://agentmods.dev/badge/skills/dmae97/omk/principle-make-operations-idempotent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pstack-principle-make-operations-idempotent

Your own site · 80×15
<a href="https://agentmods.dev/skills/dmae97/omk/principle-make-operations-idempotent"><img src="https://agentmods.dev/badge/skills/dmae97/omk/principle-make-operations-idempotent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 382 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 97% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.00382
Opus 5.5 $0.00020 $0.00153
Sonnet 5.5 $0.00010 $0.00076
Haiku 4.5 $0.00005 $0.00038

Measured 2d ago against content hash 23617ad33990, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pstack-principle-make-operations-idempotent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

97% identical to principle-make-operations-idempotent — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

packages/coding-agent/resources/pstack/skills/principle-make-operations-idempotent/SKILL.md · 23 lines

What it actually says

Make Operations Idempotent

Design operations so they converge to the correct state regardless of how many times they run or where the previous run stopped. 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.

The idea: 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. A step written this way is safe to repeat, because a repeat finds nothing left to do.

Anything a run leaves behind, such as a lock, a temporary file, a half-written record, or a claimed job, must be recognizable as stale by the next run. Judge staleness by evidence that stays true wherever the previous run could have stopped, not only in the common case. A marker that the next run cannot judge turns every crash into manual cleanup. For example, write to a temporary path and rename it into place, or compare artifacts by content instead of by creation order.

The test:

  1. What happens if this runs twice in a row?
  2. What happens if the previous run crashed at every possible point?
  3. Does re-execution converge to the same end state?

If any answer is "it depends on what state was left behind," the operation needs a reconciliation step.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 23 lines · 49 tokens per session scan A 23617ad33990

Subscribe to this mod's changes

pstack-principle-make-operations-idempotent is a skill published in the GitHub repository dmae97/omk (151 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 382 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 97% identical to principle-make-operations-idempotent, differing in 3 lines, and is treated as a copy.

Related

Other skills, from other repositories

mcp-builder

Design, build, configure, or debug Model Context Protocol servers for codewhale, including stdio and HTTP/SSE transports.

Hmbown/CodeWhale · 30 tokens

better-t-stack

Create or extend an end-to-end type-safe TypeScript project with Better-T-Stack (create-better-t-stack). Use when the user wants to start, scaffold or bootstrap an app, API, fullstack project or monorepo with any of Next.js, TanStack Router or Start, React Router, Nuxt, Svelte, Solid, Astro, React Native, Hono…

AmanVarshney01/create-better-t-stack · 149 tokens

scaffold-project

Scaffold a new app, API, backend, fullstack project, mobile app, polyglot service, monorepo, or starter with Better Fullstack. Use when the user wants to create, start, bootstrap, initialize, or generate a project from a stack description. Prefer the bundled Better Fullstack MCP server: guidance, schema…

Marve10s/Better-Fullstack · 80 tokens

cloud_api

Manages cloud AI provider API keys for Gemini, OpenAI, Claude, DeepSeek, Grok.

tubecreate/tubecli · 0 tokens

pi-package-sandbox-test

Use when verifying that published Pi packages install and load for normal users, including pi.dev package compatibility checks, release validation, Daytona sandbox tests, and package installability audits.

spences10/my-pi · 40 tokens

pi-primitive-check

Use when evaluating proposed Pi customisation work against built-in Pi primitives before implementation, especially extensions, packages, slash commands, and workflow ideas.

spences10/my-pi · 33 tokens