From Dev10x
Guides UV installation from official docs and migrates Python scripts from legacy shebangs to PEP 723 inline metadata. Useful for first-time UV setup or script modernization.
npx claudepluginhub dev10x-guru/dev10x-claude --plugin Dev10xThis skill is limited to using the following tools:
This skill follows `references/task-orchestration.md` patterns.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
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:
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.
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:
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."
Cross-reference with detected package managers from step 1 output.
Present ranked options via AskUserQuestion:
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.
If UV is now installed and scripts need migration → continue to step 3. If no scripts need migration → report success and stop.
For each file reported with WRONG_SHEBANG in the audit:
chmod +x <script>..sh wrapper that calls python3 <script>
and remove the python3 prefix so it uses exec "$SCRIPT_DIR/<script>" "$@".Re-run check-uv.sh. Confirm:
wrong_shebang_count=0not_executable_count=0Report the final status to the user.
#!/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 = []
# ///
| 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 |