idempotency-patterns

idempotency-patterns is a skill for Claude Code from sigistry/marketplace. It costs 106 tokens per session (1,165 once invoked), scanned A, original, MIT.

A collection of patterns for reliable web APIs: making repeated requests safe, moving through large result sets, and responding correctly when clients send too many requests. Idempotency means repeating an operation has the same result as doing it once.

In plain words
What is it for?
It helps design idempotency keys for unsafe requests such as payments, stable cursor or offset pagination, and standard rate-limit responses including Retry-After.
Why use it?
It prevents retries from causing duplicate effects such as charging a customer twice, and gives clients predictable ways to paginate and handle rate limits.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the api-contract-keeper plugin — 4 skills, 3 commands, 2 agents shipped together

Good fit It helps design idempotency keys for unsafe requests such as payments, stable cursor or offset pagination, and standard rate-limit responses including Retry-After.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sigistry/marketplace/idempotency-patterns
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 sigistry/marketplace --skill idempotency-patterns
Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

Made for: Claude Code.

Or install api-contract-keeper, the plugin that ships this one along with the rest of its 4 skills, 3 commands, 2 agents.

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 idempotency-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/sigistry/marketplace/idempotency-patterns/github.svg)](https://agentmods.dev/skills/sigistry/marketplace/idempotency-patterns)
Your own site
<a href="https://agentmods.dev/skills/sigistry/marketplace/idempotency-patterns"><img src="https://agentmods.dev/badge/skills/sigistry/marketplace/idempotency-patterns/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 idempotency-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/sigistry/marketplace/idempotency-patterns"><img src="https://agentmods.dev/badge/skills/sigistry/marketplace/idempotency-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,165 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 original No closer match found 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.00106 $0.01165
Opus 5.5 $0.00042 $0.00466
Sonnet 5.5 $0.00021 $0.00233
Haiku 4.5 $0.00011 $0.00117

Measured 3mo ago against content hash c6146589075f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

idempotency-patterns 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 3mo 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.

plugins/api-contract-keeper/skills/idempotency-patterns/SKILL.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Idempotency Patterns

Purpose

Provide standardized recipes for the three pieces of API plumbing that clients depend on and servers get subtly wrong: safe retries (idempotency keys so a retried mutation applies once), pagination (stable, bounded traversal of collections), and rate limiting (standard headers so clients back off correctly). All three are static, framework-agnostic patterns, apply them at the boundary, in the handler.

Why idempotency

HTTP defines GET, HEAD, PUT, and DELETE as idempotent (repeating them has the same effect as doing them once) and GET/HEAD as safe (no side effects). POST is neither: and networks retry. A client that times out and retries a POST /payments can charge twice. The fix is an idempotency key: the client sends a unique Idempotency-Key header; the server records key → outcome and, on replay, returns the stored outcome instead of re-executing.

The idempotency-key algorithm (unsafe methods only)

  1. Read the Idempotency-Key header. If absent on a create endpoint, either require it (400) or proceed without dedup, decide per endpoint.
  2. Look up the key (scoped to the authenticated principal + endpoint) in a durable store.
  3. Hit, completed → return the stored status + body verbatim. Do not re-run.
  4. Hit, in-flight → the original is still processing: return 409 (or block briefly), never run concurrently.
  5. Miss → atomically insert the key in an in-flight state (unique constraint / SET NX), execute the work, store the response, mark completed, set a TTL.
  6. Guard against key reuse with a different body: store a hash of the request; if the same key arrives with a different payload, return 422.

Apply idempotency only to unsafe, non-idempotent methods (POST, and non-idempotent PATCH). GET/HEAD/PUT/DELETE are already idempotent by contract, do not bolt a key onto them. Full store recipes and TTL/window guidance are in references/idempotency-recipes.md.

Read the full file on GitHub · 45 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3mo ago First seen · 45 lines · 106 tokens per session scan A c6146589075f

Subscribe to this mod's changes

idempotency-patterns is a skill published in the GitHub repository sigistry/marketplace (3 stars, last pushed 7d ago), licensed MIT. It adds 106 tokens to every session and 1,165 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

idempotency-patterns compared with skills from other repositories

idempotency-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
idempotency-patternssigistry/marketplaceSkill37d agoMITA106Claude Code
design-code-architecturewondelai/skillsSkill2.9k4d agoMITA220Claude Code
system-designwondelai/skillsSkill2.9k4d agoMITA139Claude Code, Codex
mcp-tool-devandisab/swe-marketplaceSkill233d agoMITA158Claude Code
mcp-server-devandisab/swe-marketplaceSkill233d agoMITA175Claude Code
nodejsxobotyi/cc-foundrySkill23yesterdayMITB50Claude Code
zogxobotyi/cc-foundrySkill23yesterdayMITB45Claude Code