Set up and run a reproducible Python dev environment with uv, ruff, mypy, and VSCode.
Single-workflow guide for setting up and operating a reproducible Python development environment with uv, ruff, mypy, and VSCode save-time guardrails.
Use this skill when:
uv runpython execution to explicit uv-based workflowsskill — Validate or improve this skill document after editsgit-commit-practices — Commit environment changes as atomic, reviewable unitsgithub-pr-workflow — Ship setup changes through PR workflowuv (required)ruff and mypy as dev dependenciesuv run to reduce environment drift (基礎と型)ruff and mypy in a repeatable sequence (成長の複利)pyproject.toml and uv.lock (温故知新)uv + ruff + mypy) and add tools only when necessary (継続は力)Create project metadata and lock reproducible dependencies.
# Initialize (run at repository/project root)
uv init .
# Verify managed Python runtime
uv run python --version
# Install dependencies
uv add --dev ruff mypy
Use when starting new Python work or normalizing an existing project.
Values: 基礎と型 / 継続は力
Use uv run as the default command prefix for Python tooling.
# ✅ CORRECT - Run commands through uv-managed environment
# Python execution
uv run python path\to\script.py
# Lint check
uv run ruff check .
# Format
uv run ruff format .
# Type check
uv run mypy .
# ❌ WRONG - Bypasses uv-managed runtime/dependencies
python path\to\script.py
Use when avoiding local interpreter/version mismatch.
Values: ニュートラル / 基礎と型
Follow a predictable order that minimizes churn and review noise. The order matters because it explains why each step comes next.
Why this sequence works:
| Phase | Command | Why |
|------|---------|-----|
| 1 | uv run ruff format . | Normalize formatting first |
| 2 | uv run ruff check . | Catch lint issues after formatting |
| 3 | uv run mypy . | Validate type-level correctness last |
Use when preparing changes for commit or pull request.
Values: 継続は力 / 成長の複利
Use Ruff formatter with explicit code actions to prevent unexpected rewrite behavior, and document why explicit actions are safer in mixed environments.
{
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
Use when save-time behavior causes unstable or surprising diffs.
Values: ニュートラル / 継続は力
Confirm that another machine/session can recreate the same environment.
# Recreate environment from lock file
uv sync
# Re-run baseline checks
uv run ruff check .
uv run mypy .
Use when onboarding collaborators or validating CI parity.
Values: 温故知新 / 基礎と型
Use explicit definitions so everyone reads commands and settings the same way.
Use when writing onboarding docs or handing off to another contributor.
Values: ニュートラル / 成長の複利
uv run for every Python-related command in docs and scripts.pyproject.toml and uv.lock.ruff format before lint and type checks to reduce noisy diffs.Running bare python instead of uv run python
Fix: Replace command examples and scripts with uv run ... consistently.
Using aggressive save-time auto-fixes
Fix: Keep source.fixAll and source.organizeImports as explicit.
Skipping lockfile updates after dependency changes
Fix: Use uv add/uv remove and commit resulting uv.lock changes.
uv pip install as a default workflow command without documentationuv init .
uv add --dev ruff mypy
uv run python --version
uv run ruff format .
uv run ruff check .
uv run mypy .
uv sync
| Situation | Action | Why |
|-----------|--------|-----|
| Need quick local check | uv run ruff check . | Catch style/lint issues fast |
| Need commit-ready diff | uv run ruff format . then uv run ruff check . | Format first, then enforce rules |
| Need confidence before PR | uv run mypy . | Catch type-level regressions early |
Q: Should we include poethepoet in this skill?
A: No. This workflow intentionally stays minimal; add task runners in a separate issue if needed.
Q: Why keep codeActionsOnSave as explicit?
A: It prevents unintended broad rewrites while still allowing controlled fixes.
Q: Is uv pip install allowed?
A: As a rule, avoid it for normal workflow; prefer uv add / uv remove to keep project state reproducible. If an exception is unavoidable, document the reason and command in README.md (or equivalent project docs).
npx skills add RyoMurakami1983/python-setup-dev-environment下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer