Optimizes AI skills for activation, clarity, and cross-model reliability. Use when creating or editing skill packs, diagnosing weak skill uptake, reducing regressions, tuning instruction salience, improving examples, shrinking context cost, or setting benchmark and release gates for skills. Trigger terms: skill optimization, activation gap, benchmark skill, with/without skill delta, regression, context budget, prompt salience.
87
87%
Does it follow best practices?
Impact
87%
1.14xAverage score across 5 eval scenarios
Passed
No known issues
The developer experience team at Cloudform maintains a skill called api-doc-writer that helps models write consistent API reference documentation. Over the past year the skill has grown from a concise 2-page guide into a sprawling 8-page document with repeated explanations, overlapping examples, and extended rationale paragraphs that nobody reads. Eval scores haven't improved with any of the additions, and the context budget is now a real concern — on long prompts, the skill is being dropped from context early due to its size.
A senior engineer has asked you to conduct a context-budget audit and produce a leaner version of the skill. The goal is to cut token count substantially while preserving all the behaviors that actually move eval metrics. You should also restructure the file so it follows a layered approach, with a high-signal top-level entry point and detailed supporting material separated from it.
Produce your output as actual skill files, not just a plan.
Produce:
SKILL-trimmed.md — the new lean top-level entry pointrules/endpoint-format.md — detailed procedure for endpoint documentation formatrules/error-codes.md — detailed procedure for error code documentationaudit-notes.md — a brief record of what you cut and why, and what you chose to keepThe following files are provided as inputs. Extract them before beginning.
Writing good API documentation is important for developer experience. When developers visit your API docs they need to be able to quickly understand what an endpoint does, what parameters it accepts, what it returns, and what errors they might encounter. Good documentation reduces support burden and increases adoption. This guide will help you write documentation that meets the standards of modern developer portals.
Good API documentation is:
These properties are important because developers use docs as a reference, not a tutorial.
Use this skill when you see: REST endpoint, OpenAPI, API reference, endpoint documentation, parameter description, response schema, error code table.
Every endpoint must be documented with:
GET /users/{id})The parameters table format:
| Name | Type | Required | Description |
|---|
The errors table format:
| Code | Meaning | Notes |
|---|
This format is important because consistency reduces cognitive load for developers scanning multiple endpoints.
Parameter descriptions should be written in present tense. They should explain what the parameter does, not just its type. For example, instead of "string", write "The user's email address, used for login." You may also want to include constraints (e.g. max length, allowed values).
Parameters should be listed required-first, then optional. This makes the most important information visible first.
The format for required parameters is different from optional ones: required parameters should be marked clearly in the Required column, while optional ones can be left blank or marked "optional".
Always include a realistic response example, not just a schema. The example should use plausible values, not placeholder text like "string" or "123".
Realistic examples help developers understand what to expect in production. Placeholder responses are common but bad practice.
Remember: response examples should match the actual response format. If the API returns snake_case keys, use snake_case in the example.
Every documented endpoint must include an error table. Common error codes to document:
Not every endpoint will return every error code — only document the ones that actually apply to the endpoint you're documenting.
Documenting errors is important because developers need to handle errors gracefully in their integrations. Undocumented errors lead to poor error handling and confusing user experiences.
Here is an example of a well-documented endpoint:
Returns a user by their unique identifier.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique identifier of the user |
Response:
{
"id": "usr_abc123",
"email": "alice@example.com",
"created_at": "2024-01-15T10:30:00Z"
}Errors:
| Code | Meaning | Notes |
|---|---|---|
| 401 | Unauthorized | Token missing or expired |
| 404 | Not Found | User with given ID does not exist |
Here is another example of a well-documented endpoint:
Creates a new user account.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | The user's email address, used for login | |
| password | string | Yes | The user's password (min 8 characters) |
| name | string | No | Display name shown in the UI |
Response:
{
"id": "usr_def456",
"email": "bob@example.com",
"name": "Bob",
"created_at": "2024-03-01T09:00:00Z"
}Errors:
| Code | Meaning | Notes |
|---|---|---|
| 400 | Bad Request | Required field missing |
| 422 | Unprocessable Entity | Email already in use or invalid format |
Here is a third example showing a DELETE endpoint:
Deletes a user and all associated data.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique identifier of the user to delete |
Response:
{
"deleted": true,
"id": "usr_abc123"
}Errors:
| Code | Meaning | Notes |
|---|---|---|
| 401 | Unauthorized | Token missing or expired |
| 403 | Forbidden | Cannot delete another user's account |
| 404 | Not Found | User with given ID does not exist |
Keep your documentation up to date as the API evolves. Stale docs are worse than no docs. You may want to set up a process to review docs on each API change. It's generally a good idea to have someone other than the implementer review the documentation for clarity.
Writing good docs takes practice. The more you write, the better you'll get. Don't be discouraged if early drafts need revision.