google-docstring-assistant

dmitriiweb's avatarfrom dmitriiweb

Write Python docstrings following the Google Python Style Guide, using clear sections and examples.

106stars🔀38forks📁View on GitHub🕐Updated Jan 2, 2026

When & Why to Use This Skill

This Claude skill automates the creation of high-quality Python docstrings strictly adhering to the Google Python Style Guide. It ensures consistency across codebases by generating structured sections for arguments, return values, exceptions, and usage examples, helping developers maintain professional, readable, and standardized documentation with minimal effort.

Use Cases

  • 1. Standardizing Enterprise Codebases: Automatically apply the Google Python Style Guide across large-scale projects to ensure documentation consistency and team-wide readability.
  • 2. Enhancing Code Maintainability: Generate detailed descriptions for complex functions and classes, including edge cases and error handling, to facilitate easier long-term maintenance and debugging.
  • 3. Automated Documentation Pipelines: Prepare Python source code for documentation generators like Sphinx or MkDocs by ensuring all docstrings follow a standardized, parsable format.
  • 4. Developer Onboarding and Handoff: Create clear usage examples and attribute descriptions within the code to help new contributors understand the internal API and logic quickly.
namegoogle-docstring-assistant
descriptionWrite Python docstrings following the Google Python Style Guide, using clear sections and examples.

Google Docstring Assistant

Quick start

  • Write docstrings using the Google Python Style Guide structure (Args, Returns, Raises, Examples, Attributes, etc.).
  • Keep sections as headers followed by indented blocks; break sections by resuming unindented text.
  • When types are annotated in code, omit them in docstrings unless clarity is improved.
  • Use Examples blocks with literal blocks (::) for commands or code snippets.
  • Document module-level variables consistently (all in Attributes or inline), and list TODOs in a Todo section.
  • See references/google_docstring_rules.md for full guidance and examples.

Workflow

  1. Choose sections

    • Functions: include Args, Returns, and Raises as needed.
    • Modules/classes: use Attributes and Todo when relevant; keep formatting consistent.
  2. Write clearly

    • One docstring per object; keep it concise and informative.
    • Use indentation under each section header; separate sections by returning to unindented text.
    • Prefer Google-style wording; avoid duplicating annotated types unless helpful.
  3. Examples and scripts

    • Use Examples: with indented literal blocks for shell commands or code snippets.
    • Include multi-line descriptions when needed; keep formatting readable.

Reference

  • references/google_docstring_rules.md: full style description and examples.