用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill api-design命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | api-design |
| description | REST/GraphQL design — naming, status codes, pagination, idempotency. |
/users, /orders, not /getUsers, /createOrder/products, /invoices/fuel-types, /gas-stations/users/{id}/orders/orders?userId=X| Method | Semantics | Idempotent | Safe |
|---|---|---|---|
| GET | Read resource(s) | Yes | Yes |
| POST | Create resource | No | No |
| PUT | Replace resource entirely | Yes | No |
| PATCH | Partial update | No | No |
| DELETE | Remove resource | Yes | No |
| Code | When to use |
|---|---|
| 200 OK | Successful GET, PUT, PATCH |
| 201 Created | Successful POST that created a resource |
| 204 No Content | Successful DELETE or action with no response body |
| 400 Bad Request | Invalid input, validation error |
| 401 Unauthorized | Not authenticated |
| 403 Forbidden | Authenticated but not authorized |
| 404 Not Found | Resource does not exist |
| 409 Conflict | State conflict (duplicate, optimistic lock) |
| 422 Unprocessable Entity | Syntactically valid but semantically invalid |
| 429 Too Many Requests | Rate limit exceeded |
| 500 Internal Server Error | Unexpected server failure |
All responses use a consistent envelope:
{ "status": "success", "data": { ... } }
{
"status": "error",
"message": "Human-readable summary",
"code": "MACHINE_READABLE_CODE",
"details": [
{ "field": "email", "message": "must be a valid email address" }
]
}
status: "success" or "error" — always presentdata: payload on success; omitted on errormessage: human-readable description of the errorcode: machine-readable identifier in SCREAMING_SNAKE_CASEdetails: optional array of field-level validation errorsFor list endpoints, always paginate:
{
"status": "success",
"data": {
"items": [...],
"meta": {
"total": 150,
"per_page": 20,
"current_page": 1,
"last_page": 8
}
}
}
Use cursor-based pagination for large datasets or real-time feeds.
Use query parameters:
GET /orders?status=active&sort=created_at&direction=desc
GET /products?category=fuel&min_price=10&max_price=50
Use URL prefix versioning — never header-based versioning:
/api/v1/users
/api/v2/users
Deprecation and Sunset response headersGET, PUT, DELETE must be idempotent — repeated calls with the same payload produce the same resultPOST is not idempotent by defaultIdempotency-Key request header:
POST submissions when relevant (e.g., order placement, account creation)Retry-After headerWhen the project exposes a GraphQL API, load
skills/architecture/graphql/SKILL.mdfor the full reference. The rules below are always active.
.graphql schema files before implementing resolversPascalCase: UserProfile, OrderItemcamelCase: firstName, totalAmountuserById, activeOrderscreateUser, updateOrderStatus, deleteProductBoolean aloneinput types for mutation arguments: CreateUserInput, UpdateProductInputedges, node, pageInfo)errors alongside data in mutation payloads (not via HTTP 4xx):type UpdateUserPayload {
user: User
errors: [UserError!]!
}
Document every endpoint with:
POST /api/v1/usersGenerate OpenAPI 3.0 spec for machine-readable documentation.