api-designer

SKILL.md

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:
    • 200 OK, 201 Created, 204 No Content
    • 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 422 Unprocessable Entity
    • 500 Internal Server Error
  • Use consistent resource naming: /users/{id}/orders for nested resources
  • 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 Sunset header

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 Authorization header
  • Use API keys for server-to-server, OAuth2 for user-facing
  • Rate limit all endpoints — return 429 with Retry-After header
  • 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
Weekly Installs
4
First Seen
Feb 24, 2026
Installed on
opencode4
gemini-cli4
claude-code4
codex4
kiro-cli4
cursor4