# Google Docstring Assistant

> Writes and reviews Python docstrings in Google style. Use when creating or updating docstrings for Python functions, methods, classes, or modules.

- Skill: `dmitriiweb/google-docstring-assistant` (Agent Skill)
- Install (CLI): `npx skillmds@latest add dmitriiweb/google-docstring-assistant`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dmitriiweb/google-docstring-assistant/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: dmitriiweb (https://skillmd.com/u/dmitriiweb)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/dmitriiweb/google-docstring-assistant

---


# Google Docstring Assistant

## Core Rules

- Use the **Google Python Style Guide** for all Python docstrings.
- Structure docstrings with clear sections such as: `Args:`, `Returns:`, `Raises:`, `Attributes:`, `Examples:`, `Todo:`.
- When type hints exist in code, **do not repeat types** in docstrings unless it significantly improves clarity.

## How to Format Docstrings

- **General layout**:
  - Summary line on the first line.
  - Optional blank line, then detailed description.
  - Section headers (`Args:`, `Returns:`, etc.) start at the left margin.
  - Section contents are indented under the header.
- **Args**:
  - One line per parameter: `name: description...`
  - Mention important semantics, defaults, and expectations; skip types if code is annotated.
- **Returns / Yields**:
  - Use `Returns:` for regular functions, `Yields:` for generators.
  - Describe what is returned, not how.
- **Raises**:
  - List each exception and the condition: `ValueError: If ...`
- **Attributes** (for classes/modules):
  - Document important attributes in a single `Attributes:` section when used.
- **Examples**:
  - Start with `Examples:`.
  - Use indented code blocks; keep them minimal and realistic.

## When to Apply This Skill

- The user asks to add or fix Python docstrings.
- You generate or refactor Python functions/classes and need docstrings.
- You review existing docstrings for consistency and quality.

Always prefer concise, precise language and consistent Google-style formatting across the file or project.


