python-pedantry

Enforce modern Python 3.10+ coding standards with Ruff linting.

28|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/oborchers/fractional-cto --skill python-pedantry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-pedantry
Source: https://github.com/oborchers/fractional-cto/tree/main/pedantic-coder/skills/python-pedantry
Command: npx skills add https://github.com/oborchers/fractional-cto --skill python-pedantry

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces modern Python best practices, preventing common pitfalls and ensuring code is clean, maintainable, and idiomatic, thereby reducing bugs and improving developer productivity.

Core Features & Use Cases

  • Modern Type Hinting: Enforces type | None over Optional[type] and list[str] over List[str].
  • Configuration Management: Promotes Pydantic BaseSettings for centralized, validated configuration.
  • Error Handling: Mandates exception chaining (raise X from e) for better debugging.
  • Code Quality: Integrates Ruff for linting and formatting, ensuring consistency.
  • Use Case: When writing new Python code or reviewing existing code, use this Skill to ensure adherence to current standards, catch subtle bugs, and improve overall code quality.

Quick Start

Apply modern type syntax and Pydantic settings to the current Python codebase.

Frequently Asked Questions about python-pedantry

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

FAQPage Schema
How do I modernize legacy Python type hints to current standards?

To enforce modern Python type hinting, replace `Optional[type]` with `type | None` and `List[str]` with `list[str]`. This ensures clean, maintainable code by leveraging Python 3.10+ features and reducing subtle typing bugs.

What is the best way to manage Python configuration using Pydantic BaseSettings?

Pydantic BaseSettings centralizes and validates application configuration, replacing scattered configuration files. This approach ensures robust settings management by enforcing type safety and validation rules across your Python codebase.

How do I enforce exception chaining in Python for better debugging?

Exception chaining in Python is enforced by mandating `raise X from e` syntax during error handling. This preserves the original traceback, ensuring better debugging context and preventing the loss of root cause exceptions.

Does this Python best practices guidance integrate with Ruff for linting?

Yes, this guidance integrates Ruff for comprehensive Python linting and formatting. Ruff ensures consistent code quality by automatically identifying and fixing style violations and legacy syntax across your project.

When should I use StrEnum and Google-style docstrings in my Python code?

Use StrEnum for modern string enumerations and Google-style docstrings for consistent API documentation when writing Python 3.10+ code. These standards ensure idiomatic code structure, improving readability and developer productivity.