api-design-patterns

Design scalable REST and GraphQL APIs with versioning, pagination, error handling, and HATEOAS.

29|15|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/NickCrew/claude-cortex --skill api-design-patterns-nickcrew
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design-patterns
Source: https://github.com/NickCrew/claude-cortex/tree/main/skills/api-design-patterns
Command: npx skills add https://github.com/NickCrew/claude-cortex --skill api-design-patterns-nickcrew

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides established API design patterns for REST and GraphQL, including versioning, pagination, error handling, and HATEOAS.

Core Features & Use Cases

  • Resource-Oriented Design: Clear resource endpoints and meaningful HTTP methods.
  • Versioning & Pagination: Strategies for evolving APIs without breaking clients.
  • Error Handling: Consistent error schemas and status codes.

Quick Start

Define endpoints for /users and /orders with version v1 and a cursor-based pagination example.

Frequently Asked Questions about api-design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design REST APIs that won't break when I need to update them?

REST API versioning strategies let you evolve endpoints without breaking existing clients. This Skill covers versioning approaches like URL paths (/v1/, /v2/) and headers, paired with pagination and consistent error handling to maintain backward compatibility while adding new features.

What's the best way to structure error responses in a REST or GraphQL API?

Standardized error schemas ensure clients handle failures predictably. This Skill defines consistent error formats, appropriate HTTP status codes, and response structures that work across REST and GraphQL APIs, reducing client-side debugging friction.

How do I implement pagination for large datasets in REST APIs?

Cursor-based and offset pagination strategies control data volume per request. This Skill provides pagination patterns that scale with large result sets, prevent client timeouts, and maintain performance in resource-oriented REST endpoints.

What is resource-oriented design and why does it matter for API contracts?

Resource-oriented design maps business objects to clear REST endpoints with meaningful HTTP methods, creating intuitive, predictable APIs. This Skill establishes patterns for consistent naming, correct method semantics, and HATEOAS links that scale across microservices.

Can I use these patterns to generate OpenAPI and GraphQL schemas automatically?

Yes. This Skill's API design patterns support OpenAPI and GraphQL schema generation, letting you define versioning, error handling, and resource structures once and export documentation and client code automatically.

When should I choose GraphQL over REST for my API design?

Both have distinct trade-offs in query flexibility, caching, and versioning complexity. This Skill covers design patterns for both GraphQL and REST, helping you apply consistent principles like error handling and pagination regardless of protocol choice.