api-design
Skill1 starsChanged 7 months agoMITView on GitHub
Design clean, consistent REST and GraphQL APIs. Endpoint naming, versioning, pagination, error handling, authentication, rate limiting, and OpenAPI documentation. Trigger with "design an API", "API endpoint for", "REST vs GraphQL", "how should I structure my API", "API versioning", "pagination strategy", or when the user needs help designing, reviewing, or documenting APIs.
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 repository164 other files it gives its agents.
- instrument-data-to-allotropeSkill
- literature-reviewSkill
- nextflow-developmentSkill
- scientific-problem-selectionSkill
- scvi-toolsSkill
- single-cell-rna-qcSkill
- discover-brandSkill
- enforce-voiceSkill
- generate-guidelinesSkill
- csat-reportSkill
- customer-escalationSkill
- customer-researchSkill
- draft-responseSkill
- kb-articleSkill
- sentiment-analysisSkill
- ticket-triageSkill
- analyzeSkill
- build-dashboardSkill
- create-vizSkill
- data-context-extractorSkill
- data-modelingSkill
- data-pipelineSkill
- etl-designSkill
- explore-dataSkill
- sql-queriesSkill
- statistical-analysisSkill
- validate-dataSkill
- write-querySkill
- accessibility-reviewSkill
- component-librarySkill
- design-critiqueSkill
- design-handoffSkill
- design-systemSkill
- frontend-designSkill
- research-synthesisSkill
- user-researchSkill
- ux-copySkill
- wireframingSkill
- Agent DevelopmentSkill
- CLAUDE.md ManagementSkill
- MCP Server BuilderSkill
- Plugin DevelopmentSkill
- Prompt EngineeringSkill
- Skill CreatorSkill
- curriculum-designSkill
- lesson-planningSkill
- quiz-generatorSkill
- study-guideSkill
- tutoringSkill
- architectureSkill
- ci-cd-pipelineSkill
- code-reviewSkill
- database-migrationSkill
- debugSkill
- dependency-auditSkill
- deploy-checklistSkill
- documentationSkill
- error-handlingSkill
- git-workflowSkill
- incident-responseSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 12 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Before designing endpoints, understand the data model and use cases:
- Distinctive: line 39
Check existing patterns: If the project has existing APIs, read them to maintain consistency.
- Distinctive: line 41
Look at existing code:
- Distinctive: line 42
Read route/controller files for current endpoint patterns.
- Distinctive: line 43
Check for API documentation (OpenAPI spec, Swagger UI, GraphQL schema).
- Very specific: line 49
Use plural nouns for collections: /users, /orders, /products
- Very specific: line 50
Use resource IDs for individual items: /users/{userId}
- Very specific: line 53
Use kebab-case for multi-word resources: /order-items, /shipping-addresses
- Very specific: line 54
Use query parameters for filtering, not path segments: /orders?status=pending
- Very specific: line 164
Use Relay-style connections for paginated lists (edges, nodes, pageInfo).
- Distinctive: line 165
Use input types for mutations, payload types for responses.
- Distinctive: line 169
Use enums for finite sets of values.
- Very specific: line 180
Use 429 Too Many Requests with Retry-After header.
- Distinctive: line 182
Use sliding window or token bucket algorithms.
- Distinctive: line 267
Action: Read existing routes, check naming conventions, HTTP method usage, error responses, and pagination patterns.
- Distinctive: line 276
Use HTTP methods correctly.
- Very specific: line 277
Always return the created/updated resource in POST/PUT/PATCH responses.
- Very specific: line 280
Use ETag and If-None-Match for conditional requests to reduce bandwidth.
- Distinctive: line 282
Keep endpoint count manageable.
- Distinctive: line 283
Document every endpoint, including error responses.
“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, review, and document REST and GraphQL APIs. Covers resource naming, HTTP method selection, pagination, filtering, error responses, authentication, rate limiting, versioning, and OpenAPI/GraphQL schema generation.
Workflow
Step 1: Understand the Domain
Before designing endpoints, understand the data model and use cases:
- Identify resources: What are the core entities? (users, orders, products, etc.)
- Map relationships: How do resources relate? (one-to-many, many-to-many)
- List operations: What actions do consumers need? (CRUD, search, aggregate, bulk)
- Identify consumers: Who calls this API? (frontend, mobile, third-party, internal services)
- Check existing patterns: If the project has existing APIs, read them to maintain consistency.
Look at existing code:
- Read route/controller files for current endpoint patterns.
- Check for API documentation (OpenAPI spec, Swagger UI, GraphQL schema).
- Review middleware for auth, validation, rate limiting.
Step 2: REST API Design
Resource Naming Conventions:
- Use plural nouns for collections:
/users,/orders,/products - Use resource IDs for individual items:
/users/{userId} - Nest related resources:
/users/{userId}/orders - Limit nesting to 2 levels max:
/users/{userId}/orders/{orderId} - Use kebab-case for multi-word resources:
/order-items,/shipping-addresses - Use query parameters for filtering, not path segments:
/orders?status=pending
HTTP Method Selection:
| Method | Purpose | Idempotent | Safe | Response Code |
| GET | Read a resource | Yes | Yes | 200 |
| POST | Create a resource | No | No | 201 |
| PUT | Replace a resource entirely | Yes | No | 200 |
| PATCH | Partial update | No* | No | 200 |
| DELETE | Remove a resource | Yes | No | 204 |
Pagination (choose one pattern):
Offset-based (simple, allows page jumping):
GET /orders?page=2&per_page=20
Response headers: X-Total-Count: 142, Link: <...>; rel="next"Cursor-based (stable, better for real-time data):
GET /orders?cursor=eyJpZCI6MTAwfQ&limit=20
Response: { "data": [...], "next_cursor": "eyJpZCI6MTIwfQ", "has_more": true }Keyset-based (performant for large datasets):
GET /orders?after_id=100&limit=20Filtering and Sorting:
GET /orders?status=pending&created_after=2024-01-01&sort=-created_at,+total
GET /products?category=electronics&price_min=10&price_max=100
GET /users?search=john&fields=id,name,emailError Response Format (RFC 7807 Problem Details):
{
"type": "https://api.example.com/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "The request body contains invalid fields.",
"instance": "/orders/create",
"errors": [
{
"field": "email",
"message": "Must be a valid email address",
"code": "INVALID_FORMAT"
}
]
}Standard HTTP Status Codes:
200 OK— Successful read or update201 Created— Successful creation (includeLocationheader)204 No Content— Successful deletion400 Bad Request— Malformed request syntax401 Unauthorized— Missing or invalid authentication403 Forbidden— Authenticated but not authorized404 Not Found— Resource does not exist409 Conflict— State conflict (duplicate, version mismatch)422 Unprocessable Entity— Validation errors429 Too Many Requests— Rate limit exceeded (includeRetry-Afterheader)500 Internal Server Error— Unexpected server failure
Step 3: GraphQL API Design
Schema Design:
type Query {
user(id: ID!): User
users(filter: UserFilter, pagination: PaginationInput): UserConnection!
order(id: ID!): Order
}
type Mutation {
createUser(input: CreateUserInput!): CreateUserPayload!
updateUser(id: ID!, input: UpdateUserInput!): UpdateUserPayload!
deleteUser(id: ID!): DeleteUserPayload!
}
type User {
id: ID!
email: String!
name: String!
orders(first: Int, after: String): OrderConnection!
createdAt: DateTime!
}
input CreateUserInput {
email: String!
name: String!
}
type CreateUserPayload {
user: User
errors: [UserError!]!
}
type UserError {
field: String
message: String!
code: ErrorCode!
}GraphQL Best Practices:
- Use Relay-style connections for paginated lists (
edges,nodes,pageInfo). - Use input types for mutations, payload types for responses.
- Return errors in the payload, not as GraphQL errors (reserve those for system failures).
- Implement DataLoader for N+1 prevention.
- Set query depth and complexity limits to prevent abuse.
- Use enums for finite sets of values.
Step 4: Authentication and Rate Limiting
Authentication patterns:
- API Keys: Simple, best for server-to-server. Send in
Authorization: Bearer <key>orX-API-Keyheader. - JWT: Stateless, best for user sessions. Short-lived access tokens + refresh tokens.
- OAuth 2.0: Best for third-party integrations. Use authorization code flow with PKCE for public clients.
Rate Limiting:
- Return rate limit info in headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset. - Use
429 Too Many RequestswithRetry-Afterheader. - Apply different limits per endpoint sensitivity (login stricter than read).
- Use sliding window or token bucket algorithms.
Step 5: Versioning Strategy
- URL path versioning:
/v1/users,/v2/users— most common, clear, easy to route. - Header versioning:
Accept: application/vnd.api+json; version=2— cleaner URLs, harder to test. - Query parameter:
/users?version=2— easy to test, pollutes query string.
Recommended approach: URL path versioning with a deprecation policy.
Step 6: Documentation
Generate OpenAPI 3.0 specification:
openapi: 3.0.3
info:
title: <API Name>
version: 1.0.0
description: <description>
paths:
/users:
get:
summary: List users
parameters:
- name: page
in: query
schema:
type: integer
default: 1
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UserList'Output Format
## API Design
### Resources
| Resource | Endpoints | Description |
|----------|-----------|-------------|
| <name> | <count> | <purpose> |
### Endpoints
#### <METHOD> <path>
**Purpose**: <what it does>
**Auth**: <required | optional | public>
**Request**:
```json
<example request body>Response (200):
<example response body>Errors: <list of possible error codes>
Authentication
<strategy and implementation details>Pagination
<chosen strategy with examples>Rate Limiting
<limits per tier/endpoint>
Versioning
<strategy and deprecation policy>
```Examples
User: "Design a REST API for an e-commerce platform" Action: Identify resources (users, products, orders, cart), design endpoints for each, define pagination, error format, auth strategy, and produce an OpenAPI spec.
User: "Should I use REST or GraphQL for my mobile app?" Action: Compare both approaches considering mobile-specific needs (bandwidth, flexibility, caching), recommend based on the use case.
User: "Review my API endpoints for consistency" Action: Read existing routes, check naming conventions, HTTP method usage, error responses, and pagination patterns. Report inconsistencies with fixes.
User: "Add pagination to my list endpoints" Action: Assess the data characteristics, recommend cursor vs offset pagination, provide implementation code and response format.
Best Practices
- Be consistent. If one endpoint uses
snake_case, all endpoints should. If one returns errors in a certain format, all should. - Design for the consumer, not the database. API resources do not need to mirror database tables.
- Use HTTP methods correctly. GET should never have side effects. DELETE should be idempotent.
- Always return the created/updated resource in POST/PUT/PATCH responses. Saves the client a round trip.
- Version from day one. Adding versioning later is painful.
- Provide
_linksorLinkheaders for discoverability (HATEOAS) on public APIs. - Use
ETagandIf-None-Matchfor conditional requests to reduce bandwidth. - Design idempotency into write operations using
Idempotency-Keyheaders for payment or order APIs. - Keep endpoint count manageable. If you have 200 endpoints, you likely need to rethink your resource model.
- Document every endpoint, including error responses. Consumers cannot use what they cannot understand.
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.

