api-design-principles

Design RESTful and GraphQL APIs with resource modeling and schema standards.

2|Updated Jun 27, 2017
One-click install
npx skills add https://github.com/leafcoder/litefs --skill api-design-principles-leafcoder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design-principles
Source: https://github.com/leafcoder/litefs/tree/main/.trae/skills/02_Architect_APIDesign
Command: npx skills add https://github.com/leafcoder/litefs --skill api-design-principles-leafcoder

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the complexity of designing consistent, maintainable, and intuitive APIs by providing a structured framework for REST and GraphQL architecture.

Core Features & Use Cases

  • RESTful Architecture: Guidance on resource-oriented design, HTTP semantics, and HATEOAS implementation.
  • GraphQL Schema Design: Best practices for schema-first development, N+1 problem prevention, and cursor-based pagination.
  • API Governance: Standards for versioning, error handling, and documentation to ensure long-term API health.

Quick Start

Use the api-design-principles skill to review my current REST API endpoint structure and suggest improvements based on resource-oriented design patterns.

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 REST API design patterns for scalable, developer-friendly systems?

REST API design patterns for scalable systems center on resource-oriented modeling, strict HTTP semantics, and HATEOAS implementation. These principles ensure your interfaces remain maintainable, intuitive, and standardized for long-term developer use.

How do I prevent the N+1 problem in GraphQL schema design?

To prevent the N+1 problem in GraphQL schema design, apply schema-first development best practices and implement cursor-based pagination. These architectural principles facilitate efficient data fetching and robust query resolution.

How do I review my existing REST API endpoints for resource-oriented design improvements?

Review your REST API endpoints by evaluating them against resource-oriented design patterns and HTTP semantics. This process highlights structural inconsistencies and suggests actionable improvements for better API governance.

What is the best way to handle API versioning and error handling for long-term API health?

API versioning and error handling are best managed through standardized API governance protocols. Implementing consistent documentation and robust error handling ensures your RESTful or GraphQL interfaces maintain long-term health.

GraphQL vs REST API architecture: which approach ensures better data fetching efficiency?

GraphQL architecture provides efficient data fetching through schema-first development and prevents over-fetching, while REST architecture relies on standardized resource modeling and HTTP semantics. Your choice depends on specific interface scaling requirements.