api-contract-design

api-contract-design is a skill for Claude Code, Codex from 05-deepak-patidar/claude-skills. It costs 79 tokens per session (1,104 once invoked), scanned A, original, MIT.

A guide for designing HTTP and REST APIs, which are rules for how software services exchange requests and responses. It covers data shapes, errors, version changes, pagination, repeat-safe requests, and webhooks.

In plain words
What is it for?
Use it when creating or changing endpoints, connecting a frontend to a backend, or publishing an API for partners and integrations.
Why use it?
It prevents a frontend, partner, or integration from relying on an unclear or inconsistent API contract. Clear contracts reduce mismatches and costly breaking changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or changing endpoints, connecting a frontend to a backend, or publishing an API for partners and integrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/05-deepak-patidar/claude-skills/api-contract-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 05-deepak-patidar/claude-skills --skill api-contract-design
Clone the repo
git clone --depth 1 https://github.com/05-deepak-patidar/claude-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-contract-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/api-contract-design/github.svg)](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/api-contract-design)
Your own site
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/api-contract-design"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/api-contract-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-contract-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/api-contract-design"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/api-contract-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.01104
Opus 5 $0.00039 $0.00552
Sonnet 5 $0.00016 $0.00221
Haiku 4.5 $0.00008 $0.00110

Measured 11d ago against content hash b1af258299cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

api-contract-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

api-contract-design/SKILL.md · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Contract Design

An API is a promise. Clients — your own frontend, partners, and AI models writing integrations — build on exactly what you return, including your mistakes. Design every endpoint as if you can never change it, because for practical purposes you can't (only add).

Contract-first, always

Before writing the handler, write the contract: method, path, auth, request shape, response shape, every error case with its code. Five minutes of contract prevents the frontend and backend from building two different APIs. Keep it wherever it's enforceable — OpenAPI, typed schemas (Pydantic/zod), or at minimum a markdown table — the schema layer IS the documentation if you make it one.

Shape rules

  • Resources and predictability over cleverness: plural nouns (/invoices/{id}), nesting only one level deep when ownership is intrinsic (/invoices/{id}/payments); verbs only for true actions (/invoices/{id}/cancel). A developer should guess the next endpoint correctly.
  • Response envelopes are uniform across the whole API: pick one success shape and ONE error shape ({"error": {"code", "message"}}-style) and never deviate. Machine-readable code (stable, documented, for programs) + human message (for humans, changeable). Clients that parse message strings are a bug you caused.
  • Every list endpoint, from day one: pagination (limit + cursor/offset), a deterministic default sort, and filters as query params. Retrofitting pagination onto a client that assumes "all rows" is a breaking change.
  • Field conventions fixed project-wide: one case style, ISO-8601 timestamps in UTC, money as string-decimal or integer minor units (never JSON floats), booleans not 0/1 strings, null vs absent given meaning consistently.
  • Return the resource state after mutation (the created/updated object), so clients don't need a follow-up GET.

Status codes — the short honest set

200 read/update ok · 201 created · 204 deleted/no body · 400 malformed/validation · 401 who are you · 403 you can't do that (but see threat-model-security: prefer 404 when existence itself is private) · 404 not found or hidden · 409 state conflict (duplicate, already-cancelled) · 422 semantic validation if you distinguish it · 429 rate limited · 5xx our fault, never leaks internals. Don't return 200 {"success": false} — that lies to every HTTP-aware layer between you and the client.

Read the full file on GitHub · 51 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 51 lines · 79 tokens per session scan A b1af258299cf

Subscribe to this mod's changes

api-contract-design is a skill published in the GitHub repository 05-deepak-patidar/claude-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 1,104 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

backend

Backend development patterns for services, error handling, logging, caching. Use when building backend services, APIs, or microservices.

xiaobei930/cc-best · 27 tokens

api

RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.

xiaobei930/cc-best · 23 tokens

java-spring-best-practices

Enterprise-grade Spring Boot 3.5.x/4.x development guide. Use when building Spring Boot APIs, microservices, or enterprise Java applications. Covers Java Records as DTOs, Virtual Threads, ProblemDetail (RFC 7807), RestClient, structured logging, Testcontainers, observability, sealed exception hierarchies, and GraalVM…

cosbort/agent-skills · 104 tokens

add-provider

Checklist for adding a new AI provider (image, video, text, audio) that satisfies all 5 integration principles — ACL, bulkhead, idempotency, observability, and contract test. Load when integrating any new external AI API. Prevents the most common mistake of pasting httpx calls directly into a service.

yerdaulet-damir/vibe-coding-rules · 69 tokens

new-feature-go

Pre-flight checklist for adding a new feature to a Go 1.22+ service. Load when creating a new endpoint, internal package, external integration, or background worker. Forces "accept interfaces, return structs", context.Context propagation, error wrapping, and bulkhead-per-provider from line one — prevents the most…

yerdaulet-damir/vibe-coding-rules · 91 tokens

debug-backend

Systematic 5-step backend debugging flow for AI-coded FastAPI apps. Load this skill when a bug is reported, a test fails, or unexpected behavior appears in any backend layer. Forces layer isolation before touching code — prevents the "touch 8 files and make it worse" pattern.

yerdaulet-damir/vibe-coding-rules · 62 tokens