Modern Python Tooling
trailofbits/skills
Sets up Python projects and standalone scripts with uv, ruff, ty, pytest and prek, and helps move existing projects off pip, Poetry, mypy and black.
Sets up Python projects with uv for packages and environments, ruff for linting and formatting, and pyright for type checking, with rules for running everything through uv.
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchain --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain .claude/skills/modern-python-toolchain && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "modern-python-toolchain" agent skill from https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain into .claude/skills/modern-python-toolchain/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modern-python-toolchain", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchainType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchain --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain .agents/skills/modern-python-toolchain && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "modern-python-toolchain" agent skill from https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain into .agents/skills/modern-python-toolchain/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modern-python-toolchain", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchain --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain .cursor/skills/modern-python-toolchain && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "modern-python-toolchain" agent skill from https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain into .cursor/skills/modern-python-toolchain/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modern-python-toolchain", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/XiaomiMiMo/MiMo-Code.git --path packages/cli/src/skill/builtin/.bundle/modern-python-toolchain--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchain --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain .gemini/skills/modern-python-toolchain && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "modern-python-toolchain" agent skill from https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain into .gemini/skills/modern-python-toolchain/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modern-python-toolchain", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchainInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .github/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain .github/skills/modern-python-toolchain && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "modern-python-toolchain" agent skill from https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain into .github/skills/modern-python-toolchain/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modern-python-toolchain", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchain --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain .opencode/skills/modern-python-toolchain && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "modern-python-toolchain" agent skill from https://github.com/XiaomiMiMo/MiMo-Code/tree/main/packages/cli/src/skill/builtin/.bundle/modern-python-toolchain into .opencode/skills/modern-python-toolchain/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "modern-python-toolchain", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
modern-python-toolchainSets up Python projects with uv for packages and environments, ruff for linting and formatting, and pyright for type checking, with rules for running everything through uv.
A setup guide for new Python projects built on three tools: uv as the package, project and Python-version manager, ruff as linter and formatter, and pyright as type checker. It covers installing uv with its shell installer, pinning one Python minor version in `pyproject.toml` (3.12 as the broad-compatibility default, 3.14 for new projects whose dependencies support it) and creating projects with `uv init`.
The rules are firm: use `uv add` rather than pip, run scripts with `uv run` instead of calling python directly, and let uv manage the virtual environment instead of `python -m venv`. The guide also explains `uvx` for one-off tools, the `uv_build` backend for libraries and packaged apps, and `[project.scripts]` entry points for applications. The excerpt is cut off before the ruff and pyright sections.
Read from SKILL.md and the folder at commit 6babeb0. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
uvuvxpythoncurlshbrewruffFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
astral.shAlso links to:
docs.astral.shFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Modern Python Toolchain loads about 1.5k tokens when it runs. Until then it costs about 114 tokens; SKILL.md has 432 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
curl -LsSf https://astral.sh/uv/install.sh | shpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from XiaomiMiMo/MiMo-Code at commit 6babeb0, republished under its MIT licence (© XiaomiMiMo). 432 words, ~1,469 tokens.
.claude/skills/modern-python-toolchain/SKILL.md (or your agent's skills folder).A guide for setting up Python projects with modern, fast tooling: uv (package/project manager), ruff (linter/formatter), and pyright (type checker).
uv is an extremely fast Python package and project manager. It replaces pip, pip-tools, pipx, pyenv, virtualenv, poetry, etc.
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Homebrew (macOS)
brew install uvAfter 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/
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.
# pyproject.toml
requires-python = "==3.12.*"Install Python via uv (no system Python needed):
uv python install 3.12uv init # Create new project with pyproject.toml
uv init -p 3.12 # Specify Python versionuv add requests # Add dependency
uv add --dev ruff "pyright[nodejs]" # Add dev dependencies
uv remove requests # Remove dependency
uv sync # Install from lockfile
uv run COMMAND # Run command in project environment
uv run script.py # Run a script
uv run python -c "..." # Run Python one-liner
uvx TOOL ARGS # Run a tool without installing itpip in uv projects — always uv add for packages.python script.py directly — always uv run script.py to ensure the correct environment. For one-liners use uv run python -c "...".python -m venv or source .venv/bin/activate — uv handles this automatically.uvx runs tools from PyPI by package name without installing them permanently.For library projects (uv init --lib) or packaged apps (uv init --package), uv_build is used as the default build backend automatically:
[build-system]
# auto-generated by uv init; version bound tracks your installed uv (here: 0.11.28)
requires = ["uv_build>=0.11.28,<0.12.0"]
build-backend = "uv_build"For application projects with an entry point:
[project.scripts]
myapp = "myapp.__main__:main"If the project does not use src layout, just run uv run main.py.
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/
Always use ruff for Python linting and formatting. Prefer uv run ruff when ruff is a dev dependency; otherwise fall back to uvx ruff.
Add to pyproject.toml:
[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"I", # isort
]Do not enable the full E category or other formatter-conflicting rules (E1xx, E501, W191, Q, COM); ruff format owns layout.
After modifying Python code, run both:
uv run ruff check --fix path/to/changed_file.py
uv run ruff format path/to/changed_file.pyUse --diff to preview changes without applying.
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):
uv add --dev "pyright[nodejs]"Run type checking:
uv run pyright path/to/changed_file.py # check specific files
uv run pyright src/ # check all codeUsually only check the files you modified. For broad changes (base classes, shared types), check the full tree.
Use modern Python 3.12+ syntax:
# Good — builtin generics, union syntax
def fetch(url: str, timeout: float = 30.0) -> list[dict[str, str | None]]:
...
# Bad — legacy typing imports
from typing import List, Dict, Optional
def fetch(url: str, timeout: float = 30.0) -> List[Dict[str, Optional[str]]]:
...Always annotate function parameters. Local variables can rely on inference unless the type is ambiguous:
items: list[tuple[str, int]] = [] # annotate — empty literal
config: dict[str, Any] = {} # annotate — empty literal
result = some_api() # inference is fineUse the modern class-based API:
model_config = ConfigDict(...) at class body level, not class Config.RootModel with root: SomeType for single-root schemas.Recommended for CLI entry points over argparse:
import typer
from typing import Annotated
cli = typer.Typer(add_completion=False)
@cli.command()
def main(name: Annotated[str, typer.Argument(help="Your name")]) -> None:
typer.echo(f"Hello {name}")
if __name__ == "__main__":
cli()© XiaomiMiMo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in packages/cli/src/skill/builtin/.bundle/modern-python-toolchain of XiaomiMiMo/MiMo-Code.
Open the folder on GitHubat commit 6babeb0
Modern Python Toolchain next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Modern Python Toolchain this skillXiaomiMiMo/MiMo-Code | 14k | — | ~1.5k | Automated safety check: Notes | MIT | |
| Modern Python Toolingtrailofbits/skills | 7.4k | — | ~2.5k | Automated safety check: Pass | CC-BY-SA-4.0 | |
| Python Project SetupFerroxLabs/wayland | 608 | — | ~3.7k | Automated safety check: Pass | Apache-2.0 | |
| Kedro Babysitkedro-org/kedro | 11k | — | ~4k | Automated safety check: Pass | Custom licence | |
| Update Dependenciesalorence/django-modern-rpc | 111 | — | ~1.3k | Automated safety check: Pass | MIT | |
| Ha Code QualityFutureTense/keymaster | 349 | — | ~462 | Automated safety check: Pass | MIT |
trailofbits/skills
Sets up Python projects and standalone scripts with uv, ruff, ty, pytest and prek, and helps move existing projects off pip, Poetry, mypy and black.
FerroxLabs/wayland
Guides expert-level Python project initialization with modern tooling: pyproject.toml configuration, uv for dependency management, src layout decisions, mypy strict mode, and ruff for…
kedro-org/kedro
Run Kedro's local lint / format / type-check / tests on changed files (uses the project's pre-commit hooks, ruff, mypy, pytest, lint-imports, detect-secrets, Make targets — in the right venv), or…
alorence/django-modern-rpc
Routine update of all project dependencies — uv itself, uv.lock (all groups), tool versions pinned in GitHub workflows and .pre-commit-config.yaml (uv, ruff, mypy...), and SHA-pinned GitHub Actions.
FutureTense/keymaster
Standards and commands for linting, code formatting, typing validation (Ruff, MyPy, Codespell, ESLint, Pre-commit/Prek, Tox), and adherence to Home Assistant Python 3.14 standards in Keymaster.
google/adk-python
Python style and codebase conventions for ADK (Agent Development Kit): private-by-default file visibility, imports, type hints, Pydantic v2 models, formatting, docstrings, logging, async I/O, file…
XiaomiMiMo/MiMo-Code
Searches arXiv, fetches metadata, generates BibTeX, downloads PDFs and finds citations and related papers using a bundled Python script.
XiaomiMiMo/MiMo-Code
Interactive guide for creating, reviewing and fixing agent skills (SKILL.md folders), covering structure, frontmatter rules, trigger phrases and validation before sharing.
XiaomiMiMo/MiMo-Code
Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.
XiaomiMiMo/MiMo-Code
Lets one MiMoCode process drive another, headless with JSON events or interactively through tmux, to test behavior and visual regressions with parseable evidence.
XiaomiMiMo/MiMo-Code
Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.
XiaomiMiMo/MiMo-Code
Builds, edits, cleans, recalculates and reads Excel workbooks and CSV files with openpyxl and pandas, plus LibreOffice for recalculation and PDF export.
Categories
Sets up Python projects with uv for packages and environments, ruff for linting and formatting, and pyright for type checking, with rules for running everything through uv. A setup guide for new Python projects built on three tools: uv as the package, project and Python-version manager, ruff as linter and formatter, and pyright as type checker.14 for new projects whose dependencies support it) and creating projects with `uv init`.
Modern Python Toolchain fits situations like: starting a new Python project and choosing its toolchain; replacing pip and virtualenv workflows with uv; setting up linting and formatting with ruff; adding pyright type checking as a dev dependency.
Run `npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a claude-code`. Or copy the skill folder (packages/cli/src/skill/builtin/.bundle/modern-python-toolchain in XiaomiMiMo/MiMo-Code) into .claude/skills/modern-python-toolchain in your project. Claude Code loads it when a task matches its description.
Run `npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a codex`. Or copy the skill folder (packages/cli/src/skill/builtin/.bundle/modern-python-toolchain in XiaomiMiMo/MiMo-Code) into .agents/skills/modern-python-toolchain in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/modern-python-toolchain, .gemini/skills/modern-python-toolchain, .github/skills/modern-python-toolchain and .opencode/skills/modern-python-toolchain in your project.
Going by SKILL.md and its folder, Modern Python Toolchain needs the command-line tools its instructions call (uv, uvx, python, curl, sh and brew). Our summary lists: Network access to install uv.
SKILL.md names 2 domains. In commands or code: astral.sh; the agent is likely to contact it when it follows the instructions. As links in the text: docs.astral.sh. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pipes a well-known installer script into a shell), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Modern Python Toolchain is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Modern Python Toolchain: Modern Python Tooling (trailofbits/skills, 7.4k stars), Python Project Setup (FerroxLabs/wayland, 608 stars), Kedro Babysit (kedro-org/kedro, 11k stars) and Update Dependencies (alorence/django-modern-rpc, 111 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
XiaomiMiMo (a GitHub organization) maintains it in XiaomiMiMo/MiMo-Code, which has 13,601 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 3, 2026.
Source: XiaomiMiMo/MiMo-Code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.