typescript

Optimize TypeScript compilation speed and resolve type errors via tsconfig tuning and refactoring.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/selfagency/agentsy --skill typescript-selfagency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/selfagency/agentsy/tree/main/.agents/skills/typescript
Command: npx skills add https://github.com/selfagency/agentsy --skill typescript-selfagency

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TypeScript performance issues and confusing type errors slow down development by causing slow compilation, expensive type-checking, and inefficient async/module patterns.

Core Features & Use Cases

  • Type system performance rules: reduce compilation cost from deep generics, large unions, complex mapped/conditional types, and type recursion.
  • tsconfig performance tuning: configure include/exclude, incremental compilation, project references, isolated transpilation/declarations, skipLibCheck, and stricter compiler options that catch issues earlier.
  • Code-level performance and correctness patterns: improve async/await behavior (avoid loop waterfalls, parallelize independent work, defer awaits), and optimize module organization (avoid barrel imports/circular deps, prefer type-only imports).
  • Use cases: applying targeted fixes when encountering TypeScript errors (e.g., is not assignable) and when refactoring performance-sensitive .ts/.tsx/.d.ts code involving types, module boundaries, or memory behavior.

Quick Start

Use the typescript skill to optimize your tsconfig and refactor the reported TypeScript performance hotspot in your codebase based on the rule categories.

Frequently Asked Questions about typescript

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

FAQPage Schema
Why does TypeScript compilation take so long and how can I speed it up?

Slow TypeScript compilation is often caused by deep generics, large unions, and complex mapped types. You can speed up TypeScript builds by applying performance-focused tsconfig tuning, enabling incremental compilation, and refactoring expensive type patterns.

How do I fix the 'is not assignable' TypeScript error when refactoring unions and generics?

To fix 'is not assignable' TypeScript errors, you must refactor complex union and generic type definitions. Applying targeted type-error remediation resolves mismatched module boundaries and ensures correct async patterns in your .ts and .tsx files.

What are the best tsconfig settings to optimize TypeScript project references and skip lib checks?

The best tsconfig settings for TypeScript performance include configuring project references, enabling isolated transpilation, and using skipLibCheck. These compiler options reduce type-checking overhead by excluding unnecessary files and catching issues earlier.

How do I avoid waterfall performance issues with async await in TypeScript loops?

To avoid async await waterfall issues in TypeScript loops, you should parallelize independent work and defer awaits. Optimizing async behavior prevents memory and correctness concerns by eliminating sequential bottlenecks in your module organization.

Does using barrel imports and circular dependencies slow down TypeScript type checking?

Yes, barrel imports and circular dependencies slow down TypeScript type checking by expanding the module graph. You can improve TypeScript performance by optimizing module organization, avoiding barrel imports, and preferring type-only imports.

Can I use this TypeScript performance tuning for .d.ts declaration files and complex conditional types?

Yes, this TypeScript performance tuning is suitable for refactoring .d.ts declaration files and complex conditional types. It applies deterministic refactoring guidance to resolve memory and correctness concerns across .ts, .tsx, and .d.ts code.