api-design-patterns

Design REST, GraphQL, and microservice APIs with a 5-layer pattern.

3|1|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/I-Onlabs/claude-code-skills --skill api-design-patterns-i-onlabs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design-patterns
Source: https://github.com/I-Onlabs/claude-code-skills/tree/main/api-design-patterns
Command: npx skills add https://github.com/I-Onlabs/claude-code-skills --skill api-design-patterns-i-onlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing and maintaining APIs across REST, GraphQL, and microservices is error-prone without a shared blueprint. This skill provides a robust, scalable approach to API design to improve consistency, maintainability, and collaboration.

Core Features & Use Cases

  • 5-layer pattern for API endpoints (MODELS, SERVICE, ROUTER, TESTS, DOCS) to ensure clear separation of concerns.
  • REST & GraphQL guidance for consistent schemas, routing, and validation.
  • OpenAPI-driven docs & tests to keep documentation and tests in sync.
  • Use cases: designing new endpoints, evolving schemas, and enforcing API governance across multiple services.

Quick Start

Scaffold a new API endpoint by applying the 5-layer pattern and generating OpenAPI docs.

Frequently Asked Questions about api-design-patterns

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

FAQPage Schema
What is the best way to standardize API design across microservices and REST?▼

The best way to standardize API design across REST and microservices is applying a 5-layer pattern covering MODELS, SERVICE, ROUTER, TESTS, and DOCS. This enforces clear separation of concerns, routing consistency, and schema validation across projects.

How do I structure a new API endpoint with FastAPI and OpenAPI docs?▼

To structure a new API endpoint with FastAPI and OpenAPI, scaffold the endpoint using the 5-layer pattern. This generates the MODELS, SERVICE, and ROUTER layers while keeping OpenAPI documentation and tests automatically in sync.

Does this API design pattern support both REST and GraphQL schemas?▼

Yes, this API design pattern supports both REST and GraphQL schemas. It provides specific guidance for consistent schemas, routing, and validation across both protocols to improve maintainability and collaboration.

How do I handle pagination and error handling consistently across API projects?▼

To handle pagination and error handling consistently across API projects, apply the standardized REST conventions provided by the 5-layer blueprint. This ensures uniform error responses and pagination logic across all endpoints and services.

When do I need a standardized API architecture blueprint for my team?▼

You need a standardized API architecture blueprint when creating new endpoints, evolving schemas, or enforcing API governance across multiple services. It prevents errors and improves consistency, maintainability, and team collaboration without a shared design.