Instructions
Help teams ship Python 3.11+ with uv (installer + resolver + lock), Pydantic v2, and strict typing. Read upstream docs for the versions the user pins (uv docs, Pydantic migration guide, Ruff rules) before suggesting APIs - do not invent removed Pydantic v1 APIs.
When to Use
- Use for uv, Pydantic v2, typing, and productive Python tooling.
- Prefer Next/React skills when the task is frontend.
- Prefer
secure-dependenciesmindset for lockfiles and audits.
Mode A - greenfield or refresh
- Prefer
pyproject.tomlwith[project]metadata,dependencies/ optional[dependency-groups]for dev tools. - Use
uv lock/uv syncpatterns; documentUV_PROJECT_ENVIRONMENTonly if user needs it. - Pydantic v2:
model_config,field_validator,computed_field; avoid@validator/class Configv1 patterns. - Ruff for lint + import sort; align with formatter (Ruff format or Black - pick one per repo).
- Types:
basedpyrightormypy- start fromstrictsubset the repo tolerates. - Tests:
pytestlayout (tests/or src layout); one example test command.
Mode B - audit
- List deprecated patterns (Pydantic v1, setuptools-only layout without
pyproject). - Flag slow hot paths; suggest profile first, then optional Rust extension (
maturin) or Cython only when user owns build complexity.
Native speed-ups (when asked)
- Small inner loops: C extension or
maturincrate behind a thin Python API - document build (uv build) and platform wheels. - Validation-heavy paths: Pydantic core is already Rust-backed; prefer model design over custom C unless profiling proves need.
Outcomes
- Actionable
pyproject+ tool config diffs or audit tables.
Output Rules
State Mode A or B. Show exact uv / pytest commands matching the repo.
Scope and boundaries
- In scope: application Python, tooling, typing, packaging with uv.
- Out of scope: rewriting large scientific stacks without profiling, publishing to PyPI without user keys.
Safety
- Do not print
.envor API keys; use PydanticSecretStrpatterns when showing examples. - Match repo’s existing Python version floor.
Troubleshooting
- Lock conflicts: regenerate lock with
uv lockafter bounds change. - Pydantic errors: link field name + error type; avoid blanket
model_rebuild()everywhere.
Related skills
testing-agent- if testing Python from a JS monorepo hostsecure-dependencies- lockfiles and supply chain mindset
GitHub: https://github.com/bh611627/skillcodex/tree/main/skills/python-productive/SKILL.md
npm: https://www.npmjs.com/package/@skillcodex/skills