typescript-performance
Comprehensive TypeScript performance analysis and optimization. Use when users report slow TypeScript compilation, slow editor experience, or want to investigate TypeScript performance issues. This skill provides diagnostic tools, trace analysis workflows, and optimization strategies. Key triggers include mentions of slow builds, type-checking delays, tsc performance, editor lag with TypeScript, or requests to analyze/improve TypeScript performance. Always prioritize data-driven analysis using --extendedDiagnostics, --generateTrace, and TS Server logs before making optimization recommendations.
Best use case
typescript-performance is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Comprehensive TypeScript performance analysis and optimization. Use when users report slow TypeScript compilation, slow editor experience, or want to investigate TypeScript performance issues. This skill provides diagnostic tools, trace analysis workflows, and optimization strategies. Key triggers include mentions of slow builds, type-checking delays, tsc performance, editor lag with TypeScript, or requests to analyze/improve TypeScript performance. Always prioritize data-driven analysis using --extendedDiagnostics, --generateTrace, and TS Server logs before making optimization recommendations.
Teams using typescript-performance should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/typescript-performance/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How typescript-performance Compares
| Feature / Agent | typescript-performance | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Comprehensive TypeScript performance analysis and optimization. Use when users report slow TypeScript compilation, slow editor experience, or want to investigate TypeScript performance issues. This skill provides diagnostic tools, trace analysis workflows, and optimization strategies. Key triggers include mentions of slow builds, type-checking delays, tsc performance, editor lag with TypeScript, or requests to analyze/improve TypeScript performance. Always prioritize data-driven analysis using --extendedDiagnostics, --generateTrace, and TS Server logs before making optimization recommendations.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# TypeScript Performance Analysis and Optimization This skill provides a systematic approach to diagnosing and resolving TypeScript performance issues through data-driven analysis. ## Core Principle: Always Start with Diagnostics Never guess at performance issues. Always collect diagnostic data first: 1. **For build performance**: Run `--extendedDiagnostics` or generate a performance trace 2. **For editor performance**: Collect TS Server logs 3. **For configuration issues**: Use `--listFilesOnly` and `--explainFiles` ## Quick Start Workflow ### 1. Identify the Problem Type Ask user to clarify: - **Build performance**: `tsc` or bundler compilation is slow - **Editor performance**: VS Code autocomplete/type-checking is slow - **Both**: Likely a fundamental type-checking issue ### 2. Collect Diagnostic Data #### For Build Performance Issues **Quick Diagnostics:** ```bash npx tsc -p . --extendedDiagnostics ``` Use `scripts/analyze_diagnostics.py` to parse and interpret the output: ```bash npx tsc -p . --extendedDiagnostics 2>&1 | python scripts/analyze_diagnostics.py - ``` **Detailed Analysis (if needed):** ```bash # Generate comprehensive trace bash scripts/generate_trace.sh . ./trace_output # Quick automated analysis npx @typescript/analyze-trace ./trace_output # Visual analysis in Chrome/Edge # Open about://tracing and load trace_output/trace.*.json ``` #### For Editor Performance Issues **Get TS Server log in VS Code:** 1. Command Palette → `TypeScript: Open TS Server log` 2. Enable logging if prompted 3. Reproduce the slow behavior 4. Return to get the log file **Check for common issues:** - High memory usage → Project too large - Slow responses → Specific file/operation issue - Frequent errors → Configuration problem ### 3. Analyze the Data #### Interpreting extendedDiagnostics Use `analyze_diagnostics.py` output to identify: - **High Check time** (>70% of total): Type-checking bottleneck → Generate trace for detailed analysis - **High I/O Read time** (>30% of total): File system issue → Check include/exclude configuration - **High file count** (>2000): Configuration problem → Review tsconfig.json patterns - **High memory usage** (>2GB): Project size issue → Consider project references #### Interpreting Performance Traces For detailed trace analysis guidance, read `references/trace-analysis-guide.md`. Key steps: 1. Load trace in about://tracing or use `@typescript/analyze-trace` 2. Focus on the Checking phase (usually the bottleneck) 3. Identify wide boxes with high "Wall Duration" 4. Look for patterns: - Specific files taking excessive time - Repeated type instantiations - Deep call stacks in type-checking ### 4. Apply Optimizations Based on diagnostic findings, consult `references/performance-checklist.md` for specific optimizations. #### Common Fix Patterns **Configuration Issues** (High I/O time, high file count): - Fix include/exclude patterns - Limit @types auto-inclusion - Enable skipLibCheck **Type-Checking Issues** (High Check time): - Prefer interfaces over type intersections - Add explicit return types - Extract complex conditional types - Use subtypes instead of large unions **Project Structure Issues** (High memory, very large projects): - Implement project references - Split monolithic projects - Separate test code **Build Tool Issues**: - Enable isolatedModules - Use faster transpilers (esbuild/swc) - Separate type-checking from transpilation ### 5. Verify Improvements After applying fixes: 1. Re-run diagnostics to measure improvement 2. Compare before/after metrics 3. Ensure functionality is unchanged ## Common Issues Reference For specific problem patterns and solutions, read `references/common-issues.md`. Common issues covered: - node_modules being scanned - Too many @types packages included - Slow type-checking of specific code patterns - Build tool integration slowness - Memory usage problems - Incremental builds not helping ## Using the Scripts ### generate_trace.sh Generates a complete performance trace with diagnostics: ```bash bash scripts/generate_trace.sh [project-path] [output-dir] ``` Default: current directory, output to `./trace_output` Output includes: - trace.\*.json files (load in about://tracing) - types.\*.json files (type information) - diagnostics.txt (extendedDiagnostics output) ### analyze_diagnostics.py Parses and analyzes extendedDiagnostics output: ```bash # From file python scripts/analyze_diagnostics.py diagnostics.txt # From pipe tsc --extendedDiagnostics 2>&1 | python scripts/analyze_diagnostics.py - ``` Provides: - Key metrics summary - Time breakdown with percentages - Automated issue detection - Specific recommendations ## Advanced Analysis For complex cases requiring deep investigation: 1. **Review trace-analysis-guide.md** for detailed trace interpretation 2. **Cross-reference with types.json** to understand type structures 3. **Use Chrome DevTools Performance tab** as alternative to about://tracing 4. **Generate CPU profiles** with --generateCpuProfile for compiler profiling ## When to File an Issue File a TypeScript issue if: - Minimal reproduction case exists - Diagnostics and trace data collected - Issue persists on latest TypeScript version - Solutions in this skill don't resolve the problem Include: - TypeScript version (`npx tsc -v`) - Node version (`node -v`) - extendedDiagnostics output - Performance trace files (if applicable) - Minimal reproduction code
Related Skills
golang-performance
Golang performance optimization patterns and methodology - if X bottleneck, then apply Y. Covers allocation reduction, CPU efficiency, memory layout, GC tuning, pooling, caching, and hot-path optimization. Use when profiling or benchmarks have identified a bottleneck and you need the right optimization pattern to fix it. Also use when performing performance code review to suggest improvements or benchmarks that could help identify quick performance gains. Not for measurement methodology (see golang-benchmark skill) or debugging workflow (see golang-troubleshooting skill).
watch-ci
CI を監視し、失敗したら自律的に修正してパスするまでループするスキル。push 後・PR 作成後・rebase 後に CI が通るか確認したいとき、CI が落ちていたら直してほしいとき、CI の結果を待ちたいときに使う。「CI 監視して」「CI が通るまで待って」「CI 直して」「push したので CI を見ておいて」など、CI の状態確認・自動修正が必要な場面では必ずこのスキルを呼び出すこと。
vue-style-guide
Vue を書くときは基本的に参考にしてください。 個人的に気に入っている ubgeeei 氏の Vue.js のスタイルガイドです。
vitess
Vitess best practices, query optimization, and connection troubleshooting for PlanetScale Vitess databases. Load when working with Vitess databases, sharding, VSchema configuration, keyspace management, or MySQL scaling issues.
triage-pr-reviews
Triages unresolved PR review comments using gh-pr-reviews. Analyzes code context and classifies each comment as Agree / Partially Agree / Disagree. Walks through each comment one-by-one, asking the user what action to take. Use when the user wants to triage, review, or analyze unresolved PR comments.
terraform-test
Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.
terraform-style-guide
Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.
terraform-stacks
Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl, .tfdeploy.hcl files), working with stack components and deployments from local modules, public registry, or private registry sources, managing multi-region or multi-environment infrastructure, or troubleshooting Terraform Stacks syntax and structure.
teach-impeccable
One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
stacked-pr
依存関係のある複数の PR を管理・同期するためのスキル。stacked PR のカスケード rebase、PR 間の依存検出、base branch 管理、CI の上流優先修正を行う。PR が別の PR に依存している状況全般で使う — cascade rebase、スタック sync、依存先 PR 更新後のメンテ、PR チェーンの整合性確認などをするときなど。
smart-compact
セッションのコンテキストを分析し、重要な情報を保持するためのプロンプトを生成して /compact コマンドの実行を支援するスキル。コンテキストウィンドウが逼迫してきた時や、セッションを整理したい時に使用。
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.