typescript-rules
Installation
SKILL.md
TypeScript Development Rules
Type Safety in Backend Implementation
Type Safety in Data Flow
Input Layer (unknown) -> Type Guard -> Business Layer (Type Guaranteed) -> Output Layer (Serialization)
Backend-Specific Type Scenarios:
- API Communication: Always receive responses as
unknown, validate with type guards - Form Input: External input as
unknown, type determined after validation - Legacy Integration: Stepwise assertion like
window as unknown as LegacyWindow - Test Code: Always define types for mocks, utilize
Partial<T>andvi.fn<[Args], Return>()