python
Auto-activate for .py files, pyproject.toml, requirements.txt, setup.py, setup.cfg. Python project conventions and tooling: uv, ruff, mypy, typing, Cython, Mypyc. Use when: configuring Python packages, linting, type-checking, building extensions, or running scripts with uv. Produ
What it does
Python Skill
Overview
Expert knowledge for Python development in this workspace. This skill aggregates tooling, build systems, and quality standards.
Core Standards
As per workspace rules, the following are MANDATORY:
- Tooling:
uvis the required tool for Python package and environment management. - Execution: Always run python programs with the
uv runprefix. - Installation: Use
uvwithpyproject.tomland install to a virtual environment. - Typing: Use
>=3.10types as per PEP 585 (e.g.,dict,listinstead oftyping.Dict,typing.List). - Comments: Prefer docstrings and type annotations over inline comments. Use inline comments only when the logic is non-obvious and cannot be clarified through better naming or type hints.
<workflow>
References Index
For detailed guides on specific tools and sub-systems, refer to the following documents:
Package & Project Management
uvGuide- Initializing projects, managing dependencies, workspaces, and tool execution (
uvx).
- Initializing projects, managing dependencies, workspaces, and tool execution (
Code Quality
- Quality Standards
- Ruff, Mypy, and Pyright configurations.
Build Systems & compiled Extensions
- Building & Packaging
- Standalone binaries, patching, and distributing.
- Cython Extensions
- Compiling C extensions for performance.
- Mypyc Extensions
- Mypyc-compatible classes and compilation workflows.
Example: pyproject.toml Setup
[project]
name = "myapp"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["litestar>=2.0", "sqlalchemy>=2.0"]
[tool.uv]
dev-dependencies = ["pytest>=8.0", "ruff>=0.8", "mypy>=1.13"]
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
select = ["ALL"]
ignore = ["D", "ANN101"]
[tool.mypy]
strict = true
python_version = "3.12"
</example>
Official References
- https://docs.astral.sh/uv/
- https://docs.astral.sh/ruff/
- https://mypy.readthedocs.io/
- https://mypyc.readthedocs.io/
Shared Styleguide Baseline
- Use shared styleguides for generic language/framework rules to reduce duplication in this skill.
- General Principles
- Python
- Keep this skill focused on tool-specific workflows, edge cases, and integration details.
Add guardrails instructions here. </guardrails>
<validation> ## ValidationAdd validation instructions here. </validation>
Capabilities
Install
Quality
deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 11 github stars · SKILL.md body (2,706 chars)