SECURITY_TYPESCRIPT.md Security
Runtime validation with Zod at system boundaries, typed environment schemas, typed error hierarchies, JWT handling with jose, RBAC with const assertions, Result types for auth, strict tsconfig, noUncheckedIndexedAccess, and typed API key management.
When to use: Reference when implementing authentication, validating external input, managing secrets, configuring TypeScript strict mode, or building typed middleware for API security.
SCALABILITY_TYPESCRIPT.md Scalability
Typed message queues with generic payloads, worker threads for CPU-bound work, typed event emitters, async/await consistency, typed circuit breakers, typed pagination with PaginatedResult, connection pooling, caching layers with generics, and type-safe API versioning.
When to use: Reference when designing async architectures, implementing background processing, building typed caching layers, or evolving API contracts with versioned types.
MAINTAINABILITY_TYPESCRIPT.md Maintainability
Generic utility functions with type safety, branded types for domain concepts, exhaustive enums and unions, Result types for expected failures, type-level tests with expectTypeOf, typed mock discipline, error wrapping with cause chains, and structured logging.
When to use: Reference during code review, when abstracting shared logic with generics, defining domain types, setting up testing with typed mocks, or establishing error handling patterns.
UIUX_TYPESCRIPT.md UI/UX
Typed optimistic state with MutationState unions, discriminated unions for AsyncState (loading, error, success), typed design tokens with as const, component props with variant unions, typed animation constants, and typed event handlers.
When to use: Reference when building typed UI components, implementing loading and error states with discriminated unions, defining design tokens, or creating typed mutation flows with optimistic updates.
AVAILABILITY_TYPESCRIPT.md Availability
Typed failover clients with interface abstractions, graceful shutdown with SIGTERM handlers, typed retry logic with generics, typed health check responses, feature flags with discriminated unions, uncaught exception handling, and memory leak detection.
When to use: Reference when implementing process lifecycle management, building resilient service clients, designing health check endpoints, or configuring typed feature flags for deployment safety.
ADAPTABILITY_TYPESCRIPT.md Adaptability
Typed translation files with compile-time key checking, Intl.DateTimeFormat and Intl.NumberFormat for cultural formatting, typed Money type for currency, Intl.Collator for locale-aware sorting, Intl.PluralRules, RTL layout typing, and CSS logical properties.
When to use: Reference when adding i18n to a TypeScript project, formatting dates and currencies with Intl APIs, implementing locale-aware sorting and search, or building RTL-compatible layouts.
CLEAN_CODE_TYPESCRIPT.md Clean Code
Root cause over type assertions, descriptive domain-specific names, enum and union naming, explicit return types on exports, no flag arguments with typed alternatives, options objects for 3+ parameters, Readonly for pure functions, and consistent casing conventions.
When to use: Reference during all TypeScript writing and review. The most frequently referenced guide. Essential for naming, function design, and resisting the temptation to use type assertions as shortcuts.
ARCHITECTURAL_DESIGN_TYPESCRIPT.md Architecture
Dependency injection with typed interfaces, polymorphism with discriminated unions and exhaustive switch, immutable data with Readonly, layered architecture (domain, application, infrastructure, presentation), module boundary enforcement, and generic repository pattern.
When to use: Reference when structuring a TypeScript project, defining module boundaries with barrel files, designing dependency injection, or implementing the repository pattern with generics.
SOURCE_STRUCTURE_TYPESCRIPT.md Structure
Feature-based organization, one concept per file, barrel files for public APIs, test co-location, file declaration order, trailing commas for clean diffs, import ordering, path aliases with tsconfig, type definition organization, and file length guidelines.
When to use: Reference when setting up a new TypeScript project, establishing file organization conventions, configuring path aliases, or deciding how to structure tests alongside source code.
DOCUMENTATION_COMMENTS_TYPESCRIPT.md Documentation
Types as documentation philosophy, when to comment (non-obvious constraints, business rules, complex generics, workarounds), avoiding redundant JSDoc, TSDoc for library APIs, branded types as documentation, and architecture decision records.
When to use: Reference when deciding whether a comment adds value, writing library documentation with TSDoc, reviewing comment quality, or establishing documentation standards for a TypeScript project.