performance-optimizer

Performance analysis and optimization guidance for finding and fixing the part of an application that is actually slow or using too many resources. It covers websites, APIs, databases, memory, and CPU usage.

In plain words
What is it for?
Use it to investigate slow pages or API requests, reduce database or network delays, find memory leaks, lower CPU use, and profile an application before and after changes.
Why use it?
It replaces guesswork with measurements, so engineers can identify the real bottleneck and confirm that a change improved performance without causing another problem.

Skill for Claude CodeCodex

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 skills/code-saurabh/openskills/performance-optimizer
Any agent
npx skills add CODE-SAURABH/OpenSkills --skill performance-optimizer
Clone the repo
git clone --depth 1 https://github.com/CODE-SAURABH/OpenSkills

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,356 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00037 $0.02356
Opus 5 $0.00018 $0.01178
Sonnet 5 $0.00007 $0.00471
Haiku 4.5 $0.00004 $0.00236

Measured yesterday against content hash 886bb07674cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

performance-optimizer scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

performance-optimizer/SKILL.md · 208 lines

How it starts

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

Performance Optimization

Approach every performance task as an engineer who measures before cutting. Premature optimization is the source of more production incidents than slow code. The process is always: measure → identify the actual bottleneck → fix the bottleneck → measure again. Intuition about where the slowness is has a poor track record. Data does not.


Step 0: Measure First, Optimize Second

Before touching any code:

  1. Reproduce the problem with numbers — "it feels slow" is not a problem statement; "p99 latency is 4.2s under 100 concurrent users" is
  2. Identify the bottleneck — use profiling tools to find where time is actually spent; it is almost never where you expect
  3. Establish a baseline — measure before making any change; you cannot prove improvement without a before number
  4. Change one thing at a time — multiple simultaneous optimizations make it impossible to know what helped
  5. Measure the result — verify the optimization worked and did not regress something else

Optimization priority order:

  1. Algorithmic complexity — O(n²) becoming O(n log n) beats any micro-optimization
  2. I/O reduction — fewer DB queries, fewer HTTP calls, smaller payloads
  3. Caching — avoid recomputing or re-fetching what has not changed
  4. Parallelism — do independent work concurrently instead of sequentially
  5. Micro-optimization — only after the above have been exhausted

Frontend Performance

Measure with real tools:

  • Lighthouse CI in the CI pipeline — fail builds that regress Core Web Vitals
  • Chrome DevTools Performance panel — flame charts for CPU, network waterfall for load
  • WebPageTest — real device testing, multiple geographic locations
  • web-vitals library — measure LCP, FID/INP, CLS in production with real user data

Core Web Vitals targets:

  • LCP (Largest Contentful Paint) < 2.5s
  • INP (Interaction to Next Paint) < 200ms
  • CLS (Cumulative Layout Shift) < 0.1

Bundle size:

  • Analyze with webpack-bundle-analyzer or vite-bundle-visualizer — know what is in the bundle
  • Code split at route boundaries — never ship one monolithic bundle
  • Tree-shake unused exports — ensure bundler tree-shaking is working
  • Lazy-load heavy components and libraries: charting, rich text editors, PDF renderers
  • Audit and remove unused dependencies — they ship to the client even if unused
  • Target: initial JS bundle < 200KB gzipped for most applications

Read the full file on GitHub · 208 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 208 lines · 37 tokens per session scan A 886bb07674cb

Subscribe to this mod's changes

performance-optimizer is a skill published in the GitHub repository CODE-SAURABH/OpenSkills (2 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 2,356 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.