typescript-expert

Diagnose and resolve TypeScript type errors, build performance, and migration issues.

Updated Sep 1, 2021
One-click install
npx skills add https://github.com/WP-Coaching/pellegrims.coach --skill typescript-expert-wp-coaching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-expert
Source: https://github.com/WP-Coaching/pellegrims.coach/tree/main/.agents/skills/typescript-expert
Command: npx skills add https://github.com/WP-Coaching/pellegrims.coach --skill typescript-expert-wp-coaching

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 painful JavaScript-to-TypeScript or ESM/CJS migrations. This Skill provides expert-level guidance and diagnostics to identify root causes and apply proven fixes. ## Core Features & Use Cases - Project Diagnostics: Runs a Python diagnostic script that inspects tsconfig settings, detects tooling (Biome, ESLint, Vitest, Turborepo, Nx), counts any usages and type assertions, and measures type-check performance. - Type-Level Programming Guidance: Covers branded types, conditional types, template literal types, and type inference patterns with copy-paste examples. - Migration & Tooling Decisions: Provides decision matrices for Biome vs ESLint, Nx vs Turborepo, and step-by-step JS-to-TS and CJS-to-ESM migration strategies. - Use Case: Your build suddenly fails with "Type instantiation is excessively deep". Invoke this Skill to diagnose the recursive type, apply a depth-limited pattern, and validate with tsc --noEmit. ## Quick Start Ask the assistant to use the typescript-expert skill to diagnose why my project fails type checking and fix the errors.

Frequently Asked Questions about typescript-expert

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

FAQPage Schema
How do I fix 'Type instantiation is excessively deep' in TypeScript?

This error comes from deeply recursive or circular types. Fix it by limiting recursion depth with conditional types, replacing type intersections with interfaces, splitting large union types, or breaking circular generic constraints.

Biome vs ESLint: which should I use for a TypeScript project?

Use Biome when speed is critical and you want one tool for linting and formatting with TypeScript-first support. Stay with ESLint when you need specific plugins, custom rules, type-aware linting, or Vue/Angular support.

How do I migrate a JavaScript project to TypeScript incrementally?

Enable allowJs and checkJs in tsconfig, rename files gradually from .js to .ts, add types file by file, then enable strict mode flags one at a time. Tools like ts-migrate and typesync can automate parts of the process.

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

Module resolution failures usually come from a moduleResolution setting that mismatches your bundler, misaligned baseUrl and paths, or stale caches. Check tsconfig settings and clear node_modules/.cache and .tsbuildinfo files.

How do I speed up slow TypeScript type checking?

Enable skipLibCheck and incremental compilation, configure include/exclude precisely, and use project references with composite: true in monorepos. Run tsc --extendedDiagnostics to identify bottlenecks.

When should I write type tests for TypeScript code?

Write type tests when publishing libraries, building complex generic functions, or defining API contracts. Use Vitest's expectTypeOf in .test-d.ts files to assert types at compile time without runtime overhead.