skills/uv-scripts/SKILL.md
Use when running or authoring standalone Python scripts with uv, especially when choosing Python versions, adding one-off dependencies, using no-project mode, or embedding inline script metadata.
npx skillsauth add narumiruna/agent-skills uv-scriptsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use uv run to execute standalone Python scripts with automatic dependency management. Core principle: prefer inline script metadata for reusable scripts, and use --no-project when running an ad hoc script from inside a project without needing project code.
For package/project dependency management, use python-uv-project-setup.
uv run script.py when no extra dependencies are needed.uv run --with ... for disposable one-off dependencies.--no-project only when running inside a project and the script should ignore project code.| Need | Command |
| --- | --- |
| Run a script | uv run script.py |
| Run module | uv run -m http.server 8000 |
| Run from stdin | uv run - |
| Here-doc | uv run - <<EOF ... EOF |
| Skip project install | uv run --no-project script.py |
| One-off deps | uv run --with requests --with rich script.py |
| Pick Python | uv run --python 3.12 script.py |
| Init script metadata | uv init --script script.py --python 3.12 |
| Add script deps | uv add --script script.py requests rich |
| Lock script deps | uv lock --script script.py |
uv run example.py
uv run example.py arg1 arg2
Run a module:
uv run -m http.server 8000
uv run -m pytest
Read from stdin:
echo 'print("hello")' | uv run -
Here-doc:
uv run - <<EOF
print("hello")
EOF
pyproject.toml), uv run installs the project first.--no-project to skip project discovery and installation.--no-project flag must be before the script name.--no-project.uv run --no-project example.py
If you use inline script metadata, project dependencies are ignored automatically and --no-project is not required.
Use --with for disposable, per-invocation dependencies:
uv run --with rich example.py
uv run --with 'rich>12,<13' example.py
uv run --with rich --with requests example.py
In a project, these dependencies are added on top of project dependencies. Use --no-project when the script should not see the project environment.
Use inline metadata instead of --with when the dependency list should live with the script or be reused by others.
Initialize inline metadata:
uv init --script example.py --python 3.12
Add dependencies:
uv add --script example.py 'requests<3' 'rich'
Example script:
# /// script
# dependencies = [
# "requests<3",
# "rich",
# ]
# ///
import requests
from rich.pretty import pprint
resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])
Use inline metadata for scripts that should be reproducible, executable by other users, or kept outside a full project.
Notes:
dependencies field must be provided even if empty.--no-project is not required.Specify a Python requirement in metadata:
# /// script
# requires-python = ">=3.12"
# dependencies = []
# ///
uv run will locate (and download if needed) the required Python version.
#!/usr/bin/env -S uv run --script
print("Hello, world!")
Make executable and run:
chmod +x greet
./greet
Dependencies are supported in this mode via inline metadata.
Lock dependencies for a script:
uv lock --script example.py
This creates example.py.lock next to the script. Subsequent uv run --script, uv add --script, and uv export --script reuse the lock.
To improve reproducibility across time, add exclude-newer:
# /// script
# dependencies = ["requests"]
# [tool.uv]
# exclude-newer = "2023-10-16T00:00:00Z"
# ///
uv add --index "https://example.com/simple" --script example.py 'requests<3' 'rich'
This adds tool.uv.index metadata to the script.
uv run --python 3.10 example.py
On Windows, .pyw scripts run with pythonw:
uv run example.pyw
Dependencies still work, e.g. uv run --with PyQt5 example_pyqt.pyw.
python script.py after installing deps manually instead of uv run.--no-project in project directories when you do not need project code.--no-project after the script name.# /// script metadata block when you want self-contained scripts.pip install for a script dependency.pyproject.toml only to run a one-file script.--no-project for a script that imports local package code.development
Score or compare one or more agent skills across trigger clarity, workflow actionability, safety boundaries, verification rigor, incremental knowledge value, and leanness. Use only when the user explicitly asks for ratings, numerical quality scores, rubric-based scorecards, or scored comparisons; use creating-agent-skills for unscored reviews or revisions.
development
Assess or improve an existing codebase's architecture when the user asks about module boundaries, coupling, scattered ownership, testability, change locality, deep modules, seams, or behavior-preserving structural refactoring. Use for cross-module design rather than ordinary diff review or a confirmed edge-case bug fix.
development
Perform read-only security audits, vulnerability assessments, or threat-focused reviews of diffs, pull requests, code paths, or explicitly scoped repositories when security is the primary objective or acceptance criterion. Use reviewing-code for ordinary review with baseline security coverage and hardening-code-paths for fixing confirmed findings.
development
Run iterative multi-reviewer panels over a code diff, verify their findings, apply explicitly authorized fixes, and re-review the updated change until it passes or reaches a stopping condition. Use when the user asks for a panel loop, multi-model code-review consensus, or a review-fix-re-review cycle.