# JS/TS Performance Audit

> Audit JavaScript and TypeScript codebases to eliminate runtime bottlenecks, memory leaks, and O(n^2) algorithmic waste.

JS/TS Performance Audit is a paid AI agent skill on Agensi by Tiago Bértolo, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Tiago Bértolo](https://www.agensi.io/creators/tiago-bertolo)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-17
- Security: scan passed (2026-11-17); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/js-ts-performance-audit
- Tags: llm-ops, typescript, nodejs, performance-optimization, v8

## About this skill

High-level performance audits for JavaScript and TypeScript projects often get bogged down in subjective style debates or micro-benchmarks that don't matter. This skill delivers a cold-blooded technical review focused exclusively on runtime speed and infrastructure cost. It identifies the O(n^2) bottlenecks, memory leaks, and unnecessary allocations that actually impact your production metrics.

### What it does
- **Runtime Profiling** identifies algorithmic inefficiencies like linear scans in loops that should be using `Map` or `Set` lookups.
- **Memory Optimization** flags unnecessary object spreads, deep copies, and chained array transformations that spike GC pressure.
- **Concurrency Audits** finds sequential `await` calls that can be parallelized or bounded to prevent resource exhaustion.
- **Dead Code Detection** locates unreferenced files and unused dependencies that bloat bundles and slow down cold starts.
- **Memoization Strategy** suggests specific caching patterns using `lru-cache` for frequent, expensive data fetches.

### How it works
1. **Define the Goal** by selecting either `speed` (latency-focused for frontend) or `cost` (compute-focused for backend/serverless).
2. **Scan Hot Paths** to prioritize code executed per request, per frame, or over large data collections.
3. **Analyze & Audit** for specific anti-patterns like `delete` on hot objects or unbounded `Promise.all` calls.
4. **Generate Report** with findings ranked by impact (High/Medium/Low) and risk of regression.
5. **Apply Edits** one by one upon request, verifying that behavior remains identical to the original implementation.

### Frameworks & tools
Works across the JS/TS ecosystem including Node.js, browser environments, and serverless handlers. Integrates with `Knip` for dead code analysis and `lru-cache` for memoization.

### Why this beats prompting it yourself
Generic prompts often suggest "cleaner" code that is actually slower or triggers V8 dictionary mode. This skill uses specific heuristics measured on modern runtimes to ensure every suggestion removes actual work without changing the public API.

### Use cases
- Auditing a Node.js API to reduce p99 latency and CPU usage.
- Reviewing a React/frontend codebase to trim bundle size and reduce main-thread blocking.
- Fixing memory leaks in long-running worker processes or CLI tools.
- Optimizing data transformation pipelines that handle large JSON datasets.

### Known limitations
Does not perform live benchmarking unless explicitly requested with specific environment setup. Optimization rules are tuned for V8 runtimes.

## Requires

- Node.js
- knip

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the JS/TS Performance Audit skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Which environments and frameworks are supported by the JS/TS Performance Audit?

This skill is optimized for all JavaScript and TypeScript environments, including Node.js backends, React/Vue frontends, and serverless runtimes like AWS Lambda or Vercel, with specific heuristics tuned for the V8 engine.

### How does this performance audit differ from a standard AI code review?

Unlike general-purpose coding assistants, this skill focuses strictly on runtime efficiency and infrastructure costs, avoiding subjective style changes to target O(n^2) bottlenecks and V8-specific optimizations like avoiding dictionary mode.

### What specific deliverables are included in a performance audit?

You will receive a categorized report ranking findings by performance impact and regression risk, along with the ability to request one-by-one automated refactors for identified hot paths.

### Can the skill perform live benchmarking on my production server?

While it identifies algorithmic waste and memory leaks in the code, it does not perform live production benchmarking unless you provide a specific environment and test suite for it to analyze.

### Do I need to install specific tools for the audit to work?

The skill includes native integrations for Knip to detect dead code and lru-cache for implementing efficient memoization strategies, ensuring all recommendations use industry-standard libraries.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
