idempotent-endpoint

idempotent-endpoint is a skill for Claude Code from ShipWithAI/shipwithai-plugins. It costs 108 tokens per session (863 once invoked), scanned A, original, MIT.

A server-side pattern for making unsafe POST requests safe to retry. It uses an Idempotency-Key, a request label that lets the server recognise the same operation and return the original response.

In plain words
What is it for?
For adding idempotency handling to Java servlet applications, including a request filter and a storage interface.
Why use it?
It prevents retries from repeating an action such as charging a card or creating an order. The project supplies storage through Redis or a database.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the shipwithai-java-backend-toolkit plugin — 11 skills, 1 agent shipped together

Good fit For adding idempotency handling to Java servlet applications, including a request filter and a storage interface.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shipwithai/shipwithai-plugins/idempotent-endpoint
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 ShipWithAI/shipwithai-plugins --skill idempotent-endpoint
Clone the repo
git clone --depth 1 https://github.com/ShipWithAI/shipwithai-plugins

Made for: Claude Code.

Or install shipwithai-java-backend-toolkit, the plugin that ships this one along with the rest of its 11 skills, 1 agent.

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 idempotent-endpoint

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/shipwithai/shipwithai-plugins/idempotent-endpoint"><img src="https://agentmods.dev/badge/skills/shipwithai/shipwithai-plugins/idempotent-endpoint.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 863 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.00108 $0.00863
Opus 5 $0.00054 $0.00432
Sonnet 5 $0.00022 $0.00173
Haiku 4.5 $0.00011 $0.00086

Measured 9d ago against content hash 2f9c75160566, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

idempotent-endpoint 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 9d 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/java-backend-toolkit/skills/idempotent-endpoint/SKILL.md · 79 lines

How it starts

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

Idempotent Endpoint — Scaffold

Unsafe POSTs get retried — by clients, proxies, and message queues. Without idempotency a retry charges the card twice or creates two orders. This scaffolds a filter that makes a retry carrying the same Idempotency-Key replay the original response, so the side effect happens exactly once.

Step 1 — Detect conventions (do not assume)

Read before generating:

  • Existing filter chain: look for OncePerRequestFilter / FilterRegistrationBean config and a …​.web / …​.config package; place the filter there and register it the same way the project registers other filters.
  • Storage available: check for Redis (spring-data-redis) or a relational DB. The filter depends only on the IdempotencyStore SPI — pick the backing store that already exists; do not add a new datastore.
  • Existing idempotency: if the project already keys retries somewhere, extend that instead of adding a parallel mechanism.

Step 2 — Render templates

From assets/, substitute {{PACKAGE}}:

  • IdempotencyStore.java.tmpl<pkg>/web/idempotency/IdempotencyStore.java (the SPI)
  • IdempotencyKeyFilter.java.tmpl<pkg>/web/idempotency/IdempotencyKeyFilter.java

The filter logic:

  1. Only guards POST requests that carry an Idempotency-Key header; everything else passes straight through.
  2. Computes a fingerprint = hash of method + URI + body.
  3. store.find(key):
    • hit, same fingerprint → replay the stored status/body, skip the handler.
    • hit, different fingerprint422 (the key was reused for a different request).
    • miss → run the handler, then store.save(key, response).

Step 3 — Implement the store

Generate (or point the user to write) one IdempotencyStore implementation:

@Component
class RedisIdempotencyStore implements IdempotencyStore {
    // SET key <json> NX EX <ttl>; GET key. Use a short TTL (minutes–hours), not forever.
    // A DB variant: unique column on key + an inserted-at for expiry.
}

Register the filter (e.g. a FilterRegistrationBean<IdempotencyKeyFilter>) scoped to the POST routes that need it — not every endpoint.

Read the full file on GitHub · 79 lines

Files

What ships with it

3 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. 9d ago First seen · 79 lines · 108 tokens per session scan A 2f9c75160566

Subscribe to this mod's changes

idempotent-endpoint is a skill published in the GitHub repository ShipWithAI/shipwithai-plugins (10 stars, last pushed 27d ago), licensed MIT. It adds 108 tokens to every session and 863 once invoked, about $0.0005 per session on Opus 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.