Skip to content

API Doc Generator

Writes API docs, OpenAPI specs and usage examples from source code.

Stars
46,401
Licence
MIT
Files
2 files

What it does

When installed, the agent follows a fixed template for documenting API endpoints: description, parameter table, success and error responses, and cURL, JavaScript and Python examples. It can also produce OpenAPI/Swagger specs, SDK usage examples, integration guides and error code references. A bundled Python script parses source files with Python's built-in ast module to find functions whose names start with get_ or post_, collects their docstrings, parameters and return annotations, and writes them out as a basic Markdown document.

Great for

  • Backend developers who need reference docs for an internal or public REST API
  • Teams that want a first draft of OpenAPI specs or endpoint documentation to edit by hand
  • Developers writing SDK examples or authentication guides

Skip it if

  • Projects that need accurate docs for real endpoints without review: the examples in the template are illustrative and the agent may invent response shapes or routes not present in the code
  • Non-Python codebases: the bundled script only parses Python and only picks up functions named get_ or post_, so it will miss most endpoints in frameworks that use other naming or decorators

Try asking

  • “Create API documentation for the user endpoints in this project”
  • “Generate an OpenAPI spec from my Flask routes”
  • “Write cURL, JavaScript and Python examples for the orders API”
  • “Build an error code reference and an authentication guide for our REST API”
Step-by-step guide: how to use API Doc GeneratorInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    doc-generator.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip doc-generator.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip doc-generator.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Point the agent at the actual route definitions and handler code so it documents real endpoints rather than guessing.
  • Review every generated example and response against the running API before publishing, since the template's sample data is illustrative.
  • The script's output is a rough extraction; ask the agent to refine it into the full endpoint structure for a polished result.

What's inside

  • generate-docs.py
  • SKILL.md

Redistributed unmodified from luongnv89/claude-howto under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.