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.
DeepseekModel
官方收录技能
质量 优秀 · 90
v1.0.0
获取
https://deepseekmodel.com/api/download.php?id=wshobson-agents-plugins-backend-development-skills-api-design-principles-skill-md&format=skill
下载 .skill
标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
name api-design-principles description 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. API Design Principles Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers and stand the test of time. When to Use This Skill Designing new REST or GraphQL APIs Refactoring existing APIs for better usability Establishing API design standards for your team Reviewing API specifications before implementation Migrating between API paradigms (REST to GraphQL, etc.) Creating developer-friendly API documentation Optimizing APIs for specific use cases (mobile, third-party integrations) Core Concepts 1. RESTful Design Principles Resource-Oriented Architecture Resources are nouns (users, orders, products), not verbs Use HTTP methods for actions (GET, POST, PUT, PATCH, DELETE) URLs represent resource hierarchies Consistent naming conventions HTTP Methods Semantics: GET : Retrieve resources (idempotent, safe) POST : Create new resources PUT : Replace entire resource (idempotent) PATCH : Partial resource updates DELETE : Remove resources (idempotent) 2. GraphQL Design Principles Schema-First Development Types define your domain model Queries for reading data Mutations for modifying data Subscriptions for real-time updates Query Structure: Clients request exactly what they need Single endpoint, multiple operations Strongly typed schema Introspection built-in 3. API Versioning Strategies URL Versioning: /api/v1/users /api/v2/users Header Versioning: Accept: application/vnd.api+json; version=1 Query Parameter Versioning: /api/users?version=1 Detailed patterns and worked examples Detailed pattern documentation lives in references/details.md . Read that file when the navigation tier above is insufficient. Best Practices REST APIs Consistent Naming : Use plural nouns for collections ( /users , not /user ) Stateless : Each request contains all necessary information Use HTTP Status Codes Correctly : 2xx success, 4xx client errors, 5xx server errors Version Your API : Plan for breaking changes from day one Pagination : Always paginate large collections Rate Limiting : Protect your API with rate limits Documentation : Use OpenAPI/Swagger for interactive docs GraphQL APIs Schema First : Design schema before writing resolvers Avoid N+1 : Use DataLoaders for efficient data fetching Input Validation : Validate at schema and resolver levels Error Handling : Return structured errors in mutation payloads Pagination : Use cursor-based pagination (Relay spec) Deprecation : Use @deprecated directive for gradual migration Monitoring : Track query complexity and execution time Common Pitfalls Over-fetching/Under-fetching (REST) : Fixed in GraphQL but requires DataLoaders Breaking Changes : Version APIs or use deprecation strategies Inconsistent Error Formats : Standardize error responses Missing Rate Limits : APIs without limits are vulnerable to abuse Poor Documentation : Undocumented APIs frustrate developers Ignoring HTTP Semantics : POST for idempotent operations breaks expectations Tight Coupling : API structure shouldn't mirror database schema
Agent 识别该技能的关键词,点击任意一个即可复制。
该技能未提供触发词。
下载的 .skill 包内含以下字段。
| 字段 | 说明 |
|---|---|
| format | 格式标识(skill/v1) |
| skill_id | 技能唯一 ID |
| name | 技能名称 |
| version | 版本号 |
| description | 技能描述 |
| category | 所属分类(数组) |
| trigger_words | 触发词列表 |
| tags | 标签列表 |
| source | 来源标识 |
| source_url | 来源链接(本页地址) |
| exported_at | 导出时间(每次下载生成) |
| system_prompt | 系统提示词正文 |
| model_config | 模型参数:provider / model / temperature / max_tokens / top_p |
| examples | 示例 |
| install_guide | 各平台导入说明(Coze / Dify / Claude / 自定义框架) |