pratos/clanker-setup/uv-python-execution
Claude Code and agent skill by pratos/clanker-setup
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Enforces using uv to run all Python scripts and ty for type checking. Includes inline script metadata (PEP 723) for one-time scripts with dependencies.
Install
npx vskill@latest install pratos/clanker-setup/uv-python-executionSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as pratos/clanker-setup/uv-python-execution.
UV Python Execution & Type Checking
Activation
When this skill is triggered, ALWAYS display this banner first:
Replace [Mode] with the detected trigger type.
When to Use
This skill activates automatically whenever:
Python Execution - Pattern matching on:
python script.pypython3 script.pypython -m modulepython3 -m module- Any direct Python interpreter invocation
One-Time Scripts - Pattern matching on:
- "write a quick script"
- "make a standalone script"
- "one-off script"
- "throwaway script"
- Scripts needing packages not in the project
Type Checking - Pattern matching on:
pyrightmypy- Any type checking operation
Rules
1. ALWAYS use `uv run` to execute Python scripts and modules.
2. ALWAYS use `ty` for type checking (not pyright or mypy directly).
Correct Usage - Python Execution
Incorrect Usage - Python Execution (NEVER DO)
Correct Usage - Type Checking
Incorrect Usage - Type Checking (NEVER DO)
Why
Python Execution with uv run
- Dependency isolation:
uv runensures the script runs with the project's virtual environment and dependencies - Reproducibility: Uses the exact versions locked in
uv.lock - Consistency: All team members run scripts the same way
- No activation needed: Works without manually activating the venv
Type Checking with ty
- Speed:
tyis extremely fast (written in Rust by Astral, same team as uv/ruff) - Unified toolchain: Part of the Astral ecosystem (uv, ruff, ty) for consistent tooling
- Project-aware: Reads
pyproject.tomlconfiguration automatically - Better defaults: Sensible defaults for modern Python projects
Exceptions
Python Execution
- System Python checks:
python3 --versionto check system Python (but preferuv run python --version) - Inside Docker/CI: When explicitly running inside a container with pre-configured environment
- User explicitly requests: If user says "use python directly" or "don't use uv"
Type Checking
- CI/pre-commit already configured: If CI uses pyright/mypy explicitly
- User explicitly requests: If user says "use pyright" or "use mypy"
- Compatibility checks: When verifying behavior matches pyright/mypy specifically
Implementation
Python Execution
When writing Bash commands that execute Python:
- Prefix with `uv run`: Always add
uv runbeforepythonorpython3 - Check existing scripts: If referencing a script in
scripts/, verify it usesuv runin justfile tasks - For new scripts: Add corresponding justfile tasks that use
uv run
Type Checking
When checking types or fixing type errors:
- Use `ty check`: Run
ty checkinstead of pyright/mypy - Target specific files: Use
ty check path/to/file.pyfor focused checking - Iterative fixing: Run
ty check, fix errors, repeat until clean
Examples
Training a Model
Running Tests
Quick Python Check
Type Checking Before Fixing Code
One-Time Scripts (Inline Dependencies)
When the user asks for a quick standalone script with external dependencies, use uv's inline script metadata (PEP 723). This runs scripts with their own dependencies without polluting the project environment.
When to Use
- "write a quick script to fetch data from an API"
- "make a one-off script to process this CSV"
- "create a standalone script that uses requests/pandas/etc."
- Any throwaway or utility script needing packages not in the project
Inline Script Format
Add a special comment block at the top of the script:
Running Inline Scripts
Examples
Fetch and display JSON data:
Quick CSV processing:
Web scraping one-liner:
Key Points
- No project setup needed: Dependencies are installed in an isolated cache
- Reproducible: Specify exact versions if needed (
requests>=2.28,<3) - Self-contained: Script documents its own requirements
- Fast: uv caches dependencies, subsequent runs are instant
When NOT to Use Inline Scripts
- Script will be used repeatedly by the team → Add to project dependencies
- Script is part of the main codebase → Use
uv runwith project deps - Complex multi-file scripts → Create proper package structure
Red Flags
❌ Using python or python3 directly without uv run ❌ Activating venv manually before running (.venv/bin/activate) ❌ Using pip install instead of uv add or uv pip install ❌ Using pyright or mypy instead of ty check ❌ Running type checking with uv run pyright or uv run mypy ❌ Installing packages globally for one-time scripts (use inline metadata instead)
Success Criteria
✅ All Python script executions use uv run prefix ✅ New scripts have corresponding justfile tasks ✅ Consistent execution environment across all runs ✅ All type checking uses ty check ✅ Type errors are checked before and after code changes ✅ One-time scripts use inline metadata (PEP 723) for dependencies
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/uv-python-execution/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/pratos/clanker-setup/uv-python-execution)