sb-typescript
Installation
SKILL.md
Sunbytes TypeScript
When to apply
Trigger on any work in .ts / .tsx files, or when the user asks to write or edit TypeScript. This is the base skill — sb-react, sb-nextjs, and sb-nestjs build on it and should be loaded alongside when the project matches.
Core typing
- Strict mode always.
tsconfighasstrict: true,noUncheckedIndexedAccess: true,exactOptionalPropertyTypes: true,noImplicitOverride: true. - No
any. Useunknownand narrow with type guards. Ifanyis unavoidable, leave a one-line comment explaining why. - No non-null assertions (
!) and noascasts except when narrowing fromunknownafter a guard, or foras const. typeoverinterfacefor new code. Useinterfaceonly when extending classes or library shapes that require it (declaration merging).- Named exports only. No default exports — they break refactoring tools and autocomplete.
- No enums. Use union literals (
type Status = 'pending' | 'done') oras constobjects with a derived value type. readonlyby default for arrays and object properties that aren't mutated.ReadonlyArray<T>for inputs.