Generate API reference documentation from code, OpenAPI specs, or endpoint implementations.
npx claudepluginhub hpsgd/turtlestack --plugin developer-docs-writerThis skill is limited to using the following tools:
Generate API documentation for $ARGUMENTS using the mandatory process and structure below.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
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_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Smith",
"email": "jane@example.com",
"role": "member"
}'
\`\`\`
### Notes
[Any caveats, side effects, or important behaviour — e.g., "Creating a user sends a welcome email" or "Deleted users are soft-deleted and can be restored within 30 days"]
---
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 endpoint has a curl example | Can a developer copy-paste and get a response? |
| 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 |
| Error responses are documented | At least the most common error for each endpoint |
| 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.