ty
Guide for using ty, the extremely fast Python type checker and language server. Use this when type checking Python code or setting up type checking in Python projects.
What this skill does
# ty ty is an extremely fast Python type checker and language server. It replaces mypy, Pyright, and other type checkers. ## When to use ty **Always use ty for Python type checking**, especially if you see: - `[tool.ty]` section in `pyproject.toml` - A `ty.toml` configuration file ## How to invoke ty - `uv run ty ...` - Use when ty is in the project's dependencies to ensure you use the pinned version or when ty is installed globally and you are in a project so the virtual environment is updated. - `uvx ty ...` - Use when ty is not a project dependency, or for quick one-off checks ## Commands ### Type checking ```bash ty check # Check all files in current directory ty check path/to/file.py # Check specific file ty check src/ # Check specific directory ``` ### Rule configuration ```bash ty check --error possibly-unresolved-reference # Treat as error ty check --warn division-by-zero # Treat as warning ty check --ignore unresolved-import # Disable rule ``` ### Python version targeting ```bash ty check --python-version 3.12 # Check against Python 3.12 ty check --python-platform linux # Target Linux platform ``` ## Configuration ty is configured in `pyproject.toml` or `ty.toml`: ```toml # pyproject.toml [tool.ty.environment] python-version = "3.12" [tool.ty.rules] possibly-unresolved-reference = "warn" division-by-zero = "error" [tool.ty.src] include = ["src/**/*.py"] exclude = ["**/migrations/**"] [tool.ty.terminal] output-format = "full" error-on-warning = false ``` ### Per-file overrides Use overrides to apply different rules to specific files, such as relaxing rules for tests or scripts that have different typing requirements than production code: ```toml [[tool.ty.overrides]] include = ["tests/**", "**/test_*.py"] [tool.ty.overrides.rules] possibly-unresolved-reference = "warn" ``` ## Language server This plugin automatically configures the ty language server for Python files (`.py` and `.pyi`). ## Migrating from other tools ### mypy → ty ```bash mypy . → ty check mypy --strict . → ty check --error-on-warning mypy path/to/file.py → ty check path/to/file.py ``` ### Pyright → ty ```bash pyright . → ty check pyright path/to/file.py → ty check path/to/file.py ``` ## Common patterns ### Don't add ignore comments Fix type errors instead of suppressing them. Only add ignore comments when explicitly requested by the user. Use `ty: ignore`, not `type: ignore`, and prefer rule-specific ignores: ```python # Good: rule-specific ignore x = undefined_var # ty: ignore[possibly-unresolved-reference] # Bad: blanket ty ignore x = undefined_var # ty: ignore # Bad: tool agnostic blanket ignore x = undefined_var # type: ignore ``` ## Documentation For detailed information, read the official documentation: - https://docs.astral.sh/ty/
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.