api-design
Skill2 starsChanged 6 months agoMITView on GitHub
REST and GraphQL API design conventions — resource modeling, pagination, error envelopes, versioning, idempotency. Use when adding, changing, or reviewing endpoints.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 164 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
Prefer additive changes. Add fields.
- Very specific: line 90
Observability: Every request has a requestId.
“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
API design
REST
Resource, not action
URLs name nouns. Actions are verbs.
Good: POST /users/:id/password-reset
Bad: POST /resetUserPassword?id=123
Status codes mean things
200success with body201created (includeLocation)204success, no body400client sent something invalid (bad syntax, bad shape)401not authenticated403authenticated but not authorized404resource doesn't exist (or the caller isn't allowed to know it does)409conflict (version conflict, duplicate, precondition failed)422semantic validation failed (body parses but rules reject)429rate limited5xxserver fault — internal detail logged, opaque to caller
Error envelope
Pick one. Use it everywhere.
{
"error": {
"code": "resource_not_found",
"message": "User alice@example.com not found.",
"requestId": "abc123"
}
}codeis machine-readable, stable, lowercase_snake.messageis human-readable. Safe to surface.requestIdlets the caller tell you what went wrong without you reading prod logs.
Pagination
Cursor-based for anything you'll scale. Offset paging breaks under concurrent writes.
GET /messages?cursor=abc&limit=50
→ { items: [...], nextCursor: "xyz" }Idempotency
Any POST that has side-effects and will be retried needs an idempotency key:
POST /payments
Idempotency-Key: <uuid-v4>Server stores the (key → response) for a reasonable TTL. Retries return the cached response, not a second charge.
Versioning
Prefer additive changes. Add fields; don't remove or rename. When you must break, version:
- URL (
/v2/...) — simple, explicit, slightly ugly - Accept header (
Accept: application/vnd.foo.v2+json) — prettier URLs, slightly opaque
Pick one per service. Never mix.
GraphQL
Nullability is a contract
String! says "this WILL be present". If you're not sure, it's String (nullable). A lie here cascades.
Relay-style pagination
Connections, edges, pageInfo, cursors. Don't invent your own.
One mutation per intent
updateUser(input: { name, email, password }) is three different operations glued together. Split them.
Errors as types
Return { user: User | UserNotFoundError | ValidationError } unions where it matters. Generic errors[] at the top is for transport-level fault, not business rules.
Across both
- Typed shapes. Schemas (OpenAPI / GraphQL / proto). Generate clients from them.
- Rate limit expensive or abuse-prone endpoints.
- Observability. Every request has a
requestId. Log it. Return it on errors. Tie logs, metrics, and traces together with it. - Auth at the edge — check in the handler or middleware the handler trusts. Never rely on the gateway alone.
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
- 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★ 505same name
- loulanyue/awesome-claude-notes★ 272same name
- KbWen/agentic-os★ 218same name
- DevelopersGlobal/ai-agent-skills★ 215same name
- kid-sid/claude-spellbook★ 190same name
- margelo/react-native-skills★ 172same 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.
Used alongsideProjects with it also use everything-claude-code, everything-claude-code-conventions 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.
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
InfopibeSkillinvestor-materials
Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.
Also in 21 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
Indium-AI-LabsSkilldata-pipeline-design
Design safe ETL/ELT pipelines, data warehouse schemas, partition strategies, idempotency controls, and data quality assertions before implementation.
Also in 3 projects that use this
- +1 more from Infopibe
In this repository10 other files it gives its agents.
- a11y-checklistSkill
- context-engineeringSkill
- debug-playbookSkill
- migration-patternsSkill
- observability-checklistSkill
- perf-checklistSkill
- pr-review-rubricSkill
- security-checklistSkill
- test-patternsSkill
- token-economySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

