What problem does it solve?
TypeScript codebases often drift into unsafe patterns like any, brittle type assertions, non-null assertions, inconsistent naming, and unvalidated external data, which leads to bugs that only show up at runtime.
Core Features & Use Cases
- Type safety guardrails: Encourages runtime validation for external inputs (fetch, filesystem, env vars, user input) using a validation library (e.g., zod/arktype/typebox) and provides patterns for type guards that narrow unknown safely.
- Maintainable structure and naming: Defines conventions for file naming, type/interface naming, and function/variable prefixes (create*, is*, get*, lookup*, generate*, handle*), plus acronym casing rules (URL, HTTP, JSON, API, etc.).
- Pragmatic correctness in error handling: Recommends rethrowing with
{ cause }, returning null when a request does not match a handler, and using a logger instead of console.log.
- Import and async discipline: Promotes named exports (no default exports), type-only imports via import type, extension-free relative imports when possible, and careful use of dynamic imports.
Quick Start
Use the typescript skill to refactor a TypeScript file so it validates all external data at runtime and removes any, as, and non-null assertions while applying the repository’s naming and import conventions.