python-plugin/skills/ty-type-checking/SKILL.md
ty: Astral's extremely fast Python type checker (mypy/Pyright alternative). Use when checking Python types or setting up type checking. Triggers: ty, mypy alternative.
npx skillsauth add laurigates/claude-plugins ty-type-checkingInstall 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.
Expert knowledge for using ty as an extremely fast Python type checker from Astral (creators of uv and ruff).
| Use this skill when... | Use basedpyright instead when... | Use mypy instead when... | |------------------------|----------------------------------|--------------------------| | Want fastest type checking (10-100x faster) | Need strictest defaults out of box | Need extensive plugin ecosystem | | Using Astral toolchain (uv, ruff) | Want Microsoft-backed alternative | Have legacy mypy configuration | | Need excellent diagnostics | Need Pylance compatibility | Require mypy-specific plugins | | Want incremental/watch mode | Team prefers Pyright conventions | Need Django/Pydantic mypy plugins | | Setting up new Python project | Already using basedpyright | Existing mypy expertise |
ty Advantages
# Install globally as tool
uv tool install ty@latest
# Run without installing
uvx ty check
# Install as dev dependency
uv add --dev ty
pip install ty
Install the astral-sh.ty extension from the VS Code marketplace.
# Check current directory
ty check
# Check specific files or directories
ty check src/
ty check src/ tests/
ty check path/to/file.py
# Verbose output
ty check --verbose
# Hide progress indicators
ty check --hide-progress
# Default output with diagnostics
ty check
# Hide progress spinners (useful for CI)
ty check --hide-progress
# Verbose mode for debugging
ty check --verbose
[tool.ty]
# Python version targeting
python-version = "3.12"
# Files to exclude
exclude = [
"**/__pycache__",
"**/.venv",
"**/node_modules",
"tests/fixtures/**",
]
[tool.ty.rules]
# Configure rule severity: "error", "warn", or "ignore"
index-out-of-bounds = "error"
possibly-unbound = "warn"
unknown-type = "ignore"
# ty.toml takes precedence over pyproject.toml
python-version = "3.12"
exclude = [
"**/__pycache__",
"**/.venv",
]
[rules]
index-out-of-bounds = "error"
possibly-unbound = "warn"
ty.toml in current directorypyproject.toml [tool.ty] section~/.config/ty/ty.toml (Linux) or %APPDATA%\ty\ty.toml (Windows)| Flag | Description |
|------|-------------|
| --python <VERSION> | Python environment/version to use |
| --project <PATH> | Run within given project directory |
| --config <PATH> | Path to ty.toml configuration file |
| --verbose | Enable verbose output |
| --hide-progress | Hide progress spinners/bars |
| Flag | Description |
|------|-------------|
| --error <RULE> | Treat rule as error severity |
| --warn <RULE> | Treat rule as warning severity |
| --ignore <RULE> | Ignore rule completely |
| Flag | Description |
|------|-------------|
| --exclude <PATTERN> | Glob patterns for files to exclude |
| --respect-ignore-files | Respect .gitignore (default) |
| --no-respect-ignore-files | Ignore .gitignore files |
astral-sh.ty-- Using nvim-lspconfig
require("lspconfig").ty.setup({
settings = {
ty = {
-- Configuration options
}
}
})
ty provides a PyCharm plugin for IDE integration.
name: Type Check
on: [push, pull_request]
jobs:
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
- name: Run ty
run: uvx ty check --hide-progress
# .pre-commit-config.yaml
repos:
- repo: https://github.com/astral-sh/ty
rev: v0.0.10
hooks:
- id: ty
ty-check:
stage: test
image: python:3.12
before_script:
- pip install ty
script:
- ty check --hide-progress
# Fast check of current project
ty check
# Check specific module
ty check src/api/
# Check with custom Python version
ty check --python 3.11
# Make specific rules errors
ty check --error index-out-of-bounds --error possibly-unbound
# Ignore noisy rules
ty check --ignore unknown-type
# Mix severities
ty check --error division-by-zero --warn possibly-unbound --ignore unknown-type
# Exclude test fixtures
ty check --exclude "tests/fixtures/**"
# Exclude multiple patterns
ty check --exclude "**/*_test.py" --exclude "**/conftest.py"
# Don't respect .gitignore
ty check --no-respect-ignore-files
| Type Checker | Relative Speed | Notes | |--------------|----------------|-------| | ty | 1x (baseline) | Fastest, Rust-based | | Pyright | 10-60x slower | Good performance | | mypy | 10-100x slower | Slower but mature |
In editor (after file edit):
| Feature | ty | basedpyright | mypy | |---------|----|--------------| -----| | Speed | Fastest | Fast | Moderate | | LSP | Built-in | Built-in | dmypy | | Diagnostics | Excellent | Good | Basic | | Plugin system | Limited | Limited | Extensive | | Intersection types | First-class | Partial | Limited | | Ecosystem | Astral (uv, ruff) | Microsoft | Standalone |
# mypy.ini / [tool.mypy]
[mypy]
python_version = 3.12
strict = true
warn_unused_ignores = true
# Equivalent ty configuration
[tool.ty]
python-version = "3.12"
[tool.ty.rules]
# Configure equivalent strictness via rules
# [tool.pyright] or [tool.basedpyright]
[tool.basedpyright]
pythonVersion = "3.12"
typeCheckingMode = "strict"
# Equivalent ty configuration
[tool.ty]
python-version = "3.12"
[tool.ty.rules]
# Configure strictness via rules
# Combine with uv and ruff for complete workflow
uv init my-project && cd my-project
uv add --dev ty ruff
uv run ty check
uv run ruff check --fix
# pyproject.toml - recommended setup
[tool.ty]
python-version = "3.12"
exclude = [
"**/__pycache__",
"**/.venv",
"**/build",
"**/dist",
]
[tool.ty.rules]
# Start with defaults, adjust as needed
# Always use --hide-progress in CI for cleaner logs
ty check --hide-progress
# Start by checking new code only
ty check src/new_module/
# Gradually expand coverage
ty check src/
| Context | Command |
|---------|---------|
| Quick check | ty check |
| CI check | ty check --hide-progress |
| Verbose debug | ty check --verbose |
| Check module | ty check src/module/ |
| Strict errors | ty check --error possibly-unbound |
| Ignore rule | ty check --ignore unknown-type |
# Basic type checking
ty check # Check current directory
ty check src/ # Check specific directory
ty check file.py # Check specific file
# Configuration
ty check --config ty.toml # Use custom config
ty check --python 3.12 # Specify Python version
# Output control
ty check --verbose # Verbose output
ty check --hide-progress # No progress indicators
# Rule control
ty check --error RULE # Treat as error
ty check --warn RULE # Treat as warning
ty check --ignore RULE # Ignore rule
# File selection
ty check --exclude "pattern" # Exclude files
# pyproject.toml
[tool.ty]
python-version = "3.12"
exclude = ["**/__pycache__", "**/.venv"]
tools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.