api-design-principles
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
Author
Category
Development ToolsInstall
Hot:7
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-api-design-principles&locale=en&source=copy
API Design Principles - Professional API Design Guide
Skill Overview
API Design Principles is a professional API design assistant that helps developers master REST and GraphQL API design principles and build intuitive, scalable, and maintainable API interfaces.
Applicable Scenarios
1. Designing a new REST or GraphQL API
When planning an API architecture from scratch, this skill can guide you through key design decisions such as resource modeling, type definitions, authentication strategies, and versioning, ensuring the new API follows best practices from the start.
2. Refactoring an existing API to improve usability
When an existing API has usability issues, this skill can provide refactoring recommendations, including improving resource naming, optimizing response structures, enhancing error handling, and introducing a reasonable versioning strategy.
3. Establishing team API design standards
When a technical team needs a unified API design specification, this skill can help create a comprehensive design guide and review checklist to ensure team members follow consistent API design principles.
Core Features
1. API style selection and modeling
Based on usage scenarios and constraints, it guides the selection of REST or GraphQL style and performs resource modeling or type definition design to ensure the API structure is clear and meets business needs.
2. Specification drafting and validation
Covers key specification elements of API design, including error handling mechanisms, versioning strategies, pagination schemes, and authentication methods, and provides example validations and consistency reviews.
3. Cross-paradigm migration support
Provides migration guidance between REST and GraphQL, helping teams understand the pros and cons of different API paradigms, choose the most suitable technical solution, and achieve a smooth transition.
Frequently Asked Questions
Which API style should I choose, REST or GraphQL?
The choice depends on the specific context. REST is suitable for standardized resource operations and simple use cases, and benefits from a mature toolchain and caching mechanisms. GraphQL is suitable for complex data relationships, frontends that need flexible data retrieval, and mobile applications that need to reduce multiple requests. This skill can offer targeted recommendations based on your consumers' needs, use cases, and technical constraints.
What are best practices for API versioning?
Common versioning strategies include URL path versioning (e.g., /v1/users), header-based versioning, and query parameter versioning. It is recommended to plan your versioning strategy early in the API design, maintain backward compatibility, and notify developers with clear changelogs. This skill can help you evaluate the advantages and disadvantages of different versioning schemes.
When is this skill not suitable?
This skill is less suitable if you only need implementation-level guidance for a specific framework (such as Express or Django), or if the work only involves infrastructure deployment without API contract design. Additionally, if you cannot modify public interfaces or perform versioning, other approaches should be considered.