用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/hpsgd/turtlestack --skill write-api-docs命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Review staged or recent changes — native Claude Code review for mechanics, layered with team conventions and the team verdict contract
Perform a security-focused audit of code changes or a specific area of the codebase.
Propose a change to a marketplace repo based on learned patterns — new rules, updated skills, evolved regex patterns. Infers which upstream marketplace the learning belongs to, confirms with the user, then creates a branch, applies changes, shows diff for review, and raises a PR on approval. Use when patterns have enough evidence to share upstream.
基于 SOC 职业分类
正在显示 SKILL.md
| name | write-api-docs |
| description | Generate API reference documentation from code, OpenAPI specs, or endpoint implementations. |
| argument-hint | [API file, directory, or OpenAPI spec path] |
| user-invocable | true |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Generate API documentation for $ARGUMENTS using the mandatory process and structure below.
Scan the codebase to find every API endpoint:
Grep to find route definitions (e.g., router.get, @app.route, @GetMapping, endpoint annotations)Glob to find controller files, route files, or OpenAPI specsBuild a complete endpoint inventory before writing anything.
Group endpoints by resource (the noun), not by HTTP method. This is how developers think about APIs.
/users endpoints together (GET list, GET by ID, POST create, PUT update, DELETE)Determine the resource hierarchy:
/users
/users/{id}
/users/{id}/projects
/users/{id}/projects/{projectId}
This hierarchy becomes the documentation structure.
Every API document starts with these sections:
Production: https://api.example.com/v1
Staging: https://api-staging.example.com/v1
State the versioning strategy (path-based /v1/, header-based, query parameter).
Document every authentication method the API supports:
#### Bearer token
Include the token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN
Obtain a token by: [exact steps or link]
Token expiration: [duration]
Token refresh: [procedure]
#### API key
Include the key as a header:
X-API-Key: YOUR_API_KEY
Obtain a key from: [exact location in dashboard]
Key permissions: [what different key types can access]
For each auth method, specify:
Rate limit: [N] requests per [period]
Header: X-RateLimit-Remaining (requests left in current window)
Header: X-RateLimit-Reset (Unix timestamp when window resets)
Exceeded response: 429 Too Many Requests
If rate limits differ by plan or endpoint, document the tiers.
Document the pagination pattern used. Pick the one that matches:
Offset-based:
GET /resources?offset=20&limit=10
Response:
{
"data": [...],
"total": 153,
"offset": 20,
"limit": 10
}
Cursor-based:
GET /resources?cursor=abc123&limit=10
Response:
{
"data": [...],
"next_cursor": "def456",
"has_more": true
}
State:
Document the standard error response structure:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Human-readable description",
"details": [
{
"field": "email",
"message": "Must be a valid email address"
}
]
}
}
| HTTP Status | Error Code | Meaning | Common cause |
|---|---|---|---|
| 400 | VALIDATION_ERROR | Request body or parameters are invalid | Missing required field, wrong type |
| 401 | UNAUTHORIZED | Authentication failed or missing | Expired token, missing header |
| 403 | FORBIDDEN | Authenticated but insufficient permissions | Wrong role, resource belongs to another user |
| 404 | NOT_FOUND | Resource does not exist | Wrong ID, deleted resource |
| 409 | CONFLICT | Request conflicts with current state | Duplicate email, concurrent edit |
| 422 | UNPROCESSABLE_ENTITY | Request is well-formed but semantically invalid | Business rule violation |
| 429 | RATE_LIMITED | Too many requests | Exceeded rate limit |
| 500 | INTERNAL_ERROR | Server error | Bug — contact support |
Populate this table with the actual error codes from the codebase.
Use this exact template for every endpoint:
---
## [Action description]
[One sentence describing what this endpoint does and when to use it.]
[METHOD] [path]
### Authentication
[Required auth level — e.g., "Requires Bearer token with `read:users` scope"]
### Path parameters
| Parameter | Type | Description |
|---|---|---|
| `id` | string (UUID) | The user's unique identifier |
### Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `status` | string | No | `active` | Filter by status. One of: `active`, `inactive`, `suspended` |
| `limit` | integer | No | 20 | Number of results per page (max: 100) |
### Request body
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | Yes | User's display name (1-100 characters) |
| `email` | string | Yes | Valid email address. Must be unique. |
| `role` | string | No | One of: `admin`, `member`, `viewer`. Default: `member` |
**Example request body:**
\`\`\`json
{
"name": "Jane Smith",
"email": "jane@example.com",
"role": "member"
}
\`\`\`
### Response
**Success: `201 Created`**
\`\`\`json
{
"id": "usr_abc123",
"name": "Jane Smith",
"email": "jane@example.com",
"role": "member",
"created_at": "2025-01-15T09:30:00Z"
}
\`\`\`
**Errors:**
| Status | Code | When |
|---|---|---|
| 400 | `VALIDATION_ERROR` | Missing required field or invalid format |
| 409 | `CONFLICT` | Email already in use |
### Example
\`\`\`bash
curl -X POST https://api.example.com/v1/users \
-H "Authorization: Bearer YOUR
Rules for endpoint documentation:
active, inactive, suspended.""string" or "foo".Document the relationship: "A Project belongs to a User. You must provide the user ID in the path."
If the API supports bulk create/update/delete, document:
If the API sends webhooks, document:
If any endpoint accepts file uploads, document:
multipart/form-data or binary body| Check | Requirement |
|---|---|
| Every curl example was actually run | Record the response body next to the example. Untested examples do not pass this check. |
| Every documented error response has a worked example | Show the request that triggers each error and paste the actual error body returned |
| Every parameter has a type | No untyped parameters |
| Every enum lists all values | No "valid value" without the list |
| Response examples use realistic data | No "string" or "test" placeholder values |
| Auth requirements are stated per endpoint | Not just in the overview |
| Pagination is documented | For every list endpoint |
The output is one instance of the endpoint template from Step 4 per endpoint, wrapped by the overview sections from Step 3. See Step 3 and Step 4 above for the exact structure.
/developer-docs-writer:write-sdk-guide — for SDK-level documentation that wraps the API. Write the API reference first, then the SDK guide./developer-docs-writer:write-integration-guide — for step-by-step integration tutorials that use the API.