Python (uv-first) Skill
Use uv for Python workflows.
Rules
- •
Default to
uvfor running, installing, and tooling. - •
Any standalone script you write MUST be a PEP 723 script and runnable as:
bashuv run path/to/script.py
- •
Avoid
python path/to/script.pyin instructions.- •Exception: CLI one-liners the agent runs during investigation, e.g.
python -c '...'.
- •Exception: CLI one-liners the agent runs during investigation, e.g.
- •
Do not mention Poetry unless the repo is legacy and already requires it.
- •If Poetry is required, follow the repo convention; optionally propose migration to
uvwhen appropriate.
- •If Poetry is required, follow the repo convention; optionally propose migration to
- •
In greenfield repos, or legacy
setup.py/pip projects, prefer moving topyproject.toml+uvwhen appropriate.
PEP 723 template
python
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "requests>=2",
# ]
# ///
def main() -> None:
print("hello")
if __name__ == "__main__":
main()