api-design
Skill1 starsChanged 7 months agoMITView on GitHub
REST API design conventions and contract standards. Use when: designing API endpoints, defining request/response schemas, implementing pagination, versioning APIs, creating OpenAPI specs, adding rate limiting, designing error responses, auditing existing APIs for REST convention compliance, or improving API consistency and documentation.
191 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 versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- 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
181 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 repository42 other files it gives its agents.
- accessibility-testingSkill
- alternatives-analysisSkill
- anomaly-detectionSkill
- async-messagingSkill
- caching-strategiesSkill
- chartsSkill
- cicdSkill
- code-reviewSkill
- commsSkill
- critical-feedbackSkill
- data-analysisSkill
- databaseSkill
- data-migrationsSkill
- data-visualizationSkill
- dependency-managementSkill
- dockerSkill
- error-handlingSkill
- feature-flagsSkill
- git-workflowSkill
- goalsSkill
- ide-setupSkill
- large-changeSkill
- logging-metricsSkill
- markdown-docsSkill
- mcp-serverSkill
- meeting-agendasSkill
- okrsSkill
- presentationsSkill
- product-managementSkill
- prompt-writingSkill
- pythonSkill
- reclassificationSkill
- release-managementSkill
- retrospectivesSkill
- roadmap-planningSkill
- securitySkill
- stakeholder-commsSkill
- statisticsSkill
- status-updatesSkill
- testingSkill
- ticket-writingSkill
- typescriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Use plural nouns for collections: /projects, /users, /orders.
- Very specific: line 26
Use nested routes for relationships: /projects/{id}/members.
- Distinctive: line 27
Keep URLs flat — avoid nesting deeper than 2 levels.
- Very specific: line 28
Use kebab-case for multi-word resources: /build-logs, not /buildLogs.
- Distinctive: line 44
Use the correct status code.
- Distinctive: line 62
All errors return a consistent shape:
- Distinctive: line 82
Never expose stack traces, internal paths, or database errors.
- Distinctive: line 86
Prefer cursor-based pagination over offset-based.
- Very specific: line 126
Use URL path versioning: /v1/projects.
- Distinctive: line 127
Only increment the major version for breaking changes.
- Distinctive: line 141
If the same key is seen again, return the stored response without re-executing.
- Very specific: line 161
Timestamps: Always ISO 8601 with timezone: 2026-03-20T12:00:00Z.
- Distinctive: line 168
Every API must have an OpenAPI 3.x spec.
- Distinctive: line 170
Document all error responses, not just the happy path.
- Distinctive: line 172
Keep the spec in sync — generate from code, don't maintain separately.
“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 Standards
When to Use
- Designing new API endpoints or resources
- Defining request/response schemas
- Implementing pagination, filtering, or sorting
- Versioning an API
- Writing OpenAPI/Swagger documentation
- Adding rate limiting or idempotency
- Auditing existing APIs for REST convention violations (naming, status codes, error shapes, pagination patterns)
- Improving API consistency across endpoints (response envelopes, error formats, query parameter conventions)
REST Conventions
Resource Naming
- Use plural nouns for collections:
/projects,/users,/orders. - Use nested routes for relationships:
/projects/{id}/members. - Keep URLs flat — avoid nesting deeper than 2 levels. Use query params for filtering beyond that.
- Use kebab-case for multi-word resources:
/build-logs, not/buildLogs.
HTTP Methods
| Method | Purpose | Idempotent | Response |
GET | Read resource(s) | Yes | 200 with body |
POST | Create resource | No | 201 with created resource |
PUT | Replace resource entirely | Yes | 200 with updated resource |
PATCH | Partial update | No* | 200 with updated resource |
DELETE | Remove resource | Yes | 204 no body |
*PATCH can be made idempotent with proper design.
Status Codes
Use the correct status code. Don't return 200 for everything.
| Code | When |
| 200 | Successful read or update |
| 201 | Resource created |
| 204 | Successful delete (no body) |
| 400 | Invalid request (validation error, malformed body) |
| 401 | Authentication required or invalid |
| 403 | Authenticated but not authorized |
| 404 | Resource not found |
| 409 | Conflict (duplicate, state mismatch) |
| 422 | Semantically invalid (well-formed but logically wrong) |
| 429 | Rate limited |
| 500 | Server error (never expose internals) |
Error Response Format
All errors return a consistent shape:
{
"error": "validation_error",
"message": "Name is required and must be between 1-100 characters",
"status": 400,
"details": [
{ "field": "name", "issue": "required" }
],
"request_id": "abc-123"
}error: Machine-readable error code (snake_case).message: Human-readable explanation.status: HTTP status code (duplicated for convenience).details: Optional array of field-level errors.request_id: Correlation ID for debugging.
Never expose stack traces, internal paths, or database errors.
Pagination: Cursor-Based
Prefer cursor-based pagination over offset-based. Offset pagination breaks when data changes between pages.
Request
GET /projects?limit=25&cursor=eyJpZCI6MTIzfQlimit: Page size (default: 25, max: 100).cursor: Opaque string encoding the position. Base64-encoded JSON is common.
Response
{
"data": [...],
"pagination": {
"next_cursor": "eyJpZCI6MTQ4fQ",
"has_more": true,
"total": 247
}
}totalis optional — include if cheaply available, omit if it requires a full count query.- First page request omits
cursor.
Filtering and Sorting
GET /projects?status=active&owner=usr_42&sort=-updated_at&fields=id,name,status- Filter by field name as query param.
- Sort with
sortparam. Prefix with-for descending. - Sparse fields with
fieldsparam to reduce payload size. - Multiple values for same filter:
status=active,archived(comma-separated).
Versioning
- Use URL path versioning:
/v1/projects. - Only increment the major version for breaking changes.
- Support the previous version for a deprecation period. Return
SunsetandDeprecationheaders on the old version. - Non-breaking changes (new optional fields, new endpoints) do not require a version bump.
Idempotency
For non-idempotent operations (POST), support an Idempotency-Key header:
POST /orders
Idempotency-Key: unique-client-generated-uuid- Store the key + response for a TTL (e.g., 24 hours).
- If the same key is seen again, return the stored response without re-executing.
- Return
409 Conflictif the key was used with different request body.
Rate Limiting
Return rate limit info in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1711000800- Return
429 Too Many Requestswhen limit is exceeded. - Include
Retry-Afterheader with seconds until reset. - Rate limit by API key, user, or IP — not globally.
Request/Response Conventions
- Request bodies:
camelCasefor JSON APIs consumed by JavaScript clients,snake_casefor Python-to-Python APIs. Pick one and be consistent. - Timestamps: Always ISO 8601 with timezone:
2026-03-20T12:00:00Z. - IDs: Strings, not integers. Use prefixed IDs when helpful:
prj_123,usr_456. - Nulls: Omit null fields from responses rather than including
"field": null. - Envelope: Wrap collections in
{ "data": [...] }. Single resources can be returned directly or wrapped consistently.
OpenAPI Documentation
- Every API must have an OpenAPI 3.x spec.
- FastAPI generates this automatically — ensure all routes have type annotations, descriptions, and example values.
- Document all error responses, not just the happy path.
- Include authentication requirements per endpoint.
- Keep the spec in sync — generate from code, don't maintain separately.
For FastAPI web server implementation patterns, see the python-web-server skill. For database design and query patterns backing API endpoints, see the database skill. For input validation and security hardening, see the security skill.
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.

