mayrlabs-typescript
Installation
SKILL.md
TypeScript Code Doctrine
TypeScript is NOT optional. We use it to structurally guarantee application integrity at build time, not merely for editor autocompletion.
The Iron Law
Never use any unless absolutely necessary and heavily justified with a comment.
Core Principles
- Strict Everything: Ensure
strict: trueis intsconfig.json. This implies no implicit anys and strict null checks. - Layered Architecture: Use strict DTOs (Data Transfer Objects) and clear interfaces for communication between your Controllers, Services, and Repositories.
- Interfaces vs Types: Use
interfacefor structural definitions (objects, classes) and extendibility. Usetypefor unions, intersections, and primitives. Be consistent. - Enums are Banned: Avoid TS
enum. They transpile to bloated reverse-mapped objects and cause runtime vs build-time confusion. Use const objects or union types (type Status = 'active' | 'inactive').