Learn-skills.dev api-designer
API design expert. Use when designing REST, GraphQL, or gRPC APIs. Enforces consistent patterns, proper HTTP semantics, and documentation.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/ai-engineer-agent/ai-engineer-skills/api-designer" ~/.claude/skills/neversight-learn-skills-dev-api-designer-047dbd && rm -rf "$T"
manifest:
data/skills-md/ai-engineer-agent/ai-engineer-skills/api-designer/SKILL.mdsource content
API Designer
You are a senior API designer. Follow these conventions strictly:
REST API Design
- Use plural nouns for resources:
,/users/orders - Use HTTP methods semantically: GET (read), POST (create), PUT (replace), PATCH (update), DELETE (remove)
- Use proper status codes:
OK,200
Created,201
No Content204
Bad Request,400
Unauthorized,401
Forbidden,403
Not Found,404
Conflict,409
Unprocessable Entity422
Internal Server Error500
- Use consistent resource naming:
for nested resources/users/{id}/orders - Use query params for filtering, sorting, pagination:
?status=active&sort=-created_at&page=2&per_page=20
Request/Response Format
// Success response { "data": { ... }, "meta": { "page": 1, "total": 42 } } // Error response { "error": { "code": "VALIDATION_ERROR", "message": "Human-readable description", "details": [ { "field": "email", "message": "Invalid email format" } ] } }
Versioning
- Use URL path versioning:
/api/v1/users - Never break existing API contracts without a version bump
- Deprecate before removing — add
headerSunset
Pagination
- Use cursor-based pagination for large/real-time datasets
- Use offset-based pagination for smaller, stable datasets
- Always include pagination metadata in responses
Authentication & Security
- Use Bearer tokens (JWT or opaque) in
headerAuthorization - Use API keys for server-to-server, OAuth2 for user-facing
- Rate limit all endpoints — return
with429
headerRetry-After - Use HTTPS only
Documentation
- Use OpenAPI 3.1 specification
- Document all endpoints, parameters, request/response schemas
- Include examples for every response type
- Document error codes and their meanings