python-style

Enforce PEP 8 style, type hints, and import ordering in Python 3.11+ code.

14|1|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/jpoutrin/product-forge --skill python-style-jpoutrin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-style
Source: https://github.com/jpoutrin/product-forge/tree/main/plugins/python-experts/skills/python-style
Command: npx skills add https://github.com/jpoutrin/product-forge --skill python-style-jpoutrin

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about python-style

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

FAQPage Schema
How do I enforce PEP 8 style in my Python code?

PEP 8 enforcement automates style compliance by checking naming conventions, import ordering, line length, and type hints syntax across your codebase. This Skill applies during code authoring and CI linting to catch violations early, ensuring consistent snake_case functions, PascalCase classes, and proper import grouping without manual review overhead.

Can I use modern type hints syntax like list[str] and X | None in Python 3.11?

Yes. Modern type hints syntax—built-in generics (list[str], dict[str, int]) and union types (X | None)—is fully supported in Python 3.10+ and enforced by this Skill. It checks that your type annotations follow current idioms rather than older Generic imports, improving readability and reducing technical debt in new codebases.

What's the best way to format docstrings in Python code?

Google-style docstrings are enforced by this Skill as the standard format for your project. They structure descriptions, parameters, returns, and exceptions in a readable, parseable way that integrates with documentation tools and code review workflows without requiring manual style corrections.

How do I refactor Python code to meet modern standards?

Refactoring to modern standards involves updating type hints to Python 3.10+ syntax, renaming variables and functions to snake_case, organizing imports into stdlib → third-party → local groups, and adding Google-style docstrings. This Skill identifies anti-patterns like bare except clauses and magic numbers, guiding systematic modernization during code review or CI linting.

Does this work with Python 3.11 projects?

Yes. This Skill is built for Python 3.11+ projects, enforcing PEP 8 conformance, modern type hints (list[str], union syntax), and import ordering standards specific to contemporary Python versions. It integrates into code authoring, reviews, and CI pipelines for maximum coverage.

What import ordering does PEP 8 require?

PEP 8 import ordering groups imports into three sections—standard library, third-party packages, and local modules—each sorted alphabetically with blank lines between sections. This Skill enforces that structure automatically, preventing the inconsistency that accumulates across large codebases and slows code review cycles.