api-design
A guide for designing predictable, resource-oriented APIs that are easy to maintain and use.
Install
mkdir -p .claude/skills/api-design-yisuescopeta && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9776" && unzip -o skill.zip -d .claude/skills/api-design-yisuescopeta && rm skill.zipInstalls to .claude/skills/api-design-yisuescopeta
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.
Design robust, scalable, and intuitive APIs (REST, GraphQL, etc.). Enforces best practices for resource naming, HTTP methods, error handling, versioning, and security. Use this when designing or refactoring backend endpoints.Key capabilities
- →Resource-oriented design
- →HTTP method enforcement
- →Status code standardization
- →GraphQL schema design
How it works
It enforces RESTful principles and industry standards for naming, methods, and responses.
Inputs & outputs
When to use api-design
- →Designing new backend endpoints
- →Refactoring legacy API design
- →Defining API contracts
About this skill
API Design Principles
Overview
Great APIs are consistent, predictable, and easy to use. This skill enforces industry standards for API design.
Core Principles
1. Resource-Oriented Design (REST)
- Nouns, not Verbs: Use resources (nouns) in methods.
- Good:
GET /users,POST /users - Bad:
GET /getUsers,POST /createUser
- Good:
- Plural Nouns: Use plural nouns for collections (
/usersnot/user). - Nesting: Use nesting to show relationships, but limit depth to 2-3 levels.
GET /users/{id}/posts(Okay)GET /users/{id}/posts/{pid}/comments(Borderline)
2. HTTP Methods
- GET: Retrieve data. Safe and idempotent.
- POST: Create new resources. Not idempotent.
- PUT: Update/Replace a resource completely. Idempotent.
- PATCH: Partial update. Idempotent.
- DELETE: Remove a resource. Idempotent.
3. Responses & Status Codes
- 200 OK: Success (GET, PUT, PATCH).
- 201 Created: Success (POST) - Return the created resource.
- 204 No Content: Success (DELETE) - No body returned.
- 400 Bad Request: Client error (validation).
- 401 Unauthorized: Missing/invalid authentication.
- 403 Forbidden: Authenticated but not allowed.
- 404 Not Found: Resource does not exist.
- 500 Internal Server Error: Server bug.
4. Naming Conventions
- Case: Use
camelCasefor JSON fields and params (e.g.,firstName). Usekebab-casefor URLs (e.g.,/user-profiles). - Consistency: If you use
userIdin one place, don't useuser_idoridelsewhere for the same concept.
5. Filtering, Sorting, Pagination
- Pagination: Always paginate collections. Use
limitandoffsetor cursor-based pagination. - Filtering: Use query parameters:
GET /users?role=admin. - Sorting: Use
sortororder:GET /users?sort=-createdAt(descending).
6. GraphQL Specifics
- Schema First: Design the schema before implementation.
- N+1 Problem: Ensure resolvers use DataLoaders to batch database requests.
- Naming: Use verb-noun for mutations (
createUser,updatePost).
Security
- HTTPS: Always use HTTPS.
- Authentication: Use Bearer Tokens (JWT) in headers.
- Rate Limiting: Protect endpoints from abuse.
When not to use it
- →Frontend UI design
Limitations
- →Design requires implementation effort
- →GraphQL N+1 problem needs manual handling
How it compares
It provides a standardized framework for consistency rather than ad-hoc endpoint creation.
Compared to similar skills
api-design side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| api-design (this skill) | 0 | 4mo | No flags | Intermediate |
| fastapi-templates | 520 | 2mo | No flags | Intermediate |
| fastapi-pro | 79 | 4mo | No flags | Advanced |
| nodejs-backend-patterns | 12 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Yisuescopeta
View all by Yisuescopeta →You might also like
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
fastapi-pro
sickn33
Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.
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.
springboot-patterns
affaan-m
Spring Boot 架构模式、REST API 设计、分层服务、数据访问、缓存、异步处理和日志记录。适用于 Java Spring Boot 后端工作。
backend-development
skillcreatorai
Backend API design, database architecture, microservices patterns, and test-driven development. Use for designing APIs, database schemas, or backend system architecture.
graphql
davila7
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.