modern-python/skills/modern-python/SKILL.md
Configures Python projects with modern tooling (uv, ruff, ty). Use when creating projects, writing standalone scripts, or migrating from pip/Poetry/mypy/black.
npx skillsauth add lidge-jun/cli-jaw-skills modern-pythonInstall 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.
Ref: trailofbits/cookiecutter-python
| Use | Instead of | Why |
|-----|-----------|-----|
| uv add / uv sync | uv pip install, manual pyproject.toml edits | Manages lockfile and venv automatically |
| uv run <cmd> | source .venv/bin/activate | No manual venv management |
| uv_build backend | hatchling | Simpler, sufficient for most cases |
| uv | Poetry | Faster, better ecosystem integration |
| pyproject.toml / PEP 723 | requirements.txt | Modern standard |
| ty | mypy / pyright | Faster, from Astral team |
| [dependency-groups] (PEP 735) | [project.optional-dependencies] | Dedicated dev/test grouping |
| [tool.ty.environment] python-version | [tool.ty] python-version | Correct config nesting |
| prek (setup) | pre-commit | Faster, Rust-native |
What are you doing?
│
├─ Single-file script with dependencies?
│ └─ PEP 723 inline metadata (./references/pep723-scripts.md)
│
├─ New multi-file project (not distributed)?
│ └─ Minimal uv setup (Quick Start below)
│
├─ New reusable package/library?
│ └─ Full project setup (Full Setup below)
│
└─ Migrating existing project?
└─ Migration Guide below
| Tool | Purpose | Replaces | |------|---------|----------| | uv | Package/dependency management | pip, virtualenv, pip-tools, pipx, pyenv | | ruff | Linting and formatting | flake8, black, isort, pyupgrade | | ty | Type checking | mypy, pyright | | pytest | Testing with coverage | unittest | | prek | Pre-commit hooks | pre-commit |
| Tool | Purpose | |------|---------| | shellcheck | Shell script linting | | detect-secrets | Secret detection | | actionlint | Workflow syntax validation | | zizmor | Workflow security audit | | pip-audit | Dependency vulnerability scanning |
See security-setup.md for configuration.
uv init myproject && cd myproject
uv add requests rich
uv add --group dev pytest ruff ty
uv run python src/myproject/main.py
uv run pytest
uv run ruff check .
For distributable packages, consider the Trail of Bits cookiecutter:
uvx cookiecutter gh:trailofbits/cookiecutter-python
Or manually:
uv init --package myproject && cd myproject
See pyproject.md for complete reference.
[project]
name = "myproject"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = []
[dependency-groups]
dev = [{include-group = "lint"}, {include-group = "test"}, {include-group = "audit"}]
lint = ["ruff", "ty"]
test = ["pytest", "pytest-cov"]
audit = ["pip-audit"]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["ALL"]
ignore = ["D", "COM812", "ISC001"]
[tool.pytest]
addopts = ["--cov=myproject", "--cov-fail-under=80"]
[tool.ty.terminal]
error-on-warning = true
[tool.ty.environment]
python-version = "3.11"
[tool.ty.rules]
possibly-unresolved-reference = "error"
unused-ignore-comment = "warn"
uv sync --all-groups
.PHONY: dev lint format test build
dev:
uv sync --all-groups
lint:
uv run ruff format --check && uv run ruff check && uv run ty check src/
format:
uv run ruff format .
test:
uv run pytest
build:
uv build
Scripts: Convert to PEP 723 inline metadata (pep723-scripts.md)
Projects:
uv init --bare
uv add requests rich # add each dependency
uv sync
Then delete requirements.txt, requirements-dev.txt, old venvs. Add uv.lock to version control.
uv init --bare to create pyproject.tomluv add each dependency from install_requiresuv add --group dev for dev dependencies[project]setup.py, setup.cfg, MANIFEST.in.flake8, [tool.black], [tool.isort] configsuv add --group dev ruffuv run ruff check --fix . && uv run ruff format .mypy.ini, pyrightconfig.jsonuv add --group dev tyuv run ty check src/| Command | Description |
|---------|-------------|
| uv init / uv init --package | Create project / distributable package |
| uv add <pkg> | Add dependency |
| uv add --group dev <pkg> | Add to dependency group |
| uv remove <pkg> | Remove dependency |
| uv sync / uv sync --all-groups | Install dependencies |
| uv run <cmd> | Run command in venv |
| uv run --with <pkg> <cmd> | Run with temporary dependency (one-off usage) |
| uv build / uv publish | Build / publish package |
development
Native Web UI structured renderer schemas for compose-block drafts, search-results cards, dataframe tables, chart-json charts, and diff output
tools
Unified search hub. Route any web/real-time/X lookup through a 4-tier escalation: built-in web search → cli-jaw browser CDP → progrok Grok OAuth → web-ai (Grok Expert / GPT Pro). Use for: search, 검색, web search, latest news, real-time info, X/Twitter, fact lookup, deep research.
development
UI/UX intent discovery, design vocabulary, product personalities, UX state patterns, typography line break judgment, favicon/product logo design, and logo trust section design. Use when user design direction is vague, when building onboarding/empty/error states, when setting up favicons or product logos, or when referencing a product aesthetic.
development
Canonical owner of module boundary rules, circular dependency detection/prevention, implicit coupling taxonomy, barrel/re-export discipline, and boundary-only defensive programming. Referenced by dev, dev-code-reviewer, dev-backend, dev-frontend stubs.