一键导入
api-design
Design RESTful APIs with proper resource modeling, error handling, pagination, and documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Design RESTful APIs with proper resource modeling, error handling, pagination, and documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design system architecture, data models, API contracts, and create Architecture Decision Records (ADRs)
Implement backend functionality including APIs, business logic, database operations, and integrations
Comprehensive code review checking for security, performance, maintainability, and best practices
Prepare deployment configuration, environment setup, health checks, and rollback procedures
Implement frontend user interfaces with modern frameworks, responsive design, and accessibility standards
Perform comprehensive security audits checking for OWASP Top 10 vulnerabilities and security best practices
| name | api-design |
| description | Design RESTful APIs with proper resource modeling, error handling, pagination, and documentation |
| allowed-tools | Read, Write, Edit, Glob, Grep |
Design clean, consistent, and developer-friendly APIs.
/users, /ordersGET /api/v1/users # List users
POST /api/v1/users # Create user
GET /api/v1/users/:id # Get user
PUT /api/v1/users/:id # Update user
DELETE /api/v1/users/:id # Delete user
GET /api/v1/users/:id/orders # Nested resource
{
"data": { ... },
"meta": {
"timestamp": "2025-01-01T00:00:00Z"
}
}
{
"data": [ ... ],
"meta": {
"page": 1,
"per_page": 20,
"total": 100,
"total_pages": 5
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{ "field": "email", "message": "Invalid email format" }
]
}
}
| Code | Use Case |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (DELETE) |
| 400 | Bad Request (validation) |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict |
| 429 | Rate Limited |
| 500 | Internal Error |
Always paginate list endpoints:
GET /api/v1/users?page=1&per_page=20
GET /api/v1/users?cursor=abc123&limit=20
GET /api/v1/users?status=active
GET /api/v1/users?sort=created_at&order=desc
GET /api/v1/users?search=john
Include headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1609459200
Use URL versioning: /api/v1/, /api/v2/
## [METHOD] /api/v1/[resource]
**Description**: [What it does]
**Auth**: Bearer token required
### Request
**Headers**:
- Authorization: Bearer {token}
- Content-Type: application/json
**Body**:
```json
{ "field": "value" }
200 OK:
{ "data": { ... } }