Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/huggingface/transformers/add-or-fix-type-checkingnpx skills add huggingface/transformers --skill add-or-fix-type-checkinggit 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.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00041 | $0.02516 |
| Opus 5 | $0.00020 | $0.01258 |
| Sonnet 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 4d 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.
- 4d 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 (164,637 stars, last pushed 4d ago), licensed Apache-2.0. It adds 41 tokens to every session and 2,516 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
hf-release-notes
Generate Hugging Face Hub (huggingfacehub) release notes from cached PR JSON files. Use when asked to draft release notes from PR files.
skill-sync-checker
Audits SKILL.md files in this repo's skills directory for references to functions, classes, or modules (mentioned by name in prose, e.g. parseinvoice) that no longer exist in the codebase because they were renamed, moved, or deleted. Proposes a targeted fix to the one skill being checked, never a blanket rewrite. ONLY…
kernel-cute-writing
Write and implement GPU kernels using NVIDIA CuTe DSL (CUTLASS 4.x Python API) — NOT for Triton, CUDA C++, or conceptual explanations. Trigger only when the user wants to write or implement a kernel, not when asking questions about CuTe DSL concepts or layouts. CuTe DSL uses cute.jit/cute.kernel decorators and…
define-equations
../../../.opencode/skills/define-equations/SKILL.md.
condition-setup
../../../.opencode/skills/condition-setup/SKILL.md.
create-problem
../../../.opencode/skills/create-problem/SKILL.md.