python-code-style

Enforce Python code style with ruff and mypy.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/sadroad/.dotfiles --skill python-code-style-sadroad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-code-style
Source: https://github.com/sadroad/.dotfiles/tree/main/modules/home-manager/opencode/skills/python-code-style
Command: npx skills add https://github.com/sadroad/.dotfiles --skill python-code-style-sadroad

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of maintaining consistent, readable, and maintainable Python code across projects and teams by providing guidance and tools for code style, linting, formatting, naming conventions, and documentation.

Core Features & Use Cases

  • Automated Formatting & Linting: Utilizes tools like ruff to automatically format code and catch style violations.
  • Type Checking: Integrates mypy or pyright for static type analysis to prevent runtime errors.
  • Naming Conventions: Enforces PEP 8 compliant naming for variables, functions, classes, and constants.
  • Docstring Standards: Guides the creation of clear, informative Google-style docstrings for all public APIs.
  • Project Documentation: Provides templates for README.md and CHANGELOG.md to ensure project clarity.

Quick Start

Configure your pyproject.toml file with ruff and mypy settings to enforce Python code style.

Frequently Asked Questions about python-code-style

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

FAQPage Schema
How do I enforce PEP 8 and Python code style across my project?

Python code style automation uses ruff to format code and catch violations, while mypy handles static type analysis to prevent runtime errors. This enforces PEP 8 naming conventions and clear Google-style docstrings.

How do I set up automated Python linting and formatting?

Automated Python linting and formatting is set up by configuring ruff and mypy settings within your pyproject.toml file to catch style violations and enforce type checking automatically.

Does mypy work with ruff for Python code quality checks?

Yes, mypy works with ruff for Python code quality checks by combining ruff's automated formatting and linting with mypy's static type analysis to prevent runtime errors and maintain codebase consistency.

What is the best way to standardize Python docstrings for public APIs?

The best way to standardize Python docstrings is to enforce Google-style docstrings for all public APIs, ensuring consistent documentation standards and improving project clarity across the codebase.

Can I use this approach to generate project documentation templates?

Yes, this approach provides templates for README.md and CHANGELOG.md files, ensuring project clarity and satisfying requirements for clear documentation alongside automated Python code style enforcement.