Performance Optimization

Performance Optimization is a skill for Claude Code, Codex from ArieGoldkin/ai-agent-hub. It costs 14 tokens per session (1,251 once invoked), scanned A, original, MIT.

A guide to finding and improving slow parts of an application across the frontend, backend, database, network, and server resources. It also covers monitoring measures such as Core Web Vitals, which describe how quickly and steadily web pages respond.

In plain words
What is it for?
Use it to investigate unresponsive applications, slow queries, large frontend bundles, high API response times, poor web performance scores, or systems preparing for heavier traffic.
Why use it?
It helps identify whether slowness comes from page loading, API responses, database queries, CPU work, or other bottlenecks.

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

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Performance Optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/ariegoldkin/ai-agent-hub/performance-optimization.svg)](https://agentmods.dev/skills/ariegoldkin/ai-agent-hub/performance-optimization)
Your own site
<a href="https://agentmods.dev/skills/ariegoldkin/ai-agent-hub/performance-optimization"><img src="https://agentmods.dev/badge/skills/ariegoldkin/ai-agent-hub/performance-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,251 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.00014 $0.01251
Opus 5 $0.00007 $0.00626
Sonnet 5 $0.00003 $0.00250
Haiku 4.5 $0.00001 $0.00125

Measured 4d ago against content hash 2edaad1efc50, 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 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 4d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (templates/api-optimization.ts, templates/caching-patterns.ts, templates/database-optimization.ts, …), 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.

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.

skills/performance-optimization/SKILL.md · 174 lines

How it starts

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

Performance Optimization Skill

Comprehensive frameworks for analyzing and optimizing application performance across the entire stack.

When to Use

  • Application feels slow or unresponsive
  • Database queries taking too long
  • Frontend bundle size too large
  • API response times exceed targets
  • Core Web Vitals need improvement
  • Preparing for scale or high traffic

Performance Targets

Core Web Vitals (Frontend)

Metric Good Needs Work
LCP (Largest Contentful Paint) < 2.5s < 4s
INP (Interaction to Next Paint) < 200ms < 500ms
CLS (Cumulative Layout Shift) < 0.1 < 0.25
TTFB (Time to First Byte) < 200ms < 600ms

Backend Targets

Operation Target
Simple reads < 100ms
Complex queries < 500ms
Write operations < 200ms
Index lookups < 10ms

Bottleneck Categories

Category Symptoms Tools
Network High TTFB, slow loading Network tab, WebPageTest
Database Slow queries, pool exhaustion EXPLAIN ANALYZE, pg_stat_statements
CPU High usage, slow compute Profiler, flame graphs
Memory Leaks, GC pauses Heap snapshots
Rendering Layout thrashing React DevTools, Performance tab

Database Optimization

Key Patterns

  1. Add Missing Indexes - Turn Seq Scan into Index Scan
  2. Fix N+1 Queries - Use JOINs or include instead of loops
  3. Cursor Pagination - Never load all records
  4. Connection Pooling - Manage connection lifecycle

Quick Diagnostics

-- Find slow queries (PostgreSQL)
SELECT query, calls, mean_time / 1000 as mean_seconds
FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;

-- Verify index usage
EXPLAIN ANALYZE SELECT * FROM orders WHERE user_id = 123;

See templates/database-optimization.ts for N+1 fixes and pagination patterns

Caching Strategy

Cache Hierarchy

L1: In-Memory (LRU, memoization) - fastest
L2: Distributed (Redis/Memcached) - shared
L3: CDN (edge, static assets) - global
L4: Database (materialized views) - fallback

Read the full file on GitHub · 174 lines

Files

What ships with it

5 files 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. 4d ago First seen · 174 lines · 14 tokens per session scan A 2edaad1efc50

Subscribe to this mod's changes

Performance Optimization is a skill published in the GitHub repository ArieGoldkin/ai-agent-hub (11 stars, last pushed 9mo ago), licensed MIT. It adds 14 tokens to every session and 1,251 once invoked, about $0.0001 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-30.