agentleFS
0xelitesystem0xelitesystem/claude-skills-collection/skills/api-docs-from-openapi/SKILL.md

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.

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
  1. Distinctive:

    Verify it's OpenAPI 3.x. If 2.0 (Swagger), ask whether to upgrade conceptually or stop and recommend a converter.

    line 17
  2. Very specific:

    Group endpoints by tag: If no tags, group by path prefix (/users/*, /orders/*).

    line 35
  3. Very specific:

    Generate sample request/response bodies from the schemas: Don't leave {...} placeholders.

    line 88
  4. Distinctive:

    Default to a single Markdown file.

    line 101
  5. Distinctive:

    Spec has 50+ endpoints: ask if the user wants per-tag files or one big file.

    line 107

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

API Docs from OpenAPI

Convert an OpenAPI 3.x spec into clean Markdown reference docs.

Process

  1. 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.

  2. Top-of-doc structure:
    # {info.title}
    
    {info.description}
    
    **Version:** {info.version}
    **Base URL:** {servers[0].url}
    
    ## Authentication
    {auth section based on securitySchemes}
    
    ## Endpoints
    ...
  3. Group endpoints by tag. If no tags, group by path prefix (/users/*, /orders/*).
  4. 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}

  5. 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 |
  6. Generate sample request/response bodies from the schemas. Don't leave {...} placeholders. Use realistic example values ("John Doe", valid UUIDs, recent dates).
  7. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.