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.5 | $0.00022 | $0.00207 |
| Sonnet 5.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 1mo 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.
- 1mo 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 3mo ago), licensed MIT. It adds 54 tokens to every session and 517 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-31.
Other skills, from other repositories
phaser-pixi-2d-games
Use when building a 2D web game with Phaser (3.x/4.x) or PixiJS 8 in TypeScript - framework vs renderer, Phaser scenes/game objects/arcade physics/groups as pools/scale manager/loader, scene shutdown cleanup, PixiJS 8 async init, Assets bundles, ticker units and destroy, and keeping rules in plain TS modules.
node-typescript-security-pitfalls
Use when reviewing Node.js or TypeScript server code - Express/Fastify/Nest handlers, Next.js server actions and route handlers, childprocess, ORM raw queries, prototype pollution, template engines, JWT and outbound HTTP clients.
node-typescript-service
Use when building or extending a TypeScript service on Node.js - Fastify, NestJS, Express or Hono, runtime validation at the boundary, strict types, the repository's ORM and migrations, async error handling, graceful shutdown.
react-typescript-patterns
Use when writing React + TypeScript components - functional components, explicit typed props, derived state over effects, and no any/unsafe casts.
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…
supermux-core
Use when building an app, script, bot or service in TypeScript that drives Claude Code, Codex, Cursor, OpenCode, Grok Build or Antigravity through the @supermux/core library.