uv-env
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.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- uv-env
- description
- 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.
03 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
numpypackage" - "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
| Task | Command |
|---|---|
Create env from pyproject.toml |
uv sync |
| Add a package | uv add <pkg> |
| Add a dev package | uv add --dev <pkg> |
| Remove a package | uv remove <pkg> |
| Run a command in the env | uv run <cmd> |
| Pin Python version | uv python pin <version> |
| Update lockfile | uv lock |
| Upgrade all deps | uv sync --upgrade |
Notes
- Commit
pyproject.tomlanduv.lock. Don't commit.venv/. - The skill defaults to a minimal
pyproject.tomland 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-pythonis too tight; loosening to>=3.10usually fixes it.
04 同仓库更多 Skills
workflow-skill-creator
Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say "make this a skill", "create a skill from what we just did", "package this workflow" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).
uv
Checks whether the uv Python package manager is installed and installs it if missing. Ensures uv is on PATH. Use when another skill requires uv as a prerequisite.
uniprot-database
Access protein metadata, function, taxonomy, and sequences across UniProtKB, UniParc, and UniRef. Use when searching for proteins, mapping identifiers, or retrieving functional annotations and publications. Don't use for sequence alignment, protein folding, or sequence similarity search (use specialized skills for those tasks).
unibind-database
Queries the UniBind database for experimentally validated transcription factor (TF) binding sites. Use when retrieving direct TF-DNA interaction datasets, downloading binding site coordinates (BED/FASTA) for local analysis, or listing available datasets by species, cell line, or TF name. Don't use to query specific intervals, locations, genes, motif models or expression data.
ucsc-conservation-and-tfbs
Fetch Evolutionary Conservation scores (phyloP, phastCons) and Transcription Factor Binding Sites (TFBS) from the UCSC Genome Browser. Use when analyzing whether genomic variants or regions are evolutionarily conserved, functionally important, or bounded by TF regulators across major projects (ENCODE, JASPAR, ReMap).
string-database
Query the STRING database for protein-protein interactions (PPIs), functional enrichment, and homology. Use when the user asks about interactions between specific proteins, interaction evidence, confidence scores, protein interaction partners, or pathway enrichments.