typescript-best-practices

Installation
SKILL.md

TypeScript Best Practices

Guidelines for writing clean, type-safe, and maintainable TypeScript code.

Note: If the repository has established code style conventions, follow those first. These guidelines serve as defaults.

Core Principles

  1. Type-First Design - Define types before implementation; minimize reliance on inference
  2. Interface for Structure - Use interface for objects, type for unions/mapped/conditional
  3. Namespace for Type Organization - Group related types with namespaces (types only, not runtime)
  4. Generic Const for Strictness - Use <const TConfig> for strict literal inference
  5. Extract, Don't Redefine - Get types from existing definitions instead of duplicating
  6. Strictest Config - Use strictest tsconfig base; install ts-reset for saner built-in types

Quick Reference

interface vs type

Installs
6
First Seen
Mar 21, 2026
typescript-best-practices — vdustr/vp-claude-code-marketplace