api-docs-from-openapi
Skill0 starsChanged 5 months agoMITView on GitHub
Use when the user wants to convert an OpenAPI (Swagger) spec into Markdown reference documentation. Triggers on "generate docs from this OpenAPI", "convert this swagger to markdown", "make API reference from spec", or when the user shares an OpenAPI 3.x file and asks for human-readable docs.
In this repository7 other files it gives its agents.
- changelog-writerSkill
- code-review-preflightSkill
- csv-cleanerSkill
- json-schema-from-sampleSkill
- meeting-notes-summarizerSkill
- regex-builderSkill
- sql-from-questionSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Verify it's OpenAPI 3.x. If 2.0 (Swagger), ask whether to upgrade conceptually or stop and recommend a converter.
- Very specific: line 35
Group endpoints by tag: If no tags, group by path prefix (/users/*, /orders/*).
- Very specific: line 88
Generate sample request/response bodies from the schemas: Don't leave {...} placeholders.
- Distinctive: line 101
Default to a single Markdown file.
- Distinctive: line 107
Spec has 50+ endpoints: ask if the user wants per-tag files or one big file.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 from OpenAPI
Convert an OpenAPI 3.x spec into clean Markdown reference docs.
Process
Confirm the spec. Accept either:
- Pasted YAML or JSON
- A file path
- A URL (only fetch if user explicitly says to)
Verify it's OpenAPI 3.x. If 2.0 (Swagger), ask whether to upgrade conceptually or stop and recommend a converter.
- Top-of-doc structure:
# {info.title} {info.description} **Version:** {info.version} **Base URL:** {servers[0].url} ## Authentication {auth section based on securitySchemes} ## Endpoints ... - Group endpoints by tag. If no tags, group by path prefix (
/users/*,/orders/*). For each endpoint:
### `{METHOD} /path` {summary} {description, if more detailed than summary} **Path parameters** | Name | Type | Required | Description | |---|---|---|---| | id | string | yes | The user ID | **Query parameters** (only if any; same table format) **Request body** (if any) - Content-Type: `application/json` - Schema: `User` (link to schema section) ```json {sample request body}Responses
200 OK-- {description}{sample response body}400 Bad Request-- {description}404 Not Found-- {description}Schemas section at the end. For each named schema:
### `User` {description} | Field | Type | Required | Description | |---|---|---|---| | id | string (uuid) | yes | Unique identifier | | email | string (email) | yes | Contact email | | created_at | string (date-time) | yes | ISO 8601 timestamp |- Generate sample request/response bodies from the schemas. Don't leave
{...}placeholders. Use realistic example values ("John Doe", valid UUIDs, recent dates). - Cross-link. Schema references in tables become Markdown links to the schema section.
What NOT to do
- MUST NOT include the entire raw spec in the output. The user wanted prose; they have the spec already.
- MUST NOT invent endpoints, parameters, or behavior not in the spec. If the spec is sparse, the docs will be sparse -- note that.
- MUST NOT generate sample values that look like real PII (real-looking names, real email addresses, real-looking SSNs).
- MUST NOT silently omit deprecated endpoints. Mark them:
### \POST /old-thing` (warning) Deprecated`. (Use the word "Deprecated", not an emoji, in the actual output.)
Output format
Default to a single Markdown file. Offer to split per-tag if the result exceeds ~1000 lines.
Edge cases
- Spec has no
examples: generate plausible ones from the schema. Mark sample values clearly so the user knows they're synthetic. - Spec uses
oneOf/anyOf: render as "One of:" with sub-bullets. Don't pick one arbitrarily. - Spec has 50+ endpoints: ask if the user wants per-tag files or one big file.
- Authentication uses multiple schemes: list each, indicate which endpoints use which.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

