ALWAYS invoke when: user creates a Python project, runs `uv init`, sets up `pyproject.toml`, adds/removes packages, installs dependencies, configures linting/formatting/testing, writes a standalone Python script with deps, or migrates from pip/Poetry/requirements.txt/mypy/black/pre-commit/prek. Apply code standards (typing, logging, pathlib, Pydantic) to ALL Python work.
Code standards are in .claude/rules/python.md — apply them to every file.
Project (multi-file):
uv init --package myproject # distributable library
uv init myproject # internal/app (no build)
uv add requests
uv add --group dev ruff ty pip-audit taskipy
uv add --group test pytest pytest-cov hypothesis
Never edit pyproject.toml manually for deps. Never use uv pip install.
Use the template in ../templates/pyproject.toml. If the project needs git hooks, use references/prek.md.
uv sync --all-groups
Invoke the /python-tests skill to set up pytest, Hypothesis, and taskipy — it owns all test configuration including:
[tool.pytest.ini_options] and [tool.coverage.*] in pyproject.toml[tool.taskipy.tasks] with lint, format, test (with pre_test / post_test)tests/conftest.py with Hypothesis profile wired to PROFILE env varUse the template in ../templates/Makefile. Key targets:
| Target | Command |
|---|---|
make dev | uv sync --all-groups and uv run prek install |
make lint | uv run task lint |
make format | uv run task format |
make test | uv run task test |
make build | uv build |
make hooks | uv run prek run --all-files |
make audit | uv run pip-audit |
| Never | Always |
|---|---|
uv pip install | uv add / uv sync |
source .venv/bin/activate | uv run <cmd> |
[project.optional-dependencies] for dev | [dependency-groups] (PEP 735) |
requirements.txt | pyproject.toml + uv.lock |
mypy / pyright | ty |
black / isort / flake8 | ruff |
pre-commit | prek |
Poetry | uv |
[tool.ty] python-version | [tool.ty.environment] python-version |
src/ layout usedrequires-python = ">=3.11"ruff + ty configuredtaskipy tasks configured (lint, format, test) — delegate to /python-testsuv.lock committedprek install run (git hooks active).claude/rules/python.md applied