From nickcrew-claude-ctx-plugin
Guides on advanced TypeScript patterns like conditional types, discriminated unions, branded types, and builders for type-safe APIs, domain models, and state machines.
npx claudepluginhub nickcrew/claude-cortexThis skill uses the workspace's default tool permissions.
Expert guidance for leveraging TypeScript's advanced type system features to build robust, type-safe applications with sophisticated type inference, compile-time guarantees, and maintainable domain models.
references/advanced-generics.mdreferences/branded-types.mdreferences/builder-pattern.mdreferences/common-pitfalls.mdreferences/conditional-types.mdreferences/decorators.mdreferences/discriminated-unions.mdreferences/mapped-types.mdreferences/performance-best-practices.mdreferences/template-literal-types.mdreferences/testing-types.mdreferences/type-guards.mdreferences/type-inference.mdreferences/utility-types.mdGuides TypeScript advanced types like generics, conditional types, mapped types, template literals, and utilities for type-safe libraries, APIs, and components. Use for complex type logic and inference.
Guides advanced TypeScript types including generics, conditional types, mapped types, template literal types, utility types. For type-safe libraries, generic components, API clients, validation, state management.
Designs complex TypeScript generics and utility types, refactors 'any' to strict alternatives, creates type guards, and resolves compiler errors for inference, conditional types, and more.
Share bugs, ideas, or general feedback.
Expert guidance for leveraging TypeScript's advanced type system features to build robust, type-safe applications with sophisticated type inference, compile-time guarantees, and maintainable domain models.
TypeScript's type system enables compile-time safety through:
value is Type)Load detailed references on-demand:
| Topic | Reference File |
|---|---|
| Conditional Types | skills/typescript-advanced-patterns/references/conditional-types.md |
| Mapped Types | skills/typescript-advanced-patterns/references/mapped-types.md |
| Template Literal Types | skills/typescript-advanced-patterns/references/template-literal-types.md |
| Type Guards | skills/typescript-advanced-patterns/references/type-guards.md |
| Discriminated Unions | skills/typescript-advanced-patterns/references/discriminated-unions.md |
| Branded Types | skills/typescript-advanced-patterns/references/branded-types.md |
| Builder Pattern | skills/typescript-advanced-patterns/references/builder-pattern.md |
| Advanced Generics | skills/typescript-advanced-patterns/references/advanced-generics.md |
| Utility Types | skills/typescript-advanced-patterns/references/utility-types.md |
| Type Inference | skills/typescript-advanced-patterns/references/type-inference.md |
| Decorators | skills/typescript-advanced-patterns/references/decorators.md |
| Performance Best Practices | skills/typescript-advanced-patterns/references/performance-best-practices.md |
| Common Pitfalls | skills/typescript-advanced-patterns/references/common-pitfalls.md |
| Testing Types | skills/typescript-advanced-patterns/references/testing-types.md |
tsconfig.json with "strict": true)Using any instead of unknown: Loses all type safety
unknown and type guards insteadType assertions without validation: Unsafe runtime behavior
value is Type) over as TypeOverusing generics: Unnecessary complexity
Deep type nesting: Slow compilation, hard to debug
Forgetting readonly: Accidental mutations
readonlyNot enabling strict mode: Missing null checks and type errors
"strict": true in tsconfig.jsonMixing type and interface incorrectly: Confusing semantics
type for unions/utilities, interface for object shapestype UserId = string & { readonly __brand: 'UserId' };
function createUserId(id: string): UserId { return id as UserId; }
type State =
| { status: 'loading' }
| { status: 'success'; data: string }
| { status: 'error'; error: Error };
type Readonly<T> = { readonly [P in keyof T]: T[P] };
type Partial<T> = { [P in keyof T]?: T[P] };
function isString(value: unknown): value is string {
return typeof value === 'string';
}