python-document

Writes and converts Google-style Python docstrings compliant with ruff D and DOC rules.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/bsamiee/Rasm --skill python-document-bsamiee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-document
Source: https://github.com/bsamiee/Rasm/tree/main/.claude/skills/python-document
Command: npx skills add https://github.com/bsamiee/Rasm --skill python-document-bsamiee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Python projects enforcing ruff's pydocstyle (D) and pydoclint (DOC) rules need consistent Google-style docstrings on every public module, class, and function, and writing or converting them by hand is repetitive and error-prone. ## Core Features & Use Cases - Docstring Authoring: Writes Google-style docstrings for modules, classes, functions, methods, properties, generators, and overloads with correct section ordering (Args, Returns/Yields, Raises). - Convention Conversion: Converts Sphinx :param: fields and NumPy-style docstrings into Google sections while preserving existing content. - Rule Compliance: Satisfies ruff D100-D421 and DOC201-DOC502 checks, including one-liner formatting, inline attribute docstrings for dataclasses and Pydantic models, and exemptions for tests and typing.override. - Use Case: When ruff reports a D417 missing-argument or DOC501 missing-raises violation, use this Skill to produce a compliant docstring that passes lint on the next run. ## Quick Start Fix the ruff D and DOC violations in this Python file by writing Google-style docstrings for every public function and class.

Frequently Asked Questions about python-document

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

FAQPage Schema
How do I write Google-style docstrings in Python?▼

Start with a one-sentence summary ending in a period, then add capitalized sections in order: Args, Returns or Yields, then Raises. Indent entries four spaces and omit type annotations since type hints already state the types.

How to fix ruff D417 missing argument in docstring?▼

Add an Args section listing every function parameter with a description, excluding self, cls, *args, and **kwargs. Each entry uses the format name followed by a colon and description, indented four spaces from the header.

Does ruff check docstrings in test files?▼

Ruff D101 to D103 rules are disabled for test files through per-file ignores, so test classes, methods, and functions need no docstrings. The module docstring at the top of the test file is still required.

Should dataclass fields use Attributes section or inline docstrings?▼

Dataclasses, Pydantic models, TypedDicts, and NamedTuples use inline string literals on the line after each field, the PEP 257 attribute docstring form. The class docstring itself contains no Attributes section for those fields.

When should a Python docstring be a one-liner?▼

Use a one-liner when the docstring needs no sections, with opening and closing quotes on one line and no blank lines around it. Ruff skips DOC rules for one-line docstrings when ignore-one-line-docstrings is enabled.

Why does DOC501 fire on my function?▼

DOC501 fires when the function body contains a raise statement but the docstring lacks a matching Raises entry. List every raised exception except NotImplementedError with a condition describing when it occurs.