typescript-expert

Diagnose and resolve TypeScript type errors, build performance issues, and monorepo configuration problems.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/usmangurowa/socialmocks --skill typescript-expert-usmangurowa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-expert
Source: https://github.com/usmangurowa/socialmocks/tree/main/.agents/skills/typescript-expert
Command: npx skills add https://github.com/usmangurowa/socialmocks --skill typescript-expert-usmangurowa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? TypeScript projects often hit cryptic compiler errors, slow type checking, module resolution failures, and migration challenges that stall development. This Skill provides expert-level guidance for diagnosing and fixing these issues using current best practices. ## Core Features & Use Cases - Type-Level Programming Guidance: Apply branded types, conditional types, template literal types, and type inference patterns to build type-safe APIs and domain models. - Performance Diagnostics: Run the included diagnostic script to detect slow type checking, excessive 'any' usage, type assertions, and misconfigured tsconfig flags, then apply fixes like skipLibCheck, incremental builds, and project references. - Migration & Tooling Decisions: Get structured guidance for JavaScript-to-TypeScript migration, ESLint vs Biome selection, Nx vs Turborepo decisions, and ESM/CJS interop issues. - Use Case: Your monorepo's type checking takes minutes and CI fails with 'Type instantiation is excessively deep' errors. Invoke this Skill to profile the compiler, identify the problematic recursive types, and restructure them with depth-limited conditionals. ## Quick Start Ask the assistant to diagnose why your TypeScript project's type checking is slow and fix the tsconfig accordingly.

Frequently Asked Questions about typescript-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix slow TypeScript type checking?

Enable skipLibCheck and incremental compilation in tsconfig, then run tsc --extendedDiagnostics to identify bottlenecks. For monorepos, configure project references with composite: true, and split large union types or deep recursive types that cause excessive instantiation.

How do I fix 'Type instantiation is excessively deep' errors?

This error comes from deeply recursive or circular generic types. Limit recursion depth with counter-based conditional types, replace type intersections with interfaces, and break large unions into smaller groups to stay within compiler limits.

Should I use Biome or ESLint for TypeScript linting?

Choose Biome when speed matters and you want a single tool for linting and formatting in a TypeScript-first project. Stay with ESLint when you need type-aware linting rules, custom plugins, or framework support for Vue and Angular.

Why does TypeScript say 'Cannot find module' when the file exists?

Module resolution failures usually come from mismatched moduleResolution settings, misaligned baseUrl and paths, or stale build caches. Check that moduleResolution matches your bundler, verify workspace protocol usage in monorepos, and clear .tsbuildinfo caches.

When should I use branded types in TypeScript?

Use branded types for critical domain primitives like UserId, OrderId, or currency values where mixing plain strings or numbers causes bugs. They create nominal typing at compile time with zero runtime cost, preventing accidental argument swaps.

How do I migrate a JavaScript project to TypeScript incrementally?

Enable allowJs and checkJs in tsconfig, then rename files from .js to .ts gradually while adding types file by file. Enable strict mode flags one at a time, and use tools like ts-migrate or typesync to automate parts of the conversion.