Agent skill

Idempotency Handling

by Asymmetric-al in Asymmetric-al/core

Implement idempotency keys and handling to ensure operations can be safely retried without duplicate effects.

AGPL-3.0Auto-check passedBackend & APIs

Install Idempotency Handling

skills CLI
$ npx skills add Asymmetric-al/core --skill idempotency-handling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Asymmetric-al/core idempotency-handling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Asymmetric-al/core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/idempotency-handling .claude/skills/idempotency-handling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
idempotency-handling
GitHub stars
381
Token cost
~867 tokens
SKILL.md length
214 words
Files
8 (incl. scripts, references)
Skills in repo
43
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Implement idempotency keys and handling to ensure operations can be safely retried without duplicate effects.

  • Building payment systems
  • SKILL.md covers This repository…, Table of Contents, Overview and When to Use, plus 3 more sections
  • Runs Shell scripts from its folder
  • APIs with retries

What it does

Idempotency Handling is an agent skill from Asymmetric-al/core. 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.

Its SKILL.md is about 870 tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts and reference files (for example `references/database-based-idempotency.md`, `references/express-idempotency-middleware.md` and `references/message-queue-idempotency.md`).

It sits in Backend & APIs. It works with Stripe. The repository describes itself as: A high-performance, enterprise-grade Next.js 16 application for mission-focused non-profit organizations. Built for high impact teams. The licence is AGPL-3.0.

When your agent uses it

  • Building payment systems
  • APIs with retries
  • Distributed transactions

Example prompts

  • “/idempotency-handling”

Requirements

  • A Bash shell

What it can do on your machine

Read from SKILL.md and the folder at commit 71b81fa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Idempotency Handling loads about 867 tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 53 tokens; SKILL.md has 214 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~867
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Asymmetric-al/core at commit 71b81fa, republished under its AGPL-3.0 licence (© Asymmetric-al). 214 words, ~867 tokens.

Download SKILL.mdSave it as .claude/skills/idempotency-handling/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
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.

This repository (Asymmetric-al/core)

Subordinate to docs/ai/rules/backend.md and docs/guides/architecture/data-access-boundary.md. Pair with Stripe/payment work using ecosystem skills under .agents/skills/ when installed.

Repo touchpoints:

  • Donor API idempotency header validation: packages/api/src/donate/idempotency.ts (idempotency-key / x-idempotency-key).
  • Prefer existing monorepo patterns (Next.js route handlers, Supabase, Stripe) over copying generic Express/Redis examples from this skill verbatim.

Refresh: references/upstream.md.

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:

typescript
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)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Express Idempotency MiddlewareExpress Idempotency Middleware
Database-Based IdempotencyDatabase-Based Idempotency
Stripe-Style IdempotencyStripe-Style Idempotency
Message Queue IdempotencyMessage 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

© Asymmetric-al, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in .agents/skills/idempotency-handling of Asymmetric-al/core.

  • SKILL.md
  • references/database-based-idempotency.md
  • references/express-idempotency-middleware.md
  • references/message-queue-idempotency.md
  • references/stripe-style-idempotency.md
  • references/upstream.md
  • scripts/validate-api.sh
  • templates/api-scaffold.yaml

Open the folder on GitHubat commit 71b81fa

Compare with similar skills

Idempotency Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Idempotency Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Idempotency Handling this skillAsymmetric-al/core381—~867Automated safety check: PassAGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl190k1 repos~1.4kAutomated safety check: NotesISC
Stripe Projectsfossasia/eventyay1.7k5 repos~2kAutomated safety check: NotesApache-2.0
Stripe Appsfossasia/eventyay1.7k1 repos~3.6kAutomated safety check: PassApache-2.0
Dinero Currency Patternsdinerojs/dinero.js6.8k—~650Automated safety check: PassMIT
Stripe Best Practiceskanchengw/cnllm1732 repos~925Automated safety check: PassApache-2.0

