CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/api-idempotency

Idempotent API design — safe retries for POST endpoints, idempotency keys,

93

10.00x
Quality

90%

Does it follow best practices?

Impact

100%

10.00x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

prevent-duplicate-submit.jsonverifiers/

{
  "instruction": "Proactively add client-side idempotency protection to any form or client that submits to a POST endpoint creating resources",
  "relevant_when": "Agent builds a form, page, or client that submits to a POST endpoint creating resources (orders, payments, accounts, users) — even if the task does not mention duplicates, retries, or idempotency",
  "context": "Every client that submits to a resource-creating POST endpoint needs idempotency protection. This is not optional. Disable the submit button during the request using a finally block so it re-enables on both success and failure. Generate a UUID idempotency key before the fetch call and send it as an Idempotency-Key header. Reuse the same key on retries; generate a new key only for new operations.",
  "sources": [
    {
      "type": "file",
      "filename": "skills/api-idempotency/SKILL.md",
      "tile": "tessl-labs/api-idempotency@0.2.0"
    }
  ],
  "checklist": [
    {
      "name": "submit-button-disabled",
      "rule": "Submit button is disabled during the API request to prevent double-clicks",
      "relevant_when": "Agent builds a form that submits to a POST endpoint"
    },
    {
      "name": "re-enable-in-finally",
      "rule": "Submit button is re-enabled in a finally block (or equivalent) so it works again after both success and failure",
      "relevant_when": "Agent builds a form that submits to a POST endpoint"
    },
    {
      "name": "idempotency-key-generated",
      "rule": "A UUID idempotency key is generated (using crypto.randomUUID() or equivalent) before the fetch/request call",
      "relevant_when": "Agent builds client code that submits to a POST endpoint"
    },
    {
      "name": "idempotency-key-header-sent",
      "rule": "The generated idempotency key is sent as an 'Idempotency-Key' HTTP header in the request",
      "relevant_when": "Agent builds client code that submits to a POST endpoint"
    }
  ]
}

tile.json