Python Docstrings
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Make sure a set of Python modules carry complete, well-formed docstrings, filling in whatever is missing, then prove the result is valid through Ruff’s docstring rules and the project’s own API-docs build. It only adds or completes docstrings — it never changes behavior, signatures, type hints, decorators or any non-docstring code.
Purpose
iru-python-docstrings detects the project flavor (Django, FastAPI or plain library) and the runner (uv run,
poetry run, pdm run, pipenv run, .venv/bin/), then discovers the project’s real docstring bar: the Ruff
pydocstyle convention (Google by default, or numpy, pep257 or reST when the project says so), Ruff D selection and
ignores, interrogate settings, the API-docs tool and contributor guides. It audits every public module, package,
class, function, method and property, generates docstrings grounded in the actual code and current changes without
restating what type hints already say, and verifies the result with Ruff D rules (forced on even when the project
does not enable them), the advisory preview pydoclint DOC rules, interrogate when configured, and a Sphinx,
MkDocs plus mkdocstrings or pdoc build with warnings as errors into a throwaway directory.
It is framework-aware: Django migrations are never touched, FastAPI route and Pydantic model docstrings become
OpenAPI descriptions so developer-only sections go after a form feed (handling the resulting Ruff D301), and
DRF or Django Ninja view docstrings feed their schema the same way. Test code is out of scope and its existing
docstrings are never stripped.
Plugin
Shipped by the iru-python plugin of the ai-catalog marketplace (install with /plugin install iru-python@ai-catalog; see Plugins).
Invocation
/iru-python-docstrings <path-or-glob>
/iru-python-docstrings
Comma-separated paths, globs or dotted module names are accepted.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
One or more files, directories, globs or dotted module names resolving to |
Non-test |
Outputs
-
Edited
.pyfiles with added or completed docstrings, plus an API-docs entry (for example anautomoduledirective) when the project lists modules explicitly and a new public module was listed nowhere. -
A per-file report: symbols already documented, gaps found and filled (kind and what was added), and any API-docs entry added.
-
The verification result per tool that ran — Ruff
D, RuffDOC(advisory), interrogate coverage againstfail-under, and the Sphinx, MkDocs or pdoc build — and which tools were unavailable or not configured. -
The convention used and where it came from, arguments dropped as tests or migrations, and out-of-scope pre-existing failures as follow-ups. Raw tool output is never pasted.
Execution flow
Dependencies
Invokes
None — iru-python-docstrings is a leaf skill; it edits docstrings and runs the project’s own Ruff, interrogate and
Sphinx, MkDocs or pdoc tooling directly. It reuses `iru-explore’s flavor markers and `iru-update-docs’s scope
approach by convention, but calls none of them.
Invoked by
-
FastAPI Code One Task Group — Step 3, docstrings for touched production files, via the
iru-gate-runneragent. -
Django Code One Task Group — Step 3, docstrings for touched production files, via the
iru-gate-runneragent.
Also referenced (not invoked) by Python Code Quality (it names this skill as the fixer for Ruff
D* findings), Setup Python Repository, Setup Repository and
Setup Python GitHub Workflows (as one of the gate skills the scaffolds are verified against).
Related agents
-
Gate Runner — callers run this skill inside an
iru-gate-runnersub-agent; the skill does not spawn agents itself.
Source
SKILL.md on GitHub — the file this page was generated from.