Agent skill

Web Performance Optimization

by secondsky in secondsky/claude-skills

Optimizes web application performance through code splitting, lazy loading, caching strategies, and Core Web Vitals monitoring.

MITAuto-check passedFrontend & Design

Install Web Performance Optimization

skills CLI
$ npx skills add secondsky/claude-skills --skill web-performance-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills web-performance-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/web-performance-optimization/skills/web-performance-optimization .claude/skills/web-performance-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
web-performance-optimization
GitHub stars
227
Token cost
~1.6k tokens
SKILL.md length
259 words
Files
3 (incl. references)
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Optimizes web application performance through code splitting, lazy loading, caching strategies, and Core Web Vitals monitoring.

  • Improving page load times
  • SKILL.md covers Overview, When to Use, Code Splitting (React) and Webpack Bundle Optimization, plus 10 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Implementing service workers

What it does

Web Performance Optimization is an agent skill from secondsky/claude-skills. Optimizes web application performance through code splitting, lazy loading, caching strategies, and Core Web Vitals monitoring. Use when improving page load times, implementing service workers, or reducing bundle sizes.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/compression-monitoring.md` and `references/typescript-advanced.md`).

It sits in Frontend & Design, covering Web performance. It works with TypeScript. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Improving page load times
  • Implementing service workers
  • Reducing bundle sizes

Example prompts

  • “Use the web-performance-optimization skill to optimiz web application performance through code splitting, lazy loading, caching strategies, and Core…”
  • “/web-performance-optimization”

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript, html and nginx).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • web.dev
    • pagespeed.web.dev
    • developers.google.com
    • webpagetest.org
    • developer.mozilla.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Web Performance Optimization loads about 1.6k tokens when it runs, and up to ~5.4k if it reads all its reference files. Until then it costs about 62 tokens; SKILL.md has 259 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 259 words, ~1,609 tokens.

Download SKILL.mdSave it as .claude/skills/web-performance-optimization/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
web-performance-optimization
description
Optimizes web application performance through code splitting, lazy loading, caching strategies, and Core Web Vitals monitoring. Use when improving page load times, implementing service workers, or reducing bundle sizes.
license
MIT

Web Performance Optimization

Overview

Implement performance optimization strategies including lazy loading, code splitting, caching, compression, and monitoring to improve Core Web Vitals and user experience.

When to Use

  • Slow page load times
  • High Largest Contentful Paint (LCP)
  • Large bundle sizes
  • Frequent Cumulative Layout Shift (CLS)
  • Mobile performance issues

Code Splitting (React)

javascript
import { lazy, Suspense } from 'react';
import { Routes, Route } from 'react-router-dom';

const Home = lazy(() => import('./pages/Home'));
const Dashboard = lazy(() => import('./pages/Dashboard'));
const Settings = lazy(() => import('./pages/Settings'));

function App() {
  return (
    <Suspense fallback={<Loading />}>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/dashboard" element={<Dashboard />} />
        <Route path="/settings" element={<Settings />} />
      </Routes>
    </Suspense>
  );
}

Webpack Bundle Optimization

javascript
// webpack.config.js
module.exports = {
  optimization: {
    splitChunks: {
      chunks: 'all',
      cacheGroups: {
        vendor: {
          test: /[\\/]node_modules[\\/]/,
          name: 'vendors',
          chunks: 'all'
        }
      }
    }
  }
};

Image Optimization

html
<picture>
  <source srcset="image.webp" type="image/webp">
  <source srcset="image.jpg" type="image/jpeg">
  <img
    src="image.jpg"
    srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
    sizes="(max-width: 600px) 100vw, 50vw"
    loading="lazy"
    decoding="async"
    alt="Description"
  >
</picture>

Service Worker Caching

javascript
// sw.js
const CACHE_NAME = 'app-v1';
const ASSETS = ['/', '/index.html', '/main.js', '/styles.css'];

self.addEventListener('install', (event) => {
  event.waitUntil(
    caches.open(CACHE_NAME).then(cache => cache.addAll(ASSETS))
  );
});

self.addEventListener('fetch', (event) => {
  event.respondWith(
    caches.match(event.request).then(cached => {
      return cached || fetch(event.request).then(response => {
        return caches.open(CACHE_NAME).then(cache => {
          cache.put(event.request, response.clone());
          return response;
        });
      });
    })
  );
});

Core Web Vitals Monitoring

javascript
// Track LCP, CLS, INP (Note: INP replaced FID as of March 2024)
// sendToAnalytics is a placeholder function that sends metrics to your analytics endpoint
// Expected signature: sendToAnalytics({ metric: string, value: number }) => void
// Example implementation:
function sendToAnalytics({ metric, value }) {
  // Replace with your analytics implementation (e.g., Google Analytics, Segment)
  fetch('/api/analytics', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ metric, value, timestamp: Date.now() })
  });
}

// Largest Contentful Paint (LCP)
new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    console.log(`LCP: ${entry.startTime}ms`);
    sendToAnalytics({ metric: 'LCP', value: entry.startTime });
  }
}).observe({ type: 'largest-contentful-paint', buffered: true });

// Cumulative Layout Shift (CLS)
new PerformanceObserver((list) => {
  let cls = 0;
  for (const entry of list.getEntries()) {
    if (!entry.hadRecentInput) cls += entry.value;
  }
  sendToAnalytics({ metric: 'CLS', value: cls });
}).observe({ type: 'layout-shift', buffered: true });

// Interaction to Next Paint (INP) - replaces FID
new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    // INP measures responsiveness - duration of slowest interaction
    const inp = entry.processingEnd - entry.processingStart;
    console.log(`INP: ${inp}ms`);
    sendToAnalytics({ metric: 'INP', value: inp });
  }
}).observe({ type: 'event', buffered: true }); // 'event' captures interaction events

Performance Targets

MetricGoodNeeds Improvement
LCP<2.5s2.5-4s
INP<200ms200-500ms
CLS<0.10.1-0.25
TTI<3.8s3.8-7.3s

Note: INP (Interaction to Next Paint) replaced FID (First Input Delay) as a Core Web Vital in March 2024. INP provides a more comprehensive measure of page responsiveness by capturing the full duration of interactions, not just the input delay.

Compression (Nginx)

nginx
gzip on;
gzip_types text/plain text/css application/json application/javascript;
gzip_min_length 1000;
gzip_comp_level 6;

Best Practices

  • Minimize bundle size with code splitting
  • Optimize images with appropriate formats
  • Implement lazy loading strategically
  • Use HTTP caching headers
  • Enable gzip/brotli compression
  • Monitor Core Web Vitals continuously
  • Implement service workers
  • Defer non-critical JavaScript
  • Optimize critical rendering path
  • Test on real devices and networks

Optimization Checklist

  • Enable code splitting for routes
  • Lazy load below-fold components
  • Optimize and compress images
  • Implement service worker caching
  • Enable gzip/brotli compression
  • Monitor Core Web Vitals
  • Minimize render-blocking resources

Additional Configuration

See references/compression-monitoring.md for:

  • Webpack compression plugin setup
  • Apache .htaccess compression config
  • TTFB monitoring implementation
  • Puppeteer automation for measurement

See references/typescript-advanced.md for:

  • TypeScript lazyLoad utility
  • TypeScript image component
  • Advanced service worker with offline fallback
  • TerserPlugin configuration
  • Complete PerformanceMetrics interface

Tools

  • Lighthouse / PageSpeed Insights
  • WebPageTest
  • Chrome DevTools Performance tab
  • web-vitals npm package

Resources

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/web-performance-optimization/skills/web-performance-optimization of secondsky/claude-skills.

  • SKILL.md
  • references/compression-monitoring.md
  • references/typescript-advanced.md

Open the folder on GitHubat commit 8837836

Compare with similar skills

Web Performance Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Web Performance Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Web Performance Optimization this skillsecondsky/claude-skills227—~1.6kAutomated safety check: PassMIT
React Frontend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2.9kAutomated safety check: PassMIT
Compare Array Bundle SizePostHog/posthog-js613—~599Automated safety check: PassCustom licence
Reduce Bundle Sizekcsujeet/ilamy-calendar351—~2.9kAutomated safety check: PassMIT
Frontend Guidelightly-ai/lightly-studio896—~2.9kAutomated safety check: PassApache-2.0
Shader for Interfacesv2space-labs/shader-for-interfaces115—~3.1kAutomated safety check: PassMIT

Similar skills

  • React Frontend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.

    10k GitHub starsUsed in 2 repos~2.9k tokens
    Frontend & DesignAuto-check passed
  • Compare Array Bundle Size

    PostHog/posthog-js

    Official

    Quickly compare the posthog-js array.js bundle size in the current working tree against a git baseline using the repository's esbuild proxy.

    613 GitHub stars~599 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Reduce Bundle Size

    kcsujeet/ilamy-calendar

    Systematically reduce the shipped bundle size of a JS/TS library without sacrificing code readability or breaking consumer APIs.

    351 GitHub stars~2.9k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Frontend Guide

    lightly-ai/lightly-studio

    Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files.

    896 GitHub stars~2.9k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Shader for Interfaces

    v2space-labs/shader-for-interfaces

    Decides whether an interface effect belongs in CSS, SVG, Canvas 2D, WebGL or WebGPU, then builds, debugs and visually verifies focused GPU effects inside product UIs.

    115 GitHub stars~3.1k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Senior Frontend

    alirezarezvani/claude-skills

    Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications.

    28k GitHub starsUsed in 5 repos~3.9k tokens
    Frontend & DesignAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 9 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 9 days ago
    Auto-check passed

Works with

Questions about Web Performance Optimization

What does Web Performance Optimization do?

Optimizes web application performance through code splitting, lazy loading, caching strategies, and Core Web Vitals monitoring. Web Performance Optimization is an agent skill from secondsky/claude-skills. Optimizes web application performance through code splitting, lazy loading, caching strategies, and Core Web Vitals monitoring.

When should I use Web Performance Optimization?

Web Performance Optimization fits situations like: improving page load times; implementing service workers; reducing bundle sizes.

How do I install Web Performance Optimization in Claude Code?

Run `npx skills add secondsky/claude-skills --skill web-performance-optimization -a claude-code`. Or copy the skill folder (plugins/web-performance-optimization/skills/web-performance-optimization in secondsky/claude-skills) into .claude/skills/web-performance-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Web Performance Optimization in Codex?

Run `npx skills add secondsky/claude-skills --skill web-performance-optimization -a codex`. Or copy the skill folder (plugins/web-performance-optimization/skills/web-performance-optimization in secondsky/claude-skills) into .agents/skills/web-performance-optimization in your project. Codex loads it when a task matches its description.

Can I use Web Performance Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill web-performance-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/web-performance-optimization, .gemini/skills/web-performance-optimization, .github/skills/web-performance-optimization and .opencode/skills/web-performance-optimization in your project.

What does Web Performance Optimization need to run?

SKILL.md names no scripts, command-line tools or credentials: Web Performance Optimization is instructions for the agent only.

Does Web Performance Optimization access the network?

SKILL.md names 5 domains. As links in the text: web.dev, pagespeed.web.dev, developers.google.com, webpagetest.org and developer.mozilla.org. This is read from the text; nothing was executed.

Is Web Performance Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Web Performance Optimization use?

Web Performance Optimization is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Web Performance Optimization use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.8k tokens, read only when the agent opens those files.

What are the alternatives to Web Performance Optimization?

Skills that share tags, products or a category with Web Performance Optimization: React Frontend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars), Compare Array Bundle Size (PostHog/posthog-js, 613 stars), Reduce Bundle Size (kcsujeet/ilamy-calendar, 351 stars) and Frontend Guide (lightly-ai/lightly-studio, 896 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Web Performance Optimization?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.