api-design

Designs REST and GraphQL APIs with endpoint structures, contracts, and versioning strategies.

3|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Fabric-Pro/fabric-oss --skill api-design-fabric-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/Fabric-Pro/fabric-oss/tree/main/.cursor/skills/api-design
Command: npx skills add https://github.com/Fabric-Pro/fabric-oss --skill api-design-fabric-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing APIs without consistent conventions leads to unpredictable endpoints, breaking changes, poor documentation, and security gaps that frustrate consumers and complicate maintenance. ## Core Features & Use Cases - REST API Design: Resource-based URLs, proper HTTP methods and status codes, consistent response formats, pagination, filtering, sorting, and versioning strategies. - GraphQL API Design: Typed schema definitions, efficient resolvers with DataLoader to avoid N+1 queries, and structured error handling with extensions. - Security & Documentation: Bearer token and API key authentication, rate limiting, idempotency keys, caching headers, webhooks, and OpenAPI/Swagger documentation. - Use Case: When building a new microservice, use this Skill to plan the endpoint structure, define request/response contracts, set up authentication, and generate an OpenAPI specification before writing implementation code. ## Quick Start Ask the AI to design a versioned REST API for a users resource with pagination, authentication, and OpenAPI documentation.

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 proper endpoints?▼

Use resource-based URLs with nouns instead of verbs, such as GET /users and POST /users/:id/posts. Apply correct HTTP methods and status codes, return consistent response structures, and support pagination, filtering, and sorting through query parameters.

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

REST suits resource-oriented services with simple caching and clear versioning via URLs. GraphQL fits clients needing flexible field selection and nested data, but requires DataLoader to prevent N+1 queries and depth limiting for security.

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

Use URL versioning like /api/v1 and /api/v2, or header versioning with Accept-Version. Send deprecation headers such as X-API-Deprecation to warn consumers, and maintain migration guides for breaking changes.

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

Use DataLoader to batch and cache database lookups within a single request. It collects IDs across resolvers, fetches them in one query, and returns results in the same order as the input IDs.

What status codes should a REST API return?▼

Return 200 for success, 201 for creation, 204 for empty success responses, 400 for invalid input, 401 for missing authentication, 403 for insufficient permissions, 404 for missing resources, 409 for conflicts, 422 for validation failures, and 429 for rate limiting.

How do I make POST requests safe to retry?▼

Require an Idempotency-Key header and cache the processed result keyed by that value. On retry, return the cached response instead of processing the request again, preventing duplicate payments or resource creation.