python

Python development standards and toolchain preferences. Use when (1) writing ANY Python code, (2) setting up Python projects with pyproject.toml, (3) creating standalone CLI scripts, (4) configuring Python tooling (ruff, mypy, pytest, nox, uv), (5) reviewing or refactoring Python code, or (6) advising on Python best practices. Enforces modern Pythonic style, strict type hints, and uv-based workflows.

⭐3stars🔀0forks📁View on GitHub🕐Updated Dec 17, 2025⬇️1downloads

When & Why to Use This Skill

This Claude skill establishes a professional-grade framework for Python development, focusing on modern standards, strict type safety, and efficient toolchain management. It streamlines the creation of high-quality Python code by enforcing best practices such as TDD workflows, PEP 8 compliance via Ruff, and robust dependency management using uv, ensuring that every script or application is scalable, maintainable, and idiomatic.

Use Cases

  • Project Scaffolding: Rapidly set up new Python projects with standardized pyproject.toml configurations and optimized directory structures using the uv toolchain.
  • Type-Safe Development: Enforce strict type hinting across all functions and modules to eliminate runtime errors and improve IDE autocompletion and code clarity.
  • Automated Quality Control: Seamlessly configure and run a suite of developer tools including Ruff for linting, Mypy for static analysis, and Pytest for automated testing.
  • Legacy Code Refactoring: Transform outdated Python scripts into modern, PEP 8-compliant codebases by applying current idioms and absolute import standards.
  • TDD Workflow Integration: Implement a Test-Driven Development cycle for complex multi-file applications to ensure high code coverage and functional reliability.
namepython
descriptionPython development standards and toolchain preferences. Use when (1) writing ANY Python code, (2) setting up Python projects with pyproject.toml, (3) creating standalone CLI scripts, (4) configuring Python tooling (ruff, mypy, pytest, nox, uv), (5) reviewing or refactoring Python code, or (6) advising on Python best practices. Enforces modern Pythonic style, strict type hints, and uv-based workflows.

Python Development Standards

Before Writing Any Code

For applications and multi-file projects: Read references/tdd-workflow.md first. Follow TDD with mandatory verification after every change.

For CLI scripts and one-off utilities: Skip TDD workflow. Focus on working code.

Core Requirements

  1. Type hints everywhere - all functions, all parameters, all return types. No Any.
  2. Docstrings on all public interfaces - RST format for Sphinx compatibility
  3. Absolute imports only - never use relative imports
  4. Modern Python idioms - use latest features appropriate for target version
  5. Empty __init__.py - never add anything to __init__.py

Reference Files

Read based on task: