api-design

Design REST and GraphQL API contracts with OpenAPI specifications and RFC 7807 errors.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/dotBeeps/hoard --skill api-design-dotbeeps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/dotBeeps/hoard/tree/main/morsels/skills/api-design
Command: npx skills add https://github.com/dotBeeps/hoard --skill api-design-dotbeeps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing APIs often becomes inconsistent, brittle, and hard to evolve; this guide helps teams define clear contracts, predictable error handling, and scalable pagination and versioning so clients and servers can be developed in parallel.

Core Features & Use Cases

  • REST & HTTP semantics: Resource naming, method usage, idempotency, and status code guidance for predictable client behavior.
  • Error shaping & observability: RFC 7807 problem details, stable error codes, and logging practices to avoid leaking internals while enabling debuggability.
  • Pagination, versioning & auth: Offset and cursor pagination patterns, URL and header versioning strategies, bearer/JWT and API key practices, rate limiting and CORS rules.
  • OpenAPI and GraphQL readiness: Spec-first workflows, OpenAPI components and tooling, GraphQL schema patterns, connection pagination, and DataLoader guidance for N+1 problems.

Quick Start

Use the api-design skill to produce an OpenAPI v3 specification for an orders service that includes resource paths, RFC 7807 error responses, cursor pagination, bearer authentication, and a clear versioning scheme.

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 error handling and pagination?

Designing a REST API requires standardizing HTTP semantics, applying RFC 7807 problem details for errors, and implementing cursor or offset pagination to ensure predictable client behavior and scalable data retrieval.

What is the best way to generate an OpenAPI v3 specification for client-ready web services?

Generating an OpenAPI v3 specification involves defining resource paths, security schemes, and OpenAPI components using a spec-first workflow, producing actionable contracts suitable for automated client generation and parallel development.

How does RFC 7807 problem details improve API error responses?

RFC 7807 problem details provide a standardized error shape for APIs, ensuring stable error codes and consistent logging practices that prevent leaking internal details while maintaining debuggability for clients.

Should I use URL versioning or header versioning for my web API?

API versioning strategies like URL and header versioning allow teams to evolve contracts without breaking clients; choosing between them depends on your specific routing requirements and client caching needs.

How do I resolve N+1 query problems in GraphQL schemas?

Resolving N+1 query problems in GraphQL schemas involves applying specific schema patterns, utilizing connection pagination, and integrating DataLoader guidance to batch data fetching efficiently.

Can I use this approach for both internal and public APIs?

This approach applies to both internal and public APIs, covering authentication practices like bearer or JWT tokens, API key management, rate limiting, and CORS rules to secure and control access.