python-code-style

Enforce Python code style and linting with ruff and mypy.

38.6k|4.1k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill python-code-style-wshobson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-code-style
Source: https://github.com/wshobson/agents/tree/main/plugins/python-development/skills/python-code-style
Command: npx skills add https://github.com/wshobson/agents --skill python-code-style-wshobson

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 on style, linting, formatting, and documentation.

Core Features & Use Cases

  • Automated Formatting: Leverages tools like ruff to automatically format code according to established standards.
  • Linting and Type Checking: Integrates with linters (ruff) and type checkers (mypy, pyright) to catch errors and enforce type safety.
  • Naming Conventions: Guides developers on using clear and consistent naming for variables, functions, classes, and constants.
  • Documentation Standards: Promotes the use of clear docstrings (e.g., Google-style) for all public APIs.
  • Use Case: When starting a new Python project, use this Skill to configure pyproject.toml with ruff and mypy settings, ensuring code quality from the outset.

Quick Start

Configure your project's pyproject.toml file to include ruff and mypy settings for code linting and formatting.

Frequently Asked Questions about python-code-style

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

FAQPage Schema
How do I configure Python code style and linting rules in pyproject.toml?

Configure Python code style in `pyproject.toml` by adding settings for `ruff` and `mypy` to automate linting, formatting, and type checking, ensuring consistent project-wide standards.

What is the best way to enforce Python naming conventions and formatting?

The best way to enforce Python naming conventions and formatting is using `ruff` for automated checks. It automatically formats code and guides consistent naming for variables, functions, and classes.

How do I add type checking to my Python project using mypy?

Add type checking to your Python project using `mypy` by configuring it within `pyproject.toml`. This integrates with your linter setup to enforce type safety and catch errors before runtime.

Does ruff work with mypy for Python code linting and formatting?

Yes, `ruff` works with `mypy` for Python code linting and formatting. You can configure both tools in `pyproject.toml` to handle automated formatting, linting, and type checking simultaneously.

How do I write Google-style docstrings for Python public APIs?

Write Google-style docstrings for Python public APIs by following clear documentation standards. This ensures all public functions and classes have readable explanations, promoting maintainability across teams.

Why does my Python code style fail automated checks during code reviews?

Python code style fails automated checks during code reviews if it violates configured `ruff` or `mypy` rules. Ensure your `pyproject.toml` is properly set up and run local formatting before submitting.