typescript-best-practices
TypeScript best practices
Use TypeScript to carry facts that callers would otherwise need to remember. Keep the model only as strong as the operations require. Repository instructions own architecture, and library skills own library APIs and programming models.
1. Establish the local contract
Before changing code, read the applicable repository and directory instructions, the owning package manifest, TypeScript and lint configuration, neighboring code, and tests. Trace the changed operation from its input boundary through the point that handles its result or failure.
Project instructions decide ownership, imports, exports, naming, testing, and architecture. This skill fills gaps in those instructions. Use existing domain types, validators, error types, and module seams when they express the same meaning.