Agent skill · software engineering · aj-geddes

idempotency-handling

Implement idempotency keys and handling to ensure operations can be safely retried without duplicate effects. Use when building payment systems, APIs with retries, or distributed transactions.

Why this skill is useful

Provides specific implementation patterns and best practices for handling idempotency in APIs and payment systems that the AI may not reliably generate on its own.

What it needs

Requires redis installed locally. About 1k tokens when loaded. Last updated 2026-03-04. 307 stars on the source repository.

What this skill does

Idempotency Handling Table of Contents Overview When to Use Quick Start Reference Guides Best Practices 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: Reference Guides Detailed implementations in the references/ directory: Guide Contents --- --- Express Idempotency Middleware Express Idempotency Middleware Database-Based Idempotency Database-Based Idempotency Stripe-Style Idempotency Stripe-Style Idempotency Message Queue Idempotency Message Queue Idempotency Best Practices ✅ DO Require idempotency keys for mutations Store request and response together Set appropriate TTL for idempotency records Validate request body matches stored request Handle concurrent requests gracefully Return same response for duplicate requests Clean up old idempotency records Use database constraints for atomicity ❌ DON'T Apply idempotency to GET requests Store idempotency data forever Skip validation of request body Use non-unique idempotency keys Process same request concurrently Change response for duplicate requests

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aj-geddes/idempotency-handling

View the source on GitHub

Browse the @skills marketplace