idempotency-patterns

Enforce idempotency keys with Redis or database-backed stores.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/marquesfelip/agents-and-skills --skill idempotency-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: idempotency-patterns
Source: https://github.com/marquesfelip/agents-and-skills/tree/main/skills/idempotency-patterns
Command: npx skills add https://github.com/marquesfelip/agents-and-skills --skill idempotency-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protect APIs from duplicate side effects by enforcing idempotency keys.

Core Features & Use Cases

  • Redis- or database-backed idempotency stores to cache and replay results for idempotent operations.
  • Per-operation key scoping, TTL strategies, and safe handling of concurrent retries to prevent duplicate execution.
  • Idempotent consumers and webhook-like at-least-once scenarios with deduplication markers.

Quick Start

Configure a Redis-backed IdempotencyStore for your API endpoints and test replay of a previous successful response using a consistent Idempotency-Key header.

Frequently Asked Questions about idempotency-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate side effects when an API is retried or delivered at least once?

To prevent duplicate side effects, enforce idempotency keys on your API endpoints. This caches and replays previous successful responses, ensuring operations like payment processing or event queue deliveries are safe to retry without executing twice.

What is the best way to handle concurrent retries in payment processing APIs?

Handling concurrent retries requires concurrency-safe idempotency stores. By applying per-operation key scoping and TTLs, the system deduplicates concurrent requests safely, preventing duplicate execution when payment processing endpoints receive overlapping retries.

Can I use a database instead of Redis for an idempotency store?

Yes, you can use a database instead of Redis for an idempotency store. Both Redis- and database-backed stores are supported to cache and replay results, manage per-operation namespaces, and apply TTL strategies for safe deduplication.

How do I deduplicate webhook deliveries in an at-least-once messaging scenario?

To deduplicate webhook deliveries in an at-least-once scenario, apply idempotency keys and deduplication markers. This protects consumers by caching results and safely replaying responses when duplicate events or webhooks are delivered.

Do I need to configure per-operation namespaces and TTLs for idempotency keys?

Yes, configuring per-operation namespaces and TTLs is needed for idempotency keys. This scoping ensures deduplication markers only apply to specific operations, while TTLs automatically expire cached responses to maintain a safe concurrency-safe environment.