AgentSkillsCN

python-uv

Python 政策:优先使用 uv,遵循 PEP 723 脚本规范,通过 uv run 运行

SKILL.md
--- frontmatter
name: python-uv
description: "Python policy: uv-first, PEP 723 scripts, run via uv run"

Python (uv-first) Skill

Use uv for Python workflows.

Rules

  • Default to uv for running, installing, and tooling.

  • Any standalone script you write MUST be a PEP 723 script and runnable as:

    bash
    uv run path/to/script.py
    
  • Avoid python path/to/script.py in instructions.

    • Exception: CLI one-liners the agent runs during investigation, e.g. python -c '...'.
  • 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 uv when appropriate.
  • In greenfield repos, or legacy setup.py/pip projects, prefer moving to pyproject.toml + uv when appropriate.

PEP 723 template

python
# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "requests>=2",
# ]
# ///

def main() -> None:
    print("hello")


if __name__ == "__main__":
    main()