Main Site ↗

setup-env

by benchflow-ai890173GitHub

When given a Python project codebase, this skill helps the agent to set up virtual environments, install dependencies, and run scripts.

Unlock Deep Analysis

Use AI to visualize the workflow and generate a realistic output preview for this skill.

Powered by Fastest LLM

Development
Compatible Agents
Claude Code
Claude Code
~/.claude/skills/
Codex CLI
Codex CLI
~/.codex/skills/
Gemini CLI
Gemini CLI
~/.gemini/skills/
O
OpenCode
~/.opencode/skills/
O
OpenClaw
~/.openclaw/skills/
GitHub Copilot
GitHub Copilot
~/.copilot/skills/
Cursor
Cursor
~/.cursor/skills/
W
Windsurf
~/.codeium/windsurf/skills/
C
Cline
~/.cline/skills/
R
Roo Code
~/.roo/skills/
K
Kiro
~/.kiro/skills/
J
Junie
~/.junie/skills/
A
Augment Code
~/.augment/skills/
W
Warp
~/.warp/skills/
G
Goose
~/.config/goose/skills/
SKILL.md

Skill: Use uv to manage Python environments

Scope

  1. Create a virtual environment
  2. Install dependencies
  3. Run Python scripts/commands

Assume uv is already available on PATH.


Workflow selection

  • If pyproject.toml exists: use project workflow (uv sync, uv run)
  • Else if requirements.txt exists: use pip workflow (uv venv, uv pip install -r ..., .venv/bin/python ...)
  • Else: stop with an error ("No pyproject.toml or requirements.txt found.")

Project workflow (pyproject.toml)

Create venv + install dependencies

From the repo root (where pyproject.toml is):

  • uv sync

Notes:

  • uv maintains a persistent project environment at .venv and installs deps there.

Run scripts / commands (preferred)

Always run within the project environment:

  • uv run -- python <script.py> [args...]
  • uv run -- python -m <module> [args...]

Notes:

  • uv run executes inside the project environment and ensures it is up-to-date.

Pip workflow (requirements.txt)

Create venv

From the repo root:

  • uv venv # creates .venv by default

Install dependencies

  • uv pip install -r requirements.txt

Run scripts / commands

Run using the venv interpreter directly (no activation required):

  • .venv/bin/python <script.py> [args...]
  • .venv/bin/python -m <module> [args...]

(uv will also automatically find and use the default .venv in subsequent invocations when you use uv pip ... commands.)


Minimal sanity checks (optional)

  • test -x .venv/bin/python
  • uv pip list (verify packages installed)

Source: https://github.com/benchflow-ai/SkillsBench#tasks-no-skills-setup-fuzzing-py-environment-skills-setup-env

Content curated from original sources, copyright belongs to authors

Grade B
-AI Score
Best Practices
Checking...
Try this Skill

User Rating

USER RATING

0UP
0DOWN
Loading files...

WORKS WITH

Claude Code
Claude
Codex CLI
Codex
Gemini CLI
Gemini
O
OpenCode
O
OpenClaw
GitHub Copilot
Copilot
Cursor
Cursor
W
Windsurf
C
Cline
R
Roo
K
Kiro
J
Junie
A
Augment
W
Warp
G
Goose