Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Design RESTful and GraphQL APIs following industry best practices for consistency, versioning, and developer experience.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
assets/api-design-checklist.md
1# API Design Checklist23## Pre-Implementation Review45### Resource Design67- [ ] Resources are nouns, not verbs8- [ ] Plural names for collections9- [ ] Consistent naming across all endpoints10- [ ] Clear resource hierarchy (avoid deep nesting >2 levels)11- [ ] All CRUD operations properly mapped to HTTP methods1213### HTTP Methods1415- [ ] GET for retrieval (safe, idempotent)16- [ ] POST for creation17- [ ] PUT for full replacement (idempotent)18- [ ] PATCH for partial updates19- [ ] DELETE for removal (idempotent)2021### Status Codes2223- [ ] 200 OK for successful GET/PATCH/PUT24- [ ] 201 Created for POST25- [ ] 204 No Content for DELETE26- [ ] 400 Bad Request for malformed requests27- [ ] 401 Unauthorized for missing auth28- [ ] 403 Forbidden for insufficient permissions29- [ ] 404 Not Found for missing resources30- [ ] 422 Unprocessable Entity for validation errors31- [ ] 429 Too Many Requests for rate limiting32- [ ] 500 Internal Server Error for server issues3334### Pagination3536- [ ] All collection endpoints paginated37- [ ] Default page size defined (e.g., 20)38- [ ] Maximum page size enforced (e.g., 100)39- [ ] Pagination metadata included (total, pages, etc.)40- [ ] Cursor-based or offset-based pattern chosen4142### Filtering & Sorting4344- [ ] Query parameters for filtering45- [ ] Sort parameter supported46- [ ] Search parameter for full-text search47- [ ] Field selection supported (sparse fieldsets)4849### Versioning5051- [ ] Versioning strategy defined (URL/header/query)52- [ ] Version included in all endpoints53- [ ] Deprecation policy documented5455### Error Handling5657- [ ] Consistent error response format58- [ ] Detailed error messages59- [ ] Field-level validation errors60- [ ] Error codes for client handling61- [ ] Timestamps in error responses6263### Authentication & Authorization6465- [ ] Authentication method defined (Bearer token, API key)66- [ ] Authorization checks on all endpoints67- [ ] 401 vs 403 used correctly68- [ ] Token expiration handled6970### Rate Limiting7172- [ ] Rate limits defined per endpoint/user73- [ ] Rate limit headers included74- [ ] 429 status code for exceeded limits75- [ ] Retry-After header provided7677### Documentation7879- [ ] OpenAPI/Swagger spec generated80- [ ] All endpoints documented81- [ ] Request/response examples provided82- [ ] Error responses documented83- [ ] Authentication flow documented8485### Testing8687- [ ] Unit tests for business logic88- [ ] Integration tests for endpoints89- [ ] Error scenarios tested90- [ ] Edge cases covered91- [ ] Performance tests for heavy endpoints9293### Security9495- [ ] Input validation on all fields96- [ ] SQL injection prevention97- [ ] XSS prevention98- [ ] CORS configured correctly99- [ ] HTTPS enforced100- [ ] Sensitive data not in URLs101- [ ] No secrets in responses102103### Performance104105- [ ] Database queries optimized106- [ ] N+1 queries prevented107- [ ] Caching strategy defined108- [ ] Cache headers set appropriately109- [ ] Large responses paginated110111### Monitoring112113- [ ] Logging implemented114- [ ] Error tracking configured115- [ ] Performance metrics collected116- [ ] Health check endpoint available117- [ ] Alerts configured for errors118119## GraphQL-Specific Checks120121### Schema Design122123- [ ] Schema-first approach used124- [ ] Types properly defined125- [ ] Non-null vs nullable decided126- [ ] Interfaces/unions used appropriately127- [ ] Custom scalars defined128129### Queries130131- [ ] Query depth limiting132- [ ] Query complexity analysis133- [ ] DataLoaders prevent N+1134- [ ] Pagination pattern chosen (Relay/offset)135136### Mutations137138- [ ] Input types defined139- [ ] Payload types with errors140- [ ] Optimistic response support141- [ ] Idempotency considered142143### Performance144145- [ ] DataLoader for all relationships146- [ ] Query batching enabled147- [ ] Persisted queries considered148- [ ] Response caching implemented149150### Documentation151152- [ ] All fields documented153- [ ] Deprecations marked154- [ ] Examples provided155- [ ] Schema introspection enabled156