010112 typescript rules
Multi-domain agent skills collection for AI coding agents (Claude, Cursor, Copilot, OpenCode, and more). Covers programming, biology, cooking, and future domains. Installable via npx skills add.
npx -y skills add natuleadan/skills --skill 010112-typescript-rulesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
TypeScript strict mode, generics, mapped types, conditional types, Zod validation, migration strategy, and anti-patterns.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.0 KB, as published. Nobody here has run it
TypeScript Rules
Overview
TypeScript 5.7+ language patterns covering strict mode configuration, type safety, advanced typesystem constructs, best practices, Zod validation, and incremental migration from JavaScript.
Quick Reference
Strict Mode
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}
Core Rules
- No
any— useunknown, generics, orRecord<string, unknown> - No
enum— union literals (type Status = "active" | "inactive") oras const - No
!non-null assertions — use guards orResult<T, E> - No
@ts-ignore—@ts-expect-erroronly for intentional error tests import type/export typefor type-only imports- Strict equality
===,constby default
Type System
- Discriminated unions for exhaustive checking
- Generics with constraints (
<T extends { id: string }>) - Mapped types (
Partial<T>,Immutable<T>,Getters<T>) - Conditional types (
IsString<T>,ArrayElement<T>,Awaited<T>) satisfiesoperator for compile-time validation- Zod schemas for runtime validation at boundaries
References
- Type Safety — Strict mode, no any, discriminated unions, type guards
- Advanced Types — Generics, mapped types, conditional types, satisfies
- Rules & Anti-Patterns — No enum, import type, Zod, Result pattern, all lint rules (merged)
- Migration Strategy — JS→TS incremental migration, JSDoc, tsconfig
- Code Examples — Repository pattern, DTOs, conditional types, Zod
- Quick Reference — Type system cheat sheet, utility types, keywords