Idempotency Handling
Guide for building idempotent operations so retries never cause duplicate effects.
- CCM score
- 42 of 100
- skills.sh installs
- 468
- GitHub stars
- 396
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers idempotency keys, stored request and response pairs, and TTL-based cleanup of old records
- Includes a Redis-backed Express example plus reference guides for database-based, Stripe-style, and message queue idempotency
- Enforces rules such as validating that a retried request body matches the stored request and never applying it to GET requests
- Designed for payment systems, retrying APIs, webhooks, message queue consumers, and distributed transactions
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill idempotency-handling -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Idempotency Handling
Table of Contents
Overview
Implement idempotency to ensure operations produce the same result regardless of how many times they're executed.
When to Use
- Payment processing
- API endpoints with retries
- Webhooks and callbacks
- Message queue consumers
- Distributed transactions
- Bank transfers
- Order creation
- Email sending
- Resource creation
Quick Start
Minimal working example:
import express from "express";
import Redis from "ioredis";
import crypto from "crypto";
interface IdempotentRequest {
key: string;
status: "processing" | "completed" | "failed";
response?: any;
error?: string;
createdAt: number;
completedAt?: number;
}
class IdempotencyService {
private redis: Redis;
private ttl = 86400; // 24 hours
constructor(redisUrl: string) {
this.redis = new Redis(redisUrl);
}
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Category
- Backend & APIs
- First seen
- Jun 3, 2026
Questions
What does the idempotency-handling skill do?
The idempotency-handling skill implements idempotency keys so operations can be safely retried without duplicate effects. It stores each request and its response together, returns the same response for duplicate requests, and handles concurrent requests gracefully.
When should I use idempotency-handling?
Use idempotency-handling when building payment systems, APIs with retries, webhooks, message queue consumers, bank transfers, order creation or email sending. It is aimed at distributed transactions and resource creation where a repeated call must not repeat its effect.
How do I install idempotency-handling?
Run npx -y skills add aj-geddes/useful-ai-prompts --skill idempotency-handling -y in your project. Once installed, idempotency-handling lets the agent add idempotency keys and duplicate-safe handling to your API and payment code.
Where does idempotency-handling stand in the Backend & APIs category?
idempotency-handling is listed in the Backend & APIs category on Claude Marketplaces, alongside entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. It stands apart by focusing on retry safety through keyed request storage and response replay.
More from aj-geddes/useful-ai-prompts
All 258- Network Analysis467
- Risk Assessment467
- Error Tracking466
- Query Caching Strategies466
- Clustering Analysis464
- Code Metrics Analysis464
- Spring Boot Application464
- Webhook Integration464
- Health Check Endpoints463
- Serverless Architecture463
- Classification Modeling462
- Transaction Management462
- Secrets Rotation461
- Deployment Documentation460
- Natural Language Processing460
- Runbook Creation460
- Autoscaling Configuration458
- Security Documentation458
- Stored Procedures458
- Profiling Optimization457
- Property Based Testing457
- Cpu Profiling456
- Frontend Routing456
- Load Balancer Setup456
Similar to Idempotency Handling
More Backend & APIswebhook-integrationaj-geddes/useful-ai-prompts464 installsSecure webhook implementation with signature checks, retry logic, and delivery guarantees for third-party and event-driven integrations.
api-error-handlingaj-geddes/useful-ai-prompts514 installsStandardized API error handling covering response formats, logging, retries, circuit breakers, and validation.
payment-idempotencyvtex/skills1.2K installsIdempotency guard for payment connector endpoints covering paymentId keys, state transitions, and retry semantics.
webhook-handler-patternshookdeck/webhook-skills466 installsGeneric webhook handler guidance covering verification order, idempotency, retries, and Express, Next.js, and FastAPI gotchas.
python-background-jobswshobson/agents11.9K installsPractical Python background job patterns covering task queues, idempotent workers, and job state tracking with Celery examples.
distributed-systemsyonatangross/orchestkit299 installsReusable patterns for distributed locks, resilience, idempotency, and rate limiting with rule files loaded on demand.