Skip to main content
skill CX Codex

ban-type-assertions — Claude Code skill: what it does, install

ban-type-assertions is a Claude Code skill that blocks TypeScript as assertions and guides their replacement with compiler-checked code. It runs when a package adopts the ban or needs existing lint violations fixed.

no license 151 installs ★ 129 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a claude-code
Open on GitHub

What ban-type-assertions does

The skill configures @typescript-eslint/consistent-type-assertions with assertionStyle: 'never', then helps locate violations and replace casts. For data from outside the program, it points to Zod schema parsing; for union types, it uses control-flow narrowing. A justified lint exception is reserved for cases such as gaps in library typings.

It also covers duplicate schemas and types, test fixtures that fail validation, and parsing inside error handling. The suggested checks are npm run lint, npm run typecheck, npm run test, and npm run knip. Add the lint rule to the .eslintrc.js file for each affected package.

What it helps with

  • block as casts in a package
  • replace unchecked casts with Zod parsing
  • narrow union types through control flow
  • repair test fixtures without disabling the lint rule

Example prompts for the agent

  • Enable the ban on as in this package and fix the lint violations.
  • Replace casts on external input with schema validation.
  • Find test fixtures that need changes after the rule is enabled.

How to install ban-type-assertions

1Skills CLI (Vercel)

npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a claude-code

2Manually: put the files in place

~/.claude/skills/ban-type-assertions/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/ban-type-assertions/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about ban-type-assertions

How do I install ban-type-assertions in Claude Code?

Run npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a claude-code. The skill file is installed at ~/.claude/skills/ban-type-assertions/SKILL.md.

What does ban-type-assertions do?

It configures @typescript-eslint/consistent-type-assertions to reject as assertions and helps replace them with code the compiler can verify.

Which checks does ban-type-assertions cover?

It suggests running npm run lint, npm run typecheck, and npm run test for affected packages, plus npm run knip from the repository root.

Similar skills

All skills for Programming languages →

From the same set17

The whole set →
frontend-design The frontend-design skill guides an agent through planning and building web interfaces, from layout and type to responsive states. Use it for a new site or a visual refresh. CX Codex +1 172installs security-review security-review scans code changes for security flaws using STRIDE threat modeling, validates exploitability, and outputs structured reports for downstream patching. CX Codex +1 168installs visual-design visual-design is a Claude Code skill that uses nanobanana CLI to create or edit project visuals and Slidev to build presentations. It covers asset, diagram, photo-editing, and slide-deck requests. CX Codex +1 167installs threat-model-generation threat-model-generation — a skill for Claude Code, Codex, Cursor, and other agents that builds a STRIDE threat model from a repository's codebase. CX Codex +1 151installs fix-knip-unused-exports fix-knip-unused-exports resolves knip “Unused exports” violations by removing or relocating exports that have no production consumers. Use when npm run knip reports unused code. CX Codex +1 147installs skill-creation skill-creation converts past session breakthroughs into reusable agent skills inside SKILL.md files. Helps extract repeatable patterns and refine existing instructions. CX Codex +1 142installs autoresearch The autoresearch skill runs repeated code experiments against a measurable target. Use it for tuning tests, builds, bundle size, or ML training results. CX Codex +1 137installs vulnerability-validation vulnerability-validation is a Claude Code skill that tests whether security scan findings can be exploited and filters false alarms. It runs after commit-security-scan, before findings become issues or block a PR. CX Codex +1 135installs

Project sponsors

Companies that keep this analytics open