designing-apis
Conventions for designing and reviewing consistent RESTful API endpoints.
Install
mkdir -p .claude/skills/designing-apis-pengfeng && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13934" && unzip -o skill.zip -d .claude/skills/designing-apis-pengfeng && rm skill.zipInstalls to .claude/skills/designing-apis-pengfeng
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
REST API design patterns — endpoints, routes, routers, resources, HTTP methods, status codes, pagination, error responses, versioning. Use when designing, reviewing, or refactoring API endpoints.Key capabilities
- →Design resource URLs with plural nouns and hyphens
- →Apply appropriate HTTP methods for API actions
- →Return correct HTTP status codes
- →Implement consistent error response formats
- →Support pagination for collection endpoints
How it works
The skill applies conventions for designing or reviewing REST API endpoints, covering URL structure, HTTP methods, status codes, error formats, and pagination.
Inputs & outputs
When to use designing-apis
- →Designing api endpoints
- →Refactoring api routes
- →Reviewing status code responses
- →Implementing pagination
About this skill
API Design Conventions
Apply these conventions when designing or reviewing REST API endpoints.
Resource URLs
- Plural nouns:
/users,/products,/order-items - Lowercase with hyphens:
/user-profilesnot/userProfiles - Nest for ownership, max 2 levels:
/users/{id}/orders - For deeper resources, promote to top-level:
/order-items/{id}not/users/{id}/orders/{id}/items/{id} - Never use verbs: GET
/users/{id}not GET/getUser/{id}
HTTP Methods
| Method | Purpose | Idempotent | Response |
|---|---|---|---|
| GET | Retrieve | Yes | 200 with body |
| POST | Create | No | 201 with created resource |
| PUT | Full replace | Yes | 200 with updated resource |
| PATCH | Partial update | No | 200 with updated resource |
| DELETE | Remove | Yes | 204 no body |
Status Codes
Use the correct code — never return 200 with an error in the body.
- 2xx: 200 OK, 201 Created, 204 No Content
- 4xx: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 422 Validation Error, 429 Rate Limited
- 5xx: 500 Internal Server Error, 503 Service Unavailable
Error Response Format
Always return a consistent error structure:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Human-readable description",
"details": [{"field": "email", "issue": "Invalid format"}]
}
}
Pagination
All collection endpoints must support pagination. Prefer cursor-based for large/real-time datasets, offset-based for simpler cases.
{
"data": [...],
"pagination": {
"total": 1000,
"limit": 50,
"offset": 100,
"has_more": true
}
}
Support filtering and sorting via query params:
- Filter:
?status=active&role=admin - Sort:
?sort=-created_at(prefix-for descending) - Field selection:
?fields=id,name,email
Versioning
Use URL path versioning (/api/v1/...) only when introducing breaking changes. Do not version preemptively.
Checklist
When designing or reviewing an API, verify:
- Resources are plural nouns, no verbs in URLs
- Correct HTTP methods and status codes
- Collections are paginated
- Error responses use consistent format
- Filtering/sorting supported where needed
- No nesting deeper than 2 levels
See references.md for external guides and specs.
Limitations
- →Nesting of resources is limited to a maximum of 2 levels.
How it compares
This skill provides specific conventions for REST API design, unlike general software development practices.
Compared to similar skills
designing-apis side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| designing-apis (this skill) | 0 | 3mo | No flags | Intermediate |
| api-design-principles | 72 | 2mo | No flags | Intermediate |
| nodejs-backend-patterns | 12 | 2mo | No flags | Intermediate |
| designing-apis | 1 | 6mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
api-design-principles
wshobson
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
nodejs-backend-patterns
wshobson
Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.
designing-apis
CloudAI-X
Designs REST and GraphQL APIs including endpoints, error handling, versioning, and documentation. Use when creating new APIs, designing endpoints, reviewing API contracts, or when asked about REST, GraphQL, or API patterns.
graphql-architect
sickn33
Master modern GraphQL with federation, performance optimization, and enterprise security. Build scalable schemas, implement advanced caching, and design real-time systems. Use PROACTIVELY for GraphQL architecture or performance optimization.
api-engineering
weirdgme
Guide to API design patterns, GraphQL, gRPC, API gateways, rate limiting, and versioning strategies.
api-designer
lushly-dev
>