Skip to content
cursor avatar

Typescript Best Practices

Strict TypeScript modeling rules that replace unchecked casts with validated, impossible-state-proof types.

CCM score
58 of 100
skills.sh installs
12.3K
GitHub stars
20.2K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers discriminated unions, branded types, constructive modeling, schema-derived types, and exhaustiveness checks for .ts and .tsx files
  • Enforces a ban on as casts and any, with unknown for external data and a fixed narrowing hierarchy from discriminant switches to user-defined guards
  • Requires type guards to genuinely verify their claim and prefers z.infer from the repository's schema library over hand-written guards
  • Applies automatically to any read or edit of .ts or .tsx files, with examples in references/patterns.md

Install

$ npx -y skills add cursor/plugins --skill typescript-best-practices -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

TypeScript best practices

Apply the type-system-discipline principle skill first.

Details

Repository
github.com/cursor/plugins
Categories
Frontend & UI Code, Code Review & Quality
First seen
Jun 23, 2026

Questions

What does the typescript-best-practices skill do?

It applies TypeScript best practices whenever an agent reads or edits any .ts or .tsx file. It covers patterns such as discriminated unions, branded types, avoiding unsafe casts, using unknown over any, and boundary validation.

How do I install the typescript-best-practices skill?

Run npx -y skills add cursor/plugins --skill typescript-best-practices -y in your project. Once installed, the agent applies these rules to TypeScript files it touches.

Which other skills lead the Frontend and UI Code category?

typescript-best-practices sits in the Frontend and UI Code category on Claude Marketplaces, alongside vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns and lark-apps. It stands out by focusing on type-system discipline for TypeScript code rather than UI design or React patterns.

More from cursor/plugins

All 93

Similar to Typescript Best Practices

More Frontend & UI Code