api-design-patterns

Design REST and GraphQL APIs with language-agnostic patterns for routes, schemas, and specs.

8|Updated Nov 4, 2025
One-click install
npx skills add https://github.com/ilude/claude-code-config --skill api-design-patterns-ilude
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design-patterns
Source: https://github.com/ilude/claude-code-config/tree/main/skills/api-design-patterns
Command: npx skills add https://github.com/ilude/claude-code-config --skill api-design-patterns-ilude

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides language-agnostic API design patterns for robust REST and GraphQL interfaces.

Core Features & Use Cases

  • REST resource naming: nouns, plural, hierarchical paths, and query-based filtering.
  • HTTP methods & status codes: matching semantics to operations.
  • Versioning & Pagination: structuring changes and large datasets.

Quick Start

Sketch a REST endpoint like GET /api/v1/users with basic pagination and a simple OpenAPI spec.

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 API endpoints with proper resource naming and HTTP methods?

REST API design uses noun-based resource names in plural form (e.g., /users, /orders) with HTTP methods (GET, POST, PUT, DELETE) matching the operation semantics. This Skill covers hierarchical path structures, query-based filtering, appropriate status codes for each operation, and OpenAPI documentation to ensure consistency across endpoints.

What's the best way to handle API versioning and pagination for large datasets?

API versioning strategies include URL-based (v1, v2) or header-based approaches to manage breaking changes. Pagination uses limit/offset or cursor-based patterns to structure large datasets efficiently. This Skill provides language-agnostic patterns for both, with examples across REST and GraphQL implementations.

How do I design a GraphQL schema with proper authentication and error handling?

GraphQL schema design applies resolver patterns, input types, and mutation structures while integrating authentication schemes and standardized error responses. This Skill covers schema semantics, error handling conventions, and authentication integration across GraphQL resolvers alongside REST equivalents.

Can I use the same API design patterns for both REST and GraphQL?

Yes. This Skill provides language-agnostic design patterns applicable to both REST endpoints and GraphQL resolvers, covering resource naming, status codes, versioning, pagination, filtering, authentication, and error handling across both architectural styles.

What HTTP status codes should I use for different API operations?

HTTP status codes convey operation outcomes: 200 for success, 201 for resource creation, 400 for client errors, 401/403 for authentication/authorization failures, and 5xx for server errors. This Skill matches status codes to REST methods and operations with semantic accuracy and OpenAPI documentation.

How do I document API design decisions in OpenAPI or Swagger specifications?

OpenAPI/Swagger specs formally document endpoints, methods, parameters, request/response schemas, status codes, and authentication requirements. This Skill teaches spec creation alongside resource naming, versioning, and pagination patterns to ensure API contracts are clear and enforceable.