skills/python-uv-project-setup/SKILL.md
Use when initializing a Python project or script, adding dependencies, or running commands with uv, especially to avoid pip install and direct python/pytest usage.
npx skillsauth add narumiruna/agent-skills python-uv-project-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use uv for project environments, dependency management, and command execution. Core principle: install, sync, and run through uv so local work matches the project environment.
pyproject.toml.For standalone scripts with inline metadata or one-off dependencies, use uv-scripts instead.
pyproject.toml and use the repo's existing uv layout.uv add; add test, lint, type, and build tools with uv add --dev.uv run and sync with uv sync when dependencies changed elsewhere.uv add (never pip install).uv run (never direct python or pytest).uv add --dev for development-only tools such as ruff, ty, pytest, pytest-cov, and build/release helpers.| Task | Command |
| --- | --- |
| Initialize project | uv init <name> |
| Add dependency | uv add <package> |
| Add dev dependency | uv add --dev <package> |
| Remove dependency | uv remove <package> |
| Run Python | uv run python <file.py> |
| Run module | uv run python -m <module> |
| Run pytest | uv run pytest |
| Sync deps | uv sync |
pyproject.toml, project code, or shared lockfile. Use this skill.uv-scripts.uv run python script.py.uv init my-project
cd my-project
uv add loguru typer
uv add --dev ruff pytest pytest-cov ty
uv add fastapi
uv run pytest
uv run python -m my_package
uv run pytest
pip install first and only switching to uv after it fails.python or pytest directly instead of uv run.uv-scripts would be smaller and clearer.| Excuse | Reality | | --- | --- | | "pip install is faster for a quick fix" | It bypasses the project environment and drifts from uv-managed state. | | "I can run python/pytest directly this once" | Direct runs skip uv's environment and can break reproducibility. |
pip install, python, or pytest directly.development
Maintains concise repository MEMORY.md notes for gotchas, stale memory corrections, and durable user preferences. Use at the start of repository conversations, when the user mentions MEMORY.md, when an error should be remembered to avoid repeating it, or when MEMORY.md content may be wrong.
testing
Use only when the user explicitly names the work-log-writer skill; never auto-activate from generic work log, daily log, EOD summary, status update, or date-range summary requests.
development
Use when implementing non-trivial code changes that should follow TDD (write a failing test first, make the smallest passing change, then refactor safely).
tools
Use when designing, implementing, reviewing, or debugging Codex CLI hooks, including `hooks.json`, `.codex/hooks.json`, feature-flag setup, matcher behavior, event-specific stdin/stdout payloads, and hook scripts for `SessionStart`, `PreToolUse`, `PostToolUse`, `UserPromptSubmit`, or `Stop`.