api-design-patterns

Provide REST and GraphQL API design patterns for Node.js, Flask, and FastAPI.

9|1|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/benshapyro/cadre-devkit-claude --skill api-design-patterns-benshapyro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design-patterns
Source: https://github.com/benshapyro/cadre-devkit-claude/tree/main/skills/api-design-patterns
Command: npx skills add https://github.com/benshapyro/cadre-devkit-claude --skill api-design-patterns-benshapyro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides best practices for designing RESTful and GraphQL APIs across Node.js, Flask, and FastAPI, focusing on consistency, versioning, error handling, and security.

Core Features & Use Cases

  • Consistent REST conventions (resources, status codes, pagination)
  • GraphQL schema and resolver patterns (DataLoader, error handling)
  • Error handling, security, and rate limiting patterns
  • Versioning and self-documenting APIs

Quick Start

Ask Claude to apply REST or GraphQL patterns to your /api/ or /routes/ directories and start designing endpoints for a resource.

Frequently Asked Questions about api-design-patterns

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

FAQPage Schema
How do I design REST API endpoints that follow standard conventions?

REST API design uses resource-based URLs, HTTP status codes, and consistent naming to create predictable endpoints. Apply REST conventions by organizing endpoints around nouns (resources), using GET/POST/PUT/DELETE for operations, returning appropriate status codes (200, 201, 400, 404), and structuring responses consistently across your Node.js, Flask, or FastAPI application.

What's the best way to handle errors consistently across my API?

Standardized error handling ensures clients receive predictable error responses. Define a consistent error response format with status codes, error messages, and details; implement error middleware in Node.js, Flask, or FastAPI; and document error scenarios for each endpoint so clients know what to expect and how to recover.

How do I implement pagination in REST and GraphQL APIs?

Pagination prevents large datasets from overwhelming responses. In REST, use limit/offset or cursor-based parameters in query strings. In GraphQL, use cursor-based pagination with DataLoader for efficient database queries. Both approaches improve performance and provide consistent navigation through results.

How do I version my API without breaking existing clients?

API versioning maintains backward compatibility while evolving your endpoints. Use URL-based versioning (v1, v2), header-based versioning, or accept parameter approaches to let clients opt into new behavior. Plan deprecation timelines and communicate changes to prevent unexpected client failures.

What authentication and security patterns should I use for APIs?

Secure APIs with authentication (API keys, JWT tokens, OAuth) and rate limiting to prevent abuse. Validate all inputs, use HTTPS, implement proper authorization checks, and follow security best practices specific to Node.js, Flask, or FastAPI frameworks to protect user data and prevent attacks.

How do I structure GraphQL schemas and resolvers effectively?

GraphQL schema design defines your API's type system and query capabilities. Structure schemas around domain entities, implement resolvers that fetch data efficiently using DataLoader to batch requests, handle errors at resolver level, and document schema types so clients understand available queries and mutations.