Synthèse automatique
Détecte l'installation d'UV, guide l'utilisateur dans son installation et migre les scripts Python autonomes vers des shebangs UV avec métadonnées inline PEP 723.
Points forts
- Automatise l'audit des scripts via un script de vérification qui distingue UV absent, shebang obsolète et script non exécutable
- Construit le bloc de métadonnées PEP 723 en classant les imports entre stdlib et dépendances tierces
- Présente les options d'installation classées par coût de maintenance sans exécuter la commande à la place de l'utilisateur
- Met à jour les wrappers .sh qui appellent encore python3 pour qu'ils exécutent directement le script
Limites
- Ne s'applique qu'aux scripts Python autonomes, pas aux packages Python classiques
- Suppose Python 3.12+ dans le template PEP 723 proposé, ce qui peut ne pas convenir aux environnements plus anciens
- Repose sur un chemin de plugin CLAUDE_PLUGIN_ROOT et des outils Claude Code, donc non portable tel quel
À utiliser lorsqu'on veut adopter uv sur une base de scripts Python existants ou convertir des shebangs /usr/bin/env python3 en scripts autonomes PEP 723.
Ne pas l'invoquer si uv est déjà configuré et que tous les scripts sont migrés, ou si l'on développe un package Python distribuable plutôt qu'un script.
Analyse de sécurité
PrudenceThe 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.
- •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
Exemples
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.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.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:
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)
-
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:- 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
-
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.shto verify. -
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:
- Read the script and identify all imports.
- Classify imports as stdlib or third-party.
- Build PEP 723 metadata block (see Migration Reference below).
- Replace the shebang line (and any existing encoding declaration) with the UV shebang + metadata block.
- Ensure executable:
chmod +x <script>. - Update wrappers: find any
.shwrapper that callspython3 <script>and remove thepython3prefix so it usesexec "$SCRIPT_DIR/<script>" "$@".
4. Verify
Re-run check-uv.sh. Confirm:
- Exit code is 0
wrong_shebang_count=0not_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 |
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
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. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.
Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/uv-python-script-manager-mryiqgip/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.