UV Python Script Manager

VerifiedCaution

Guide UV installation and migrate Python scripts from legacy shebangs to UV inline metadata (PEP 723).

Sby Skills Guide Bot
DevelopmentIntermediate
7/24/2026
Claude Code
#python#uv#pep-723#shebang-migration#dependency-management

Recommended for

Automated summary

Detects whether UV is installed, walks the user through installation, and migrates standalone Python scripts to UV shebangs with PEP 723 inline metadata.

Strengths

  • Automates script auditing with a check script that distinguishes missing UV, stale shebangs, and non-executable files
  • Builds the PEP 723 metadata block by classifying imports as stdlib versus third-party dependencies
  • Ranks installation methods by maintenance burden and shows exact commands without running them on the user's behalf
  • Updates .sh wrappers that still call python3 so they exec the script directly

Limitations

  • Covers only standalone Python scripts, not regular Python packages
  • The supplied PEP 723 template assumes Python 3.12+, which may not suit older environments
  • Depends on the CLAUDE_PLUGIN_ROOT plugin path and Claude Code tools, so it is not portable as-is
When to use it

Use it when adopting uv across an existing set of Python scripts or converting /usr/bin/env python3 shebangs into self-executing PEP 723 scripts.

When not to use it

Skip it when uv is already configured and every script is migrated, or when you are building a distributable Python package rather than a script.

Security analysis

Caution
Quality score82/100

The skill is a legitimate UV/PEP 723 migration helper with no exfiltration, no obfuscation, and no destructive commands. Notably it explicitly refuses to execute installation commands and hands the command to the user, which is good practice. Risk comes from its use of powerful editing/chmod capabilities: broad Edit(~/.claude/**), unscoped Bash(chmod:*), and automated in-place rewriting of shebangs and shell wrappers. These are used for plausible legitimate purposes, so this is 'caution' rather than 'risky', but a reviewer should note the breadth of write/chmod scope and that the delegated check script is unaudited.

Findings
  • •Edit(~/.claude/**) grants broad write access to the user's Claude configuration/dotfiles directory
  • •Bash(chmod:*) is unscoped — chmod can be applied to any path, not just migrated scripts
  • •Step 3 rewrites shebangs, PEP 723 blocks, and .sh wrapper scripts automatically, which can break working scripts if imports are misclassified
  • •Skill relies on an external check-uv.sh from the plugin that is not shown or auditable here
How this analysis is made

Examples

Migrer un script vers uv
Convertis mon script deploy.py qui commence par #!/usr/bin/env python3 en script autonome uv avec les métadonnées PEP 723, en détectant ses dépendances.
Première installation d'uv
Je n'ai jamais installé uv. Aide-moi à l'installer sur cette machine et vérifie ensuite que mes scripts Python sont bien migrés.
Audit des shebangs
Fais un audit de mes scripts Python pour trouver ceux qui utilisent encore un shebang python3 classique et migre-les vers le format uv run --script.

name: Dev10x:py-uv description: > Guide UV installation and migrate Python scripts from legacy shebangs to UV inline metadata (PEP 723). TRIGGER when: migrating scripts to uv, setting up uv for the first time, or converting shebangs to PEP 723 format. DO NOT TRIGGER when: uv is already configured, or user is writing standard Python packages (not standalone scripts). user-invocable: true invocation-name: Dev10x:py-uv allowed-tools:

  • Bash(${CLAUDE_PLUGIN_ROOT}/skills/py-uv/scripts/:*)
  • WebFetch(https://docs.astral.sh/uv/getting-started/installation/:*)
  • AskUserQuestion
  • Read(~/.claude/**)
  • Edit(~/.claude/**)
  • Bash(chmod:*)

UV Python Script Manager

Orchestration

This skill follows references/task-orchestration.md patterns. Create a task at invocation, mark completed when done:

REQUIRED: Create a task at invocation. Execute at startup:

  1. TaskCreate(subject="Configure UV for Python", activeForm="Configuring UV")

Mark completed when done: TaskUpdate(taskId, status="completed")

Detect UV installation status, guide installation from official docs, and migrate legacy #!/usr/bin/env python3 scripts to self-executing UV scripts with PEP 723 inline metadata.

Workflow

1. Detect

Run the check script to assess current state:

${CLAUDE_PLUGIN_ROOT}/skills/py-uv/scripts/check-uv.sh

Parse the structured output:

  • === UV_STATUS === — is UV installed?
  • === PACKAGE_MANAGERS === — which installers are available?
  • === SCRIPT_AUDIT === — which scripts need migration?

Branch based on exit code:

  • Exit 0 → Report "UV installed, all scripts migrated" and stop.
  • Exit 1 → Go to step 2 (Install).
  • Exit 2 → Go to step 3 (Migrate).

2. Install (if UV missing)

  1. Fetch the official installation page:

    WebFetch URL=https://docs.astral.sh/uv/getting-started/installation/
    prompt="Extract all installation methods with their exact commands. For each method list: method name, command to run, and any prerequisites."
    
  2. Cross-reference with detected package managers from step 1 output.

  3. Present ranked options via AskUserQuestion:

    • Rank by maintenance burden (lowest first): system package manager > pipx > standalone installer > curl
    • Only show options where the prerequisite tool is available
    • Include the exact command for each option
  4. Do NOT execute the install command. Tell the user the command and let them run it. After the user confirms installation, re-run check-uv.sh to verify.

  5. If UV is now installed and scripts need migration → continue to step 3. If no scripts need migration → report success and stop.

3. Migrate (if legacy scripts found)

For each file reported with WRONG_SHEBANG in the audit:

  1. Read the script and identify all imports.
  2. Classify imports as stdlib or third-party.
  3. Build PEP 723 metadata block (see Migration Reference below).
  4. Replace the shebang line (and any existing encoding declaration) with the UV shebang + metadata block.
  5. Ensure executable: chmod +x <script>.
  6. Update wrappers: find any .sh wrapper that calls python3 <script> and remove the python3 prefix so it uses exec "$SCRIPT_DIR/<script>" "$@".

4. Verify

Re-run check-uv.sh. Confirm:

  • Exit code is 0
  • wrong_shebang_count=0
  • not_executable_count=0

Report the final status to the user.


Migration Reference

PEP 723 Template

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "requests>=2.31",
# ]
# ///

For stdlib-only scripts, use an empty dependency list:

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = []
# ///

Common Mistakes

| Mistake | Fix | |---------|-----| | Missing -S flag in shebang | Use #!/usr/bin/env -S uv run --script — -S enables multi-arg passing to env | | Forgetting --script flag | Without it, uv run treats the file as a module, not a script | | Wrong dependency names | PyPI names may differ from import names (e.g., import yaml → PyYAML) | | Leaving python3 in wrappers | Wrapper scripts must exec the .py directly — UV shebang handles the rest | | File not executable | Always chmod +x after migration | | Existing # -*- coding: utf-8 -*- line | Remove encoding declarations — they go between old shebang and imports, conflicting with PEP 723 block placement |

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/uv-python-script-manager-mryiqgip' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/uv-python-script-manager-mryiqgip/download' --output '.skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md.part' && mv '.skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md.part' '.skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills