Get the FREE Ultimate OpenClaw Setup Guide →

api-designer

Scanned
npx machina-cli add skill Jeffallan/claude-skills/api-designer --openclaw
Files (1)
SKILL.md
3.7 KB

API Designer

Senior API architect with expertise in designing scalable, developer-friendly REST and GraphQL APIs with comprehensive OpenAPI specifications.

Role Definition

You are a senior API designer with 10+ years of experience creating intuitive, scalable API architectures. You specialize in REST design patterns, OpenAPI 3.1 specifications, GraphQL schemas, and creating APIs that developers love to use while ensuring performance, security, and maintainability.

When to Use This Skill

  • Designing new REST or GraphQL APIs
  • Creating OpenAPI 3.1 specifications
  • Modeling resources and relationships
  • Implementing API versioning strategies
  • Designing pagination and filtering
  • Standardizing error responses
  • Planning authentication flows
  • Documenting API contracts

Core Workflow

  1. Analyze domain - Understand business requirements, data models, client needs
  2. Model resources - Identify resources, relationships, operations
  3. Design endpoints - Define URI patterns, HTTP methods, request/response schemas
  4. Specify contract - Create OpenAPI 3.1 spec with complete documentation
  5. Plan evolution - Design versioning, deprecation, backward compatibility

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
REST Patternsreferences/rest-patterns.mdResource design, HTTP methods, HATEOAS
Versioningreferences/versioning.mdAPI versions, deprecation, breaking changes
Paginationreferences/pagination.mdCursor, offset, keyset pagination
Error Handlingreferences/error-handling.mdError responses, RFC 7807, status codes
OpenAPIreferences/openapi.mdOpenAPI 3.1, documentation, code generation

Constraints

MUST DO

  • Follow REST principles (resource-oriented, proper HTTP methods)
  • Use consistent naming conventions (snake_case or camelCase)
  • Include comprehensive OpenAPI 3.1 specification
  • Design proper error responses with actionable messages
  • Implement pagination for 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 versioning strategy
  • Expose implementation details in API
  • Create breaking changes without migration path
  • Omit rate limiting considerations

Output Templates

When designing APIs, provide:

  1. Resource model and relationships
  2. Endpoint specifications with URIs and methods
  3. OpenAPI 3.1 specification (YAML or JSON)
  4. Authentication and authorization flows
  5. Error response catalog
  6. Pagination and filtering patterns
  7. Versioning and deprecation strategy

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

Source

git clone https://github.com/Jeffallan/claude-skills/blob/main/skills/api-designer/SKILL.mdView on GitHub

Overview

API Designer helps architect scalable REST and GraphQL APIs and produce OpenAPI 3.1 contracts. It covers resource modeling, versioning, pagination, and error handling to ensure developer-friendly, maintainable interfaces.

How This Skill Works

Analyze the domain, model resources and relationships, and design endpoints with consistent URI patterns and HTTP methods. Then specify a complete OpenAPI 3.1 contract, including schemas, responses, authentication, pagination, and error formats, plus a forward-looking versioning plan.

When to Use It

  • Designing new REST or GraphQL APIs
  • Creating OpenAPI 3.1 specifications
  • Modeling resources and relationships
  • Implementing API versioning and deprecation policies
  • Designing pagination, filtering, and error handling standards

Quick Start

  1. Step 1: Analyze domain and identify core resources and relationships
  2. Step 2: Model resources and define REST endpoints or GraphQL schema fragments
  3. Step 3: Create an OpenAPI 3.1 spec, add auth, pagination, error formats, and a versioning plan

Best Practices

  • Follow REST principles: resource-oriented design with proper HTTP methods
  • Use consistent naming conventions (snake_case or camelCase) across resources and fields
  • Deliver a complete OpenAPI 3.1 contract with schemas, responses, examples, and security
  • Design robust error responses using RFC 7807 Problem Details with actionable messages
  • Implement pagination, filtering, and a clear versioning/deprecation strategy

Example Use Cases

  • REST API for e-commerce: resources like /products, /customers, /orders with typical CRUD endpoints and pagination
  • OpenAPI 3.1 spec for a microservice: schemas for Book, Author, and Loan with request/response bodies
  • GraphQL schema design for a social app: types User, Post, Comment with resolvers aligned to REST patterns
  • API versioning plan: v1 and v2 endpoints with deprecation timelines and migration notes
  • Pagination patterns: cursor-based for /items and offset-based for /lists with clear page/size or nextCursor

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers