performance-optimization

performance-optimization is a skill for Claude Code, Codex from vanja-emichi/a0_agent_skills. It costs 45 tokens per session (2,477 once invoked), scanned A, original, MIT.

Instructions for improving an application’s speed by measuring its real bottlenecks first and then checking the result after changes. Core Web Vitals are browser-based measures of loading, responsiveness, and visual stability.

In plain words
What is it for?
Investigating slow pages or features, profiling bottlenecks, improving load or interaction performance, and checking for regressions.
Why use it?
They reduce the risk of making speculative changes that add complexity without fixing the actual performance 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/vanja-emichi/a0_agent_skills/performance-optimization
Any agent
npx skills add vanja-emichi/a0_agent_skills --skill performance-optimization
Clone the repo
git clone --depth 1 https://github.com/vanja-emichi/a0_agent_skills

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/vanja-emichi/a0_agent_skills/performance-optimization.svg)](https://agentmods.dev/skills/vanja-emichi/a0_agent_skills/performance-optimization)
Your own site
<a href="https://agentmods.dev/skills/vanja-emichi/a0_agent_skills/performance-optimization"><img src="https://agentmods.dev/badge/skills/vanja-emichi/a0_agent_skills/performance-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,477 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.00045 $0.02477
Opus 5 $0.00023 $0.01239
Sonnet 5 $0.00009 $0.00495
Haiku 4.5 $0.00005 $0.00248

Measured 5d ago against content hash 630c3261540a, 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 5d 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.

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 · 333 lines

How it starts

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

Performance Optimization

Supporting files: This skill has a companion performance checklist. Use text_editor:read with the full path shown in the file tree when this skill is loaded to open performance-checklist.md (sibling to this SKILL.md).

Overview

Measure before optimizing. Performance work without measurement is guessing — and guessing leads to premature optimization that adds complexity without improving what matters. Profile first, identify the actual bottleneck, fix it, measure again. Optimize only what measurements prove matters.

When to Use

  • Performance requirements exist in the spec (load time budgets, response time SLAs)
  • Users or monitoring report slow behavior
  • Core Web Vitals scores are below thresholds
  • You suspect a change introduced a regression
  • Building features that handle large datasets or high traffic

When NOT to use: Don't optimize before you have evidence of a problem. Premature optimization adds complexity that costs more than the performance it gains.

Core Web Vitals Targets

Metric Good Needs Improvement Poor
LCP (Largest Contentful Paint) ≤ 2.5s ≤ 4.0s > 4.0s
INP (Interaction to Next Paint) ≤ 200ms ≤ 500ms > 500ms
CLS (Cumulative Layout Shift) ≤ 0.1 ≤ 0.25 > 0.25

The Optimization Workflow

1. MEASURE  → Establish baseline with real data
2. IDENTIFY → Find the actual bottleneck (not assumed)
3. FIX      → Address the specific bottleneck
4. VERIFY   → Measure again, confirm improvement
5. GUARD    → Add monitoring or tests to prevent regression

Step 1: Measure

Frontend — using Agent Zero's browser tool:

1. browser: open → navigate to the page
2. browser: evaluate → inject web-vitals library or read performance entries
3. browser: screenshot → capture visual state
4. Use browser: action=content to read console output for perf logs

For synthetic Lighthouse-style profiling:

# Run via code_execution_tool
npx lighthouse https://localhost:3000 --output=json --quiet

Read the full file on GitHub · 333 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. 5d ago First seen · 333 lines · 45 tokens per session scan A 630c3261540a

Subscribe to this mod's changes

performance-optimization is a skill published in the GitHub repository vanja-emichi/a0_agent_skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 2,477 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.