What problem does it solve?
Inconsistent TypeScript style across a large monorepo leads to unreadable code, hidden runtime bugs from unsafe types, and bloated bundles. This Skill gives AI assistants and reviewers a single, authoritative set of conventions for all TypeScript code in the Phoenix repository.
Core Features & Use Cases
- Naming and Function Standards: Enforces self-documenting variable names, verb-prefixed booleans, action-verb function names, and object destructuring for multi-parameter functions with JSDoc annotations.
- Type Safety Rules: Requires type guards for union narrowing, bans
any in favor of unknown, and mandates Partial<Record<K, V>> or V | undefined for lookup maps to prevent silent undefined access.
- Purity and Import Discipline: Requires pure utilities to accept overridable defaults (e.g.,
now, DEFAULT_ constants) instead of reading ambient state, and mandates lodash path imports for tree shaking.
- Use Case: When writing a new utility in
js/packages/phoenix-client or refactoring a React component in js/app/, apply these rules so the code passes review without style-related rework.
Quick Start
Review my new TypeScript function in js/app and rewrite it to follow the Phoenix TypeScript conventions.