Using uv

From lexler/skill-factory · View interactive version

Using uv is an AI agent skill from the GitHub repository lexler/skill-factory. Python package and project management with UV. Use when creating Python scripts, initializing projects, or managing dependencies.

How to use this skill

Skill file

UV

UV is a fast Python package manager. Two modes:

Scripts vs Projects

Use scripts when:

Use projects when:

Scripts

Standalone Python files with inline dependencies (PEP 723).

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = ["requests", "rich"]
# ///

import requests
from rich import print

Run: uv run script.py

See references/scripts.md for full guide.

Projects

Structured Python with pyproject.toml and lockfile.

uv init myproject
cd myproject
uv add requests
uv run python main.py

Key files:

See references/projects.md for full guide.

Common Patterns

uv run pytest                     # Run in project env
uv add --dev pytest               # Dev dependency
uvx ruff check .                  # One-off tool execution
uv run --with rich script.py      # Script with ad-hoc dep
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.