/scientific-python-development:scientific-documentation runs instead · from scientific-python-development
Sets up and maintains documentation for scientific Python packages using Sphinx or MkDocs. Covers NumPy-style docstrings, Diataxis framework, accessibility, and Read the Docs deployment.
This skill never runs in Claude Code
It ships in scientific-python-development at skills/, but /scientific-python-development:scientific-documentation (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
End-to-end sequence for a new project. Run each step and verify before proceeding.
1. Choose framework Sphinx (math-heavy / API-first / PDF needed)
MkDocs + Material (Markdown-native / simpler setup)
Jupyter Book (notebook-centric tutorials)
2. Initialize docs/ sphinx-quickstart docs/ OR mkdocs new .
3. Configure Copy asset template, fill in package name and extensions
assets/sphinx-conf-scientific.py (Sphinx)
assets/mkdocs-scientific.yml (MkDocs)
4. Build locally nox -s docs (warns-as-errors on)
└─ Checkpoint: zero warnings, all pages render
5. Check links nox -s docs_linkcheck
└─ Checkpoint: no broken internal or external links
6. Deploy .readthedocs.yaml → import repo on readthedocs.org
assets/readthedocs.yaml for the config file
└─ Checkpoint: RTD build passes; versioned URL resolves
| File | Contents |
|---|---|
assets/sphinx-conf-scientific.py | Complete annotated conf.py for scientific Python (all extensions pre-configured) |
assets/mkdocs-scientific.yml | Complete mkdocs.yml with Material theme, math, mkdocstrings, mkdocs-jupyter |
assets/noxfile-docs.py | Nox sessions: docs, docs_live, docs_linkcheck, docs_spelling, docs_doctest |
assets/readthedocs.yaml | .readthedocs.yaml v2 with pip install .[docs], fail_on_warning: true |
assets/index-template.md | Landing page template (badges, one-liner, install snippet, Diataxis nav) |
references/diataxis-framework.md | Full Diataxis guide: templates and examples for tutorials, how-to, reference, explanation |
references/sphinx-extensions.md | Extension-by-extension config: autodoc, autosummary, napoleon, intersphinx, myst_parser, mathjax |
references/docstring-examples.md | NumPy-style docstrings for functions, classes, generators, modules |
references/notebook-integration.md | nbsphinx and mkdocs-jupyter: execution options, cell tags, CI considerations |
references/accessible-documentation.md | Accessibility: alt text, color contrast, heading hierarchy, video captions |
references/common-issues.md | Build failures, autodoc import errors, intersphinx 404s, RTD environment issues |
scripts/generate-api-docs.py | Script to generate autosummary stubs from package modules |
conf.py additionsextensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon", # NumPy/Google docstrings
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"numpydoc",
"myst_parser",
]
html_theme = "pydata_sphinx_theme"
napoleon_numpy_docstring = True
autosummary_generate = True
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
}
See assets/sphinx-conf-scientific.py for the full annotated file including theme options, myst extensions, nbsphinx, and version switcher config.
mkdocs.yml additionstheme:
name: material
plugins:
- mkdocstrings:
handlers:
python:
options:
docstring_style: numpy
- mkdocs-jupyter:
execute: false
markdown_extensions:
- pymdownx.arithmatex:
generic: true
See assets/mkdocs-scientific.yml for the full file including navigation structure, MathJax setup, dark/light mode, and search configuration.
# Sphinx (via nox — see assets/noxfile-docs.py)
nox -s docs # build with warnings-as-errors
nox -s docs_live # live reload in browser
nox -s docs_linkcheck # check all links
# Sphinx (direct)
sphinx-build -W -b html docs docs/_build/html
sphinx-autobuild docs docs/_build/html
# MkDocs
mkdocs build --strict
mkdocs serve
Standard for scientific Python packages. Minimal complete example:
def compute_statistic(data, method="mean", axis=0):
"""
Compute a statistical measure along the specified axis.
Parameters
----------
data : array_like
Input data. Any shape.
method : {'mean', 'median', 'std'}, optional
Statistical method. Default is ``'mean'``.
axis : int or None, optional
Axis along which to compute. Default is 0.
Returns
-------
ndarray
Computed statistic with the same shape as `data` minus `axis`.
Raises
------
ValueError
If `method` is not one of the supported options.
Examples
--------
>>> import numpy as np
>>> compute_statistic(np.array([1, 2, 3, 4, 5]))
3.0
"""
Key conventions:
----------): 'mean' `data`See references/docstring-examples.md for classes, generators, Attributes, See Also, and Notes with math.
pyproject.toml)[project.optional-dependencies]
docs = [
"sphinx>=7.0",
"pydata-sphinx-theme>=0.15",
"numpydoc>=1.6",
"myst-parser>=2.0",
"sphinx-autodoc-typehints>=2.0",
"nbsphinx>=0.9", # or mkdocs-jupyter for MkDocs
]
autodoc can't import your package at build time: install the package (pip install -e .) in the RTD build environment with pip install .[docs], not just the docs extras.autosummary_generate = True creates stub .rst files in docs/generated/ — add that directory to .gitignore and tell Sphinx to write there with :toctree: generated/.napoleon vs numpydoc: don't enable both simultaneously; use numpydoc alone for the richest NumPy-style output (cross-references, parameter tables).myst_parser dollar-math: requires dollarmath in myst_enable_extensions AND sphinx.ext.mathjax in extensions to actually render in HTML.fail_on_warning: true: set this from day one; it prevents silent docstring formatting errors from accumulating.intersphinx_timeout = 30 to avoid flaky builds on slow networks.See references/common-issues.md for build failures, autodoc import errors, and RTD environment problems.
assets/index-template.md (opens in a new tab)assets/mkdocs-scientific.yml (opens in a new tab)assets/noxfile-docs.py (opens in a new tab)assets/readthedocs.yaml (opens in a new tab)assets/sphinx-conf-scientific.py (opens in a new tab)references/accessible-documentation.md (opens in a new tab)references/common-issues.md (opens in a new tab)references/diataxis-framework.md (opens in a new tab)references/docstring-examples.md (opens in a new tab)references/notebook-integration.md (opens in a new tab)references/sphinx-extensions.md (opens in a new tab)scripts/generate-api-docs.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
scientific-python, sphinx, mkdocs, read-the-docs, numpy-docstrings, diataxis
Generated from the plugin's indexed repository (uw-ssec/savvy) — no native marketplace selected
npx claudepluginhub p/uw-ssec-scientific-python-development-plugins-scientific-python-development5 skills in this plugin
/code-quality-toolsUse when the user asks about setting up linting, type checking, code formatting, or pre-commit hooks for Python projects, or mentions ruff, mypy, or pre-commit configuration. Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects. Covers linting rules, type checking configuration, formatting, and CI integration./pixi-package-managerUse when the user works with pixi (pixi.toml, pixi.lock, pixi add/run/task/global/exec) or wants a reproducible scientific Python environment that mixes conda-forge and PyPI packages: creating environments, adding dependencies, defining tasks, multi-platform lockfiles, or migrating from conda environment.yml / requirements.txt. Not for pure uv/pip projects or for building and publishing packages to PyPI (use python-packaging)./python-packagingCreate and publish distributable scientific Python packages following Scientific Python community best practices. Covers pyproject.toml, src layout, Hatchling, metadata, CLI entry points, and PyPI publishing. Use when the user wants to create a new Python package, set up pyproject.toml, configure Hatchling, publish to PyPI, or follow Scientific Python packaging standards.Other plugins' skills for the same job