DE

designing-apis

Assists in designing API resources, error handling, versioning, and OpenAPI documentation.

Install

mkdir -p .claude/skills/designing-apis && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3509" && unzip -o skill.zip -d .claude/skills/designing-apis && rm skill.zip

Installs to .claude/skills/designing-apis

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.

Designs REST and GraphQL APIs including endpoints, error handling, versioning, and documentation. Use when creating new APIs, designing endpoints, reviewing API contracts, or when asked about REST, GraphQL, or API patterns.
223 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Design REST and GraphQL endpoint structures
  • Define request and response formats
  • Plan API error handling and status codes
  • Generate OpenAPI 3.0 specifications

How it works

The skill follows a structured design workflow covering resource definition, endpoint structure, and security, validated against a predefined checklist.

Inputs & outputs

You give it
API design requirements
You get back
API contract and design documentation

When to use designing-apis

  • Design REST endpoint structure
  • Define API request/response formats
  • Document API with OpenAPI spec
  • Review API contracts

About this skill

Designing APIs

When to Load

  • Trigger: Designing REST or GraphQL endpoints, API contracts, versioning, request/response formats
  • Skip: Internal-only code with no API surface

API Design Workflow

Copy this checklist and track progress:

API Design Progress:
- [ ] Step 1: Define resources and relationships
- [ ] Step 2: Design endpoint structure
- [ ] Step 3: Define request/response formats
- [ ] Step 4: Plan error handling
- [ ] Step 5: Add authentication/authorization
- [ ] Step 6: Document with OpenAPI spec
- [ ] Step 7: Validate design against checklist

REST API Design

URL Structure

# Resource-based URLs (nouns, not verbs)
GET    /users              # List users
GET    /users/:id          # Get user
POST   /users              # Create user
PUT    /users/:id          # Replace user
PATCH  /users/:id          # Update user
DELETE /users/:id          # Delete user

# Nested resources
GET    /users/:id/orders   # User's orders
POST   /users/:id/orders   # Create order for user

# Query parameters for filtering/pagination
GET    /users?role=admin&status=active
GET    /users?page=2&limit=20&sort=-createdAt

HTTP Status Codes

CodeMeaningUse Case
200OKSuccessful GET, PUT, PATCH
201CreatedSuccessful POST
204No ContentSuccessful DELETE
400Bad RequestInvalid input
401UnauthorizedMissing/invalid auth
403ForbiddenValid auth, no permission
404Not FoundResource doesn't exist
409ConflictDuplicate, state conflict
422UnprocessableValidation failed
429Too Many RequestsRate limited
500Internal ErrorServer error

Response Formats

Success Response:

{
  "data": {
    "id": "123",
    "type": "user",
    "attributes": {
      "name": "John Doe",
      "email": "[email protected]"
    }
  },
  "meta": {
    "requestId": "abc-123"
  }
}

List Response with Pagination:

{
  "data": [...],
  "meta": {
    "total": 100,
    "page": 1,
    "limit": 20,
    "totalPages": 5
  },
  "links": {
    "self": "/users?page=1",
    "next": "/users?page=2",
    "last": "/users?page=5"
  }
}

Error Response:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input data",
    "details": [
      {
        "field": "email",
        "message": "Must be a valid email address"
      }
    ]
  },
  "meta": {
    "requestId": "abc-123"
  }
}

API Versioning

URL Versioning (Recommended):

/api/v1/users
/api/v2/users

Header Versioning:

Accept: application/vnd.api+json; version=1

Authentication Patterns

JWT Bearer Token:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

API Key:

X-API-Key: your-api-key

Rate Limiting Headers

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1609459200
Retry-After: 60

GraphQL Patterns

Schema Design:

type Query {
  user(id: ID!): User
  users(filter: UserFilter, pagination: Pagination): UserConnection!
}

type Mutation {
  createUser(input: CreateUserInput!): UserPayload!
  updateUser(id: ID!, input: UpdateUserInput!): UserPayload!
}

type User {
  id: ID!
  name: String!
  email: String!
  orders(first: Int, after: String): OrderConnection!
}

input CreateUserInput {
  name: String!
  email: String!
}

type UserPayload {
  user: User
  errors: [Error!]
}

OpenAPI Specification Template

See OPENAPI-TEMPLATE.md for the full OpenAPI 3.0 specification template.

API Design Validation

After completing the design, validate against this checklist:

Validation Checklist:
- [ ] All endpoints use nouns, not verbs
- [ ] HTTP methods match operations correctly
- [ ] Consistent response format across endpoints
- [ ] Error responses include actionable details
- [ ] Pagination implemented for list endpoints
- [ ] Authentication defined for protected endpoints
- [ ] Rate limiting headers documented
- [ ] OpenAPI spec is complete and valid

If validation fails, return to the relevant design step and address the issues.

Security Checklist

  • HTTPS only
  • Authentication on all endpoints
  • Authorization checks
  • Input validation
  • Rate limiting
  • Request size limits
  • CORS properly configured
  • No sensitive data in URLs
  • Audit logging

When not to use it

  • Internal-only code without an API surface

Limitations

  • Requires manual validation against the provided security checklist
  • Relies on user input for resource relationships

How it compares

It provides a standardized design checklist and template-based validation rather than ad-hoc API creation.

Compared to similar skills

designing-apis side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
designing-apis (this skill)16moNo flagsIntermediate
api-design-principles722moNo flagsIntermediate
nodejs-backend-patterns122moNo flagsIntermediate
graphql-architect14moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by CloudAI-X

View all by CloudAI-X

convex-backend

CloudAI-X

Convex backend development guidelines. Use when writing Convex functions, schemas, queries, mutations, actions, or any backend code in a Convex project. Triggers on tasks involving Convex database operations, real-time subscriptions, file storage, or serverless functions.

827

threejs-animation

CloudAI-X

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

57

designing-architecture

CloudAI-X

Designs software architecture and selects appropriate patterns for projects. Use when designing systems, choosing architecture patterns, structuring projects, making technical decisions, or when asked about microservices, monoliths, or architectural approaches.

48

parallel-execution

CloudAI-X

Patterns for parallel subagent execution using Task tool with run_in_background. Use when coordinating multiple independent tasks, spawning dynamic subagents, or implementing features that can be parallelized.

417

threejs-shaders

CloudAI-X

Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.

430

analyzing-projects

CloudAI-X

Analyzes codebases to understand structure, tech stack, patterns, and conventions. Use when onboarding to a new project, exploring unfamiliar code, or when asked "how does this work?" or "what's the architecture?"

327

Search skills

Search the agent skills registry