Agent skill · software engineering · wshobson

python-code-style

Python code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or establishing project standards.

Why this skill is useful

Codifies Python code style and linting standards, which the AI could infer but now doesn't have to guess.

What it needs

Requires mypy, ruff installed locally. About 4k tokens when loaded. Last updated 2026-08-05. 38,570 stars on the source repository.

What this skill does

Python Code Style & Documentation Consistent code style and clear documentation make codebases maintainable and collaborative. This skill covers modern Python tooling, naming conventions, and documentation standards. When to Use This Skill Setting up linting and formatting for a new project Writing or reviewing docstrings Establishing team coding standards Configuring ruff, mypy, or pyright Reviewing code for style consistency Creating project documentation Core Concepts 1. Automated Formatting Let tools handle formatting debates. Configure once, enforce automatically. 2. Consistent Naming Follow PEP 8 conventions with meaningful, descriptive names. 3. Documentation as Code Docstrings should be maintained alongside the code they describe. 4. Type Annotations Modern Python code should include type hints for all public APIs. Quick Start Fundamental Patterns Pattern 1: Modern Python Tooling Use ruff as an all-in-one linter and formatter. It replaces flake8, isort, and black with a single fast tool. Run with: Pattern 2: Type Checking Configuration Configure strict type checking for production code. Alternative: Use pyright for faster checking. Pattern 3: Naming Conventions Follow PEP 8 with emphasis on clarity over brevity. Files and Modules: Classes and Functions: Constants: Pattern 4: Import Organization Group imports in a consistent order: standard library, third-party, local. Use absolute imports exclusively: Advanced Patterns Pattern 5: Google-Style Docstrings Write docstrings for all public classes, methods, and functions. Simple Function: Complex Function: Class Docstring: Pattern 6: Line Length and Formatting Set line length to 120 characters for modern displays while maintaining readability. Pattern 7: Project Documentation README Structure: CHANGELOG Format (Keep a Changelog): Best Practices Summary 1. Use ruff - Single tool for linting and formatting 2. Enable strict mypy - Catch type errors before runtime 3. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills wshobson/python-code-style

View the source on GitHub

Browse the @skills marketplace