component-common-domai…
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic duplicated?", "find common…
Optimize web performance: bundle size, images, caching, lazy loading, and overall page speed. Use when site is slow, reducing bundle size, fixing layout shifts, improving Time to Interactive, or optimizing for Lighthouse scores. Triggers on: web performance, bundle size, page
$ npx -y skills add tech-leads-club/agent-skills --skill perf-web-optimization --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/perf-web-optimizationContext preview
The summary Claude sees to decide when to auto-load this skill.
Optimize web performance: bundle size, images, caching, lazy loading, and overall page speed. Use when site is slow, reducing bundle size, fixing layout shifts, improving Time to Interactive, or optimizing for Lighthouse scores. Triggers on: web performance, bundle size, page
name: perf-web-optimization description: 'Optimize web performance: bundle size, images, caching, lazy loading, and overall page speed. Use when site is slow, reducing bundle size, fixing layout shifts, improving Time to Interactive, or optimizing for Lighthouse scores. Triggers on: web performance, bundle size, page speed, slow site, lazy loading. Do NOT use for Core Web Vitals-specific fixes (use core-web-vitals), running Lighthouse audits (use perf-lighthouse), or Astro-specific optimization (use perf-astro).'
Systematic approach: Measure → Identify → Prioritize → Implement → Verify.
| Metric | Good | Needs Work | Poor | | ------ | ------- | ---------- | ------- | | LCP | < 2.5s | 2.5-4s | > 4s | | INP | < 200ms | 200-500ms | > 500ms | | CLS | < 0.1 | 0.1-0.25 | > 0.25 | | TTFB | < 800ms | 800ms-1.8s | > 1.8s |
<!-- Hero/LCP image: eager + high priority --> <img src="/hero.webp" alt="Hero" width="1200" height="600" loading="eager" fetchpriority="high" decoding="async" /> <!-- Below fold: lazy load --> <img src="/product.webp" alt="Product" width="400" height="300" loading="lazy" decoding="async" />
Always set `width` and `height` to prevent CLS.
<!-- Preconnect to font origin --> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <!-- Non-blocking font load --> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter&display=swap" media="print" onload="this.media='all'" />
<!-- Defer to user interaction -->
<script>
function loadThirdParty() {
// Load analytics, chat widgets, etc.
}
;['scroll', 'click', 'touchstart'].forEach((e) => addEventListener(e, loadThirdParty, { once: true, passive: true }))
setTimeout(loadThirdParty, 5000)
</script>Inline critical CSS in `<head>`, defer the rest:
<style> /* critical styles */ </style> <link rel="preload" href="/styles.css" as="style" onload="this.rel='stylesheet'" />
# Webpack npx webpack-bundle-analyzer dist/stats.json # Vite npx vite-bundle-visualizer # Check package size before installing npx bundlephobia <package-name>
Common heavy packages to replace:
// React lazy
const Chart = lazy(() => import('./Chart'))
// Next.js dynamic
const Admin = dynamic(() => import('./Admin'), { ssr: false })
// Vite/Rollup manual chunks
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom']
}
}
}
}# Static assets (immutable hash in filename) Cache-Control: public, max-age=31536000, immutable # HTML (revalidate) Cache-Control: no-cache # API responses Cache-Control: private, max-age=0, must-revalidate
For running audits, reading reports, and setting budgets, use the **perf-lighthouse** skill.
For in-depth optimization patterns, see:
The secure, validated skill registry for professional AI coding agents. Extend Antigravity, Claude Code, Cursor, Copilot and more with absolute confidence.
Repo: tech-leads-club/agent-skills
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic duplicated?", "find common…
Detects misplaced classes and fixes component hierarchy problems — finds code that should belong inside a component but sits at the root level. Use when asking…
Maps architectural components in a codebase and measures their size to identify what should be extracted first. Use when asking "how big is each module?",…
Analyzes coupling between modules using the three-dimensional model (strength, distance, volatility) from "Balancing Coupling in Software Design". Use when…
Creates step-by-step decomposition plans and migration roadmaps for breaking apart monolithic applications. Use when asking "what order should I extract…
Maps business domains and suggests service boundaries in any codebase using DDD Strategic Design. Use when asking "what are the domains in this codebase?",…