typescript-guide

Installation
SKILL.md

TypeScript/JavaScript Guide

Applies to: TypeScript 5+, Node.js 20+, ES2022+, React, Server-Side JS

Core Principles

  1. Strict TypeScript: Enable all strict flags; treat type errors as build failures
  2. Immutability by Default: Use const, readonly, as const, and spread operators; mutate only when profiling demands it
  3. Explicit Types at Boundaries: All function signatures, API responses, and public interfaces must have explicit type annotations; infer internally
  4. Functional Patterns: Prefer pure functions, map/filter/reduce, and composition over classes and mutation
  5. Zero any: Use unknown for truly unknown data, Zod/io-ts for runtime narrowing; every any requires a code-review comment explaining why

Guardrails

TypeScript Configuration

  • Enable "strict": true (this activates strictNullChecks, noImplicitAny, strictFunctionTypes, etc.)
  • Enable "noUncheckedIndexedAccess": true (arrays and records return T | undefined)
  • Enable "noImplicitReturns": true and "noFallthroughCasesInSwitch": true
Related skills
Installs
8
Repository
ar4mirez/samuel
First Seen
Mar 1, 2026