Skip to content
Agentmart
Submit a tool

python-venv

Always use this skill before any explicit or implicit Python execution in a workspace (for example python/python3 commands, shebang scripts, test/build tools…

Skill by anaregdesign

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/anaregdesign-python-venv

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Always use this skill before any explicit or implicit Python execution in a workspace (for example python/python3 commands, shebang scripts, test/build tools that invoke Python, uv run, uvx, pip, poetry, tox, or nox). Provision and activate uv environments under workspace-dir/python/vX.Y.Z, switch Python versions, and manage dependencies with uv add, uv lock, and uv sync.

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/python-venv

What's inside

Skill name
python-venv
Description
Always use this skill before any explicit or implicit Python execution in a workspace (for example python/python3 commands, shebang scripts, test/build tools that invoke Python, uv run, uvx, pip, poetry, tox, or nox). Provision and activate uv environments under workspace-dir/python/vX.Y.Z, switch Python versions, and manage dependencies with uv add, uv lock, and uv sync.
License
MIT
Instructions
102 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (2)

  • SKILL.md
  • .gitkeep · assets/

SKILL.md (first lines)

# Python Venv Environment Provider

## Hard Rules

- Always place projects under `<workspace-dir>/python/vX.Y.Z`.
- Resolve absolute `<workspace-dir>` from MCPHost app context (for example workspace metadata, current project root, or an environment variable such as `PYTHON_VENV_WORKSPACE_DIR`).
- Never depend on caller `cwd` to choose project location.
- MCPHost can run CLI directly. Do not require helper script files.
- Invoke this skill before any Python code execution in the workspace.
- This skill performs environment provisioning only. Do not execute user Python code in this skill.
- Do not generate business/domain artifacts (for example deck plans, chart specs, PPTX files).
- If the requested version does not exist yet, create it and activate it.
- For dependency changes, run `uv add`, then `uv lock`, then `uv sync` in the target version project.
- If version is not specified, default to `3.12.8`.
- Call `path` at most once at the end of provisioning. Do not poll it in a loop.

## Prerequisites

- Require `uv` in `PATH`. Check with `uv --version`.
- If `uv` is missing on macOS, run `brew install uv`.
- If `uv` is missing on Linux, run `curl -LsSf https://astral.sh/uv/install.sh | sh`.
- If `uv` is missing on Windows (PowerShell), run `winget install --id=astral-sh.uv -e`.
- If `winget` is unavailable, run `powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"`.
- For current options, see `https://docs.astral.sh/uv/getting-started/installation/`.

## Handoff Contract

- Scope of this skill: create/switch Python virtual environments and manage Python packages only.
- After provisioning, return only:
  - version used,
  - resolved environment directory from `path <version>`,
  - packages added (if any).
- Do not continue into domain workflow steps after this handoff.

## Action Semantics

Use these action labels as procedural units. Implement them with direct shell commands.

1. `ensure <version>`
   - Create `<workspace-dir>/python/vX.Y.Z`.
   - Initialize uv project if missing.
   - Create `.venv` with the requested Python version.
2. `activate <version>`
   - Activate existing venv.
   - If venv is missing, run `ensure` first.
3. `deactivate`
   - Deactivate current venv if active.
   - Use this only when you explicitly want to leave the active environment.
4. `use <version>`
   - Run `ensure`.
   - If another venv is active, `deactivate` first.
   - Activate requested version.
5. `add <version> <deps...>`
   - Run `ensure`.
   - Run `uv add <deps...>`, `uv lock`, `uv sync`.
   - If non-Python dependencies are included (for example `pptxgenjs`), skip them and show install guidance.
6. `path <version>`
   - Print resolved `<workspace-dir>/python/vX.Y.Z` path.

## Environment Provisioning Protocol

When asked for a Python environment, perform the following in order:

1. Choose version:
   - User-specified version if provided.
   - Otherwise `3.12.8`.
2. Resolve `env_dir="<workspace-dir>/python/v<version>"`.
3. Run `ensure` then `activate`.
4. If dependency updates are requested, run `add`.
5. Return `path` once at the end.

## MCPHost CLI Contract

1. Resolve absolute `<workspace-dir>` first.
2. Execute one `bash -lc` command that includes:
   - workspace path input passed from MCPHost (for example `PYTHON_VENV_WORKSPACE_DIR="<workspace-dir>"`),
   - direct `uv` commands for `ensure` and (if needed) `activate` / `add` / `path`.
3. Run in this order:
   - `use`,
   - optional `add`,
   - `path` (once at end).

```bash
bash -lc '
PYTHON_VENV_WORKSPACE_DIR="<workspace-dir>"
version="3.12.8"
env_dir="$PYTHON_VENV_WORKSPACE_DIR/python/v$version"
mkdir -p "$env_dir"
cd "$env_dir"
test -f pyproject.toml || uv init --bare --python "$version" --name "python_v${version//./_}"
uv venv --python "$version" --allow-existing
source "$env_dir/.venv/bin/activate"
'
```

## Direct Command Notes

- `add` should skip non-Python dependencies such as `pptxgenjs` / `npm:pptxgenjs` and print install guidance instead of failing.
- `path` should print `<workspace-dir>/python/v<version>`.
- `deactivate` should be used only when explicitly switching environments.

From anaregdesign/skills, MIT.

More from anaregdesign/skills

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Mar 8, 2026 (7 months ago)
Last release
Mar 11, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from anaregdesign

Cite this page

python-venv skill. Agent Mart. https://agentmart.dev/skills/anaregdesign-python-venv (last updated 2026-10-24)