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 14d 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.
- 14d 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 15d 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.
Other skills, from other repositories
python-release
Handle Python SDK release, build, bump, packaging metadata, PyPI client pin, uv.lock, nox/build workflow, and publish verification changes. Use for Python release process work or dependency pin bumps; do not use for ordinary Python feature implementation.
writing-friday-python-agents
Authoring guide for Python user agents (type:"user") on the Friday platform via the friday-agent-sdk. Covers the @agent decorator, AgentContext capabilities (ctx.llm, ctx.http, ctx.tools, ctx.stream), structured input parsing, result types, and the NATS subprocess execution model. Load when an agent.py exists in…
performant-python
Strategies for high-performance Python systems (FastAPI, Asyncio, UVloop, Memory Optimization).
project-graveyard
Scans the developer's machine for dead side projects, autopsies each one from its git history (died at the payments wall, killed by a newer project, finished but never shipped), surfaces their personal death patterns, and picks the corpse most worth resurrecting — then helps ship it. Use when the user mentions…
commit-archaeologist
Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite…
scope-creep-detector
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, public API renames, config or CI edits, oversized hunks, and formatting-only files. Use when the user asks whether a change grew beyond the fix, a PR is too…