Hugging Face Transformers is a framework that defines machine-learning models for text, vision, audio, video, and multimodal data, supporting both training and inference. Developers use it to work with pretrained models and connect them to training frameworks, inference engines, and other modeling libraries. The catalogue add-ons provide instructions and a skill for working with Transformers.
Borrowing it
Nothing to install: this file belongs to huggingface/transformers. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/huggingface/transformers/main/.ai/skills/add-or-fix-type-checking/SKILL.mdgit clone --depth 1 https://github.com/huggingface/transformersWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/huggingface/transformers/add-or-fix-type-checking)<a href="https://agentmods.dev/skills/huggingface/transformers/add-or-fix-type-checking"><img src="https://agentmods.dev/badge/skills/huggingface/transformers/add-or-fix-type-checking/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/huggingface/transformers/add-or-fix-type-checking"><img src="https://agentmods.dev/badge/skills/huggingface/transformers/add-or-fix-type-checking.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Snyk pass
- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00041 | $0.02516 |
| Opus 5.5 | $0.00016 | $0.01006 |
| Sonnet 5.5 | $0.00008 | $0.00503 |
| Haiku 4.5 | $0.00004 | $0.00252 |
Grade A, and why
add-or-fix-type-checking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add Or Fix Type Checking
Input
<target>: module or directory to type-check (if known).- Optional
make typingor CI output showing typing failures.
Workflow
-
Identify scope from the failing run:
- If you already have
make typingor CI output, extract the failing file/module paths. - If not, run:
make typing - Choose the narrowest target that covers the failures.
- If you already have
-
Run
ty checkfor the target to get a focused baseline:ty check --respect-ignore-files --exclude '**/*_pb*' <target> -
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.tynarrows through all of these patterns, including the negative forms:# Narrow X | None — use `if ...: raise`, never `assert` if x is None: raise ValueError("x must not be None") x.method() # ty knows x is X here # Narrow str | UploadFile if isinstance(field, str): raise TypeError("Expected file upload, got string") await field.read() # ty knows field is UploadFile here # Narrow broad union parameters early in a function body # (common for methods accepting e.g. list | dict | BatchEncoding) if isinstance(encoded_inputs, (list, tuple)): raise TypeError("Expected a mapping, got sequence") encoded_inputs.keys() # ty sees only the dict/mapping types nowb. Use local variables to help ty track narrowing across closures. When
self.xisX | Noneand you need to pass it to nested functions or closures,tycannot track thatself.xstays non-None. Copy to a local variable and narrow the local:manager = self.batching_manager if manager is None: raise RuntimeError("Manager not initialized") # Use `manager` (not `self.batching_manager`) in nested functions
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 216 lines · 41 tokens per session scan A f39fc4b05630
add-or-fix-type-checking is a skill published in the GitHub repository huggingface/transformers (168,576 stars, last pushed today), licensed Apache-2.0. It adds 41 tokens to every session and 2,516 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
add-or-fix-type-checking compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| add-or-fix-type-checkinghuggingface/transformers | Skill | 169k | today | Apache-2.0 | A | 41 | Claude Code, Codex |
| python-code-qualitymicrosoft/agent-framework | Skill | 15k | yesterday | MIT | A | 40 | Claude Code, Codex |
| plugin-architecture-patternsxberg-io/xberg | Skill | 9.5k | today | MIT | A | 15 | Claude Code |
| test-corpusxberg-io/xberg | Skill | 9.5k | today | MIT | A | 15 | Claude Code, Codex |
| stack-trace-python-probeopensquilla/opensquilla | Skill | 7.1k | 6d ago | Apache-2.0 | A | 40 | Claude Code |
| idapythonmrexodia/ida-pro-mcp | Skill | 13k | 1mo ago | MIT | A | 77 | Claude Code |
| memory-optimizationbenchflow-ai/skillsbench | Skill | 1.9k | 2d ago | Apache-2.0 | A | 60 | Claude Code, Codex |