API Design Mastery

Design robust, scalable, and type-safe APIs across REST, GraphQL, and tRPC.

Updated Feb 18, 2026
One-click install
npx skills add https://github.com/SamuelSaha/Reqflow --skill api-design-mastery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: API Design Mastery
Source: https://github.com/SamuelSaha/Reqflow/tree/main/SWARM/skills/backend/api-design
Command: npx skills add https://github.com/SamuelSaha/Reqflow --skill api-design-mastery

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the complexity and potential pitfalls in designing robust, maintainable, and scalable APIs across various paradigms like REST, GraphQL, and tRPC.

Core Features & Use Cases

  • Paradigm Selection: Guides the choice between REST, GraphQL, tRPC, gRPC, and WebSocket based on project needs.
  • Pattern Implementation: Provides best practices for resource naming, HTTP status codes, error handling, pagination, schema design, and security.
  • Type Safety & Validation: Emphasizes using tools like Zod for end-to-end type safety and runtime validation.
  • Documentation: Promotes auto-generation of API documentation using OpenAPI.
  • Use Case: A development team needs to design a new public-facing API. This Skill helps them select the most appropriate paradigm (e.g., REST), define clear resource structures, implement secure endpoints with proper error handling, and ensure the API is well-documented and versioned for future compatibility.

Quick Start

Use the API Design Mastery skill to generate a REST API design for a user management system, including resource naming and error response formats.

Frequently Asked Questions about API Design Mastery

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

FAQPage Schema
How do I choose between REST, GraphQL, and tRPC for my API design?

Choosing between REST, GraphQL, and tRPC for API design depends on your project needs. This guidance helps evaluate factors like data fetching flexibility, client constraints, and end-to-end type safety requirements to select the appropriate paradigm.

What is contract-first API design and how does it improve type safety?

Contract-first API design defines the API schema before implementation, improving type safety by ensuring client and server adhere to a shared contract. Using tools like Zod provides runtime validation and end-to-end type safety.

How do I design scalable REST APIs with proper error handling and pagination?

Designing scalable REST APIs requires following best practices for resource naming, HTTP status codes, and structured error response formats. Implementing standardized pagination patterns ensures the API remains performant as data volume grows.

Can I use Zod for runtime validation and auto-generated OpenAPI documentation?

Yes, you can use Zod for runtime validation to enforce type safety. Combining Zod schemas with OpenAPI allows you to auto-generate API documentation, ensuring your docs accurately reflect the validated contract.

What are the best practices for API security and rate limiting?

API security best practices involve implementing strict input validation and rate limiting to prevent abuse. Applying these patterns protects endpoints from malicious payloads and controls traffic flow to ensure service availability.

When should I implement idempotency in API design?

Implement idempotency in API design when operations might be retried or duplicated, such as payment processing. Idempotency ensures multiple identical requests produce the same result as a single request, preventing unintended side effects.