standards-python

Enforce Google-style Python conventions for code and reviews.

2|Updated Apr 10, 2024
One-click install
npx skills add https://github.com/gdurandvadas/dotfiles --skill standards-python-gdurandvadas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: standards-python
Source: https://github.com/gdurandvadas/dotfiles/tree/main/config/opencode/skills/standards-python
Command: npx skills add https://github.com/gdurandvadas/dotfiles --skill standards-python-gdurandvadas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent Python style, missing or incorrect type annotations, weak error handling, and unclear docstrings cause review friction, runtime bugs, and long-term maintenance costs; this Skill provides a single, opinionated reference derived from the Google Python Style Guide to reduce those problems and improve code readability and safety.

Core Features & Use Cases

  • Idiomatic patterns: guidance on common Python idioms, iteration, comprehensions, and avoiding anti-patterns.
  • Type annotations & generics: rules for annotating public APIs, preferring modern union syntax, and using abstract container types in signatures.
  • Formatting & tooling: recommendations for linters and type checkers, import ordering, formatter choice, and CI enforcement.
  • Docstrings & naming: standards for triple-double-quote docstrings, parameter/return sections, and consistent naming conventions.
  • Use Cases: writing new modules, performing code reviews, preparing public APIs, and establishing repository-wide style checks.

Quick Start

Ask the assistant to review a Python file for Google-style issues, add missing public API type annotations, recommend docstring improvements, and suggest import and formatting fixes.

Frequently Asked Questions about standards-python

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

FAQPage Schema
How do I enforce Google Python style guide conventions for imports and type annotations?

Enforce Google Python style guide conventions by applying rules for import ordering, public API type annotations, and modern union syntax to ensure idiomatic code and typing safety.

What's the best way to fix missing docstrings and type annotations during a Python code review?

Fix missing docstrings and type annotations during a Python code review by enforcing triple-double-quote docstrings with parameter sections and requiring abstract container types in public API signatures.

How do I configure pylint and mypy for linting and type checking Python modules?

Configure pylint and mypy for linting and type checking Python modules by applying opinionated style rules that satisfy CI enforcement requirements and align formatting with Black or Pyink.

When do I need modern union syntax and abstract container types in Python public APIs?

You need modern union syntax and abstract container types in Python public APIs when defining module signatures that require strict type checking and clear interface boundaries for long-term maintenance.

Does this Python style guide approach work with Black and Pyink formatting tools?

This Python style guide approach works with Black and Pyink formatting tools by aligning import ordering and naming conventions with the formatter's output to reduce review friction.

What are the limitations of using opinionated Python style guides for legacy code?

The limitations of using opinionated Python style guides for legacy code include potential review friction when enforcing strict type annotations and docstring standards on existing modules with inconsistent patterns.