Apply modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
82
77%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./.agent/skills/typescript/typescript-language/SKILL.mdas const. No runtime enum.typeof, instanceof, predicates.Partial, Pick, Omit, Record.readonly arrays/objects. Const Assertions: as const, satisfies.on${Capitalize<string>}.public. Use private/protected or #private.string & { __brand: 'Id' }.any: Use unknown or a specific interface instead.Function: Use signature () => void.enum: Runtime cost.!: Avoid non-null assertion (!). Use narrowing (typeof, instanceof, if-checks).jest.Mocked<T> or as unknown as T.// Branded Type
type UserId = string & { __brand: 'Id' };
// Satisfies (Validate + Infer)
const cfg = { port: 3000 } satisfies Record<string, number>;
// Discriminated Union
type Result<T> = { kind: 'ok'; data: T } | { kind: 'err'; error: Error };After any type change that crosses module boundaries or involves generics, unions, conditional types, or branded types: call getDiagnostics (typescript-lsp MCP tool) to confirm no type errors before finalizing.
For advanced type patterns and utility types: See references/REFERENCE.md.
19a1140
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.