What problem does it solves?
Maintaining consistent Python coding style, adhering to PEP standards, and using modern idioms across a codebase can be challenging and time-consuming, leading to readability issues and technical debt. This Skill automatically enforces Python style best practices.
Core Features & Use Cases
- Core Standards: Enforcement of PEP 8, modern Type Hints (Python 3.10+ syntax), Google-style Docstrings, and organized Imports.
- Naming Conventions: Guidelines for PascalCase classes, snake_case functions/variables, and SCREAMING_SNAKE_CASE constants.
- Type Hints: Examples for using built-in generics (
list[str]), union types (X | None), and TypedDict for structured dictionaries.
- Function Length Guidelines: Recommendations for ideal, reviewable, and refactoring-needed function lengths.
- Anti-Patterns to Avoid: Identification of common pitfalls like missing type hints, bare
except clauses, and magic numbers.
- Use Case: Writing new Python code that automatically adheres to PEP 8; refactoring old code to use modern type hints; ensuring docstrings follow Google style; identifying and fixing common Python anti-patterns.
Quick Start
Use the python-style skill to refactor the attached Python function to use modern type hints and adhere to PEP 8 naming conventions.