| name | mypy-to-ty |
| description | Migrate Python type checking from mypy to ty (Astral). Use when mirrors-mypy is in .pre-commit-config.yaml or [tool.mypy] config exists. |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(find *), Bash(test *), Bash(pre-commit *), Bash(uvx *), AskUserQuestion, TodoWrite |
| model | sonnet |
| args | [--check-only] [--fix] |
| argument-hint | [--check-only] [--fix] |
| created | "2026-04-14T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-04-14T00:00:00.000Z" |
/migration-patterns:mypy-to-ty
Migrate from mypy to ty — Astral's new fast Python type checker. Replaces the mirrors-mypy pre-commit hook with a local repo: local hook using uvx ty check, migrates config from [tool.mypy] to [tool.ty], and removes mypy.ini.
When to Use This Skill
| Use this skill when... | Keep mypy when... |
|---|
.pre-commit-config.yaml contains mirrors-mypy | ty does not yet support a specific mypy plugin you rely on |
[tool.mypy] section exists in pyproject.toml | CI pipeline depends on mypy-specific exit codes or plugins |
| You want faster type checking (ty is written in Rust) | Project uses mypy daemon (dmypy) for incremental checks |
| Repo uses uv and the astral stack already | Team prefers mypy's error message format |
Context
- Pre-commit config: !
find . -maxdepth 1 -name '.pre-commit-config.yaml'
- pyproject.toml: !
find . -maxdepth 1 -name 'pyproject.toml'
- mypy.ini: !
find . -maxdepth 1 -name 'mypy.ini'
- uv available: !
find . -maxdepth 1 -name 'uv.lock'
Parameters
| Parameter | Description |
|---|
--check-only | Report what would change without modifying files |
--fix | Apply migration automatically |
Execution
Execute this mypy-to-ty migration:
Step 1: Audit current mypy configuration
- Read
.pre-commit-config.yaml and locate any mirrors-mypy or mypy entries.
- Read
pyproject.toml and extract the [tool.mypy] section.
- Check for
mypy.ini.
- Report findings:
mypy → ty migration audit
==========================
pre-commit hook: mirrors-mypy found at rev <rev>
pyproject.toml: [tool.mypy] section found (N lines)
mypy.ini: FOUND / NOT FOUND
uv.lock: EXISTS (uv available) / MISSING
If , stop here.