Similar skills

  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    190k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Stripe Projects

    fossasia/eventyay

    A skill your agent uses when the user wants to provision infrastructure or third-party services using Stripe Projects.

    1.7k GitHub starsUsed in 5 repos~2k tokens
    Backend & APIsAuto-check: notes
  • Stripe Apps

    fossasia/eventyay

    A skill your agent uses when building, modifying, or reviewing a Stripe App — or when the user describes something that implies one (e.g.

    1.7k GitHub starsUsed in 1 repo~3.6k tokens
    Backend & APIsAuto-check passed
  • Dinero Currency Patterns

    dinerojs/dinero.js

    Currency handling patterns for the Dinero.js money library. An agent skill from dinerojs/dinero.js.

    6.8k GitHub stars~650 tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Stripe Best Practices

    kanchengw/cnllm

    Guides Stripe integration decisions — API selection (Checkout Sessions vs PaymentIntents), Connect platform setup (Accounts v2, controller properties), billing/subscriptions, Treasury financial…

    173 GitHub starsUsed in 2 repos~925 tokens
    Backend & APIsAuto-check passed
  • Handles Laravel Cashier Stripe integration including subscriptions, webhooks, Stripe Checkout, invoices, charges, refunds, trials, coupons, metered billing, and payment failure handling.

    343 GitHub starsUsed in 1 repo~1.2k tokens
    Backend & APIsAuto-check passed

More from Asymmetric-al/core

All 43 skills in this repo
  • Accessibility Review

    Asymmetric-al/core

    Audit and fix accessibility in Core UI. An agent skill from Asymmetric-al/core.

    381 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Email Inbox

    Asymmetric-al/core

    A skill your agent uses when building any system where email content triggers actions — AI agent inboxes, automated support handlers, email-to-task pipelines, or any workflow processing untrusted…

    381 GitHub stars~4.1k tokensUpdated today
    Auto-check: notes
  • Components Build

    Asymmetric-al/core

    Build modern, composable, and accessible React UI components following the components.build specification.

    381 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Create Agent

    Asymmetric-al/core

    Guides a one-question-at-a-time design interview, captures alignment in agent/EVE-BRIEF.md, then scaffolds and implements a runnable eve agent with verbose teaching comments.

    381 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Emil Design Engineering

    Asymmetric-al/core

    Design engineering principles and patterns for building polished, accessible web interfaces.

    381 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Grill For Unknowns

    Asymmetric-al/core

    Use only when the user explicitly invokes grill-for-unknowns or asks for a map-vs-territory unknowns pass, blindspot discovery, unknown-known prototypes, or a subagent launch packet before…

    381 GitHub stars~4.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Idempotency Handling

What does Idempotency Handling do?

Implement idempotency keys and handling to ensure operations can be safely retried without duplicate effects. Idempotency Handling is an agent skill from Asymmetric-al/core. Implement idempotency keys and handling to ensure operations can be safely retried without duplicate effects.

When should I use Idempotency Handling?

Idempotency Handling fits situations like: building payment systems; APIs with retries; distributed transactions.

How do I install Idempotency Handling in Claude Code?

Run `npx skills add Asymmetric-al/core --skill idempotency-handling -a claude-code`. Or copy the skill folder (.agents/skills/idempotency-handling in Asymmetric-al/core) into .claude/skills/idempotency-handling in your project. Claude Code loads it when a task matches its description.

How do I install Idempotency Handling in Codex?

Run `npx skills add Asymmetric-al/core --skill idempotency-handling -a codex`. Or copy the skill folder (.agents/skills/idempotency-handling in Asymmetric-al/core) into .agents/skills/idempotency-handling in your project. Codex loads it when a task matches its description.

Can I use Idempotency Handling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Asymmetric-al/core --skill idempotency-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/idempotency-handling, .gemini/skills/idempotency-handling, .github/skills/idempotency-handling and .opencode/skills/idempotency-handling in your project.

What does Idempotency Handling need to run?

Going by SKILL.md and its folder, Idempotency Handling needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Idempotency Handling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Idempotency Handling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Idempotency Handling use?

Idempotency Handling is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Idempotency Handling use?

About 867 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.1k tokens, read only when the agent opens those files.

What are the alternatives to Idempotency Handling?

Skills that share tags, products or a category with Idempotency Handling: Firecrawl Build Onboarding (firecrawl/firecrawl, 190k stars), Stripe Projects (fossasia/eventyay, 1.7k stars), Stripe Apps (fossasia/eventyay, 1.7k stars) and Dinero Currency Patterns (dinerojs/dinero.js, 6.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Idempotency Handling?

Asymmetric-al (a GitHub organization) maintains it in Asymmetric-al/core, which has 381 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on October 11, 2026.

Source: Asymmetric-al/core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.