claude/ai-resources-plugin/skills/optimize-tsconfig/SKILL.md
Optimize tsconfig.json for build speed, watch mode, and tsc memory. Use for slow tsc, too many file watchers, or TypeScript performance audits.
npx skillsauth add amhuppert/my-ai-resources optimize-tsconfigInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit and optimize TypeScript configuration for faster builds, reduced memory usage, and fewer file watchers. Produces targeted, project-specific recommendations — not a generic checklist.
<target> $ARGUMENTS </target>If no path was provided, find all tsconfig files in the project using the Glob tool with pattern **/tsconfig*.json.
Read each tsconfig, including any extended configs (follow extends chains to understand the full effective configuration). Note which settings are inherited vs. overridden.
Run tsc --extendedDiagnostics for each tsconfig to establish a baseline:
npx tsc -p path/to/tsconfig.json --extendedDiagnostics --noEmit
Record key metrics: Files checked, total time, memory used, program size. These are the numbers to improve.
If the concern is watch mode specifically, check the current watchOptions (or lack thereof) and ask the user to provide a file watcher count if available (e.g., from lsof, /proc/PID/fdinfo, or a tool like watchman).
Consult references/tsconfig-performance.md for the full catalog of optimization settings, tradeoffs, and impact rankings.
Evaluate each potential optimization against the project's current config. Categorize recommendations into tiers:
Settings that improve performance with zero functional impact. Apply these unconditionally:
watchOptions.excludeDirectories — Exclude **/node_modules and build output dirs from watch. Typical reduction: 90%+ of file watchers eliminated.watchOptions.watchFile: "useFsEvents" — Use OS-native file events instead of polling.skipLibCheck: true — Skip type-checking .d.ts files. Almost always safe.incremental: true — Cache compiler state for faster rebuilds. Add tsBuildInfoFile pointing to build output dir.Settings with minor tradeoffs that are appropriate for most projects:
isolatedModules: true — Enables fast transpilers (SWC, esbuild). May require removing const enums or namespace merging patterns.exclude patterns — Ensure test files, build output, and hidden directories are excluded from the main program. Consider a separate tsconfig.test.json for test files.watchOptions.fallbackPolling: "dynamicPriorityPolling" — Best fallback when FS events are unavailable.Settings that require deliberate tradeoff decisions — present these with clear context:
types array — Restricting auto-included @types reduces program size but requires manual maintenance when adding dependencies. Recommend only when there's clear evidence of unnecessary types being pulled in.isolatedDeclarations (TS 5.5+) — Enables parallel .d.ts generation but requires explicit annotations on all exports.noCheck (TS 5.6+) — Skips type checking for emit-only builds. Only for split build pipelines.disableReferencedProjectLoad, etc.) — Only for large monorepos where VS Code runs out of memory.strict mode for performance — the impact is negligible and the safety loss is real.@types packages unless they are clearly irrelevant to the project.exclude patterns that might break type resolution.Present the tiered recommendations to the user. For Tier 1, suggest applying immediately. For Tier 2-3, explain the tradeoff and ask for confirmation.
When applying changes:
tsc --noEmit to verify the project still compiles cleanlytsc --watch to pick up the new watchOptionsRe-run tsc --extendedDiagnostics and compare against the Step 2 baseline. Report the before/after metrics.
If watch mode was the concern and the user can measure watcher counts, compare those as well.
references/tsconfig-performance.md — Complete catalog of performance-related tsconfig settings with explanations, tradeoffs, impact rankings, diagnostic commands, and code patterns that affect compiler performancetools
Use when picking or vetting a keyboard shortcut on macOS. Triggers include "what hotkey should I use for X", "is `<combo>` available", "does this shortcut conflict", "recommend a keybinding for…", "check `<combo>` against my setup", "pick a hotkey for…", or any mention of choosing/binding/changing a shortcut in WezTerm, tmux, Zed, Chrome, Claude Code, or macOS. Determines whether a proposed combo collides with OS-reserved bindings, app defaults, or the user's customizations, and recommends ergonomic alternatives when needed.
development
Detect and remove dead code with knip. Use when the user asks to "run knip", "find unused files", "find unused exports", "find unused dependencies", "clean up dead code", "remove dead code", "set up knip", "configure knip", "knip.json", "knip false positive", "knip CI", or mentions a `knip` config, dependency bloat, bundle bloat from unused imports, or tree-shaking unused exports. Covers the configuration-first workflow, confidence-gated deletion, framework-specific gotchas (Next.js 15+, Tailwind, Storybook, Jest, Bun's test runner and `bun build --compile`), monorepos, CI integration, and performance tuning.
tools
This skill should be used when the user asks to "set up react-scan", "install react-scan", "diagnose React re-renders", "find unnecessary renders", "find unstable props", "automate React render checks with Playwright", "react-scan + playwright", "measure component renders programmatically", "check why a React component is slow", or mentions React rendering issues, slow React interactions, render counts, or component-level perf attribution. Covers install across Next.js/Vite/Remix/script-tag/browser-extension, the lite headless API for CI, and the canonical render-attribution → fix → validate loop driven through Playwright.
documentation
This skill should be used when integrating source material into a knowledge base, including when the user asks to "integrate this document into the knowledge base", "add this transcript to the memory bank", "ingest this document", "update the knowledge base", "analyze a new source document", or "sync current-state docs with this source".