Idempotency
AI-agent skills for software engineering — works with Claude Code, Codex, Cursor
npx -y skills add vaibhavsaxena022/skills --skill idempotencyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 23 days oldThe repository was created 23 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Make a mutating endpoint safe to retry. Use when a create/POST or payment-like operation could arrive twice (client retries, at-least-once queues). Adds idempotency keys so duplicates don't double-apply.
SKILL.md
1.3 KB, as published. Nobody here has run it
Idempotency
Ensure "send it twice" behaves like "send it once".
Approach
- The client sends an Idempotency-Key (or derive one from a natural business key).
- On receipt, look up the key:
- new → process, then store
{key → result}atomically. - seen, completed → return the stored result; don't re-process.
- seen, in progress → return
409/425(or wait); don't double-process.
- new → process, then store
- Store keys with a TTL matching your retry window.
Rules
- The check-and-store must be atomic (unique constraint or transaction) to survive concurrent retries.
- Scope keys to the operation + caller so they can't collide.
- Idempotency protects writes; reads are already idempotent.
- For queue consumers, dedupe on a message/business id the same way.