frontend-performance
Use when the user asks about bundle size, slow page loads, code splitting by route, lazy loading, rendering cost, memoization or a frontend performance budget…
от j4flmao★ 47 звёзд на GitHub
Установить frontend-performance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Frontend Performance
Purpose
Optimize Core Web Vitals (LCP, CLS, INP) and bundle size. Measure before and after every optimization. Never optimize without data.
Agent Protocol
Trigger
Exact user phrases: "performance", "slow page", "bundle size", "lazy loading", "code splitting", "LCP", "CLS", "INP", "web vitals", "image optimization", "caching", "page speed", "load time".
Input Context
Before activating, verify:
- The performance issue is identified (slow page load, janky interaction, large bundle) or ask.
- The framework is known (React, Vue, Angular, Next.js, Nuxt).
- Whether the target is lab metrics (Lighthouse) or field metrics (RUM data).
Output Artifact
No file output. Produces optimization recommendations as text.
Response Format
Metric: {LCP/CLS/INP/bundle}
Current: {measured value}
Target: {target value}
Root cause: {specific cause}
Fix: {specific change with code}
Expected improvement: {estimated factor}
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Metric measured before optimization (Lighthouse, Web Vitals, or bundle analysis).
- Root cause identified from the measurement data.
- Specific fix provided with code example.
- Performance budget defined.
- One optimization at a time with before/after measurement.
Max Response Length
Per optimization: 10 lines. Code example: 8 lines.
Performance Architecture / Decision Trees
Optimization Priority Decision Tree
Measure Core Web Vitals first.
|-- LCP > 2.5s? -->
| Priority 1: Optimize LCP
| |-- Preload hero image <link rel="preload">
| |-- Optimize images: AVIF/WebP, resize, compress
| |-- SSR/SSG critical content
| |-- Remove render-blocking resources
| |-- Improve TTFB (CDN, server optimization)
|
|-- CLS > 0.1? -->
| Priority 2: Optimize CLS
| |-- Set width/height on all images and embeds
| |-- Use aspect-ratio CSS
| |-- Reserve space for dynamic content (ads, embeds)
| |-- Use font-display: optional
|
|-- INP > 200ms? -->
| Priority 3: Optimize INP
| |-- Break long tasks (<50ms chunks)
| |-- Debounce/throttle input handlers
| |-- Web Workers for heavy computation
| |-- Virtual scrolling for long lists
|
|-- Bundle size > 200KB JS (compressed)? -->
Priority 4: Bundle optimization
|-- Route-level code splitting
|-- Dynamic imports for heavy libs
|-- Remove dead code (tree shaking)
Image vs JS vs Font Decision Tree
What is the heaviest page resource?
|-- Images (typical: 60-80% of page weight) -->
| Quick wins: AVIF/WebP, resize to display size, lazy load below-fold
| Tools: sharp, squoosh, image CDN
|
|-- JavaScript (typical: 15-25% of page weight) -->
| Quick wins: code splitting, tree shaking, dynamic imports
| Tools: webpack-bundle-analyzer, source-map-explorer
|
|-- Fonts (typical: 5-10% of page weight) -->
| Quick wins: subset fonts, self-host, font-display: optional
| Tools: glyphhanger, fonttools
|
|-- Third-party scripts (typical: 5-15% load time) -->
Quick wins: defer, async, lazy-load after interaction
Tools: Request Map, webpagetest
Workflow
Step 1: Measure
| Tool | What It Measures |
|---|---|
| Lighthouse | Lab: LCP, CLS, INP, TBT, SI |
| Web Vitals library | Field: real user metrics |
| Chrome DevTools Performance | JS profiling, long tasks, layout thrashing |
| source-map-explorer / bundle-analyzer | Bundle composition |
| WebPageTest | Multi-location waterfall |
Never optimize without measurement. Intuition about what is slow is wrong more than 50% of the time.
Step 2: Optimize LCP
Target: <2.5s
| Technique | How |
|---|---|
| Preload hero/LCP image | <link rel="preload" href="hero.webp" as="image" fetchpriority="high"> |
| Optimize images | WebP/AVIF format, responsive srcset, compress to <100KB |
| SSR/SSG critical content | First paint includes meaningful content |
| Remove render-blocking resources | Inline critical CSS, defer non-critical JS |
| Good TTFB | CDN, server-side optimization, early hints |
Step 3: Optimize CLS
Target: <0.1
| Technique | How |
|---|---|
| Set media dimensions | Always include width and height attributes |
| Reserve layout space | min-height for dynamic content containers |
| aspect-ratio CSS | Prevent layout shift from images/videos |
| font-display: optional | Prevent invisible text flash and layout shift |
| Stable placeholders | Ads, embeds, and late-injected content get reserved space |
Step 4: Optimize INP
Target: <200ms
| Technique | How |
|---|---|
| Break long tasks | Split work into chunks under 50ms |
| requestIdleCallback | Defer analytics, logging, non-critical work |
| Web Workers | Heavy computation ( |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/bundle-optimization.md
- references/perf-bundling.md
- references/perf-monitoring.md
- references/perf-patterns.md
- references/rendering-performance.md
- references/web-vitals.md
FAQ
Что делает скилл frontend-performance?
Use when the user asks about bundle size, slow page loads, code splitting by route, lazy loading, rendering cost, memoization or a frontend performance budget in a framework app. Produces measure-first, framework-level optimizations. Not for Core Web Vitals field data and CrUX diagnosis (use web-performance) or image pipelines (use frontend-image-optimization).
Как установить скилл frontend-performance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-performance запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…