daffy0208/ai-dev-standards/api-designer
- community
Checking that the SKILL.md file is still in the repository.
Design REST and GraphQL APIs. Use when creating backend APIs, defining API contracts, or integrating third-party services. Covers endpoint design, authentication, versioning, documentation, and best practices.
Install
npx vskill@latest install daffy0208/ai-dev-standards/api-designerSKILL.md
API Designer
Design robust, scalable, and developer-friendly APIs.
Core Principles
1. Developer Experience First
- Clear, predictable naming conventions
- Comprehensive documentation
- Helpful error messages
- Consistent patterns across endpoints
2. Design for Evolution
- Versioning strategy from day one
- Backward compatibility
- Deprecation process
- Migration guides for breaking changes
3. Security by Default
- Authentication and authorization
- Rate limiting and throttling
- Input validation and sanitization
- HTTPS only, no exceptions
4. Performance Matters
- Efficient queries and indexing
- Caching strategies
- Pagination for large datasets
- Compression (gzip, brotli)
REST API Design
Resource Naming Conventions
HTTP Methods & Semantics
| Method | Purpose | Idempotent | Safe | Request Body | Response Body | |
|---|---|---|---|---|---|---|
| GET | Retrieve data | Yes | Yes | No | Yes | |
| POST | Create resource | No | No | Yes | Yes (created) | |
| PUT | Replace resource | Yes | No | Yes | Yes (optional) | |
| PATCH | Partial update | No | No | Yes | Yes (optional) | |
| DELETE | Remove resource | Yes | No | No | No (204) or Yes |
Idempotent: Multiple identical requests have same effect as single request Safe: Request doesn't modify server state
HTTP Status Codes
Success (2xx):
200 OK- Successful GET, PUT, PATCH, DELETE201 Created- Successful POST, includesLocationheader204 No Content- Successful request, no response body (often DELETE)
Client Errors (4xx):
400 Bad Request- Invalid syntax, validation error401 Unauthorized- Authentication required or failed403 Forbidden- Authenticated but lacks permission404 Not Found- Resource doesn't exist409 Conflict- Request conflicts with current state422 Unprocessable Entity- Validation error (semantic)429 Too Many Requests- Rate limit exceeded
Server Errors (5xx):
500 Internal Server Error- Generic server error502 Bad Gateway- Upstream service error503 Service Unavailable- Temporary unavailability504 Gateway Timeout- Upstream timeout
Response Format Standards
Success Response:
Error Response:
List Response with Pagination:
Pagination Strategies
Cursor-based (Recommended):
Offset-based:
Filtering, Sorting, and Search
Filtering:
Sorting:
Search:
Authentication & Authorization
JWT Bearer Token (Recommended for SPAs):
API Keys (for service-to-service):
OAuth 2.0 (for third-party access):
Basic Auth (only for internal/admin tools):
Rate Limiting
Standard Headers:
Common Strategies:
- Fixed window: 1000 requests per hour
- Sliding window: 1000 requests per rolling hour
- Token bucket: Burst allowance with refill rate
- Per-user, per-IP, or per-API-key limits
Versioning Strategies
URL Versioning (Recommended):
Header Versioning:
Best Practices:
- Start with v1, not v0
- Only increment for breaking changes
- Support N and N-1 versions simultaneously
- Provide migration guides
- Announce deprecation 6-12 months ahead
GraphQL API Design
Schema Design
GraphQL Best Practices
1. Use Relay Connection Pattern for Pagination:
2. Input Types for Mutations:
3. Error Handling:
REST vs GraphQL Decision
Use REST when:
- Simple CRUD operations
- Caching is critical (HTTP caching)
- Public API for third-parties
- File uploads/downloads
- Team unfamiliar with GraphQL
Use GraphQL when:
- Clients need flexible queries
- Reducing over-fetching/under-fetching
- Rapid frontend iteration
- Complex nested data relationships
- Strong typing and schema benefits
API Documentation
OpenAPI/Swagger Specification
Documentation Best Practices
- ✅ Include request/response examples
- ✅ Document all error codes
- ✅ Provide authentication guides
- ✅ Interactive API playground (Swagger UI, GraphQL Playground)
- ✅ Code examples in multiple languages
- ✅ Rate limit information
- ✅ Changelog for API updates
Security Checklist
- [ ] HTTPS only (redirect HTTP → HTTPS)
- [ ] Authentication required for protected endpoints
- [ ] Authorization checks (user can only access own data)
- [ ] Input validation (schema validation, sanitization)
- [ ] Rate limiting per user/IP
- [ ] CORS configuration (whitelist origins)
- [ ] SQL injection prevention (parameterized queries)
- [ ] No sensitive data in URLs (use headers/body)
- [ ] Audit logging for sensitive operations
- [ ] API keys rotatable and revocable
Related Resources
Related Skills:
frontend-builder- For consuming APIs from frontenddeployment-advisor- For API hosting decisionsperformance-optimizer- For API performance tuning
Related Patterns:
META/DECISION-FRAMEWORK.md- REST vs GraphQL decisionsSTANDARDS/architecture-patterns/api-gateway-pattern.md- API gateway architecture (when created)
Related Playbooks:
PLAYBOOKS/deploy-api.md- API deployment procedure (when created)PLAYBOOKS/version-api.md- API versioning workflow (when created)
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/api-designer/SKILL.md
Popularity
- Repository stars
- 21
- Repository forks
- 6
- 7-day trend score
- 15
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/daffy0208/ai-dev-standards/api-designer)