agentleFS
pengqianhanpengqianhan/open-paper-skills/skills/uv-env/SKILL.md

uv-env

Skill2 starsChanged 5 months agoMITView on GitHub

Create and manage Python project environments with the uv package manager. Use whenever the user wants to set up a new Python project, create a virtual environment, initialize a pyproject.toml, install/add Python packages, lock or sync dependencies, or pin a Python version — even if they don't explicitly mention "uv". Prefer this skill over raw pip/venv/conda for any Python environment work in a project directory.

  • Pipes a download into a shell
  • Installs packages

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check that uv is installed:

    line 21
  2. Distinctive:

    If missing, install it (Linux/macOS):

    line 27
  3. Very specific:

    If the directory has no pyproject.toml, create a minimal one.

    line 39
  4. Very specific:

    Use >=3.10 as a sensible default unless the user specifies otherwise.

    line 50
  5. Very specific:

    Avoid uv init when the user already has files in the directory — it can scaffold extra files (README.md, hello.py, .python-version) the …

    line 52
  6. Distinctive:

    If the user requested a specific Python version, set it first:

    line 65
  7. Very specific:

    Always use uv add rather than pip install — it updates pyproject.toml and uv.lock together.

    line 74
  8. Very specific:

    Prefer uv run over manually activating .venv:

    line 84
  9. Distinctive:

    If the user explicitly wants to activate the venv (e.g., for an interactive shell session), use the traditional approach:

    line 93
  10. Very specific:

    Prefer uv run for one-off commands and scripts — it's stateless and avoids the "wrong env activated" footgun.

    line 100
  11. Very specific:

    Commit pyproject.toml and uv.lock.

    line 117
  12. Very specific:

    If the user runs into a resolution conflict, check whether requires-python is too tight.

    line 119

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

uv-env

Set up and maintain Python project environments using uv. uv is fast, replaces pip + venv + pip-tools, and works from a single pyproject.toml.

When to use

  • "Create a Python environment for this project"
  • "Set up a pyproject.toml"
  • "Install / add the numpy package"
  • "Lock the dependencies"
  • "Pin Python to 3.11"
  • Any request to bootstrap a Python project where the manager is unspecified — default to uv.

Prerequisites

Check that uv is installed:

uv --version

If missing, install it (Linux/macOS):

curl -LsSf https://astral.sh/uv/install.sh | sh

Then ensure it's on PATH (the installer prints the line to source, usually ~/.local/bin).

Core workflow

1. Initialize a project

If the directory has no pyproject.toml, create a minimal one. Keep dependencies empty at start — only add what's needed.

[project]
name = "<project-name>"
version = "0.1.0"
description = "<short description>"
requires-python = ">=3.10"
dependencies = []

Use >=3.10 as a sensible default unless the user specifies otherwise. Pick name from the directory name (kebab-case).

Avoid uv init when the user already has files in the directory — it can scaffold extra files (README.md, hello.py, .python-version) the user didn't ask for. Writing the pyproject.toml directly is cleaner.

2. Create the virtual environment

uv sync

This:

  • Creates .venv/ in the project root
  • Resolves dependencies from pyproject.toml
  • Writes/updates uv.lock

If the user requested a specific Python version, set it first:

uv python pin 3.11
uv sync

3. Add packages later

Always use uv add rather than pip install — it updates pyproject.toml and uv.lock together.

uv add numpy pandas
uv add --dev pytest ruff      # dev-only deps
uv remove <package>           # remove

4. Run commands inside the environment

Prefer uv run over manually activating .venv:

uv run python script.py
uv run pytest

uv run ensures the environment is in sync before executing.

If the user explicitly wants to activate the venv (e.g., for an interactive shell session), use the traditional approach:

source .venv/bin/activate   # bash/zsh
deactivate                  # exit

Prefer uv run for one-off commands and scripts — it's stateless and avoids the "wrong env activated" footgun.

Quick reference

TaskCommand
Create env from pyproject.tomluv sync
Add a packageuv add <pkg>
Add a dev packageuv add --dev <pkg>
Remove a packageuv remove <pkg>
Run a command in the envuv run <cmd>
Pin Python versionuv python pin <version>
Update lockfileuv lock
Upgrade all depsuv sync --upgrade

Notes

  • Commit pyproject.toml and uv.lock. Don't commit .venv/.
  • The skill defaults to a minimal pyproject.toml and grows it incrementally — don't preinstall packages the user hasn't asked for. This keeps the lockfile small and avoids dragging in transitive deps that might cause version conflicts later.
  • If the user runs into a resolution conflict, check whether requires-python is too tight; loosening to >=3.10 usually fixes it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.