Agent skill

Modern Python Toolchain

by XiaomiMiMo in XiaomiMiMo/MiMo-Code

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.

MITAuto-check: notesDevelopment

Install Modern Python Toolchain

skills CLI
$ npx skills add XiaomiMiMo/MiMo-Code --skill modern-python-toolchain -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install XiaomiMiMo/MiMo-Code modern-python-toolchain --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
modern-python-toolchain
GitHub stars
14k
Token cost
~1.5k tokens
SKILL.md length
432 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Starting a new Python project and choosing its toolchain
  • SKILL.md covers Installing uv, uv basics, ruff and pyright, plus 1 more section
  • Calls uv, uvx and python; reaches astral.sh
  • Replacing pip and virtualenv workflows with uv

What it does

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.

When your agent uses it

  • 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

Example prompts

  • “Set up a new Python project in ./etl-tool with uv and pin Python 3.12.”
  • “Convert this pip and requirements.txt project to uv.”
  • “Add ruff and pyright as dev dependencies and show me how to run them.”
  • “Install uv on this machine.”

Requirements

  • Network access to install uv

What it can do on your machine

Read from SKILL.md and the folder at commit 6babeb0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • uvx
    • python
    • curl
    • sh
    • brew
    • ruff

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • astral.sh

    Also links to:

    • docs.astral.sh

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~114
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

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.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePipes a well-known installer script into a shellSKILL.md:16
    curl -LsSf https://astral.sh/uv/install.sh | sh
  • NotePipes a well-known installer script into a shellSKILL.md:19
    powershell -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.

SKILL.md

The full file from XiaomiMiMo/MiMo-Code at commit 6babeb0, republished under its MIT licence (© XiaomiMiMo). 432 words, ~1,469 tokens.

Download SKILL.mdSave it as .claude/skills/modern-python-toolchain/SKILL.md (or your agent's skills folder).
name
modern-python-toolchain
description
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.

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.

bash
# 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 uv

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.

toml
# pyproject.toml
requires-python = "==3.12.*"

Install Python via uv (no system Python needed):

bash
uv python install 3.12
Creating a new project
bash
uv init                       # Create new project with pyproject.toml
uv init -p 3.12               # Specify Python version
Common commands
bash
uv 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 it
Rules
  • Never use pip in uv projects — always uv add for packages.
  • Never run python script.py directly — always uv run script.py to ensure the correct environment. For one-liners use uv run python -c "...".
  • Don't manually manage environments with python -m venv or source .venv/bin/activate — uv handles this automatically.
  • uvx runs 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:

toml
[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:

toml
[project.scripts]
myapp = "myapp.__main__:main"

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/

Show full SKILL.md (183 more words)Show less
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:

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.

Post-edit workflow

After modifying Python code, run both:

bash
uv run ruff check --fix path/to/changed_file.py
uv run ruff format path/to/changed_file.py

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):

bash
uv add --dev "pyright[nodejs]"

Run type checking:

bash
uv run pyright path/to/changed_file.py    # check specific files
uv run pyright src/                        # check all code

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:

python
# 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:

python
items: list[tuple[str, int]] = []    # annotate — empty literal
config: dict[str, Any] = {}          # annotate — empty literal
result = some_api()                  # inference is fine
pydantic v2

Use the modern class-based API:

  • model_config = ConfigDict(...) at class body level, not class Config.
  • RootModel with root: SomeType for single-root schemas.
typer (CLI)

Recommended for CLI entry points over argparse:

python
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

Files

Just SKILL.md in packages/cli/src/skill/builtin/.bundle/modern-python-toolchain of XiaomiMiMo/MiMo-Code.

Open the folder on GitHubat commit 6babeb0

Compare with similar skills

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.

Modern Python Toolchain compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Modern Python Toolchain this skillXiaomiMiMo/MiMo-Code14k—~1.5kAutomated safety check: NotesMIT
Modern Python Toolingtrailofbits/skills7.4k—~2.5kAutomated safety check: PassCC-BY-SA-4.0
Python Project SetupFerroxLabs/wayland608—~3.7kAutomated safety check: PassApache-2.0
Kedro Babysitkedro-org/kedro11k—~4kAutomated safety check: PassCustom licence
Update Dependenciesalorence/django-modern-rpc111—~1.3kAutomated safety check: PassMIT
Ha Code QualityFutureTense/keymaster349—~462Automated safety check: PassMIT

Similar skills

  • Modern Python Tooling

    trailofbits/skills

    Official

    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.

    7.4k GitHub stars~2.5k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Python Project Setup

    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…

    608 GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Kedro Babysit

    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…

    11k GitHub stars~4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Update Dependencies

    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.

    111 GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ha Code Quality

    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.

    349 GitHub stars~462 tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Adk Style

    google/adk-python

    Official

    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…

    22k GitHub stars~748 tokensUpdated today
    DevelopmentAuto-check passed

More from XiaomiMiMo/MiMo-Code

All 22 skills in this repo
  • Paper Research on arXiv

    XiaomiMiMo/MiMo-Code

    Searches arXiv, fetches metadata, generates BibTeX, downloads PDFs and finds citations and related papers using a bundled Python script.

    14k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Agent Skill Creator

    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.

    14k GitHub stars~1.9k tokensUpdated 4 days ago
    Auto-check passed
  • DOCX Toolkit

    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.

    14k GitHub stars~2.4k tokensUpdated 4 days ago
    Auto-check passed
  • Drive MiMo Code

    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.

    14k GitHub stars~3.9k tokensUpdated 4 days ago
    Auto-check passed
  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 4 days ago
    Auto-check passed
  • XLSX Spreadsheet Toolkit

    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.

    14k GitHub stars~2.9k tokensUpdated 4 days ago
    Auto-check passed

Works with

Categories

Questions about Modern Python Toolchain

What does Modern Python Toolchain do?

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`.

When should I use Modern Python Toolchain?

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.

How do I install Modern Python Toolchain in Claude Code?

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.

How do I install Modern Python Toolchain in Codex?

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.

Can I use Modern Python Toolchain in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Modern Python Toolchain need to run?

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.

Does Modern Python Toolchain access the network?

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.

Is Modern Python Toolchain safe to install?

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.

What licence does Modern Python Toolchain use?

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.

How many tokens does Modern Python Toolchain use?

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.

What are the alternatives to Modern Python Toolchain?

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.

Who maintains Modern Python Toolchain?

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.