api-designer
jeffallan/claude-skills
Design REST and GraphQL APIs with OpenAPI 3.1 specifications, resource modeling, and versioning strategies.
What is api-designer?
Senior API architect skill for designing REST and GraphQL APIs with comprehensive OpenAPI 3.1 specifications. Use when planning API architecture, creating resource models, defining endpoints, establishing versioning strategies, and designing error handling standards.
- Analyze domain requirements and model resources with entity relationships
- Design REST endpoints with proper HTTP methods and URI patterns
- Generate OpenAPI 3.1 specifications with validation
- Create RFC 7807 error response catalogs with actionable messages
- Plan API versioning, deprecation, and backward-compatibility strategies
- Design pagination, filtering, and authentication flows
How to install api-designer
npx skills add https://github.com/jeffallan/claude-skills --skill api-designer- Node.js and npm installed
- @redocly/cli for OpenAPI validation: npx @redocly/cli lint openapi.yaml
- @stoplight/prism-cli for mock servers: npx @stoplight/prism-cli mock openapi.yaml
How to use api-designer
- 1.Analyze business requirements and identify resources, relationships, and client needs
- 2.Sketch entity diagram and resource model before writing specifications
- 3.Define endpoint URIs, HTTP methods, and request/response schemas
- 4.Create OpenAPI 3.1 specification using provided template
- 5.Validate spec: npx @redocly/cli lint openapi.yaml
- 6.Spin up mock server to test contracts: npx @stoplight/prism-cli mock openapi.yaml
- 7.Design versioning, deprecation, and backward-compatibility strategy
- 8.Document authentication, authorization, pagination, and error responses
Use cases
- Building a new REST API from scratch with OpenAPI specification
- Redesigning an existing API to follow REST principles and add versioning
- Creating GraphQL schema alongside REST endpoints
- Documenting API contracts for SDK generation and mock servers
- Planning API evolution with deprecation and breaking-change strategies
- API architects and senior backend engineers
- Technical leads designing API contracts
- Teams building SDKs or client libraries
- DevOps and platform engineers standardizing API patterns
api-designer FAQ
REST is resource-oriented with fixed endpoints and HTTP methods; GraphQL is query-flexible with a single endpoint. This skill covers both—use REST patterns for traditional APIs and GraphQL schema design for flexible query APIs.
Design a versioning strategy upfront (URL versioning, header versioning, or deprecation headers). Plan a migration path, announce deprecation with timelines, and maintain multiple API versions during transition.
Cursor-based pagination is preferred for large datasets and real-time data; offset-based is simpler for small, stable datasets; keyset pagination balances both. Choose based on data size, sort stability, and client needs.
Use RFC 7807 Problem Details format with a stable `type` URI, human-readable `detail`, and HTTP status code. Include field-level errors in an `errors[]` array for validation failures.
Yes. Valid OpenAPI 3.1 specs can generate server stubs, client SDKs, and documentation. Validate with @redocly/cli before using for code generation.
Full instructions (SKILL.md)
Source of truth, from jeffallan/claude-skills.
name: api-designer description: Use when designing REST or GraphQL APIs, creating OpenAPI specifications, or planning API architecture. Invoke for resource modeling, versioning strategies, pagination patterns, error handling standards. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: api-architecture triggers: API design, REST API, OpenAPI, API specification, API architecture, resource modeling, API versioning, GraphQL schema, API documentation role: architect scope: design output-format: specification related-skills: graphql-architect, fastapi-expert, nestjs-expert, spring-boot-engineer, security-reviewer
API Designer
Senior API architect specializing in REST and GraphQL APIs with comprehensive OpenAPI 3.1 specifications.
Core Workflow
- Analyze domain — Understand business requirements, data models, and client needs
- Model resources — Identify resources, relationships, and operations; sketch entity diagram before writing any spec
- Design endpoints — Define URI patterns, HTTP methods, request/response schemas
- Specify contract — Create OpenAPI 3.1 spec; validate before proceeding:
npx @redocly/cli lint openapi.yaml - Mock and verify — Spin up a mock server to test contracts:
npx @stoplight/prism-cli mock openapi.yaml - Plan evolution — Design versioning, deprecation, and backward-compatibility strategy
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| REST Patterns | references/rest-patterns.md | Resource design, HTTP methods, HATEOAS |
| Versioning | references/versioning.md | API versions, deprecation, breaking changes |
| Pagination | references/pagination.md | Cursor, offset, keyset pagination |
| Error Handling | references/error-handling.md | Error responses, RFC 7807, status codes |
| OpenAPI | references/openapi.md | OpenAPI 3.1, documentation, code generation |
Constraints
MUST DO
- Follow REST principles (resource-oriented, proper HTTP methods)
- Use consistent naming conventions (snake_case or camelCase — pick one, apply everywhere)
- Include comprehensive OpenAPI 3.1 specification
- Design proper error responses with actionable messages (RFC 7807)
- Implement pagination for all collection endpoints
- Version APIs with clear deprecation policies
- Document authentication and authorization
- Provide request/response examples
MUST NOT DO
- Use verbs in resource URIs (use
/users/{id}, not/getUser/{id}) - Return inconsistent response structures
- Skip error code documentation
- Ignore HTTP status code semantics
- Design APIs without a versioning strategy
- Expose implementation details in the API surface
- Create breaking changes without a migration path
- Omit rate limiting considerations
Templates
OpenAPI 3.1 Resource Endpoint (copy-paste starter)
openapi: "3.1.0"
info:
title: Example API
version: "1.1.0"
paths:
/users:
get:
summary: List users
operationId: listUsers
tags: [Users]
parameters:
- name: cursor
in: query
schema: { type: string }
description: Opaque cursor for pagination
- name: limit
in: query
schema: { type: integer, default: 20, maximum: 100 }
responses:
"200":
description: Paginated list of users
content:
application/json:
schema:
type: object
required: [data, pagination]
properties:
data:
type: array
items: { $ref: "#/components/schemas/User" }
pagination:
$ref: "#/components/schemas/CursorPage"
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"429": { $ref: "#/components/responses/TooManyRequests" }
/users/{id}:
get:
summary: Get a user
operationId: getUser
tags: [Users]
parameters:
- name: id
in: path
required: true
schema: { type: string, format: uuid }
responses:
"200":
description: User found
content:
application/json:
schema: { $ref: "#/components/schemas/User" }
"404": { $ref: "#/components/responses/NotFound" }
components:
schemas:
User:
type: object
required: [id, email, created_at]
properties:
id: { type: string, format: uuid, readOnly: true }
email: { type: string, format: email }
name: { type: string }
created_at: { type: string, format: date-time, readOnly: true }
CursorPage:
type: object
required: [next_cursor, has_more]
properties:
next_cursor: { type: string, nullable: true }
has_more: { type: boolean }
Problem: # RFC 7807 Problem Details
type: object
required: [type, title, status]
properties:
type: { type: string, format: uri, example: "https://api.example.com/errors/validation-error" }
title: { type: string, example: "Validation Error" }
status: { type: integer, example: 400 }
detail: { type: string, example: "The 'email' field must be a valid email address." }
instance: { type: string, format: uri, example: "/users/req-abc123" }
responses:
BadRequest:
description: Invalid request parameters
content:
application/problem+json:
schema: { $ref: "#/components/schemas/Problem" }
Unauthorized:
description: Missing or invalid authentication
content:
application/problem+json:
schema: { $ref: "#/components/schemas/Problem" }
NotFound:
description: Resource not found
content:
application/problem+json:
schema: { $ref: "#/components/schemas/Problem" }
TooManyRequests:
description: Rate limit exceeded
headers:
Retry-After: { schema: { type: integer } }
content:
application/problem+json:
schema: { $ref: "#/components/schemas/Problem" }
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- BearerAuth: []
RFC 7807 Error Response (copy-paste)
{
"type": "https://api.example.com/errors/validation-error",
"title": "Validation Error",
"status": 422,
"detail": "The 'email' field must be a valid email address.",
"instance": "/users/req-abc123",
"errors": [
{ "field": "email", "message": "Must be a valid email address." }
]
}
- Always use
Content-Type: application/problem+jsonfor error responses. typemust be a stable, documented URI — never a generic string.detailmust be human-readable and actionable.- Extend with
errors[]for field-level validation failures.
Output Checklist
When delivering an API design, provide:
- Resource model and relationships (diagram or table)
- Endpoint specifications with URIs and HTTP methods
- OpenAPI 3.1 specification (YAML)
- Authentication and authorization flows
- Error response catalog (all 4xx/5xx with
typeURIs) - Pagination and filtering patterns
- Versioning and deprecation strategy
- Validation result:
npx @redocly/cli lint openapi.yamlpasses with no errors
Knowledge Reference
REST architecture, OpenAPI 3.1, GraphQL, HTTP semantics, JSON:API, HATEOAS, OAuth 2.0, JWT, RFC 7807 Problem Details, API versioning patterns, pagination strategies, rate limiting, webhook design, SDK generation
Related skills
More from jeffallan/claude-skills and the wider catalog.
laravel-specialist
Build Laravel 10+ applications with Eloquent models, Sanctum auth, queues, APIs, and Livewire components.
golang-pro
Senior Go developer for concurrent systems, microservices, and production-grade performance optimization.
flutter-expert
Senior Flutter engineer for cross-platform apps with Riverpod, Bloc, GoRouter, and performance optimization.
php-pro
Senior PHP developer for modern PHP 8.3+, Laravel, Symfony with strict typing, PHPStan level 9, and enterprise patterns.
kubernetes-specialist
Deploy and manage Kubernetes workloads with secure manifests, RBAC, networking, and troubleshooting.
devops-engineer
Creates Dockerfiles, CI/CD pipelines, Kubernetes manifests, and infrastructure-as-code templates for deployment automation.