api-design-principles

Design RESTful and GraphQL APIs using principles, patterns, and best practices.

1|Updated Feb 8, 2024
One-click install
npx skills add https://github.com/hokix/dotfiles --skill api-design-principles-hokix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design-principles
Source: https://github.com/hokix/dotfiles/tree/main/ai/.agents/skills/api-design-principles
Command: npx skills add https://github.com/hokix/dotfiles --skill api-design-principles-hokix

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps developers design and build intuitive, scalable, and maintainable APIs by providing comprehensive guidance on REST and GraphQL design principles and best practices.

Core Features & Use Cases

  • RESTful Design: Learn resource-oriented architecture, HTTP method semantics, and common patterns like pagination and error handling.
  • GraphQL Design: Understand schema-first development, query structure, and patterns for efficient data fetching.
  • Use Case: When designing a new microservice API, use this Skill to ensure adherence to best practices for both REST and GraphQL, leading to a more developer-friendly and robust API.

Quick Start

Review the RESTful design principles for resource collection design.

Frequently Asked Questions about api-design-principles

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

FAQPage Schema
What are the best practices for RESTful API resource collection design?

RESTful API design best practices involve resource-oriented architecture, proper HTTP method semantics, and standard patterns for pagination and error handling to ensure scalable and maintainable endpoints.

How do I design a GraphQL schema for efficient data fetching?

Designing a GraphQL schema requires a schema-first development approach, structuring queries effectively, and applying patterns that optimize data fetching to build intuitive and developer-friendly APIs.

Should I use REST or GraphQL for my new microservice API?

Choosing between REST and GraphQL for microservice API design depends on your data fetching needs. REST uses resource-oriented architecture, while GraphQL offers schema-first development for flexible query structures.

How do I handle errors and pagination in REST API design?

Handling errors and pagination in REST API design relies on applying common RESTful patterns, utilizing correct HTTP method semantics, and following resource collection principles for robust endpoints.

What principles should I follow to improve developer experience in API design?

Improving developer experience in API design requires adhering to core principles and patterns for both REST and GraphQL, ensuring your schema design is intuitive, scalable, and maintainable.