# Typescript Performance

> TypeScript performance skill for profiling, bundle size optimization, type-checking overhead, and runtime efficiency. Trigger phrases: TypeScript performance, bundle size, sourcemap impact, type checking speed, memory leak, CPU profile.

- **Type:** Skill
- **Install:** `agentstack add skill-caraya-agent-skills-typescript-performance`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [caraya](https://agentstack.voostack.com/s/caraya)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [caraya](https://github.com/caraya)
- **Source:** https://github.com/caraya/agent-skills/tree/main/skills/typescript-performance

## Install

```sh
agentstack add skill-caraya-agent-skills-typescript-performance
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# TypeScript Performance

## Use When

- Profiling TypeScript applications for CPU, memory, or bundle size issues.
- Analyzing type-checking and build time performance.
- Optimizing bundle size and startup time.

## Profiling Tools

1. **Node.js profiling**
- CPU: `node --prof app.js` then `node --prof-process` to analyze.
- Memory: Use Chrome DevTools heap snapshots or `--inspect`.
- Flame graphs: Use `0x` package or native `--prof` + tools.

2. **Build and bundle analysis**
- Type-checking: `tsc --diagnostics` or `tsc --listFiles` to trace performance.
- Bundle: Use `webpack-bundle-analyzer`, `rollup-plugin-visualizer`, or `esbuild --metafile`.
- Sourcemap impact: Check `.map` file sizes; consider source-map-loader overhead.

3. **Type-checking overhead**
- Profile `tsc` compilation: `time tsc --noEmit`.
- Check for expensive patterns: deeply nested generics, complex type unions, circular type references.

## Checklist

1. Type-checking and build performance
- Are expensive type operations (deep generics, complex unions) unavoidable, or can they be simplified?
- Is type-checking parallelizable? Use `project references` for large monorepos.
- Are sourcemaps necessary for production? Remove them for speed/size.

2. Runtime performance
- Identify hot paths with CPU profiling; focus optimization there.
- Check for unnecessary object allocations in loops.
- Verify async operations are not blocking the event loop.

3. Bundle and startup
- Analyze bundle composition: what is the largest and most-imported module?
- Check for dead code; use tree-shaking rules in tsconfig and bundler.
- Consider code splitting and lazy loading for large features.

4. Memory efficiency
- Look for large object retention or circular references in heap dumps.
- Check for memory leaks from event listeners or timers not cleaned up.

## Output Requirements

For each finding provide:
- Measurement (current baseline, profiling evidence).
- Root cause and impact.
- Optimization strategy with expected improvement.
- Effort and risk assessment.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [caraya](https://github.com/caraya)
- **Source:** [caraya/agent-skills](https://github.com/caraya/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-caraya-agent-skills-typescript-performance
- Seller: https://agentstack.voostack.com/s/caraya
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
