api-design-principles

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

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/nperepichka/Antigravity --skill api-design-principles-nperepichka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design-principles
Source: https://github.com/nperepichka/Antigravity/tree/main/config/skills/api-design-principles
Command: npx skills add https://github.com/nperepichka/Antigravity --skill api-design-principles-nperepichka

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve? Designing consistent, maintainable APIs is hard: teams struggle with inconsistent naming, missing pagination, unclear error formats, N+1 query problems in GraphQL, and unplanned versioning that breaks clients. ## Core Features & Use Cases - REST API Design Guidance: Resource-oriented URL structures, correct HTTP method and status code usage, pagination, filtering, rate limiting, and HATEOAS patterns. - GraphQL Schema Patterns: Schema-first design with Relay cursor pagination, DataLoader-based N+1 prevention, input/payload mutation patterns, and deprecation strategies. - Review Checklists and Templates: A pre-implementation checklist covering security, performance, and documentation, plus a FastAPI REST template for bootstrapping endpoints. - Use Case: Before implementing a new public API, run the design checklist against your endpoint specification to catch missing pagination, inconsistent error responses, and incorrect status codes. ## Quick Start Use the api-design-principles skill to review my proposed REST endpoint specification for consistency and best practices.

Frequently Asked Questions about api-design-principles

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

FAQPage Schema
How do I design a REST API with proper pagination?▼

Use offset-based pagination with page and page_size parameters for simple cases, or cursor-based pagination for large datasets. Always include pagination metadata like total count and enforce a maximum page size such as 100 items.

REST vs GraphQL: which should I choose for my API?▼

REST fits resource-oriented services with simple caching and clear HTTP semantics, while GraphQL suits clients needing flexible queries and exact field selection. The skill covers both paradigms including migration scenarios between them.

How do I prevent N+1 queries in GraphQL?▼

Use the DataLoader pattern to batch and cache database requests per request cycle. The skill provides Python DataLoader implementations that batch load related entities like user orders in a single query.

What HTTP status codes should a REST API return?▼

Return 200 for successful reads, 201 for creation, 204 for deletion, 400 for malformed requests, 401 for missing auth, 403 for insufficient permissions, 404 for missing resources, 422 for validation errors, and 429 for rate limiting.

How do I version an API without breaking existing clients?▼

Use URL versioning like /api/v1/users for clarity, or header-based versioning for cleaner URLs. In GraphQL, prefer the @deprecated directive to evolve schemas gradually instead of removing fields.

When should I not use this API design skill?▼

Skip it when you only need framework-specific implementation help, when doing infrastructure work without API contracts, or when you cannot change or version public interfaces.