From mr-sparkle
Gotchas and conventions for writing Python scripts with UV inline metadata (PEP 723). Use when creating or editing Python scripts that use uv run.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mr-sparkle:uv-scriptsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Corrections and conventions for writing Python scripts with UV inline metadata (PEP 723). Claude knows UV basics but consistently gets these details wrong.
Corrections and conventions for writing Python scripts with UV inline metadata (PEP 723). Claude knows UV basics but consistently gets these details wrong.
#!/usr/bin/env -S uv run --script
Not #!/usr/bin/env uv run --script — without -S, env treats uv run --script as a single argument and fails.
For scripts that should suppress UV's own output, use --quiet:
#!/usr/bin/env -S uv run --quiet --script
The dependencies field is required even when empty:
# /// script
# requires-python = ">=3.11"
# dependencies = []
# ///
Omitting dependencies causes UV to fail, even if you only need requires-python.
#!/usr/bin/env -S uv run --quiet --script
# /// script
# requires-python = ">=3.11"
# dependencies = []
# ///
npx claudepluginhub racurry/neat-little-package --plugin mr-sparkleCreates self-contained Python scripts with inline PEP 723 dependencies for UV execution via `uv run`. Includes shebangs, templates, and examples for CLI apps and data tasks.
Runs Python scripts with uv supporting PEP 723 inline dependencies, temporary --with packages, and ephemeral uvx tools. Use for quick script execution without virtualenvs.
Validates Python shebangs and PEP 723 metadata against dependency rules. Fixes incorrect patterns or adds blocks for standalone scripts with uv.