A tool to manage Python projects, dependencies, and environments using the uv package manager.
Install
mkdir -p .claude/skills/uv-bifangknt && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9500" && unzip -o skill.zip -d .claude/skills/uv-bifangknt && rm skill.zipInstalls to .claude/skills/uv-bifangknt
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
在 Windows/macOS/Linux 上使用 `uv` 执行 Python 运行、依赖同步、锁文件管理、Python 版本管理与工具命令(`uv run`、`uv sync`、`uv lock`、`uv python`、`uv tool`)。当任务涉及“用 uv 运行脚本/命令”“临时依赖(`--with`)”“锁文件一致性(`--locked`/`--frozen`)”“跨平台 shell(bash/zsh/PowerShell)下排查 uv 执行问题”时使用此 skill。Key capabilities
- →Execute Python scripts and commands within project environments
- →Synchronize project environments and manage lock files
- →Install and run command-line tools with temporary dependencies
- →Manage and pin specific Python interpreter versions
- →Perform read-only status checks on project configurations
How it works
The agent identifies the project context and selects the appropriate uv subcommand to perform read-only checks before executing write operations on lock files or virtual environments.
Inputs & outputs
When to use uv
- →Running scripts with temporary dependencies
- →Synchronizing project environments from lock files
- →Installing and running command-line tools
- →Pinning specific Python versions for projects
About this skill
Uv
Overview
以可复现、可审计的方式使用 uv。优先给出最小可执行命令,先读状态后做写入,明确是否会修改 uv.lock、.venv、.python-version。
Workflow
- 确认上下文:当前目录是否为
pyproject.toml项目、是否允许改动锁文件和环境。 - 先选操作面:运行命令(
run)、同步环境(sync)、更新锁(lock)、Python 版本(python)、工具(tool)。 - 先执行只读探测:版本、help、检查状态(如
uv --version、uv lock --check、uv sync --check)。 - 再执行变更命令:明确写入范围(
uv.lock、.venv、.python-version、工具目录)。 - 输出关键结果与下一步。
Operation Decision
- 只执行一次命令且不想持久安装工具:用
uv tool run(或uvx)。 - 在项目环境中执行代码/命令:用
uv run。 - 需要补齐或重建项目环境:用
uv sync。 - 需要检查或更新锁文件:用
uv lock(只检查用uv lock --check)。 - 需要固定解释器版本:用
uv python install+uv python pin。
Command Rules
uv选项必须放在被执行命令之前;必要时用--分隔(例如uv run --python 3.12 -- python)。- 需要临时依赖时用
uv run --with <pkg>或uv tool run --with <pkg>。 - 不希望自动发现项目时用
--no-project。 uv run/uv sync默认会处理 lock/sync;需要禁止写锁文件时优先--locked,需要跳过锁文件更新检查时用--frozen。- 执行 Python 脚本工具(如校验脚本)缺依赖时,优先
uv run --with pyyaml <script>。 - 在 Windows 下出现 Python 默认编码导致的
UnicodeDecodeError时,可先设置$env:PYTHONUTF8='1'后再运行uv run ...。
Failure Handling
- 命令不存在或子命令写错:先运行对应
--help,再重试最小命令。 No module named ...:改为uv run --with <missing-package> ...。--locked失败(锁文件过期):先uv lock或uv sync更新,再重试。- 目录不是项目却执行了项目命令:改用
--no-project或切换到正确项目目录。 - PowerShell 环境变量导致参数展开异常:优先使用单引号和显式变量赋值。
Safety Checklist
执行会写入的命令前,先确认:
- 当前仓库/目录是否正确。
- 是否允许修改
uv.lock与.venv。 - 是否允许写入
.python-version。 - 是否为一次性命令(应使用
uv tool run)还是持久安装(uv tool install)。
Output Format
统一按以下结构输出:
Plan: 本次要完成的 uv 任务。Commands: 实际执行命令(先只读,后变更)。Result: 关键结果(是否改动锁文件/环境、关键版本、状态检查结果)。Next: 失败时的最短可执行下一步。
Reference
按需读取参考文档:
- 命令索引:
references/commands.md - 运行与临时依赖:
references/run.md - 锁与同步:
references/sync-lock.md - Python 版本管理:
references/python.md - 工具命令:
references/tool.md - 常见故障:
references/troubleshooting.md
When not to use it
- →When the current directory is not a valid project and --no-project is not appropriate
- →When modifications to uv.lock, .venv, or .python-version are prohibited
Limitations
- →Requires explicit handling of environment variables in PowerShell to avoid parameter expansion issues
- →Locked commands fail if the lock file is outdated, requiring a manual sync or lock update
How it compares
Unlike manual environment management, this workflow enforces explicit read-only verification steps and structured command execution to ensure reproducibility.
Compared to similar skills
uv side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| uv (this skill) | 0 | 5mo | No flags | Intermediate |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
| dev | 2 | 6mo | Review | Advanced |
| mflux-release | 1 | 5mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by BiFangKNT
View all by BiFangKNT →You might also like
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
dev
atopile
LLM-focused workflow for working in this repo: compile Zig, run the orchestrated test runner, consume test-report.json/html artifacts, and discover/debug ConfigFlags.
mflux-release
filipstrand
Prepare a release in mflux (version bump, changelog, uv lock) without tagging/publishing.
code-changelog
bear2u
AI가 만든 모든 코드 변경사항을 reviews 폴더에 기록하고 간단한 HTML 뷰어로 웹 브라우저에서 실시간 확인할 수 있습니다. 매 수정마다 문서가 생성되고 Python 서버로 즉시 확인 가능합니다.
github-skill-forge
YuJunZhiXue
一个"制造技能的技能"。这个工具自动化了将任意 GitHub 仓库转换为标准化 Trae 技能的全过程,是扩展 AI Agent 能力的核心工具。
tdd-migrate
parcadei
TDD workflow for migrations - orchestrate agents, zero main context growth