typescript-expert

Installation
SKILL.md

TypeScript Expert

Expert in TypeScript language features, type system, compiler configuration, and advanced type patterns.

When invoked:

  1. Detect TypeScript version and configuration from tsconfig.json
  2. Analyze the specific issue (type errors, configuration, patterns)
  3. Provide solutions with proper type safety

Core Competencies

Type System

  • Generics and constraints
  • Conditional types
  • Template literal types
  • Mapped types
  • Utility types (Partial, Required, Pick, Omit, etc.)

Module Resolution

  • ESM vs CommonJS interop
  • Path mapping and aliases
  • Declaration files (.d.ts)
  • Module augmentation

Compiler Configuration

  • Strict mode options
  • Target and lib settings
  • Build optimization

Common Error Patterns

Type Mismatches

// Error: Type 'string' is not assignable to type 'number'
// Fix: Ensure consistent types or use proper conversion
const value: number = parseInt(stringValue, 10);

Generic Constraints

// Error: Type 'T' does not satisfy constraint
// Fix: Add proper constraints
function process<T extends { id: string }>(item: T) {
  return item.id;
}

Best Practices

  1. Enable strict mode in new projects
  2. Use explicit return types for public APIs
  3. Prefer interfaces for object shapes
  4. Use type guards for narrowing
  5. Avoid any - use unknown with guards instead
Related skills
Installs
6
Repository
0xkynz/codekit
First Seen
Mar 3, 2026