uv-package-manager

SKILL.md

Reference Files

Detailed uv guidance organized by topic:


UV Package Manager

Expert guidance for using uv, an extremely fast Python package installer and resolver written in Rust. Provides 10-100x faster installation than pip with drop-in compatibility, virtual environment management, Python version management, and modern lockfile support.

Focus Areas

  • Ultra-fast project initialization and dependency installation
  • Virtual environment creation and management with automatic activation
  • Python interpreter installation and version pinning
  • Lockfile-based reproducible builds for CI/CD
  • Migration from pip, pip-tools, and poetry
  • Monorepo and workspace support
  • Docker and production deployment optimization
  • Cross-platform compatibility (Linux, macOS, Windows)

Core Approach

Essential patterns for effective uv usage:

Project initialization:

  • Use uv init for new projects (creates pyproject.toml, .python-version, .gitignore)
  • Use uv sync to install from existing pyproject.toml
  • Pin Python versions with uv python pin 3.12
  • Always commit uv.lock for reproducible builds

Virtual environments:

  • Prefer uv run over manual venv activation (auto-manages environment)
  • Create venvs with uv venv (detects Python version from .python-version)
  • Use uv venv --python 3.12 for specific versions

Package management:

  • Use uv add package to add and install dependencies
  • Use uv add --dev pytest for development dependencies
  • Use uv remove package to remove dependencies
  • Use uv lock to update lockfile, uv sync --frozen to install from lockfile

Reproducible builds:

  • Use uv sync --frozen in CI/CD (installs exact versions from lockfile)
  • Use uv lock --upgrade to update all dependencies
  • Use uv lock --upgrade-package requests to update specific packages
  • Export to requirements.txt with uv export --format requirements-txt

Performance optimization:

  • Global cache shared across projects (automatic)
  • Parallel installation (automatic)
  • Offline mode with --offline flag
  • Use --frozen to skip resolution in CI

Quality Checklist

Before deploying uv-based projects:

  • uv.lock committed to version control for reproducible builds
  • .python-version exists and specifies required Python version
  • pyproject.toml includes all production and dev dependencies
  • CI/CD uses uv sync --frozen for exact reproduction
  • Docker builds leverage multi-stage builds and cache mounting
  • Local development uses uv run to avoid activation issues
  • Dependencies organized into optional groups ([project.optional-dependencies])
  • Python version constraints specified (requires-python = ">=3.8")
  • Security: uv export with --require-hashes for production lockdown

Safety and Best Practices

Version control: Always commit uv.lock and .python-version; never commit .venv.

CI/CD: Use --frozen to prevent unexpected updates; pin uv version; cache uv's global cache directory.

Security: Use uv export --require-hashes for supply chain security; review dependency updates; use uv tree to audit the dependency graph.

Development: Use uv run instead of activating venvs; create separate optional dependency groups; test with minimal dependencies before adding extras.

Where to Find What

Resources

Weekly Installs
5
GitHub Stars
9
First Seen
Jan 25, 2026
Installed on
opencode5
antigravity5
claude-code5
gemini-cli5
codex4
windsurf4