api-design
Skill1 starsChanged 55 days agoMITView on GitHub
Review or design REST and GraphQL APIs for correctness, consistency, and evolvability. Always use this skill when designing a new API, reviewing an existing one, choosing HTTP verbs, designing URL structure, defining error response shapes, thinking through versioning, or writing OpenAPI/Swagger specs. Use when the user says "review this API", "how should I model this resource", "is this endpoint design right", "should I use PUT or PATCH", "is this breaking", or "how should errors look". Use even when the question seems simple.
125 other projects use a version of this.
Adopted by
Most recently taken up by
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- SkillMedev/api-integration-engineeringtheir own version, first seen Oct 5, 2026
- SkillMedev/full-stack-web-devtheir own version, first seen Oct 5, 2026
- cellrishi-code/claude-skills-atlastheir own version, first seen Oct 4, 2026
- mnzralee/claude-multi-agent-architecturetheir own version, first seen Oct 3, 2026
- vekzz-dev/opencode-skillstheir own version, first seen Oct 3, 2026
Used with
Projects with it also use data-modeling, ci-pipeline 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.
mmondoraSkilldata-modeling
Schema design, multi-tenant data isolation, and migration management. Firestore and PostgreSQL patterns, RLS, UUID v7 conventions. Use when designing database schemas, writing migrations, or implementing multi-tenant data access.
Also in 7 projects that use this
vndeeSkillci-pipeline
Use when creating or updating CI/CD pipelines with GitHub Actions or GitLab CI for Go, Python, or React projects
Also in 4 projects that use this
pluginagentmarketplaceSkillmicroservices
Microservices architecture patterns and best practices. Service decomposition, inter-service communication, and distributed data management.
Also in 4 projects that use this
kevinaimonsterSkilltypescript-strict
TypeScript strict mode and advanced type system assistant. Helps write strictly-typed TypeScript code with generics, type guards, utility types, conditional types, mapped types, and template literal types. Trigger when user says 'TypeScript types' 'type gymnastics' 'TypeScript generics' 'strict TypeScript' 'type guard' 'TS类型' 'TypeScript严格模式' '类型体操' '泛型怎么写' 'TS type help'. Keywords: TypeScript, strict mode, generics, type guard, utility types, conditional types, mapped types, template literal types, infer, extends, keyof, typeof, type narrowing, discriminated unions, type assertion, type predicate, type gymnastics, TS, 类型体操, 泛型, 类型守卫, 严格类型
Also in 4 projects that use this
InfopibeSkilldeployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
Also in 10 projects that use this
DatabricksSkillload-testing
Load test a Databricks App to find its maximum QPS. Use when: (1) User says 'load test', 'benchmark', 'QPS', 'throughput', or 'performance test', (2) User wants to find how many queries per second their app can handle, (3) User wants to set up load testing scripts for their agent, (4) User wants to view load test results/dashboard, (5) User wants to validate results or observe latency/error rate with MLflow tracing.
Also in 4 projects that use this
Other versions125 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 125
- xu-xiang/everything-claude-code-zh★ 2ksame name
- Aaronontheweb/dotnet-skills★ 1.2ksame name
- nth5693/gemini-kit★ 373same name
- loulanyue/awesome-claude-notes★ 272same name
- KbWen/agentic-os★ 206same name
- margelo/react-native-skills★ 173same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- cohen-liel/hivemind★ 110same name
- microsoft/haste★ 106same name
115 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 repository25 other files it gives its agents.
- arch-reviewSkill
- db-reviewSkill
- debugSkill
- dotnet-asyncSkill
- dotnet-opsSkill
- dotnet-testingSkill
- dotnet-typesSkill
- go-concurrencySkill
- go-opsSkill
- go-testingSkill
- go-typesSkill
- incidentSkill
- node-asyncSkill
- node-opsSkill
- perfSkill
- pr-prepSkill
- py-asyncSkill
- py-opsSkill
- py-testingSkill
- py-typesSkill
- refactorSkill
- securitySkill
- test-genSkill
- ts-testingSkill
- ts-typesSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 104 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Avoid: POST /createOrder, POST /getOrderById, POST /cancelOrder
- Very specific: line 17
When it's genuinely an action with no natural resource (e.g., triggering a batch job, sending a notification), a sub-resource on a relevant …
- Distinctive: line 35
PUT vs PATCH: use PUT when the client sends the whole resource.
- Very specific: line 40
Use the right code. Vague codes (200 OK for everything, 500 for validation errors) make clients guess.
- Distinctive: line 76
Don't use HTTP status codes as the only signal.
- Distinctive: line 78
Never include stack traces, internal paths, or database errors in production responses
- Distinctive: line 107
When you're unsure: if any existing client that works today would break after the change, it's breaking.
- Distinctive: line 133
Don't put credentials in query strings.
- Distinctive: line 142
Pagination in GraphQL: use the Relay cursor connection spec, since it's what clients expect and tools understand.
“Common” is measured: kept by at least 6 in 10 of the 104 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
An API is a contract with callers you may never meet. Design it to be honest and consistent: easy to use correctly, hard to use wrong. It also has to survive change, meaning you can evolve it without breaking existing clients.
Resource modeling
Design around resources (nouns), not actions (verbs). A resource is a thing the API manages, not a procedure.
Good: POST /orders, GET /orders/{id}, PATCH /orders/{id}/status
Avoid: POST /createOrder, POST /getOrderById, POST /cancelOrder
When it's genuinely an action with no natural resource (e.g., triggering a batch job, sending a notification), a sub-resource on a relevant entity works well:
POST /reports/{id}/export, POST /users/{id}/password-reset
Pluralize consistently. Pick one convention and hold it: /users not /user, /orders/{id} not /order/{id}.
Nest only one level deep. /users/{id}/addresses is fine. /users/{id}/addresses/{id}/lines is where you lose people and create coupling. If the nested resource makes sense standalone, give it a top-level route too.
HTTP method semantics
| Method | Semantics | Idempotent? | Safe? |
| GET | Read, no side effects | Yes | Yes |
| POST | Create, or non-idempotent action | No | No |
| PUT | Full replace of a resource | Yes | No |
| PATCH | Partial update | No (unless designed carefully) | No |
| DELETE | Remove | Yes | No |
- GET must never have side effects. Caches, proxies, and clients will retry GETs freely.
- PUT vs PATCH: use PUT when the client sends the whole resource; PATCH when sending only changed fields. Don't use PATCH if you can't handle partial updates cleanly; a PUT is more honest.
- POST for non-idempotent actions is fine, but make it obvious. Document it; consider making it idempotent via a client-supplied idempotency key.
Status codes
Use the right code. Vague codes (200 OK for everything, 500 for validation errors) make clients guess.
Common codes and when to use them:
200 OK: success with a body201 Created: resource created; includeLocationheader pointing to the new resource204 No Content: success, no body (e.g., DELETE, some PATCHes)400 Bad Request: client error, such as invalid syntax, a missing required field, or a constraint violation401 Unauthorized: not authenticated (confusingly named; means "prove who you are")403 Forbidden: authenticated but not authorized for this action404 Not Found: resource doesn't exist or the caller doesn't have permission to know it exists (see: 403 vs 404 for security-sensitive resources)409 Conflict: state conflict (e.g., optimistic lock failure, duplicate key)422 Unprocessable Entity: syntactically valid but semantically wrong (good for business rule violations)429 Too Many Requests: rate limited; includeRetry-After500 Internal Server Error: something unexpected went wrong; don't leak stack traces
Error shapes
Errors must be machine-readable, not just human-readable. Callers need to handle errors programmatically.
A solid error shape:
{
"error": {
"code": "VALIDATION_FAILED", // stable machine-readable code
"message": "Email is required.", // human-readable, localizable
"field": "email", // for field-level errors
"request_id": "abc-123" // for support/tracing correlation
}
}Rules:
codemust be a stable, documented string; never change it once published- Don't use HTTP status codes as the only signal; wrap them with semantic codes
- For validation failures, enumerate all errors in one response. Don't make the client fix one field at a time
- Never include stack traces, internal paths, or database errors in production responses
Versioning
URL versioning (/v1/, /v2/) is the most practical approach for most APIs. It's explicit, cacheable, and easy to route. The downside is that clients have to opt in to upgrades.
Header versioning (Accept: application/vnd.api+json;version=2) is cleaner theoretically but harder to test and debug.
No versioning works only if you commit to never breaking clients, which means additive-only changes forever. Viable for internal APIs with a small, known set of consumers.
Whatever you choose, establish the strategy before shipping v1. Retrofitting versioning is painful.
Breaking vs non-breaking changes
Non-breaking (safe to ship without a new version):
- Adding optional fields to a response
- Adding optional query parameters
- Adding new endpoints
- Adding new error codes for new error conditions
Breaking (requires a new version or deprecation window):
- Removing or renaming a field
- Changing a field's type
- Changing HTTP method for an endpoint
- Adding a required field to a request
- Changing the meaning of an existing field or status code
When you're unsure: if any existing client that works today would break after the change, it's breaking.
Pagination
For any collection that can grow, paginate from day one. Retrofitting it is a breaking change.
Cursor-based (preferred for most cases): opaque cursor in the response, client passes it back. Stable under concurrent inserts/deletes. Doesn't allow random access but almost nothing needs it.
Offset-based (?page=2&limit=20): simple, allows random access, but unstable: a concurrent insert shifts every page. Acceptable for small, stable datasets.
Response shape:
{
"data": [...],
"pagination": {
"next_cursor": "opaque-token",
"has_more": true
}
}Auth conventions
- Authenticate with
Authorization: Bearer <token>for API tokens and JWTs, not cookies (unless you're a browser-first API) - Distinguish 401 (not authenticated) from 403 (authenticated but not allowed)
- Don't put credentials in query strings; they end up in server logs and browser history
- For machine-to-machine, prefer short-lived tokens with refresh over long-lived static secrets
GraphQL-specific
N+1 is the first thing to solve. Any field resolver that executes a query per parent will kill you at scale. Use DataLoader (or equivalent) for batching.
Limit query depth and complexity. Unbounded nested queries are a DoS vector. Set a max depth (typically 7-10 levels) and a complexity budget.
Pagination in GraphQL: use the Relay cursor connection spec, since it's what clients expect and tools understand.
Mutations should return the mutated resource, not just a success flag. Clients need to update their cache.
Errors in GraphQL: the top-level errors array is for execution errors; use a union type (SuccessResult | ErrorResult) for business logic errors that are part of the expected contract.
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.

