Use when when you have a Python package with docstrings in the source
Scanned 9/12/2026
Install to Claude Code
npx -y skills add HolobiomicsLab/asb-skill-collections --skill api-documentation-automation --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Api Documentation Automation?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/holobiomicslab-api-documentation-automation)More formats (shields.io, HTML) on the badges page.
---
name: api-documentation-automation
description: Use when when you have a Python package with docstrings in the source
code and need to generate comprehensive, browsable HTML API documentation.
license: CC-BY-4.0
metadata:
edam_operation: http://edamontology.org/operation_3763
edam_topics:
- http://edamontology.org/topic_0081
- http://edamontology.org/topic_3372
tools:
- pip
- Sphinx
- sphinx-apidoc
license_tier: open
provenance_tier: literature
derived_from:
- doi: 10.1038/s41587-025-02663-3
title: DreaMS
evidence_spans:
- pip install -r requirements.txt
claims: []
provenance:
collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v2
assembled_by: scripts/collect_metabolomics_collection.py
sources:
- build: coll_dreams_cq
doi: 10.1038/s41587-025-02663-3
title: DreaMS
dedup_kept_from: coll_dreams_cq
schema_version: 0.2.0
attribution:
generator: AgenticScienceBuilder
original_doi: 10.1038/s41587-025-02663-3
all_source_dois:
- 10.1038/s41587-025-02663-3
zenodo_doi: 10.5281/zenodo.20794027
curators: []
promoter: Louis-Félix Nothias
sponsor: CNRS & Université Côte d'Azur
---
# API Documentation Automation
## Summary
Automate the generation of API documentation stubs and HTML browsable outputs from Python source code using Sphinx and sphinx-apidoc. This skill bridges repository source files to machine-readable and human-browsable API reference documentation.
## When to use
When you have a Python package with docstrings in the source code and need to generate comprehensive, browsable HTML API documentation. Apply this skill after installing package dependencies when the documentation source tree exists but API stubs have not yet been generated, or when documentation needs to be rebuilt after source code changes.
## When NOT to use
- Source code lacks docstrings or uses a non-Sphinx documentation system (e.g., MkDocs, pdoc); use the appropriate tool for your documentation framework instead.
- Documentation is already built and only minor updates to display are needed; incrementally modify .rst sources rather than regenerating from scratch.
- Python package is not installed or does not follow standard module structure; ensure the package can be imported before running sphinx-apidoc.
## Inputs
- requirements.txt (Python dependency file)
- Python package source directory (e.g., ../dreams module with docstrings)
- Sphinx configuration file (conf.py)
- Sphinx source files (.rst files)
- tutorials directory (optional but recommended)
## Outputs
- _build/html/ directory (compiled HTML documentation)
- _build/html/index.html (main documentation entry point)
- API stubs (.rst files generated by sphinx-apidoc)
- Browsable API reference pages
## How to apply
First, install Python dependencies listed in requirements.txt using pip. Then create a symbolic link from the tutorials folder to the documentation directory to ensure tutorials are accessible in the build. Next, run sphinx-apidoc to recursively scan the Python package source directory (e.g., ../dreams) and generate reStructuredText stub files in the current directory. Finally, execute make html to invoke the Sphinx build system, which processes the generated stubs and source files to produce compiled HTML documentation in the _build/html output directory. The resulting directory contains an index.html entry point for browser navigation.
## Related tools
- **Sphinx** (Compiles reStructuredText documentation sources into HTML and manages documentation build system via make html) — https://www.sphinx-doc.org/
- **sphinx-apidoc** (Scans Python package source directory and automatically generates API documentation stub files (.rst) from module and function docstrings) — https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html
- **pip** (Installs Python package dependencies from requirements.txt before documentation build) — https://pip.pypa.io/
## Examples
```
cd docs && pip install -r requirements.txt && ln -s ../tutorials tutorials && sphinx-apidoc -o . ../dreams && make html && open _build/html/index.html
```
## Evaluation signals
- Verify that _build/html/ directory exists and contains index.html and module-specific .html files
- Open _build/html/index.html in a browser and confirm all API modules, classes, and functions are listed with docstrings rendered as formatted text
- Check that generated API stub files (.rst) in the documentation directory match the source package structure (e.g., dreams.rst, dreams.module1.rst for submodules)
- Confirm that tutorials folder is linked and accessible from the browsable documentation (e.g., a 'Tutorials' link resolves without 404 errors)
- Validate that no Sphinx build warnings or errors are reported during make html execution (warnings are acceptable if they do not prevent HTML generation)
## Limitations
- sphinx-apidoc requires source code to use standard Python docstring formats (Google, NumPy, or reStructuredText); inconsistent or missing docstrings result in sparse or empty API pages.
- The build assumes a conventional Sphinx project layout with conf.py and Makefile in the documentation directory; non-standard configurations may require manual adjustments to sphinx-apidoc options or make invocation.
- Symbolic linking (ln -s) is Unix-only; Windows environments must use alternatives such as mklink or copy the tutorials folder instead.
- Large packages with hundreds of modules can produce slow sphinx-apidoc scans; filtering specific modules via sphinx-apidoc flags may be needed for performance.
- Generated HTML is static; dynamic content or real-time API queries must be added post-hoc via JavaScript or custom Sphinx extensions.
## Evidence
- [methods] Generate API documentation stubs by running sphinx-apidoc to scan the ../dreams module and output documentation source files.: "Generate API documentation stubs by running sphinx-apidoc to scan the ../dreams module and output documentation source files"
- [methods] Build HTML documentation using make html, which processes Sphinx source files and generates the browsable output in _build/html/.: "Build HTML documentation using make html, which processes Sphinx source files and generates the browsable output in _build/html/"
- [methods] sphinx-apidoc -o . ../dreams && make html: "sphinx-apidoc -o . ../dreams && make html"
- [methods] Install Python dependencies from requirements.txt using pip.: "Install Python dependencies from requirements.txt using pip"
- [methods] Create a symbolic link from the tutorials folder to the current documentation directory using ln -s.: "Create a symbolic link from the tutorials folder to the current documentation directory using ln -s"
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!