performance-profiling

A measurement-first method for finding and fixing slow web pages and interactions. It covers browser performance measures such as Core Web Vitals, which describe loading speed, responsiveness, and visual stability.

In plain words
What is it for?
Use it to run Lighthouse audits, inspect page loading, browser interactions, JavaScript bundles, runtime behavior, and memory, then verify whether a performance fix worked.
Why use it?
It replaces guesswork with a cycle of measuring the current state, isolating a bottleneck, making one change, and checking the result.

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/phuonghx/aim-cli/performance-profiling
Any agent
npx skills add phuonghx/aim-cli --skill performance-profiling
Clone the repo
git clone --depth 1 https://github.com/phuonghx/aim-cli

Made for: Claude Code, Codex.

Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 875 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.00076 $0.00875
Opus 5 $0.00038 $0.00438
Sonnet 5 $0.00015 $0.00175
Haiku 4.5 $0.00008 $0.00088

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

Security

Grade A, and why

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

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/lighthouse_audit.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.

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.

aim/templates/aim-agents/skills/performance-profiling/SKILL.md · 113 lines

How it starts

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

Performance Profiling

Measure, then analyze, then change -- in that order. Optimizing on a hunch wastes effort.

Automation

Script What it does How to run
scripts/lighthouse_audit.py Runs a Lighthouse audit and extracts scores python scripts/lighthouse_audit.py https://example.com

Core Web Vitals

What "good" looks like

Metric Good Poor What it captures
LCP under 2.5s over 4.0s How fast the main content paints
INP under 200ms over 500ms How responsive interactions feel
CLS under 0.1 over 0.25 How much the layout jumps around

Where to measure each stage

  • While developing -- local Lighthouse runs.
  • In CI -- Lighthouse CI to catch regressions before merge.
  • In production -- real-user monitoring (RUM), because lab numbers miss field reality.

The profiling loop

  1. Baseline -- record where things stand today.
  2. Isolate -- find the single biggest bottleneck.
  3. Fix -- make one focused change aimed at it.
  4. Verify -- re-measure and confirm the change actually helped.

Matching the tool to the problem

  • Whole-page load -> Lighthouse
  • Shipping too much JavaScript -> a bundle analyzer
  • Sluggish runtime behavior -> the Performance panel in DevTools
  • Climbing memory -> the Memory panel
  • Slow requests -> the Network panel

Reading the bundle

Red flags

  • A heavy dependency sitting near the top of the bundle.
  • The same code duplicated across multiple chunks.
  • Large stretches of code the page never executes (low coverage).
  • One giant chunk with no splitting.

Corresponding moves

  • Heavy library -> import only the pieces you use.
  • Duplicate dependency -> dedupe and align versions.
  • Route bundled into the entry point -> split it out.
  • Dead exports -> rely on tree-shaking, or delete them.

Runtime and memory

Performance panel cues

  • Long tasks over ~50ms block the main thread and hurt responsiveness.
  • A flood of tiny tasks often means work that could be batched.
  • Heavy layout/paint activity points at a rendering bottleneck.
  • Big script blocks point at expensive JavaScript.

Read the full file on GitHub · 113 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 · 113 lines · 76 tokens per session scan A b7cf9b8deb23

Subscribe to this mod's changes

performance-profiling is a skill published in the GitHub repository phuonghx/aim-cli (1 stars, last pushed 2mo ago), licensed MIT. It adds 76 tokens to every session and 875 once invoked, about $0.0004 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.