Python development guidelines and best practices. Use when working with Python code.
65
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
Standards and best practices for Python development. Follow these guidelines when writing or modifying Python code.
Apply DRY, KISS, and SOLID consistently. Prefer functional methods where relevant; use classes for stateful behavior. Use composition with Protocol classes for interfaces rather than inheritance. Each module should have a single responsibility. Use dependency injection for class dependencies.
Any unless necessary__init__.py; prefer blank filesdict, list instead of typing.Dict, typing.Liststr | None instead of Optional[str]from __future__ import annotations at top of files with type hintsenvironment.py file with individual methods per variable (e.g., api_key() for API_KEY, database_url() for DATABASE_URL)src/ directory structuretest_def foo() create class TestFoopytest over unittestpytest-mock for mockingconftest.py for shared fixturestests/__test_<package_name>__ for shared testing codeWhen implementing Python code:
references/uv-scripts.md.references/uv-monorepo.md.e6ec8ed
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.