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 skills add zacharygcook/agent-skills --skill ban-type-assertionsgit clone --depth 1 https://github.com/zacharygcook/agent-skillsWrote 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/zacharygcook/agent-skills/ban-type-assertions)<a href="https://agentmods.dev/skills/zacharygcook/agent-skills/ban-type-assertions"><img src="https://agentmods.dev/badge/skills/zacharygcook/agent-skills/ban-type-assertions/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/zacharygcook/agent-skills/ban-type-assertions"><img src="https://agentmods.dev/badge/skills/zacharygcook/agent-skills/ban-type-assertions.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00054 | $0.00517 |
| Opus 5 | $0.00027 | $0.00259 |
| Sonnet 5 | $0.00011 | $0.00103 |
| Haiku 4.5 | $0.00005 | $0.00052 |
Grade A, and why
ban-type-assertions 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 10d 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 — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ban Type Assertions
Configure @typescript-eslint/consistent-type-assertions with assertionStyle: "never", then replace assertions with code the compiler or runtime can verify. Treat as const according to the repository's explicit policy.
Decision Order
1. Validate external data
Parse JSON, network responses, storage, database rows, messages, and other untrusted inputs with the repository's runtime schema library.
// Avoid
const value = JSON.parse(raw) as Payload
// Prefer
const value = PayloadSchema.parse(JSON.parse(raw))
Use non-throwing parse APIs where failure needs structured handling or request context.
2. Narrow with control flow
Use discriminated unions, exhaustive switch, typeof, instanceof, and in when TypeScript can prove the result.
if (error instanceof Error && "code" in error) {
handleCode(error.code)
}
3. Improve the API or types
Fix overly broad return types, generic inference, duplicate domain types, and missing package contracts. Prefer satisfies when checking an object without changing its inferred type.
4. Document a genuine exception
Use a narrow lint suppression only for an unavoidable library/type-system gap. Explain why it is safe and why normal narrowing cannot work. Do not quietly raise a ratchet threshold.
Avoid Disguised Assertions
A custom predicate returning value is T is still an assertion unless its checks fully establish T. Use schema validation for rich object shapes. Do not replace one cast with a weak guard that only checks one property.
Rollout
- Locate all TypeScript packages and their ESLint configurations.
- Enable the rule consistently.
- Inventory violations and classify boundary, narrowing, API-design, and unavoidable cases.
- Fix violations package by package.
- Add a CI check or zero-tolerance report if repository lint scope can miss files.
- Run lint, typecheck, focused tests, the full suite when practical, and unused-export checks after shared-type changes.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 10d ago First seen · 58 lines · 54 tokens per session scan A d732a549c78a
ban-type-assertions is a skill published in the GitHub repository zacharygcook/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 517 once invoked, about $0.0003 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-31.
Other skills, from other repositories
architecture-audit
Systematic architecture audit and refactoring methodology for Rust + TypeScript codebases. Use when performing refactoring, cleanup, unification, code review, dead code removal, module reorganization, or tech debt elimination. Ensures no naming confusion, semantic overloading, hidden defaults, duplicate logic, or…
bun-toolkit
JS/TS/JSX toolkit with Bun awareness. Use when using Bun as a runtime, test runner, or package manager in JavaScript and TypeScript projects.
ts-debug
TypeScript/Node debugging expert. Use when the user needs to debug, profile, or trace TypeScript or Node.js code — e.g. "how do I debug this", "find the memory leak", "why is this slow", "add a breakpoint", "profile this function", "why won't the process exit".
typescript-conventions
Use when writing, reviewing, or refactoring TypeScript or JavaScript code — naming conventions, type annotations, private fields, null vs. undefined, async/await pitfalls, and module structure.
typescript
Write, review, and refactor TypeScript for readability, type safety, and runtime correctness (Node.js/React/shared libs). Use when creating TS modules, modeling domain types, handling errors (Result/Either), validating external inputs (Zod/io-ts), organizing imports, or preventing cyclic dependencies. NOT for choosing…
setup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.