karanmrn/karanagentskills/modern-python-toolchain
- community
Checking that the SKILL.md file is still in the repository.
Author "karanmrn" has blocked skill(s)
Modern Python project setup with uv, ruff, and pyright. Use when initializing a new Python project, configuring the Python environment, setting up linting/formatting, or when a project needs uv (the fast Python package manager). Trigger on: 'set up Python', 'new Python project', 'configure uv', 'install uv', 'ruff', 'pyright', 'Python linting', 'Python formatting', or when a task requires Python and no pyproject.toml exists yet.
Install
npx vskill@latest install karanmrn/karanagentskills/modern-python-toolchainSKILL.md
Modern Python Toolchain
A guide for setting up Python projects with modern, fast tooling: uv (package/project manager), ruff (linter/formatter), and pyright (type checker).
Installing uv
uv is an extremely fast Python package and project manager. It replaces pip, pip-tools, pipx, pyenv, virtualenv, poetry, etc.
After installation, restart your shell or run source $HOME/.local/bin/env (the installer prints the exact command).
For detailed information: https://docs.astral.sh/uv/
uv basics
Python version
Pin a single Python minor version. The recommended default is 3.12 (broadest ecosystem support — PyTorch, CUDA images, downstream libraries). Python 3.14 is the latest stable; prefer it for new projects unless you depend on packages that haven't added 3.14 support yet.
Install Python via uv (no system Python needed):
Creating a new project
Common commands
Rules
- Never use `pip` in uv projects — always
uv addfor packages. - Never run `python script.py` directly — always
uv run script.pyto ensure the correct environment. For one-liners useuv run python -c "...". - Don't manually manage environments with
python -m venvorsource .venv/bin/activate— uv handles this automatically. uvxruns tools from PyPI by package name without installing them permanently.
Project types
For library projects (uv init --lib) or packaged apps (uv init --package), uv_build is used as the default build backend automatically:
For application projects with an entry point:
If the project does not use src layout, just run uv run main.py.
ruff
Ruff is an extremely fast Python linter and code formatter. It replaces Flake8, isort, Black, pyupgrade, autoflake, and more.
For detailed information: https://docs.astral.sh/ruff/
When to use
Always use ruff for Python linting and formatting. Prefer uv run ruff when ruff is a dev dependency; otherwise fall back to uvx ruff.
Configuration
Add to pyproject.toml:
Do not enable the full E category or other formatter-conflicting rules (E1xx, E501, W191, Q, COM); ruff format owns layout.
Post-edit workflow
After modifying Python code, run both:
Use --diff to preview changes without applying.
pyright
Pyright is a fast type checker for Python. Only use it when the project lists it as a dev dependency or explicitly uses type checking.
Install with the nodejs extra so Node.js is bundled automatically (no system node required):
Run type checking:
Usually only check the files you modified. For broad changes (base classes, shared types), check the full tree.
Coding style
Type annotations
Use modern Python 3.12+ syntax:
Always annotate function parameters. Local variables can rely on inference unless the type is ambiguous:
pydantic v2
Use the modern class-based API:
model_config = ConfigDict(...)at class body level, notclass Config.RootModelwithroot: SomeTypefor single-root schemas.
typer (CLI)
Recommended for CLI entry points over argparse:
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/modern-python-toolchain/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/karanmrn/karanagentskills/modern-python-toolchain)