What problem does it solve?
TypeScript projects with heavy generic types can suffer from slow compilation caused by excessive type instantiations. This Skill provides a measured, iterative workflow to reduce Instantiations reported by --extendedDiagnostics without changing runtime behavior.
Core Features & Use Cases
- Ranked Optimization Catalog: Runs
top-type-optims.js to list documented type optimizations sorted by historical mean instantiation savings from type-optim.md.
- Measured Iteration Workflow: Records a baseline with
--extendedDiagnostics, applies one optimization at a time, and keeps only changes that reduce instantiations.
- Statistics Tracking: Uses
update-type-optim-stats.js to record each attempt's instantiation diff into bucketed stats, so future runs prioritize proven optimizations.
- Use Case: A developer notices slow type-checking in a large TypeScript ORM codebase, runs the optimizer to apply patterns like removing redundant intersections and unused generics, and verifies each change lowers the instantiation count.
Quick Start
Use the type-optimizer skill to reduce TypeScript type instantiations in this project, starting with a baseline extendedDiagnostics measurement.