python-docstring-review

Review and minimally revise Python docstrings against repository policy and public API contracts.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/brendan-m-murphy/docs-doctor --skill python-docstring-review-brendan-m-murphy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-docstring-review
Source: https://github.com/brendan-m-murphy/docs-doctor/tree/main/.agents/skills/python-docstring-review
Command: npx skills add https://github.com/brendan-m-murphy/docs-doctor --skill python-docstring-review-brendan-m-murphy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes often leave docstrings stale or inaccurate, and generic linting only checks formatting rather than whether the documented contract matches actual behavior. This Skill reviews the smallest relevant set of Python modules and objects, comparing docstrings against annotations, implementations, tests, and repository policy so callers and maintainers get accurate API documentation. ## Core Features & Use Cases - Policy-aware review: Resolves docstring authority in order—repository policy, configured dialect and linter settings, then PEP 257—without silently converting between Google, numpydoc, or Sphinx styles. - Semantic contract checks: Verifies parameters, return values, side effects, exceptions, class invariants, and scientific details like units, shapes, and tolerances against source and tests. - Assessment or edit modes: Reports actionable findings with evidence and minimal fixes, or applies the smallest policy-conforming docstring edits when authorized. - Use Case: After a pull request changes a public function's signature and behavior, run the Skill against the diff to confirm the docstring still describes the caller contract, then receive either a findings report or minimal authorized corrections. ## Quick Start Use $python-docstring-review to review the changed public objects in this branch against origin/main and report findings only.

Frequently Asked Questions about python-docstring-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review Python docstrings after a code change?

Identify the changed files or diff and comparison base, then check each affected object's docstring against its annotations, implementation, and tests. This Skill automates that review, covering parameters, return values, side effects, and exceptions, and reports only actionable findings.

What docstring style should I use: Google, numpydoc, or Sphinx?

Follow your repository's existing policy and configured tooling first. This Skill never converts between Google, numpydoc, or Sphinx dialects without explicit repository or user authority, and falls back to policy-neutral PEP 257 checks when no local policy exists.

Does Ruff catch incorrect docstring content?

No. Ruff's pydocstyle D rules check docstring presence and formatting, and DOC rules check selected signature relationships, but a clean linter result does not prove semantic correctness. This Skill treats linter output as partial evidence alongside source and test comparison.

Can this Skill edit docstrings or only report issues?

Both. In assessment mode it reports findings with object, policy, evidence, consequence, and minimal action. In edit mode it makes the smallest policy-conforming docstring changes, preserves unrelated code, and reruns focused checks.

When should docstring issues be escalated instead of fixed?

Escalate when changes involve disputed scientific meaning, safety concerns, destructive effects, or public contract modifications. These require domain or maintainer review rather than unilateral docstring edits, and broader page work is handed off explicitly.