用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill rest-api-design命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | rest-api-design |
| description | >- Use when this capability is needed. |
Guide design and review of HTTP JSON APIs that follow REST-oriented conventions. Combine checklist-driven feedback with actionable recommendations.
If the user needs test cases for an existing endpoint, prefer the separate api-test-scenario-generator skill. This skill focuses on shape, semantics, and documentation of the API itself.
Use for requests such as:
Optional: if the workspace has a documentation MCP, you may use it for framework-specific snippets; this skill does not require any MCP.
Inputs (any combination):
Outputs:
/, avoid verbs in URLs. Prefer shallow paths; use query filters instead of deep nesting when possible (/nodes?flowsheetId= vs four-level paths)./v1/, /v2/). Avoid versioning only via query or ad-hoc headers as the sole mechanism.For anti-patterns, troubleshooting tables, production checklist, and Swagger/OpenAPI checklist detail, read references/detail.md when producing a full review.
# Collections (plural nouns)
GET /users
POST /users
GET /users/{id}
PUT /users/{id}
PATCH /users/{id}
DELETE /users/{id}
# Nested resources (keep shallow)
GET /users/{id}/posts
POST /users/{id}/posts
# Prefer not: /getUsers, /createUser, /user (singular collection)
| Method | Typical use | Idempotent |
|---|---|---|
| GET | Read | Yes |
| POST | Create, actions | No |
| PUT | Replace full resource | Yes |
| PATCH | Partial update | Yes |
| DELETE | Remove | Yes |
| Code | Meaning | Typical use |
|---|---|---|
| 200 | OK | Successful GET, PUT, PATCH |
| 201 | Created | Successful POST creating a resource |
| 204 | No Content | Successful DELETE or empty success |
| 400 | Bad Request | Malformed request, generic client error |
| 401 | Unauthorized | Missing or invalid auth |
| 403 | Forbidden | Authenticated but not allowed |
| 404 | Not Found | Resource missing |
| 409 | Conflict | State conflict, duplicate |
| 422 | Unprocessable | Validation / semantic error (common convention) |
| 429 | Too Many Requests | Rate limited |
| 500 | Server Error | Unexpected server failure |
Use 4xx for client-fixable issues and 5xx only for server-side failures. Do not return 200 with an error payload for failed operations.
Prefer a consistent envelope so clients can parse predictably:
{
"data": { "id": 1, "name": "Example" },
"meta": { "timestamp": "2024-01-15T10:00:00Z" }
}
For collections, include pagination metadata in meta (or a documented top-level object) consistent with your pagination strategy.
Errors (illustrative; align with your standard and RFC 9457 where applicable):
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [{ "field": "email", "message": "Invalid format" }]
}
}
GET /users?status=active&sort=-createdAt&page=1&pageSize=20
GET /users?fields=id,name,email
GET /products?category=electronics&price_lt=100
Document filter operators if you use suffixes like _lt, _gt, etc.
cursor, limit, nextCursor / hasMore in response.page, pageSize with totalItems, totalPages in the response.Validate page ≥ 1 and pageSize within min/max; return clear error messages for out-of-range pagination (see detail reference).
2024-09-15T08:00:00Z).Source: dneprokos/skills-examples — distributed by TomeVault.