api-design
Skill1 starsChanged 2 months agoMITView on GitHub
Use when designing, reviewing, or evolving a REST or GraphQL API — resource naming, HTTP status codes, versioning strategy, error response shapes, pagination, and authentication patterns.
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 165 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
- Distinctive: line 24
Use nouns, not verbs. Collections are plural.
- Distinctive: line 78
Use RFC 9457 Problem Details:
- Distinctive: line 100
Never include: stack traces, internal IDs, raw database errors.
- Very specific: line 106
Prefer URL versioning for public APIs: /v1/users.
- Distinctive: line 121
Never break a version in place.
- Distinctive: line 128
Use cursor-based pagination for large or frequently-updated collections.
- Very specific: line 165
Use input types for mutations — don't accept scalar arguments directly on mutations that take more than one field.
- Very specific: line 169
Don't expose internal database IDs directly — use opaque, base64-encoded global IDs (User:123 → VXNlcjoxMjM=).
- Distinctive: line 177
Before shipping a new API endpoint or changing an existing one:
“Common” is measured: kept by at least 6 in 10 of the 165 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
Design choices for HTTP APIs (REST-style and GraphQL). The goal is an API that is consistent, predictable, and easy to evolve without breaking callers.
Reference: Google API Design Guide, JSON:API, RFC 9457 (Problem Details for HTTP APIs).
Resource naming (REST)
Use nouns, not verbs. Collections are plural.
GET /users → list users
POST /users → create a user
GET /users/{id} → get one user
PATCH /users/{id} → partial update
PUT /users/{id} → full replace
DELETE /users/{id} → delete
GET /users/{id}/posts → posts belonging to a user
POST /users/{id}/posts → create a post for a userActions that don't map cleanly to CRUD go on a sub-resource with a verb:
POST /users/{id}/activate
POST /payments/{id}/refundNaming rules:
kebab-casefor multi-word path segments (/user-profiles, not/userProfilesor/user_profiles)camelCasefor JSON field names (consistent with most JS/TS clients)- IDs in path, filters/pagination in query string
HTTP status codes — use them correctly
| Code | Meaning | Use for |
| 200 | OK | Successful GET, PATCH, PUT |
| 201 | Created | Successful POST that creates a resource |
| 204 | No Content | Successful DELETE or action with no response body |
| 400 | Bad Request | Client sent invalid data (validation failure) |
| 401 | Unauthorized | Not authenticated (no or invalid token) |
| 403 | Forbidden | Authenticated but not permitted for this resource |
| 404 | Not Found | Resource doesn't exist (or is hidden for auth reasons) |
| 409 | Conflict | Duplicate creation, optimistic lock failure |
| 422 | Unprocessable Entity | Syntactically valid but semantically invalid input |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected server failure (never expose details) |
Common mistakes:
200with{"success": false}in the body — use a 4xx status code404for auth failures — use401/403(don't leak resource existence only when that itself is sensitive)500for business logic failures — use a 4xx
Error response shape
{
"type": "https://api.example.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"detail": "The request body contains invalid fields.",
"instance": "/requests/abc-123",
"errors": [
{ "field": "email", "message": "must be a valid email address" },
{ "field": "age", "message": "must be a positive integer" }
]
}type— a stable URI identifying the error class (not a URL that must resolve, but it should if possible)title— human-readable, stable label for the error classdetail— human-readable description of this specific error instanceerrors— field-level validation failures (your extension, not in the spec)
Never include: stack traces, internal IDs, raw database errors.
Versioning
Prefer URL versioning for public APIs: /v1/users. It's explicit and easy
to route at the infrastructure level.
/v1/users → current stable version
/v2/users → new version (breaking changes)Rules:
- Additive changes (new fields, new endpoints) are non-breaking — deploy without a version bump.
- Breaking changes (removed fields, changed types, removed endpoints) require a new version.
- Maintain at least one previous major version for a published deprecation window (typically 6–12 months).
- Never break a version in place. Even a "fix" that changes a field type is a breaking change.
Pagination
Use cursor-based pagination for large or frequently-updated collections. Offset pagination is simpler but breaks under concurrent writes.
// Request
GET /users?cursor=eyJpZCI6MTAwfQ&limit=20
// Response
{
"data": [...],
"pagination": {
"next_cursor": "eyJpZCI6MTIwfQ",
"has_more": true
}
}limithas a server-enforced maximum (e.g. 100); clients can request smaller pages but not larger.next_cursoris opaque — clients must not parse it.- Return
has_more: falseand omitnext_cursoron the last page.
Authentication
- Bearer tokens in the
Authorizationheader:Authorization: Bearer <token>— never in the URL. - API keys in a custom header (
X-Api-Key) or Bearer — never in query params (they appear in server logs). - Return
401for missing/invalid credentials;403for valid credentials that lack permission for the specific resource.
GraphQL-specific notes
- Use
inputtypes for mutations — don't accept scalar arguments directly on mutations that take more than one field. - Implement cursor-based connection pagination for lists (Relay connection spec).
- Don't expose internal database IDs directly — use opaque, base64-encoded
global IDs (
User:123→VXNlcjoxMjM=). - Rate-limit by query complexity or depth, not just request count.
Review checklist
Before shipping a new API endpoint or changing an existing one:
- Nouns used for resource names; collections plural;
kebab-casepaths - Correct HTTP method and status codes for each operation
- Error responses follow RFC 9457 shape; no stack traces in responses
- Additive changes do not bump the version; breaking changes do
- Pagination implemented for any list endpoint that could return > 100 items
- Authentication tokens sent in headers only (not URL or body)
- Sensitive fields not exposed (passwords, internal IDs, PII beyond what's needed)
- New endpoints documented (OpenAPI / README)
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★ 224same name
- DevelopersGlobal/ai-agent-skills★ 216same 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 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
- +1 more from Infopibe
In this repository77 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/accessibility.mdcCursor rule
- .cursor/rules/agentharness-router.mdcCursor rule
- .cursor/rules/agentic-loops.mdcCursor rule
- .cursor/rules/api-design.mdcCursor rule
- .cursor/rules/audit-review-followup.mdcCursor rule
- .cursor/rules/big-work-plan-review.mdcCursor rule
- .cursor/rules/branching.mdcCursor rule
- .cursor/rules/clean-architecture.mdcCursor rule
- .cursor/rules/code-review-api.mdcCursor rule
- .cursor/rules/code-review-db.mdcCursor rule
- .cursor/rules/code-review.mdcCursor rule
- .cursor/rules/code-review-ui.mdcCursor rule
- .cursor/rules/committing.mdcCursor rule
- .cursor/rules/database-conventions.mdcCursor rule
- .cursor/rules/dependency-audit.mdcCursor rule
- .cursor/rules/dependency-injection.mdcCursor rule
- .cursor/rules/design-patterns.mdcCursor rule
- .cursor/rules/docker-conventions.mdcCursor rule
- .cursor/rules/error-handling.mdcCursor rule
- .cursor/rules/file-placement-policy.mdcCursor rule
- .cursor/rules/github-issue-triage.mdcCursor rule
- .cursor/rules/go-conventions.mdcCursor rule
- .cursor/rules/harness-feedback.mdcCursor rule
- .cursor/rules/logging.mdcCursor rule
- .cursor/rules/multi-agent-coordination.mdcCursor rule
- .cursor/rules/mutation-testing.mdcCursor rule
- .cursor/rules/performance-profiling.mdcCursor rule
- .cursor/rules/planning-with-files.mdcCursor rule
- .cursor/rules/port-agent-config.mdcCursor rule
- .cursor/rules/project-bootstrap.mdcCursor rule
- .cursor/rules/python-conventions.mdcCursor rule
- .cursor/rules/react-best-practices.mdcCursor rule
- .cursor/rules/refactoring.mdcCursor rule
- .cursor/rules/requirements-clarification.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/solid-principles.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/typescript-conventions.mdcCursor rule
- accessibilitySkill
- agentic-loopsSkill
- audit-review-followupSkill
- big-work-plan-reviewSkill
- branchingSkill
- clean-architectureSkill
- code-review-apiSkill
- code-review-dbSkill
- code-reviewSkill
- code-review-uiSkill
- committingSkill
- database-conventionsSkill
- dependency-auditSkill
- dependency-injectionSkill
- design-patternsSkill
- docker-conventionsSkill
- error-handlingSkill
- file-placement-policySkill
- github-issue-triageSkill
- The first 60 shown.
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.

