api-design
Skill2 starsChanged 3 months agoMITView on GitHub
Design and review HTTP/REST (and choose between REST/GraphQL/gRPC) APIs that are contract-first, resource-oriented, backward-compatible, and secure by default. Use whenever the task touches an API surface — designing an API, adding or changing an endpoint or route, picking an HTTP method or status code, naming resources, paginating a list, versioning, deprecating a field, modeling errors, idempotency, concurrency, webhooks, or writing an OpenAPI spec. Triggers: "design an API", "add an endpoint", API, REST, endpoint, route, HTTP, versioning, pagination, webhook, OpenAPI, idempotency. Not for pure UI work — see building-frontend-ui.
192 other projects use a version of this.
Adopted by
Most recently taken up by
- Badhon-00/MDCPtheir own version, first seen Nov 16, 2026
- AndresArreguy/ecc-pi-porttheir own version, first seen Nov 16, 2026
- youcisla/Agent-Foundrytheir own version, first seen Nov 16, 2026
- samsam007b/claude-code-standards-kittheir own version, first seen Nov 16, 2026
- agenticluke/rest-api-designer-plustheir own version, first seen Nov 15, 2026
- dovuthanhhien1609/claude-skillstheir own version, first seen Nov 15, 2026
Used with
Projects with it also use db-design, everything-claude-code and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
yuexueyuSkilldb-design
数据库工程师技能 - Schema设计、索引优化、并发安全、数据库审计。当你涉及数据库表/字段/索引/SQL/迁移/MCP数据库操作、建表改表、写查询时必须使用此技能。即使用户只是说"加个字段"或"查下数据",也应触发。
Also in 4 projects that use this
InfopibeSkilleverything-claude-code
Also in 9 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
thejordanleopoldSkillthird-party-integration
Use when integrating with external APIs, payment processors (Stripe), webhooks, or third-party services. Use when implementing API clients with authentication and rate limiting, handling webhooks with signature verification and idempotency, writing contract tests for external services, or isolating third-party dependencies behind adapters. Triggers: \"Stripe\", \"payment integration\", \"webhook\", \"third-party API\", \"external service\", \"API client\", \"integrate with\", \"signature verification\", \"idempotency key\".
Also in 3 projects that use this
Indium-AI-LabsSkilldata-pipeline-design
Design batch or incremental ETL and ELT pipelines and warehouse models: grain, partitioning, idempotent loads, late-arriving data, data quality tests, PII controls, and cost monitoring, before building them. Use when adding or changing a dbt model, warehouse table, scheduled transformation, or ingestion job. Not for transactional schema design (use the database-design skill) or event-sourced stores (use the event-sourcing-architecture skill).
Also in 3 projects that use this
CodeWithBehnamSkilldmux-workflows
Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.
Also in 16 projects that use this
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- affaan-m/ECC★ 246ksame name
- RostislavDugin/postgresus★ 9.3ksame name
- databasus/databasus★ 9.3ksame name
- authgear/authgear-server★ 2.2ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- Aaronontheweb/dotnet-skills★ 1.2ksame name
- epam/ai-dial-chat★ 501same name
- loulanyue/awesome-claude-notes★ 272same name
- KbWen/agentic-os★ 236same name
- DevelopersGlobal/ai-agent-skills★ 216same name
182 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- building-frontend-uiSkill
- debugging-agent-runsSkill
- developing-featuresSkill
- developing-features-tddSkill
- documenting-featuresSkill
- ensuring-cross-platformSkill
- evaluating-ai-outputSkill
- exploratory-testingSkill
- fixing-bugsSkill
- playwright-cliSkill
- reviewing-codeSkill
- running-agent-loopsSkill
- security-reviewSkill
- threat-modelingSkill
- validating-in-realitySkill
- writing-prdSkill
- writing-pull-requestsSkill
- writing-testsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 166 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Design contract-first: Write the OpenAPI (or proto/SDL) spec before the code.
- Very specific: line 41
Standardize errors: Use RFC 9457 application/problem+json with a stable machine-readable code.
- Very specific: line 53
Capture a learning (final step): If you hit a convention, constraint, or trap not already in this file or references/, append a …
“Common” is measured: kept by at least 6 in 10 of the 166 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Design
A good API is a contract you can evolve without breaking the people who depend on it. Design the contract first, model resources not actions, use HTTP the way it is specified, stay backward-compatible, and make security and operability the default — not an afterthought.
This skill is protocol-agnostic at the workflow level; the canonical detail lives in references/ and is loaded on demand.
Read first (always)
List learnings/ and read every file whose name looks relevant to the current task — the project's versioning policy, its error envelope, its auth model, its naming conventions, and provider-specific webhook quirks live there and override the defaults in this file. If a learning conflicts with this SKILL.md, the learning wins — mention it to the user.
Tradeoff — when to apply, when to lighten up
Apply the full discipline for any API with external or cross-team consumers, or anything that persists state. Lighten the ceremony for a private, single-consumer endpoint you fully control on both sides and can change atomically — but never lighten the security floor (authorization, input validation, no secrets in URLs).
Workflow
- Choose the protocol deliberately. REST for resource CRUD and broad client reach; GraphQL when clients need flexible, client-shaped queries over a graph; gRPC for low-latency internal service-to-service. Don't default to GraphQL/gRPC because they're new. State the choice and why. → verify: you can name the consumer and why this protocol fits it.
- Design contract-first. Write the OpenAPI (or proto/SDL) spec before the code; review it, then generate or hand-write handlers against it. Lint the spec in CI (e.g. Spectral) so drift fails the build. → verify: the spec exists and is the source of truth, not reverse-engineered from code.
- Model resources (nouns), not actions. A resource is a thing with an identity; collections are plural. Unusual operations become sub-resources or state, not verbs in the path. See
references/rest-conventions.md. → verify: no verb in any path. - Use HTTP method + status-code semantics correctly. GET/HEAD safe and idempotent, PUT/DELETE idempotent, PATCH partial, POST creates/non-idempotent. Status code carries the outcome; the body carries the data or the error. See
references/rest-conventions.md. → verify: no200 OKwith an error in the body. - Apply consistent conventions everywhere. One casing for paths, one for fields; pluralized collections; opaque IDs (don't leak DB sequence/structure). Inconsistency is a permanent tax on every consumer. → verify: a reader can predict the shape of an endpoint they haven't seen.
- Never break consumers. Additive-only changes within a version; breaking changes need a new version and a deprecation window with
Deprecation/Sunsetheaders. Adding pagination to a previously-unpaginated list is a breaking change. Seereferences/versioning-and-compatibility.md. → verify: every change is classified additive or breaking before you ship it. - Standardize errors. Use RFC 9457
application/problem+jsonwith a stable machine-readablecode. HTTP status must match the body. Never leak stack traces. Seereferences/errors-idempotency-concurrency.md. → verify: every error path returns the same envelope shape and a stable code. - Paginate every list from day one. Cursor-based (
page_size+page_token/nextlink) preferred over offset. Retrofitting pagination later breaks clients. → verify: no unbounded list endpoint exists. - Make writes safe to retry.
Idempotency-Keyfor non-idempotent POST (store and replay the first response); optimistic concurrency withETag+If-Match→412on conflict. Seereferences/errors-idempotency-concurrency.md. → verify: a client that retries a POST after a timeout cannot double-charge / double-create. - Security by default. TLS only; validate tokens server-side; per-object authorization (not just role); no secrets in URLs; validate input against the schema; rate-limit; CORS allow-list. See
references/security.md. → verify: object-level authorization is checked on every request that names an object. - Capture a learning (final step). If you hit a convention, constraint, or trap not already in this file or
references/, append alearnings/YYYY-MM-DD-slug.md. Otherwise skip.
Anti-patterns (reject on sight)
- Verbs in paths —
POST /createUser,/getOrders. UsePOST /users,GET /orders. 200 OKwith an error in the body. The status code is the outcome; clients and proxies rely on it.- Leaking internal/DB models — exposing column names, internal enums, sequence IDs, or join structure as the public shape. Map to a deliberate DTO.
- Chatty endpoints / N+1 — forcing clients to make many round-trips to assemble one view. Offer expansion (
expand=) or a coarser resource. - Breaking changes without a new version — including renaming/removing a field, changing a type or default, or adding pagination to a previously-unpaginated list.
- Inconsistent conventions — mixed casing, singular and plural collections, sometimes-wrapped responses.
- Non-idempotent POST with no idempotency key — any retry double-creates.
- Sensitive data in URLs — tokens, PII, secrets in path or query; they land in logs, history, and referers.
- Missing object-level authorization (BOLA) — checking authentication but not whether this caller may touch this object. OWASP API #1.
- Exposing stack traces — internal class names, file paths, SQL in the error body.
- Unbounded list endpoints —
GET /eventsreturning everything.
Capture a learning
When you finish, ask: did I encounter a convention, constraint, or trap that wasn't in this SKILL.md or references/? (A project-specific versioning policy, a non-standard error envelope the org has standardized on, a webhook provider's signing scheme, a mandated header.) If yes, append a learnings/YYYY-MM-DD-slug.md following learnings/README.md. If no, skip — don't write noise.
See also
references/rest-conventions.md— resource modeling, naming, methods, status codes, pagination, filtering, caching.references/versioning-and-compatibility.md— versioning strategies, additive vs breaking changes, deprecation policy.references/errors-idempotency-concurrency.md— problem+json, idempotency keys, optimistic concurrency, retries, long-running ops, webhooks.references/security.md— TLS, OAuth2/OIDC, BOLA/BFLA, input validation, rate limiting, CORS, data exposure.developing-featuresskill — general production rules and the full security reference (the API surface is one boundary among several).reviewing-codeskill — review a diff that changes an API surface.documenting-featuresskill — capture the API contract, ADRs, and the domain model alongside the code.learnings/— project-specific API conventions accumulated over time.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

