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
npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a claude-codeWhat 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
ascasts 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
asin 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-code2Manually: put the files in place
~/.claude/skills/ban-type-assertions/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ban-type-assertions/
1Skills CLI (Vercel)
npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a codex2Manually: put the files in place
.agents/skills/ban-type-assertions/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a cursor2Manually: put the files in place
.cursor/skills/ban-type-assertions/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Factory-AI/factory-plugins plugins/typescript/skills/ban-type-assertions2Manually: put the files in place
.github/skills/ban-type-assertions/SKILL.md1Skills CLI (Vercel)
npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a gemini-cli2Platform CLI
gemini skills install https://github.com/Factory-AI/factory-plugins --path plugins/typescript/skills/ban-type-assertionsManually: put the files in place
.devin/skills/ban-type-assertions/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Factory-AI/factory-plugins --skill ban-type-assertions -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.