api-design

Design API contracts for REST, GraphQL, and gRPC contexts.

258|26|Updated Dec 9, 2025
One-click install
npx skills add https://github.com/majiayu000/claude-arsenal --skill api-design-majiayu000
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/majiayu000/claude-arsenal/tree/main/skills/api-design
Command: npx skills add https://github.com/majiayu000/claude-arsenal --skill api-design-majiayu000

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

REST/GraphQL/gRPC API designs are often under-specified, leading to mismatches between teams. This Skill provides best practices for contract-first API design, OpenAPI 3.2, GraphQL Federation, and gRPC streaming to ensure consistent contracts across REST, GraphQL, and gRPC.

Core Features & Use Cases

  • Contract-first approach: Define API specs before implementation to reduce mismatch.
  • OpenAPI 3.2 & GraphQL: Guidance for REST specs, GraphQL schemas, and federation patterns.
  • Versioning & Errors: Clear versioning strategy and RFC 7807-style errors.
  • When to use What: REST for MVP/public APIs, GraphQL for data-rich clients, gRPC for internal microservices.

Quick Start

Draft a REST OpenAPI 3.2 spec skeleton for /users and a basic GraphQL schema for a User type; consider gRPC streaming for internal services.

Frequently Asked Questions about api-design

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

FAQPage Schema
How do I design REST APIs with versioning and error handling?▼

REST API design follows contract-first approach using OpenAPI 3.2 specs. Define versioning strategy upfront, apply RFC 7807-compliant errors, standard status codes, and idempotency patterns to ensure consistent contracts before implementation begins.

What's the difference between REST, GraphQL, and gRPC for API design?▼

REST suits MVP and public APIs with straightforward CRUD operations. GraphQL serves data-rich clients needing flexible queries and schema federation. gRPC optimizes internal microservices with streaming and binary protocols for performance.

How do I handle API schema evolution and backward compatibility?▼

Schema evolution requires versioning strategy and careful field deprecation. Contract-first design using OpenAPI, GraphQL Federation schemas, or gRPC proto definitions ensures teams align on changes before implementation, preventing breaking changes.

Can I use OpenAPI specifications with GraphQL and gRPC?▼

OpenAPI 3.2 is REST-native, but contract-first principles apply across protocols. GraphQL uses federation schemas; gRPC uses proto definitions. Each protocol has dedicated specification formats, though cross-protocol interoperability patterns exist for polyglot architectures.

What should I include in an API contract before implementation?▼

Contract-first design includes endpoint definitions, request/response schemas, authentication requirements, error codes, pagination approach (cursor-based), idempotency rules, and security constraints. OpenAPI 3.2, GraphQL schemas, or gRPC protos document these formally.

How do I implement cursor-based pagination across different API types?▼

Cursor-based pagination encodes position state in opaque tokens, improving performance over offset-based queries. Implement consistently across REST endpoints, GraphQL resolvers, and gRPC streaming responses to handle large datasets reliably.