ab-test-analysis
Design and analyze A/B tests, calculate statistical significance, and determine sample sizes…
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.
$ npx -y skills add aj-geddes/useful-ai-prompts --skill idempotency-handling --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/idempotency-handlingContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: idempotency-handling description: > 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.
Implement idempotency to ensure operations produce the same result regardless of how many times they're executed.
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);
}
async getRequest(key: string): Promise<IdempotentRequest | null> {
const data = await this.redis.get(`idempotency:${key}`);
return data ? JSON.parse(data) : null;
}
// ... (see reference guides for full implementation)Detailed implementations in the `references/` directory:
| Guide | Contents | |---|---| | [Express Idempotency Middleware](references/express-idempotency-middleware.md) | Express Idempotency Middleware | | [Database-Based Idempotency](references/database-based-idempotency.md) | Database-Based Idempotency | | [Stripe-Style Idempotency](references/stripe-style-idempotency.md) | Stripe-Style Idempotency | | [Message Queue Idempotency](references/message-queue-idempotency.md) | Message Queue Idempotency |
488 production-ready AI prompts, all following a standardized template with validated quality gates. Transform ChatGPT, Claude, and other AI assistants into expert consultants.
Repo: aj-geddes/useful-ai-prompts
Design and analyze A/B tests, calculate statistical significance, and determine sample sizes…
Implement Role-Based Access Control (RBAC), permissions management, and authorization…
Implement WCAG 2.1/2.2 accessibility standards, screen reader compatibility, keyboard…
Test web applications for WCAG compliance and ensure usability for users with disabilities.…
Plan and execute effective sprints using Agile methodologies. Define sprint goals, estimate…
Implement comprehensive alert management with PagerDuty, escalation policies, and incident…