# add-or-fix-type-checking

> Claude/Codex skill by [@huggingface](https://omgskills.com/library/huggingface/index.md) · 165k stars · Updated 2026-09-12

Fixes broken typing checks detected by ty, make typing, or make check-repo. Use when typing errors appear in local runs, CI, or PR logs.

Tags: audio, deep-learning, deepseek, gemma, glm, hacktoberfest, llm, machine-learning, model-hub, natural-language-processing, nlp, pretrained-models, python, pytorch, pytorch-transformers, qwen, speech-recognition, transformer, vlm

## Install

```sh
git clone https://github.com/huggingface/transformers /tmp/transformers && ln -s /tmp/transformers/.ai/skills/add-or-fix-type-checking ~/.claude/skills/add-or-fix-type-checking
```

## From README

Add Or Fix Type Checking Input : module or directory to type-check (if known). Optional make typing or CI output showing typing failures. Workflow Identify scope from the failing run: If you already have make typing or CI output, extract the failing file/module paths. If not, run: Choose the narrowest target that covers the failures. Run ty check for the target to get a focused baseline: Triage errors by category before fixing anything: Wrong/missing type annotations on signatures Attribute access on union types (for example X | None) Functions returning broad unions (for example str | list | BatchEncoding) Mixin/protocol self-type issues Dynamic attributes on objects or modules Third-party stub gaps (missing kwargs, missing version, etc.) Apply fixes using this priority order (simplest first): a. Narrow unions with isinstance() / if x is None / hasattr(). This is the primary tool for resolving union-type errors.

## Links

- HTML page: https://omgskills.com/skills/huggingface/transformers/add-or-fix-type-checking/
- GitHub: https://github.com/huggingface/transformers
- Author: [@huggingface](https://omgskills.com/library/huggingface/index.md)

## More skills by this author

- [trl-training](https://omgskills.com/skills/huggingface/trl/trl-training/index.md) — Post-train LLMs with TRL (Transformers Reinforcement Learning) — SFT, DPO, GRPO, KTO, and reward-model training.
   - [@huggingface](https://omgskills.com/library/huggingface/index.md) · 19k stars
- [train-sentence-transformers](https://omgskills.com/skills/huggingface/sentence-transformers/train-sentence-transformers/index.md) — Train or fine-tune sentence-transformers models across \`SentenceTransformer\` (bi-encoder, dense or static embedding...
   - [@huggingface](https://omgskills.com/library/huggingface/index.md) · 19k stars
- [sync-models](https://omgskills.com/skills/huggingface/chat-ui/add-model-descriptions/index.md) — Sync chat-ui's model config with the HuggingFace router — add descriptions for new models, flag reasoning-capable ones,...
   - [@huggingface](https://omgskills.com/library/huggingface/index.md) · 11k stars
