Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cursor avatar

Typescript Best Practices

  • 531 installs
  • 2.5k repo stars
  • Updated August 5, 2026
  • cursor/plugins

Apply TypeScript conventions—strict typing, module boundaries, error handling, and testable patterns—while implementing Cursor plugin extension code.

About

TypeScript-best-practices skill encodes Cursor plugin coding standards: strict types, disciplined modules, safe async patterns, and maintainable structures for extension UI, commands, and shared library code.

  • Strict typing defaults
  • Clear module boundaries
  • Predictable error handling
  • Testable pure helpers
  • Consistent public types

Typescript Best Practices by the numbers

  • 531 all-time installs (skills.sh)
  • Ranked #607 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cursor/plugins --skill typescript-best-practices

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs531
repo stars2.5k
Last updatedAugust 5, 2026
Repositorycursor/plugins

What it does

Apply TypeScript conventions—strict typing, module boundaries, error handling, and testable patterns—while implementing Cursor plugin extension code.

Files

SKILL.mdMarkdownGitHub ↗

TypeScript best practices

Apply the type-system-discipline principle skill first; this skill grounds it in TypeScript syntax.

RuleSummary
Discriminated unionsModel variants with a kind literal discriminant so impossible states can't be represented. No optional-field bags.
Branded typesBrand primitives with & { readonly __brand: "X" } so they can't be mixed up. Validate once at creation.
unknown over anyExternal data is unknown. any disables type checking everywhere it touches.
No as castsEvery as is a runtime crash waiting. Cast only after validation.
Narrowing hierarchyDiscriminant switch > in operator > typeof/instanceof > user-defined type guard > as.
Type guardsMust verify the claim. A lying guard is worse than as because the bug hides behind a name that says it's safe. Name them isX or hasX.
ExhaustivenessInline const _exhaustive: never = x; in default arms so the compiler errors when a new variant is added.
satisfies over asValidates the value without widening literal types.
Boundary validationValidate where data crosses in; trust types inside. See the boundary-discipline principle skill.
Schema-derived typesReach for Pick/Omit/Parameters/ReturnType/Awaited/typeof before declaring a new interface.
Object argsPass objects, not positional, so argument order is self-documenting. Skip on hot paths (per-frame render, tokenizers, parsers).

Examples: references/patterns.md.

Related skills

Frontend Developmentfrontendbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.