SkillVaultskills Browse all 500 skills

Architecture · Version 1.4.0 · Reviewed 2026-08-02

Idempotency Design Advisor

Make a defensible decision about idempotency key design and deduplication window sizing with evidence, explicit trade-offs, and a verification plan.

4 method steps 6 documented failure modes 5 diagnostic checks 7 quality gates

Designs idempotency keys, deduplication windows, replay semantics, and exactly-once-effect behavior across retries and failures.

₹149 one-time

Get this skill archive

What this skill helps you do

  • Idempotency key design
  • Deduplication window sizing
  • Replay semantics

How Idempotency Design Advisor works

You provide

Endpoint contract, retry behavior, and downstream effects

It inspects

Whether key and effect commit in one transaction

It decides

Key scheme, dedup window, and replay response

You verify

Concurrent duplicate submission yields one effect

What it checks first

Idempotency Design Advisor designs idempotency keys, deduplication windows, replay semantics, and exactly-once-effect behavior across retries and failures. Use it when the work involves Idempotency key design, Deduplication window sizing, Replay semantics.

  1. Whether the idempotency key is persisted in the same transaction as the side effect, which is the only version that is crash-safe.
  2. What the server returns for a replayed key: the original response, a conflict, or a new operation.
  3. The deduplication window relative to realistic client retry behavior including offline retries.
  4. Whether the key is client-generated and stable across retries, or regenerated per attempt.
  5. Whether downstream effects (emails, webhooks, ledger entries) are also deduplicated or only the primary write.

Failure modes it recognizes

  • Recording the idempotency key after the side effect, so a crash between them permits a duplicate.
  • A client regenerating the key on retry, defeating deduplication entirely.
  • A deduplication window shorter than the client retry window, so a late retry creates a second operation.
  • Concurrent requests with the same key both passing an existence check before either writes, requiring a unique constraint rather than a read.
  • Returning a different response body on replay, so the client treats a successful replay as a new outcome.
  • The primary write deduplicated but a downstream notification sent twice.

Answers it will reject

  • Deduplicating by hashing the request body, which breaks when a timestamp or nonce is included.
  • Using a cache for idempotency records, where eviction silently reopens the duplicate window.
  • Treating a client-visible timeout as a failure, when the operation may have succeeded.
  • Implementing idempotency only on the happy path and not for partial failures.

Decision rules it applies

  • Persist the key and the effect atomically, enforced by a unique constraint rather than a read-then-write.
  • A replayed key must return the original response, not a new execution and not an error.
  • Set the deduplication window longer than the maximum client retry horizon, and document it in the API contract.
  • Make every irreversible downstream effect idempotent independently; the entry point alone is not sufficient.

Evidence it asks for

  • Test by replaying an identical request with the same key and asserting byte-identical response and a single side effect.
  • Test concurrent duplicate submission to confirm the unique constraint rather than the application check enforces it.
  • Count operations per idempotency key in production as an ongoing correctness signal.

The method inside

  1. Map the artifact, actors, boundaries, and invariants relevant to idempotency key design.
  2. Trace concrete failure or abuse paths for deduplication window sizing; do not report checklist items without a mechanism.
  3. Prioritize replay semantics findings by impact, likelihood, confidence, and cost of correction.
  4. Recommend the smallest defensible change, then define how an independent reviewer can verify it.

Deliverables

  • Idempotency key design assessment
  • Deduplication window sizing decision and action plan
  • Replay semantics verification checklist

Evidence requirements

  • Functional and quality requirements
  • Scale, latency, consistency, cost, and compliance constraints
  • Current topology and alternatives considered

Quality gates

  • Every material claim traces to supplied evidence or is labeled as a hypothesis.
  • The response follows the declared deliverable contract.
  • No execution, access, measurement, or verification is invented.
  • Secrets and personal data are redacted rather than repeated.
  • The user receives a concrete independent verification step.
  • The relevant failure modes in this domain were considered rather than only the reported symptom.
  • No listed anti-pattern was recommended as a solution.

Example task

Input

Our payment endpoint occasionally double-charges when clients retry after a timeout.

Expected output

The client cannot distinguish a lost response from a failed request, so retrying is correct behavior on their side. The server must absorb it: persist the idempotency key in the same transaction as the charge, not before or after, otherwise a crash between the two reopens the exact window you are trying to close...

Boundaries and compatibility

Ideal for

  • Idempotency key design: produce a decision or artifact grounded in supplied evidence.
  • Deduplication window sizing: produce a decision or artifact grounded in supplied evidence.
  • Replay semantics: produce a decision or artifact grounded in supplied evidence.

Out of scope

  • Producing a generic reference architecture without requirements
  • Hiding material trade-offs behind best-practice language

Agent compatibility

  • GitHub Copilot custom agents
  • Claude Agent Skills / SKILL.md
  • Any instruction-following chat model

Tool policy: Advisory by default. No tools are assumed. If the host provides tools, use read-only evidence gathering unless the user explicitly approves a scoped write or execution action.