api-design
Skill1 starsChanged 38 days agoMITView on GitHub
Designs REST API surfaces - resource naming, HTTP method and status-code semantics, error shapes, pagination, and filtering - and delivers an endpoint spec a consumer can build against without asking questions. Use when someone asks "how should I name this endpoint", "what status code should this return", "should this be PUT or PATCH", "how do I paginate this list", or is reviewing an API before it ships to external consumers. Do NOT use for planning breaking-change rollouts and deprecation windows - use api-versioning-strategist instead; for GraphQL type and resolver design - use graphql-schema instead; for generating client SDKs from an existing spec - use api-client-generator instead; for designing inbound webhook endpoints - use webhook-receiver-hardener instead.
192 other projects use a version of this.
Adopted by
Most recently taken up by
- RostislavDugin/postgresustheir own version, first seen Nov 8, 2026
- Markssuave/Markssuave-Agent-skillstheir own version, first seen Nov 8, 2026
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- databasus/databasustheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 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
tpavanipradeepSkillnextjs-turbopack
Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.
Also in 15 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
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
Other versions192 projects use a version of this.
Word for word · 2
- SkillMedev/technical-writing-studio★ 1100% same
- SkillMedev/api-integration-engineering★ 0100% same
Edited · 0
None found.
Wrote their own version · 190
- affaan-m/ECC★ 246ksame name
- databasus/databasus★ 9.3ksame name
- RostislavDugin/postgresus★ 9.3ksame name
- authgear/authgear-server★ 2.1ksame 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★ 229same name
- DevelopersGlobal/ai-agent-skills★ 216same name
180 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 repository6 other files it gives its agents.
- database-schemaSkill
- graphql-schemaSkill
- nextjs-app-routerSkill
- stripe-integrationSkill
- supabase-expertSkill
- web-performanceSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 164 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Read/write ratio and latency expectations per endpoint.
- Distinctive: line 30
No verbs in paths; the HTTP method is the verb.
- Distinctive: line 37
PUT: full replace, idempotent.
- Distinctive: line 39
DELETE: remove, idempotent, returns 204.
- Distinctive: line 60
Default page size 25, maximum 100.
- Distinctive: line 96
Do not mirror the database schema in the API - consumers get coupled to internals you will want to change.
- Distinctive: line 97
Do not return 200 for failures with an error body.
- Distinctive: line 98
Do not use offset pagination on unbounded collections - it duplicates and skips rows under writes and degrades linearly.
- Distinctive: line 99
Do not nest paths deeper than two levels.
- Distinctive: line 100
Do not silently ignore unknown query parameters - a typoed filter that returns unfiltered data is a data-leak class bug.
- Distinctive: line 105
Every endpoint states its status codes, including error cases.
- Distinctive: line 106
All collection endpoints share one pagination contract.
“Common” is measured: kept by at least 6 in 10 of the 164 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
REST API Design
APIs are products: the consumer's mental model, not your database schema, decides the shape. The costly mistake this skill prevents is shipping an inconsistent surface - mixed naming, wrong status codes, offset pagination on a growing table - that every consumer then hardcodes around, making it effectively unfixable once integrated.
Operating procedure
Work in this order. Resources come before methods because method semantics depend on what the resource is; error and pagination contracts come before the spec is written because retrofitting them breaks consumers.
Step 1: gather inputs
Collect before designing. Label any assumption as a guess.
- The consumers: internal services, first-party clients, or external developers. External consumers raise the consistency bar - default to external if unknown.
- The core nouns of the domain and which ones own which (drives nesting).
- Expected collection sizes and growth. A list that can exceed ~10,000 rows rules out offset pagination.
- Read/write ratio and latency expectations per endpoint.
- Auth model (affects 401 vs 403 correctness).
Step 2: name resources
- Plural nouns: /users, /orders, /products.
- Nest one level for ownership: /users/{id}/orders. Do not nest deeper than two levels - flatten with filters instead (/orders?user_id=... beats /users/{id}/orders/{oid}/items/{iid}).
- No verbs in paths; the HTTP method is the verb. For genuine actions that fit no CRUD verb (e.g. sending an invoice), model a subresource POST: POST /invoices/{id}/send-attempts.
- Consistent case: kebab-case for multi-word path segments, snake_case for JSON fields - pick once, apply everywhere.
Step 3: assign methods and status codes
- GET: read, idempotent, no request body. 200 with body.
- POST: create. Return 201 plus a Location header pointing at the new resource. Return the created representation in the body so the client skips a follow-up GET.
- PUT: full replace, idempotent. Missing fields mean "clear", not "keep".
- PATCH: partial update (JSON Merge Patch or JSON Patch - state which in the spec).
- DELETE: remove, idempotent, returns 204. Deleting an already-deleted resource returns 204 or 404 - pick one and document it.
- Errors: 400 for malformed input, 401 for missing/invalid credentials, 403 for valid credentials without permission, 404 for absent resources (also use 404 instead of 403 when revealing existence is a leak), 409 for state conflicts, 422 for well-formed but semantically invalid input, 429 for rate limits (with Retry-After), 500 for server faults - never expose stack traces or internal identifiers.
Step 4: fix the error contract
One shape for every error, machine-readable code first:
{
"error": "validation_error",
"message": "Email is required",
"field": "email",
"request_id": "req_abc123"
}The request_id must be logged server-side so support can correlate. Human message is for developers reading logs, never for end-user display.
Step 5: fix pagination and filtering
- Cursor-based pagination for any collection that grows: return an opaque cursor and has_more flag. Offset pagination is acceptable only for small, bounded, admin-facing lists - it degrades linearly and skips/duplicates rows under concurrent writes.
- Default page size 25, maximum 100. Reject page sizes above the max with 400, do not silently clamp.
- Filtering and sorting via query params: ?status=active&sort=created_at:desc. Document which fields are filterable; reject unknown filter params with 400 rather than ignoring them (silent ignoring hides client bugs).
Step 6: apply performance and payload budgets
- p95 latency budget: 300 ms for interactive endpoints, 1 s for reports/exports. If an operation cannot meet 1 s, make it asynchronous: 202 Accepted plus a status resource to poll.
- Response payload budget: keep typical responses under 100 KB; anything routinely above 1 MB needs pagination, field selection (?fields=), or a dedicated export flow.
- Version breaking changes in the URL path (/v1/). Additive changes (new optional fields) do not require a version bump. Hand the deprecation timeline itself to api-versioning-strategist.
Worked contrast
Bad:
POST /getUserOrders?userId=42&page=3
→ 200 { "data": [...], "error": null }Verb in the path, GET semantics on a POST, offset paging, 200 wrapping an error field so clients must parse the body to know if the call failed.
Good:
GET /users/42/orders?status=shipped&limit=25&cursor=eyJpZCI6OTh9
→ 200 { "orders": [...], "next_cursor": "eyJpZCI6MTIzfQ", "has_more": true }
→ 404 { "error": "not_found", "message": "User 42 does not exist", "request_id": "req_9f2" }Noun path, ownership nesting, cursor paging, status codes carry the outcome.
Deliverable
Produce an endpoint spec containing: the resource table (path, methods, status codes per method), the shared error shape, the pagination contract (cursor format, defaults, max), the filtering whitelist, and the latency/payload budget per endpoint.
Do NOT
- Do not mirror the database schema in the API - consumers get coupled to internals you will want to change.
- Do not return 200 for failures with an error body; clients and monitoring both key off status codes.
- Do not use offset pagination on unbounded collections - it duplicates and skips rows under writes and degrades linearly.
- Do not nest paths deeper than two levels; deep nesting encodes one access path and forbids all others.
- Do not silently ignore unknown query parameters - a typoed filter that returns unfiltered data is a data-leak class bug.
Quality bar
- A consumer could implement a client from the spec without asking a single question.
- Every endpoint states its status codes, including error cases.
- All collection endpoints share one pagination contract; all errors share one shape.
- Identical concepts have identical names across every path and payload.
- Each endpoint has an explicit latency budget and the >1 s ones are async.
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.

