api-conventions
Skill2 starsChanged 9 months agoMITView on GitHub
REST API design conventions and standards. Apply when writing, reviewing, or discussing API endpoints, routes, controllers, serializers, or HTTP handlers. Covers URL structure, HTTP methods, response formats, error handling, pagination, versioning, and authentication headers.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- willdady/platypustheir own version, first seen Oct 2, 2026
- mx-space/coretheir own version, first seen Sep 13, 2026
- TheDecipherist/claude-code-mastery-project-starter-kittheir own version, first seen Jun 26, 2026
- justnau1020/claude-ostheir own version, first seen Mar 30, 2026
- onejaejae/skillstheir own version, first seen Feb 27, 2026
- maxyeh0817/Forgetheir own version, first seen Feb 25, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- mx-space/core★ 564same name
- TheDecipherist/claude-code-mastery-project-starter-kit★ 338same name
- willdady/platypus★ 114same name
- maxyeh0817/Forge★ 34same name
- justnau1020/claude-os★ 3same name
- lodetomasi/claude-code-training-lab★ 2same name
- onejaejae/skills★ 2same name
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 repository239 other files it gives its agents.
- claude-code-docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- claude-code-docs/llms.txtllms.txt
- agent-native-architectureSkill
- claude-apiSkill
- embedding-strategiesSkill
- fal-ai-mediaSkill
- gemini-imagegenSkill
- hybrid-search-implementationSkill
- langchain-architectureSkill
- llm-evaluationSkill
- ml-pipeline-workflowSkill
- prompt-engineering-patternsSkill
- rag-implementationSkill
- similarity-search-patternsSkill
- vector-index-tuningSkill
- api-design-principlesSkill
- api-designSkill
- architecture-patternsSkill
- cqrs-implementationSkill
- event-store-designSkill
- fastapi-templatesSkill
- microservices-patternsSkill
- openapi-spec-generationSkill
- projection-patternsSkill
- saga-orchestrationSkill
- andrew-kane-gem-writerSkill
- angular-migrationSkill
- auth-implementation-patternsSkill
- backend-patternsSkill
- bazel-build-optimizationSkill
- coding-standardsSkill
- database-migrationSkill
- debugging-strategiesSkill
- dependency-upgradeSkill
- dhh-rails-styleSkill
- dotnet-backend-patternsSkill
- dspy-rubySkill
- error-handling-patternsSkill
- monorepo-managementSkill
- nodejs-backend-patternsSkill
- nx-workspace-patternsSkill
- react-modernizationSkill
- temporal-python-testingSkill
- turborepo-cachingSkill
- workflow-orchestration-patternsSkill
- defi-protocol-templatesSkill
- nft-standardsSkill
- solidity-securitySkill
- web3-testingSkill
- backtesting-frameworksSkill
- billing-automationSkill
- competitive-landscapeSkill
- data-storytellingSkill
- employment-contract-templatesSkill
- investor-materialsSkill
- investor-outreachSkill
- kpi-dashboard-designSkill
- market-sizing-analysisSkill
- paypal-integrationSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 7 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Use kebab-case for URL path segments: /user-profiles, not /userProfiles or /user_profiles
- Very specific: line 14
Use plural nouns for resource collections: /orders, /products, /users
- Very specific: line 16
Never use verbs in URLs. The HTTP method is the verb: DELETE /sessions/{id} not POST /logout
- Very specific: line 29
Use POST /resources to create.
- Very specific: line 30
Use PATCH for partial updates, not PUT, unless clients always send the full representation.
- Distinctive: line 34
All responses use JSON. Property names use camelCase:
- Very specific: line 69
Use a machine-readable code (snake_case string) for programmatic handling
- Very specific: line 70
Use a human-readable message for display
- Very specific: line 71
Always include requestId for support and tracing
- Distinctive: line 89
Never return 200 with an error body.
- Distinctive: line 93
Use cursor-based pagination for all list endpoints returning potentially large data:
- Distinctive: line 111
Default page size: 25. Maximum: 100.
- Distinctive: line 112
Use offset pagination only for admin UIs where jumping to a page is required.
- Very specific: line 123
Use Authorization: Bearer <token> for API keys and JWT tokens
- Distinctive: line 124
Never put tokens in URL query parameters (they appear in server logs)
- Very specific: line 126
Use WWW-Authenticate header in 401 responses
- Distinctive: line 143
Always return these headers:
“Common” is measured: kept by at least 6 in 10 of the 4 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
URL Design
- Use kebab-case for URL path segments:
/user-profiles, not/userProfilesor/user_profiles - Use plural nouns for resource collections:
/orders,/products,/users - Nest resources at most one level deep:
/orders/{id}/itemsis fine;/orders/{id}/items/{id}/notesis too deep - promotenotesto a top-level resource - Never use verbs in URLs. The HTTP method is the verb:
DELETE /sessions/{id}notPOST /logout - Resource IDs go in the path; filters go in query params:
GET /products?category=books&min_price=10
HTTP Methods
| Method | Semantics | Idempotent | Safe |
| GET | Read resource(s) | Yes | Yes |
| POST | Create resource or trigger action | No | No |
| PUT | Replace resource entirely | Yes | No |
| PATCH | Partial update | No | No |
| DELETE | Remove resource | Yes | No |
- Use
POST /resourcesto create. Return201 CreatedwithLocationheader pointing to the new resource. - Use
PATCHfor partial updates, notPUT, unless clients always send the full representation.
Response Format
All responses use JSON. Property names use camelCase:
{
"id": "ord_01HXZ",
"userId": "usr_abc",
"status": "pending",
"createdAt": "2025-03-15T10:00:00Z",
"items": [
{ "productId": "prd_xyz", "quantity": 2, "unitPrice": 9.99 }
]
}- Dates and times are ISO 8601 in UTC:
"2025-03-15T10:00:00Z" - IDs are strings (never expose raw database integer IDs)
- Monetary amounts are integers in the smallest currency unit (cents), with a separate
currencyfield - Booleans use true/false (not 0/1 or "yes"/"no")
- Omit null fields by default; include them only when the absence is meaningful
Error Responses
{
"error": {
"code": "validation_error",
"message": "Request validation failed",
"details": [
{ "field": "email", "issue": "Must be a valid email address" }
],
"requestId": "req_01HXZ"
}
}- Use a machine-readable
code(snake_case string) for programmatic handling - Use a human-readable
messagefor display - Always include
requestIdfor support and tracing
HTTP Status Codes
| Code | When to use |
| 200 | Successful GET, PATCH, or DELETE with body |
| 201 | Successful POST that created a resource |
| 204 | Successful DELETE or action with no response body |
| 400 | Client sent an invalid request (validation errors) |
| 401 | Authentication required or invalid credentials |
| 403 | Authenticated but not authorized for this resource |
| 404 | Resource not found (or deliberately hidden) |
| 409 | Conflict (duplicate, optimistic lock failure) |
| 422 | Request is valid JSON but semantically wrong |
| 429 | Rate limit exceeded |
| 500 | Unexpected server error |
Never return 200 with an error body.
Pagination
Use cursor-based pagination for all list endpoints returning potentially large data:
GET /orders?limit=25&cursor=eyJpZCI6IjEwMCJ9Response:
{
"data": [ ... ],
"pagination": {
"limit": 25,
"nextCursor": "eyJpZCI6IjEyNSJ9",
"hasMore": true
}
}- Default page size: 25. Maximum: 100.
- Use offset pagination only for admin UIs where jumping to a page is required.
Versioning
- Version in the URL path:
/v1/orders,/v2/orders - Increment the major version only for breaking changes (removed fields, changed semantics)
- Deprecate old versions with a
Deprecationresponse header; support them for at least 12 months - New optional fields added to responses are non-breaking and do not require a version bump
Authentication
- Use
Authorization: Bearer <token>for API keys and JWT tokens - Never put tokens in URL query parameters (they appear in server logs)
- For API keys: prefix them with a product identifier for easy detection:
sk_live_...,pk_test_... - Use
WWW-Authenticateheader in 401 responses
Filtering, Sorting, and Searching
- Filters:
GET /products?status=active&category=books - Sorting:
GET /orders?sort=createdAt&order=desc(default toasc) - Full-text search:
GET /products?q=wireless+headphones - Range filters:
GET /orders?createdAfter=2025-01-01&createdBefore=2025-03-01
Idempotency
- Accept an
Idempotency-Keyheader on POST requests that create resources or trigger payments - Store the key and return the same response if the same key is replayed within 24 hours
- Return
409 Conflictif the same key is used with a different request body
Rate Limiting
Always return these headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 487
X-RateLimit-Reset: 1741694400
Retry-After: 30 (only on 429)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.

