用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill api-development-expert命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | api-development-expert |
| description | API development expert including REST design, OpenAPI, and documentation |
| version | 1.0.0 |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Write","Edit","Bash","Grep","Glob"] |
| consolidated_from | 1 skills |
| best_practices | ["Follow domain-specific conventions","Apply patterns consistently","Prioritize type safety and testing"] |
| error_handling | graceful |
| streaming | supported |
When designing REST APIs, follow these core architectural principles:
Resource-Oriented Design
/users, /products, /orders/getUsers, /createProduct/users/{userId}/orders (orders belonging to a user)/product-details not /productdetails/users not /users/HTTP Methods (Verbs with Purpose)
GET - Retrieve resources (idempotent & safe, no side effects)POST - Create new resources (not idempotent, returns 201 Created with Location header)PUT - Replace entire resource or upsert (idempotent)PATCH - Partial update (not idempotent, use application/json-patch+json)DELETE - Remove resource (idempotent, returns 204 No Content or 200 OK)Query Parameters for Filtering, Sorting, and Pagination
/products?category=electronics&price_gt=100/products?sort_by=price&order=desc/products?page=2&limit=10
Choose one and stick to it:
/v1/users, /api/v2/products
Accept: application/vnd.myapi.v1+jsonUse OpenAPI 3.0+ to define your API specification:
Benefits:
Define schemas for:
Example: Define validation rules so invalid requests are caught before reaching your backend
Protect against abuse and ensure fair usage:
Implementation strategies:
429 Too Many Requests status codeX-RateLimit-Limit: 1000X-RateLimit-Remaining: 999X-RateLimit-Reset: 1640000000Consistent Error Response Structure:
{
"error": {
"code": "validation_error",
"message": "Input validation failed.",
"details": [{ "field": "email", "message": "Invalid email format." }]
}
}
Use Appropriate HTTP Status Codes:
2xx Success: 200 OK, 201 Created, 204 No Content
3xx Redirection: 301 Moved Permanently, 304 Not Modified
4xx Client Error:
400 Bad Request - General client error401 Unauthorized - Authentication missing/failed403 Forbidden - Authenticated but no permission404 Not Found - Resource doesn't exist405 Method Not Allowed - Invalid HTTP method409 Conflict - Resource already exists422 Unprocessable Entity - Semantic validation error429 Too Many Requests - Rate limiting5xx Server Error:
500 Internal Server Error - Generic server error503 Service Unavailable - Service temporarily downProvide machine-readable codes AND human-readable messages
OAuth 2.1 (Industry standard for delegated authorization)
JWT (JSON Web Tokens) for stateless authentication:
API Keys for simpler integrations:
HTTP Caching Headers:
Cache-Control: max-age=3600 - Cache for 1 hourETag - Entity tag for conditional requestsExpires - Absolute expiration time304 Not Modified - Return for unchanged resourcesCaching strategies:
Optimization techniques:
?fields=id,name)202 Accepted with status endpointComprehensive documentation must include:
Use tools:
This expert skill consolidates 1 individual skills:
Before starting:
cat .claude/context/memory/learnings.md
After completing: Record any new patterns or exceptions discovered.
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.