Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mir-am/skills-agents-ai-coding --skill python-venvgit clone --depth 1 https://github.com/mir-am/skills-agents-ai-codingWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/python-venv)<a href="https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/python-venv"><img src="https://agentmods.dev/badge/skills/mir-am/skills-agents-ai-coding/python-venv/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/python-venv"><img src="https://agentmods.dev/badge/skills/mir-am/skills-agents-ai-coding/python-venv.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.01694 |
| Opus 5.5 | $0.00011 | $0.00678 |
| Sonnet 5.5 | $0.00006 | $0.00339 |
| Haiku 4.5 | $0.00003 | $0.00169 |
Grade A, and why
python-venv scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
result = subprocess.run( How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
What I do
- Create
.venvin the project root using an available Python 3 interpreter - Reuse a working environment without recreating it or changing its packages
- Preserve existing files when
.venvis not a valid virtual environment - Ensure the root
.gitignoreexcludes.venv/, preserving existing content - Verify the environment's interpreter and Git ignore behavior
When to use me
Use when setting up a project-local Python virtual environment or ensuring an existing .venv stays out of Git. This workflow requires Git and a Bash-compatible POSIX environment with Python 3; it does not install project dependencies or commit changes.
Workflow
1. Locate the project and interpreter
Read project instructions and any Python version requirements first. Use the Git working-tree root as the project root, including when invoked from a subdirectory. For an explicitly selected nested project, resolve its location before adapting the paths below. If there is no Git working tree, report that prerequisite instead of initializing a repository.
For a new environment, prefer a user-specified or project-required interpreter when available. The command below tries python3, then python, accepting only Python 3 with the standard-library venv module. Adjust the candidate list for a required version or a discovered versioned executable such as python3.12; do not silently substitute an incompatible version. Reuse an existing valid environment even if no separate Python executable is on PATH; report any conflict with the project's Python requirement.
2. Create or reuse, exclude, and verify
Run this block with Bash. It stops before changing an invalid .venv, a symlink at .venv or .gitignore, or an environment already tracked by Git. Normal interpreter symlinks inside a virtual environment are supported.
(
set -e
venv_project_root=$(git rev-parse --show-toplevel)
cd "$venv_project_root"
if [ -L .venv ] || [ -L .gitignore ]; then
echo 'Stop: .venv or .gitignore is a symlink; preserve it and resolve the target first.' >&2
exit 1
fi
if [ -e .gitignore ] && [ ! -f .gitignore ]; then
echo 'Stop: .gitignore is not a regular file; leaving it unchanged.' >&2
exit 1
fi
venv_tracked=$(git ls-files -- .venv)
if [ -n "$venv_tracked" ]; then
echo 'Stop: .venv has tracked files; ignore rules cannot untrack them.' >&2
exit 1
fi
verify_venv() {
[ -f .venv/pyvenv.cfg ] && [ -x .venv/bin/python ] &&
.venv/bin/python -I -c 'import pathlib, sys; expected = pathlib.Path(".venv").resolve(); sys.exit(0 if sys.version_info.major == 3 and sys.prefix != sys.base_prefix and pathlib.Path(sys.prefix).resolve() == expected else 1)'
}
if [ -e .venv ]; then
if ! verify_venv; then
echo 'Stop: existing .venv is not a working Python 3 virtual environment; preserved unchanged.' >&2
exit 1
fi
echo 'Reusing .venv'
else
venv_python=''
for venv_candidate in python3 python; do
if command -v "$venv_candidate" >/dev/null 2>&1 &&
"$venv_candidate" -I -c 'import sys, venv; sys.exit(0 if sys.version_info.major == 3 else 1)' >/dev/null 2>&1; then
venv_python="$venv_candidate"
break
fi
done
if [ -z "$venv_python" ]; then
echo 'Stop: no usable Python 3 with the venv module found.' >&2
exit 1
fi
"$venv_python" -m venv .venv
verify_venv
echo 'Created .venv'
fi
.venv/bin/python -I - <<'PY'
from pathlib import Path
import subprocess
def ignored_by_root():
result = subprocess.run(
["git", "check-ignore", "--no-index", "-v", "-z", "--stdin"],
input=b".venv/\0", stdout=subprocess.PIPE, check=False,
)
if result.returncode not in (0, 1):
raise SystemExit("Stop: git check-ignore failed.")
fields = result.stdout.split(b"\0")
return (len(fields) == 5 and fields[0] == b".gitignore"
and bool(fields[2]) and not fields[2].startswith(b"!"))
ignore = Path(".gitignore")
if not ignored_by_root():
content = ignore.read_bytes() if ignore.exists() else b""
newline = b"\r\n" if b"\r\n" in content else b"\n"
separator = b"" if not content or content.endswith(b"\n") else newline
with ignore.open("ab") as stream:
stream.write(separator + b".venv/" + newline)
print("Added .venv/ to root .gitignore")
else:
print("Root .gitignore already excludes .venv/")
if not ignored_by_root():
raise SystemExit("Stop: root .gitignore does not exclude .venv/.")
PY
verify_venv
.venv/bin/python -I -c 'import sys; print("Interpreter:", sys.executable); print("Version:", sys.version.split()[0]); print("Environment:", sys.prefix)'
git check-ignore -q -- .venv/pyvenv.cfg
git check-ignore -v -- .venv/ .venv/pyvenv.cfg
)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 133 lines · 28 tokens per session scan A 85730ddc950b
python-venv is a skill published in the GitHub repository mir-am/skills-agents-ai-coding (2 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 1,694 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.
python-venv compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| python-venvmir-am/skills-agents-ai-coding | Skill | 2 | 2mo ago | MIT | A | 28 | Claude Code, Codex |
| python-releaseComposioHQ/composio | Skill | 31k | today | MIT | A | 53 | Claude Code, Codex |
| performant-pythonandreibesleaga/GABBE | Skill | 24 | 3d ago | none | A | 55 | Claude Code, Codex |
| writing-friday-python-agentsfriday-platform/friday-studio | Skill | 102 | 2mo ago | none | A | 131 | Claude Code, Codex |
| project-graveyardShubhamsaboo/awesome-llm-apps | Skill | 146k | today | Apache-2.0 | A | 127 | Claude Code, Codex |
| effect-v4ComposioHQ/composio | Skill | 31k | today | MIT | A | 159 | Claude Code, Codex |
| marimo-pairmarimo-team/marimo | Skill | 24k | yesterday | Apache-2.0 | A | 57 | Claude Code, Codex |