api-design

Design RESTful, GraphQL, and RPC API specifications with OpenAPI/Swagger schema generation.

53|1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/cosmix/claude-code-setup --skill api-design-cosmix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/cosmix/claude-code-setup/tree/main/skills/api-design
Command: npx skills add https://github.com/cosmix/claude-code-setup --skill api-design-cosmix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides designing consistent APIs, with clear versioning, schemas, error handling, and developer UX.

Core Features & Use Cases

  • Resource Structures: Nouns-based paths, consistent naming.
  • Operations & Pagination: CRUD mapping, filtering, and pagination.
  • Documentation Readiness: OpenAPI specs and examples.

Quick Start

Draft an OpenAPI spec for a /users resource with GET/POST endpoints and basic pagination.

Frequently Asked Questions about api-design

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

FAQPage Schema
How do I design a REST API with consistent resource naming and HTTP methods?

REST API design uses noun-based paths for resources with standard HTTP methods (GET, POST, PUT, DELETE) mapped to CRUD operations. Structure URLs consistently—for example, /users for collections and /users/{id} for individual resources—to create intuitive, predictable endpoints that developers can understand without documentation.

What's the best way to document an API with OpenAPI and Swagger?

OpenAPI and Swagger specifications formally document API endpoints, request/response schemas, and authentication flows in machine-readable format. Generate these specs from your API design to enable automatic SDK generation, interactive documentation, and validation tools that keep documentation synchronized with implementation.

How do I handle pagination and filtering in API endpoints?

Pagination uses limit and offset or cursor-based parameters to break large datasets into manageable chunks; filtering applies query parameters to narrow results by resource attributes. Consistent pagination and filtering conventions across all endpoints improve usability for client applications working with large datasets.

Do I need to version my API, and how should I structure it?

API versioning prevents breaking changes from disrupting clients; common approaches include URL paths (/v1/users), headers, or query parameters. Clear versioning strategy with deprecation timelines lets you evolve the API safely while maintaining backward compatibility for existing integrations.

Can I use this approach for GraphQL schemas and internal microservices?

API design principles apply beyond REST to GraphQL schemas and RPC interfaces, and work for public APIs, internal services, and multi-tenant architectures. The same resource modeling, authentication planning, and documentation practices ensure consistency and developer experience across different API styles and deployment contexts.

What authentication and error handling patterns should I include in API design?

API design specifies authentication flows (OAuth, API keys, JWT), consistent error response formats with meaningful status codes and messages, and security considerations like rate limiting. Documenting these patterns upfront prevents ad-hoc implementations and ensures clients handle errors predictably.