typescript-best-practices

Installation
SKILL.md

TypeScript best practices

Use when authoring .ts / .tsx, configuring tsconfig, or integrating Zod and generated API types.

Strictness

  • Enable strict (and related flags) project-wide; don’t carve out any silos without a plan to remove them.
  • Prefer unknown over any at boundaries; narrow with type guards or schemas.

Types vs runtime

  • Zod (or similar) at IO boundaries (API, env, search params); infer TS types with z.infer to avoid drift.
  • Don’t assume generated OpenAPI types are perfect; wrap or refine where the contract is loose.

Modules and imports

  • Use import type for type-only imports when it helps bundlers and clarity.
  • Avoid circular imports; extract shared types or small modules to break cycles.
Installs
1
First Seen
Apr 12, 2026
typescript-best-practices — alexandretrotel/skills