performance-optimization

A measure-first guide for finding and fixing slow parts of software. It covers profiling and performance work in application backends, frontends, networks, and memory use.

In plain words
What is it for?
Use it to investigate slow endpoints, high latency, low throughput, memory leaks, large frontend bundles, or slow page loads. It helps set a target, profile the bottleneck, make a focused change, and measure the result.
Why use it?
Performance problems are often fixed by guesswork, which can change code without improving speed. Measuring a repeatable case before and after a change shows where time or resources are actually being lost.

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/svngoku/coding-agents-skills/performance-optimization
Any agent
npx skills add svngoku/coding-agents-skills --skill performance-optimization
Clone the repo
git clone --depth 1 https://github.com/svngoku/coding-agents-skills

Made for: Claude Code, Codex.

Per session 175 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,490 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.00175 $0.03490
Opus 5 $0.00088 $0.01745
Sonnet 5 $0.00035 $0.00698
Haiku 4.5 $0.00017 $0.00349

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

Security

Grade A, and why

performance-optimization 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.

The scan reads SKILL.md. This mod also ships 2 executable files (fixtures/slow.py, graders/check.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| High TTFB | Slow backend or no CDN | `curl -w` timing breakdown |
skills/performance-optimization/SKILL.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.

Performance Optimization

Most "slow" problems are diagnosed by guesswork. This skill replaces guessing with a measure-first workflow: profile, fix minimally, re-measure against a budget. Covers backend (database, caching, concurrency), frontend (bundles, images, rendering), network (CDN, compression, HTTP), and memory, with concrete tools and before/after examples.

Quick Reference

Topic Reference
Profiling tools per runtime and reading flame graphs profiling-tools.md
EXPLAIN, index design, N+1 fixes, caching, pooling backend-optimization.md
Bundles, images, React rendering, Core Web Vitals frontend-performance.md

Core Workflow

1. Measure First

Never optimize before you can answer: "how do I know it got faster?"

  1. Reproduce — get a repeatable trigger (endpoint, page, script, load profile).
  2. Baseline — record current latency distribution, throughput, and resource usage.
  3. Budget — set an explicit target (e.g., p95 < 200 ms, initial JS < 170 KB gzipped).
  4. Profile — find where time actually goes (CPU, I/O wait, dependency latency, GC).
  5. Hypothesize — one bottleneck, one predicted fix, one measurable effect.
  6. Fix minimally — the smallest change that tests the hypothesis.
  7. Re-measure — same tool, load, and environment; keep the fix only if it moves the metric.

2. The Triage Loop (symptom → cause)

Symptom Likely cause Quick check
High p95 but healthy p50 Queueing, GC pauses, one slow dependency Percentile breakdown; GC logs; sample slow requests
Slow only under load Contention, pool exhaustion, saturation Load test at increasing concurrency; watch pool waits
Slow in prod, fast locally Cold cache, missing index on prod-size data EXPLAIN on prod data; cache hit ratio
ORM makes dozens of queries N+1 lazy loading Log query counts; enable ORM query logging
High CPU CPU-bound loop, regex, serialization cProfile / py-spy dump
Memory grows monotonically Leak or unbounded cache Heap snapshots; cache size/capacity audit
Slow page load, fast API Render-blocking JS/CSS, oversized images Lighthouse waterfall; DevTools Network
High TTFB Slow backend or no CDN curl -w timing breakdown

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 · 175 tokens per session scan A 0ccc15dd66e9

Subscribe to this mod's changes

performance-optimization is a skill published in the GitHub repository svngoku/coding-agents-skills (9 stars, last pushed 20d ago), licensed MIT. It adds 175 tokens to every session and 3,490 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

skill-authoring

Author SKILL.md skills: frontmatter, validator limits, structure.

mateaix/mateclaw · 18 tokens

iflytek-hyper-tts

Use when user asks to synthesize speech, convert text to audio, or read text aloud. 讯飞超拟人语音合成 - 支持文本转语音、语音合成(发音人/语速/语调/音量/输出格式)。大模型语音合成技能。语音合成, 文字转语音, 超拟人, TTS.

iflytek/iFly-Skills · 92 tokens

iflytek-voiceclone-tts

Use when user asks to clone a voice, train a custom voice model, or synthesize speech with a cloned voice. iFlytek Voice Clone tts(声音复刻) — train a custom voice model from audio samples and synthesize speech with the cloned voice. Supports the full workflow: get training text → create task → upload audio → submit…

iflytek/iFly-Skills · 99 tokens

iflytek-pdf-image-ocr

AI-powered OCR service for images and PDF documents using iFlytek's advanced recognition APIs.

iflytek/iFly-Skills · 81 tokens

iflytek-translate

Translate text using iFlytek's Machine Translation API (机器翻译). Supports 70+ language pairs.

iflytek/iFly-Skills · 65 tokens

iflytek-contract-intelligence-review

Use when user asks to review contracts, detect contract risks, or perform compliance checks. 合同智能审核 - 对合同扫描件、图片合同、双语合同进行完整审核。 覆盖 OCR 识别、条款分析、风险检测、合规校对、翻译摘要全流程。 适用于法务审核、采购合同审查、供应链合规检查等场景。 关键词:合同审核、风险检测、条款分析、合规校对、contract review、risk detection。.

iflytek/iFly-Skills · 116 tokens