modules/home/programs/cli-agents/shared/skills/python/SKILL.md
Use uv for Python development. Always prefer uv over pip/poetry/virtualenv. Use ruff for linting/formatting, pytest for testing, mypy for type checking.
npx skillsauth add not-matthias/dotfiles-nix 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.
You are a Python development specialist using uv and related tools. ALWAYS use uv — never pip, poetry, virtualenv, or venv directly.
NEVER use: pip install, python -m venv, poetry, pipenv, conda
ALWAYS use: uv
# Create project
uv init <name> # New project with pyproject.toml
uv init --lib <name> # Library project
# Dependencies
uv add <package> # Add dependency
uv add --dev <package> # Add dev dependency
uv remove <package> # Remove dependency
uv sync # Install all deps from lockfile
# Running
uv run python script.py # Run in project environment
uv run pytest # Run tool in project environment
uv run <any-command> # Preferred way to run anything
# Tools (one-off usage, no install needed)
uvx ruff check . # Run ruff without installing
uvx mypy . # Run mypy without installing
Always follow this sequence:
uv run pytest -q # Run tests first
uv run ruff check . # Linting
uv run ruff format --check . # Format check
uv run mypy . # Type checking (if project uses it)
Decision tree:
uv run ruff check . (fast)uv run pytest -quv run ruff format .uv run mypy .Ruff replaces flake8, isort, black, and more. Prefer it over all of them.
uv run ruff check . # Lint
uv run ruff check --fix . # Auto-fix lint issues
uv run ruff format . # Format (replaces black)
uv run ruff format --check . # Check formatting without modifying
[tool.ruff]
line-length = 88
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "UP"] # pycodestyle, pyflakes, isort, pyupgrade
ignore = ["E501"] # Line too long (handled by formatter)
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["S101"] # Allow assert in tests
uv run pytest # Run all tests
uv run pytest -q # Quiet output
uv run pytest -x # Stop on first failure
uv run pytest -k "test_name" # Run matching tests
uv run pytest -v # Verbose output
uv run pytest --tb=short # Short traceback
uv run pytest tests/ # Run specific directory
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q --tb=short"
uv run mypy . # Check entire project
uv run mypy src/ # Check specific directory
uv run mypy --strict . # Strict mode
[tool.mypy]
python_version = "3.11"
strict = true
ignore_missing_imports = true
my-project/
├── pyproject.toml
├── uv.lock
├── src/
│ └── my_project/
│ ├── __init__.py
│ └── main.py
└── tests/
├── __init__.py
└── test_main.py
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = []
[project.optional-dependencies]
dev = ["pytest", "ruff", "mypy"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.ruff]
line-length = 88
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q"
[tool.mypy]
strict = true
ignore_missing_imports = true
uv init my-project
cd my-project
uv add --dev pytest ruff mypy
uv run pytest # verify setup works
[project.scripts]
my-tool = "my_project.cli:main"
uv run my-tool # Run the script
uv run --with requests python script.py # Ad-hoc dependency
uvx python-script-tool # Run published tool
uv run ruff check --fix . && uv run ruff format . && uv run pytest -q
Issue: ModuleNotFoundError after uv add
uv sync # Re-sync lockfile to environment
Issue: Wrong Python version
uv python pin 3.11 # Pin project to specific version
uv python install 3.11 # Install if not available
Issue: Stale lockfile
uv lock --upgrade # Update all deps
uv lock --upgrade-package X # Update specific package
development
Emulates not-matthias's technical blog writing style. Use when writing blog posts, technical articles, README content, or any long-form technical prose. Produces investigation-driven, first-person narratives with dry humor, practical code examples, and concrete takeaways.
development
Create and manage Git worktrees for parallel feature development. Use when user wants to work on multiple features simultaneously or needs isolated development environments.
development
Systematic technical research and brainstorming. Given a question, recursively explores attached specifications, source code, documentation, GitHub repositories, and authoritative online sources to build comprehensive, accurate answers. Surfaces edge cases, caveats, and implementation details that matter.
development
Converts a research paper (PDF path, uploaded PDF, or URL) into a reusable skill that stores distilled knowledge for future sessions. Use when a user asks to "turn this paper into a skill", "make this PDF reusable", "encode this research", or wants project-specific decisions backed by a specific paper without re-uploading it.