API Idempotency Handling

•
239
•

Implements resilient idempotency patterns using Redis caching and database constraints to prevent duplicate processing and race conditions.

The API Idempotency Handling skill equips Claude Code with production-ready architectural patterns for building strictly idempotent operations across distributed systems. It provides robust implementations for Redis-cached response middleware, database-backed atomic key locking with SHA-256 request hashing, and lifecycle state management (processing, completed, failed). Ideal for payment gateways, webhook ingestion endpoints, and transactional email systems, this skill helps developers eliminate duplicate charges, handle network retries safely, and maintain clean database storage via automated TTL cleanup strategies.

主な機能

01Full lifecycle state tracking to handle in-flight, succeeded, and failed requests
02Scheduled TTL cleanup implementations for PostgreSQL, Node.js, and Python
03Redis middleware integration for sub-millisecond cached response replay
04239 GitHub stars
05Atomic database locking with request payload hashing to block concurrent race conditions
06Mismatched payload detection to prevent idempotency key reuse across distinct requests

ユースケース

01Protecting distributed background jobs and transactional notifications from duplicate execution
02Preventing duplicate charges and double-spend errors during payment processing
03Safely handling third-party webhook retries without duplicate record creation