api-docs-writer
Skill22 starsChanged 2 months agoMITView on GitHub
Writes precise, complete reference documentation for HTTP/REST APIs and authors valid OpenAPI 3.1 specifications, including endpoint pages, request/response schemas, parameter tables, authentication, pagination, code samples, and error tables. Use this skill when the user asks to "document an API", "write API reference docs", "create an OpenAPI/Swagger spec", "document these endpoints", "write a REST API reference", "add request/response examples", "document error codes", "describe API parameters", or convert code/routes into API documentation.
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use it for two distinct deliverables:
- Distinctive: line 18
Prefer generating the OpenAPI spec first, then deriving Markdown from it, when both are requested.
- Distinctive: line 21
Follow these steps in order.
- Very specific: line 27
Choose the deliverable: If the user wants a spec, scaffold OpenAPI 3.1 (see references/openapi-3.1-reference.md and …
- Distinctive: line 29
Document each endpoint: Write the summary (imperative, one line), description (behavior, side effects, constraints), parameter tables, …
- Very specific: line 37
Validate: If you produced an OpenAPI file, run scripts/validate_openapi.py path/to/spec.yaml to catch structural errors before delivering.
- Distinctive: line 55
Always use this column order:
- Distinctive: line 62
Use a single consistent shape unless the API dictates otherwise:
- Distinctive: line 75
Document the envelope once, then reference it from each error table.
- Distinctive: line 78
Document the actual behavior, not the intended behavior — verify against code or live calls.
- Very specific: line 79
Use stable, machine-readable error code strings.
- Distinctive: line 85
Keep summaries imperative and under ~60 chars.
- Distinctive: line 86
Document idempotency and side effects for every non-GET endpoint.
- Very specific: line 95
Not specifying the content type (application/json vs multipart/form-data).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Docs Writer
Overview
This skill produces production-quality API reference documentation and OpenAPI 3.1 specifications. It covers endpoint reference pages, parameter/field tables, authentication, pagination, rate limits, request/response examples in multiple languages, and complete error tables.
Keywords: API documentation, REST reference, OpenAPI, Swagger, endpoint docs, request schema, response schema, error codes, curl example, parameter table, authentication docs.
Use it for two distinct deliverables:
- Human-readable reference docs (Markdown) — one page per resource or endpoint.
- Machine-readable OpenAPI 3.1 spec (YAML/JSON) — the single source of truth for tooling, SDK generation, and doc portals.
Prefer generating the OpenAPI spec first, then deriving Markdown from it, when both are requested.
Process
Follow these steps in order.
- Gather the source of truth. Identify where the API behavior is defined: route handlers, controllers, framework decorators (Flask/FastAPI/Express/Spring), existing partial specs, Postman collections, or live responses. Never invent fields — read the code or ask. If a detail is unknown, mark it clearly rather than guessing.
- Inventory the surface. For each endpoint capture: HTTP method, path (with
{path_params}), summary, auth requirement, query/path/header params, request body schema, success responses (per status code), error responses, and idempotency. Usereferences/extraction-checklist.mdto avoid omissions. - Choose the deliverable. If the user wants a spec, scaffold OpenAPI 3.1 (see
references/openapi-3.1-reference.mdandtemplates/openapi-skeleton.yaml). If they want a reference page, usetemplates/endpoint-reference.md. - Document each endpoint. Write the summary (imperative, one line), description (behavior, side effects, constraints), parameter tables, request body, and responses. Every parameter row must state: name, in (path/query/header/cookie), type, required, default, constraints, description.
- Add examples. Provide at least a
curlexample and one realistic JSON request/response pair per endpoint. Use real-looking values, neverfoo/bar. Show the exact status code. Seereferences/style-guide.mdfor example conventions. - Document errors. Build a per-endpoint error table AND a global error reference. Each row: HTTP status, machine-readable
code, when it occurs, and how to fix. Reuse a consistent error envelope. - Document cross-cutting concerns. Authentication, pagination, rate limiting, versioning, idempotency keys, and content types. Document these once in shared sections and link to them.
- Validate. If you produced an OpenAPI file, run
scripts/validate_openapi.py path/to/spec.yamlto catch structural errors before delivering. Fix every reported issue. - Self-review against
references/extraction-checklist.mdand the Common Pitfalls list below.
Endpoint documentation structure
Each endpoint page should contain, in order:
- Title:
METHOD /path - One-line summary + auth badge (e.g.
Requires: Bearer token) - Description (behavior, side effects, when to use)
- Path parameters table
- Query parameters table
- Request headers table (only non-standard ones)
- Request body: schema table + example
- Responses: one block per status code with schema + example
- Errors: table specific to this endpoint
- Code samples (curl + at least one SDK/language)
Parameter table format
Always use this column order:
| Name | In | Type | Required | Default | Constraints | Description |
limit | query | integer | No | 20 | 1–100 | Max items per page. |
Error envelope (recommended default)
Use a single consistent shape unless the API dictates otherwise:
{
"error": {
"code": "resource_not_found",
"message": "No user exists with id 'usr_123'.",
"details": [],
"request_id": "req_8f2c1a"
}
}Document the envelope once, then reference it from each error table.
Best Practices
- Document the actual behavior, not the intended behavior — verify against code or live calls.
- Use stable, machine-readable error
codestrings; HTTP status alone is not enough. - Make every example copy-paste runnable. Include the base URL and a placeholder token format like
Bearer sk_test_.... - Reuse schemas via
$ref/components.schemasin OpenAPI; never copy a schema twice. - Show pagination with a concrete example of fetching page 2.
- State default values, units (ms, bytes, ISO-8601), and timezones explicitly.
- Mark deprecated fields/endpoints with the reason and the replacement.
- Keep summaries imperative and under ~60 chars; put detail in the description.
- Document idempotency and side effects for every non-GET endpoint.
Common Pitfalls
- Inventing fields or status codes that the code does not produce.
- Missing the error responses (only documenting the happy path).
- Forgetting
requiredvs optional, or omitting defaults. - Using
foo/bar/stringplaceholders instead of realistic values. - Mixing
200and201without saying which operation returns which. - OpenAPI: putting examples in the wrong place, missing
requestBody.required, or referencing undefined$refs. - Not specifying the content type (
application/jsonvsmultipart/form-data). - Documenting auth in each endpoint instead of one shared section + per-endpoint badge.
Supporting files
references/openapi-3.1-reference.md— OpenAPI 3.1 structure, field semantics, schema patterns, security schemes, and reusable components.references/style-guide.md— voice, examples, naming, and formatting conventions.references/extraction-checklist.md— what to capture per endpoint; use as a final review gate.templates/endpoint-reference.md— fill-in Markdown template for one endpoint.templates/openapi-skeleton.yaml— minimal valid OpenAPI 3.1 starting point.scripts/validate_openapi.py— stdlib validator for common OpenAPI mistakes.examples/users-api.md— a complete worked example (input routes -> reference page + spec excerpt).
Other versions2 projects use a version of this.
Word for word · 2
- JayRHa/agent-skills★ 12100% same
- JayRHa/AgentSkills★ 12100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository194 other files it gives its agents.
- 0-templateSkill
- ab-test-analyzerSkill
- academy-guideSkill
- add-to-my-skillsSkill
- adr-authorSkill
- ai-tools-setupSkill
- algorithmic-artSkill
- api-and-interface-designSkill
- api-designerSkill
- apple-store-submitSkill
- aws-cost-optimizerSkill
- bash-script-hardeningSkill
- blog-post-writerSkill
- book-summarizerSkill
- branch-cleanupSkill
- brand-copy-landingSkill
- brand-copySkill
- brand-designSkill
- brand-guidelinesSkill
- browser-testing-with-devtoolsSkill
- canvas-designSkill
- changelog-generatorSkill
- changelog-keeperSkill
- chart-chooserSkill
- ci-cd-and-automationSkill
- ci-fix-loopSkill
- claude-apiSkill
- cloudflare-block-countriesSkill
- coderabbitloopSkill
- code-review-and-qualitySkill
- code-reviewerSkill
- code-simplificationSkill
- codexloopSkill
- comms-notionSkill
- comms-slackSkill
- comms-whatsappSkill
- competitive-analysisSkill
- concept-explainerSkill
- constraint-driven-developmentSkill
- context-engineeringSkill
- context-repoSkill
- cover-letter-writerSkill
- crash-courseSkill
- cron-schedulerSkill
- data-digestSkill
- data-pipeline-architectSkill
- debug-detectiveSkill
- debugging-and-error-recoverySkill
- decision-matrixSkill
- dependabot-triageSkill
- dependency-upgraderSkill
- deprecation-and-migrationSkill
- dev-instantdbSkill
- discernment-nudgeSkill
- doc-coauthoringSkill
- dockerfile-proSkill
- docs-index-keeperSkill
- documentation-and-adrsSkill
- docxSkill
- doubt-driven-developmentSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

