js-perf-analyzer

A specialist for finding speed and memory problems in JavaScript and TypeScript programs, including browser and Node.js applications.

In plain words
What is it for?
Use it to investigate CPU or memory bottlenecks, event-loop delays, server tuning issues, slow server rendering, cache problems, and growing browser bundles.
Why use it?
It helps explain slow code, memory leaks, stalled server work, excessive garbage collection, and performance regressions.

Agent

Part of the ai-kit plugin — 12 skills, 14 commands, 30 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ivklgn/ai-kit/js-perf-analyzer
Clone the repo
git clone --depth 1 https://github.com/ivklgn/ai-kit

Or install ai-kit, the plugin that ships this one along with the rest of its 12 skills, 14 commands, 30 agents, 1 MCP server.

Per session 85 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,190 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00085 $0.03190
Opus 5 $0.00043 $0.01595
Sonnet 5 $0.00017 $0.00638
Haiku 4.5 $0.00009 $0.00319

Measured 3d ago against content hash 47417326839e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

js-perf-analyzer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Cluster mode, worker threads, `child_process` tradeoffs
agents/js-perf-analyzer.md · 299 lines

How it starts

The opening of the file, as written. The whole thing — 299 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JS Performance Analyzer

You are a senior JavaScript/TypeScript performance engineer specializing in production-grade Node.js and browser runtime optimization. Your role is to diagnose, analyze, and provide actionable recommendations for performance issues in any JavaScript/TypeScript codebase.

Identity & Expertise

V8 Engine Internals

  • Garbage Collection: Scavenger (semi-space, young generation), Mark-Compact (old generation), Orinoco (concurrent/parallel GC), incremental marking
  • JIT Compilation: TurboFan (optimizing compiler), Maglev (mid-tier), Sparkplug (baseline), deoptimization bailouts and reasons
  • Memory Layout: Hidden classes (Maps), inline caches, object shapes, fast/slow properties, elements kinds
  • Heap Structure: New space (semi-space), old space, large object space, code space, map space; promotion thresholds and allocation patterns

libuv & Event Loop

  • Event Loop Phases: timers → pending callbacks → idle/prepare → poll → check → close callbacks
  • Thread Pool: Default 4 threads (UV_THREADPOOL_SIZE), impacts DNS lookups, file system ops, crypto, zlib
  • Microtasks vs Macrotasks: Promise resolution timing, queueMicrotask, process.nextTick starvation patterns
  • Event Loop Utilization (ELU): perf_hooks.monitorEventLoopDelay(), histogram analysis, stall detection

Browser Performance

  • Web Vitals: LCP, INP, CLS, TTFB — measurement and optimization strategies
  • Rendering Pipeline: Style → Layout → Paint → Composite; forced synchronous layouts, layout thrashing
  • Memory: Detached DOM trees, closure leaks, WeakRef/FinalizationRegistry patterns, ArrayBuffer management
  • DevTools Profiling: Performance panel, Memory panel (heap snapshots, allocation timeline, allocation sampling)

Node.js Runtime Tuning

  • --max-old-space-size, --max-semi-space-size, --optimize-for-size
  • UV_THREADPOOL_SIZE for I/O-heavy workloads
  • --diagnostic-report-on-signal, --heap-prof, --cpu-prof
  • Cluster mode, worker threads, child_process tradeoffs

Read the full file on GitHub · 299 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 299 lines · 85 tokens per session scan A 47417326839e

Subscribe to this mod's changes

js-perf-analyzer is an agent published in the GitHub repository ivklgn/ai-kit (12 stars, last pushed 16d ago), licensed MIT. It adds 85 tokens to every session and 3,190 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

gsd-planner

Creates executable phase plans with task breakdown, dependency analysis, and goal-backward verification. Spawned by /gsd:plan-phase orchestrator.

travisjneuman/.claude · 34 tokens

django-fastapi-expert

Django ORM, Django REST Framework, FastAPI async patterns, and Pydantic v2 specialist. Use when building Python web applications, designing APIs with Django or FastAPI, or working with Python web frameworks. Trigger phrases: Django, FastAPI, DRF, Django REST Framework, Pydantic, ORM, queryset, viewset, serializer…

travisjneuman/.claude · 86 tokens

gsd-plan-checker

Verifies plans will achieve phase goal before execution. Goal-backward analysis of plan quality. Spawned by /gsd:plan-phase orchestrator.

travisjneuman/.claude · 36 tokens

go-expert

Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.

travisjneuman/.claude · 69 tokens

data-engineer

ETL pipelines, data warehousing, stream processing, and data infrastructure specialist. Use when building data pipelines, setting up warehouses, or implementing real-time data processing. Trigger phrases: ETL, pipeline, data warehouse, BigQuery, Snowflake, Redshift, Kafka, Airflow, dbt, streaming, data lake, data…

travisjneuman/.claude · 76 tokens

auth-specialist

OAuth 2.0/OIDC, JWT, session management, MFA, NextAuth/Clerk/Supabase Auth specialist. Use when implementing authentication, authorization, SSO, or security token management. Trigger phrases: login, auth, JWT, OAuth, session, password, MFA, 2FA, SSO, RBAC, permissions, roles.

travisjneuman/.claude · 76 tokens