Skip to content
Skills Library
Programming · Analysis

performance

/performance

Optimize frontend Core Web Vitals (LCP, INP, CLS) and loading/rendering/network. Use when the UI feels slow, images/fonts/bundles need work, or during design audits that touch performance — phrases like "lemot", "optimize", "LCP", or "Core Web Vitals" without requiring a slash command.

Licence
MIT
Last repository change
18.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
2
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 18.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • SKILL.md zawiera komentarze HTML (2). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Optimize frontend Core Web Vitals (LCP, INP, CLS) and loading/rendering/network. Use when the UI feels slow, images/fonts/bundles need work, or during design audits that touch performance — phrases like "lemot", "optimize", "LCP", or "Core Web Vitals" without requiring a slash command.

Triggers from the description

lemotoptimizeLCPCore Web Vitals
Original author description

Optimize frontend Core Web Vitals (LCP, INP, CLS) and loading/rendering/network. Use when the UI feels slow, images/fonts/bundles need work, or during design audits that touch performance — phrases like "lemot", "optimize", "LCP", or "Core Web Vitals" without requiring a slash command.

How it works

  1. Overview
  2. When to Use
  3. Targets
  4. Decision trees
  5. Workflow
  6. Performance budget
  7. Quick audit method
  8. Checklist
  9. Depth
Original SKILL.md headings · 190 lines, 925 words
SKILL.md preview
---
name: performance
description: >-
  Optimize frontend Core Web Vitals (LCP, INP, CLS) and loading/rendering/network.
  Use when the UI feels slow, images/fonts/bundles need work, or during design
  audits that touch performance — phrases like "lemot", "optimize", "LCP", or
  "Core Web Vitals" without requiring a slash command.
---

# Web Performance

## Overview

Measure-first performance for user-facing UI. Hit Core Web Vitals targets; prefer compositor-friendly work and sensible loading.

## When to Use

- Performance regressions or budgets
- Deep `/design` audits
- Image/font/bundle optimization work
- User reports "slow", "lemot", "loading lama"

## Targets

| Metric | Target | Measures |
|--------|--------|----------|
| **LCP** | ≤ 2.5s | Largest visible content element render time |
| **INP** | ≤ 200ms | Interaction to visual response time |
| **CLS** | ≤ 0.1 | Unexpected layout shift score |

## Decision trees

### Image format decision

```
Is it a photo or complex image?
  YES → Is AVIF supported by your target browsers?
         YES → AVIF (smallest, best quality)
         NO  → WebP (wide support, good compression)
  NO  → Is it an icon or simple graphic?
         YES → SVG (scalable, tiny) or Reicon
         NO  → Is transparency needed?
               YES → WebP or PNG (WebP preferred)
               NO  → WebP or JPEG (WebP preferred)
```

### Font loading strategy

```
Is the font critical for LCP text?
  YES → Preload + font-display: swap
        <link rel="preload" as="font" href="/font.woff2" type="font/woff2" crossorigin>
  NO  → Is it a secondary/accent font?
        YES → font-display: swap (load async)
        NO  → Is it used only on specific pages?
              YES → Lazy load via JS / @font-face on that page only
              NO  → font-display: optional (may skip if slow)
```

### LCP resource priority

```
What is the LCP element?
  IMAGE → fetchpriority="high" + preload + NO lazy-load + width/height set
  TEXT  → Preload the font + inline critical CSS for that heading
  VIDEO → Preload poster image + fetchpriority="high" on poster
  
Is there a render-blocking script above LCP?
  YES → Move to bottom / add defer / async
  NO  → Good
```

## Workflow

### 1. Loading

- Preconnect critical origins
- Preload LCP resources (`<link rel="preload">`)
- `fetchpriority="high"` on LCP image — **never lazy-load it**
- Self-host fonts with `font-display: swap` and `woff2` format
- Modern image formats (WebP/AVIF) with `<picture>` fallback
- Code-split routes and heavy features (`lazy()` + `Suspense`)

**Recipe — optimal LCP image:**
```html
<!-- Preload in <head> -->
<link rel="preload" as="image" href="/hero.webp" type="image/webp">

<!-- In body — no lazy, explicit dimensions -->
<img 
  src="/hero.webp" 
  alt="Hero description"
  width="1200" height="600"
  fetchpriority="high"
>
```

### 2. Rendering

- Avoid unnecessary re-renders (memoize when profiling shows waste)
- Virtualize long lists (>100 items) — `@tanstack/react-virtual` or equivalent
- Animate only `transform` / `opacity` / `filter` for compositor-friendly motion
- Avoid layout thrashing (batch DOM reads before writes)
- Use `content-visibility: auto` for off-screen sections

**Recipe — avoid layout thrashing:**
```js
// BAD: interleaved read-write
elements.forEach(el => {
  const h = el.offsetHeight;    // read → forces layout
  el.style.height = `${h}px`;   // write → invalidates layout
});

// GOOD: batch reads, then writes
const heights = elements.map(el => el.offsetHeight); // all reads
elements.forEach((el, i) => {
  el.style.height = `${heights[i]}px`; // all writes
});
```

### 3. CLS prevention

| Cause | Fix |
|-------|-----|
| Images without dimensions | Always set `width` + `height` or `aspect-ratio` |
| Dynamic content above fold | Reserve space with min-height or skeleton |
| Web fonts FOUT | `font-display: optional` for non-critical fonts |
| Late-loading ads/embeds | Fixed-size container placeholder |
| Injected banners/bars | Reserve space or use transform animation |

### 4. INP optimization

| Symptom | Fix |
|---------|-----|
| Click feels slow (>200ms) | Break long tasks — `scheduler.yield()` or `requestIdleCallback` |
| Typing lag in inputs | Debounce heavy handlers (300ms); keep onChange lightweight |
| Scroll jank | Use passive event listeners; avoid heavy scroll handlers |
| Heavy computation on interaction | Move to Web Worker or defer with `requestIdleCallback` |

**Recipe — break long task:**
```js
async function processItems(items) {
  for (const item of items) {
    processItem(item);
    // Yield to let browser handle pending interactions
    if (navigator.scheduling?.isInputPending?.()) {
      await scheduler.yield();
    }
  }
}
```

### 5. Network

- Cache hashed static assets (`max-age=31536000, immutable`)
- HTML: `no-cache` (always revalidate)
- API: appropriate cache or `no-store` for private data
- Compression: brotli preferred > gzip
- Paginate API responses; field selection when available

## Performance budget

| Resource | Budget |
|----------|--------|
| Total JavaScript | < 200KB gzipped |
| Total CSS | < 50KB gzipped |
| Total Images (above fold) | < 500KB |
| Total Fonts | < 100KB |
| First Contentful Paint | < 1.8s |
| Largest Contentful Paint | < 2.5s |
| Total Blocking Time | < 200ms |
| Cumulative Layout Shift | < 0.1 |

## Quick audit method

1. **Lighthouse** — run in Incognito, mobile throttling → check LCP, INP, CLS scores
2. **Performance panel** — record interaction, look for long tasks (>50ms red blocks)
3. **Network panel** — check waterfall: is LCP resource the first to load?
4. **Coverage tab** — how much CSS/JS is unused on this page?
5. **web-vitals library** — add to app for real-user monitoring

## Checklist

- [ ] CWV targets known for the change
- [ ] LCP resource identified + prioritized (`fetchpriority="high"`, preload)
- [ ] LCP image NOT lazy-loaded
- [ ] Image format decision tree followed (WebP/AVIF)
- [ ] Font loading strategy chosen (preload critical, swap/optional others)
- [ ] No obvious CLS (reserved sizes for media, skeletons for dynamic content)
- [ ] Heavy features code-split
- [ ] INP: no long tasks blocking interactions
- [ ] Motion uses compositor-friendly properties (`transform`/`opacity`)
- [ ] Performance budget within limits

## Depth

Full guide: `references/performance.md`.

Versions

RepositoryScoreLicence
This page · sukirman1901/frontend-expert100MIT
ericrisco/rsc-harness100MIT
yonatangross/orchestkit100MIT
yonatangross/orchestkit100MIT
davila7/claude-code-templates100MIT
motormetrics/motormetrics100MIT
motormetrics/motormetrics100MIT
event4u-app/agent-config100MIT
arxdsilva/ai-loops100MIT

Database snapshot: 13.11.2026 · package version dd6bee2d6182 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100core-web-vitals
    Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".
  • 100core-web-vitals
    Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".
  • 100core-web-vitals
    Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to \"improve Core Web Vitals\", \"fix LCP\", \"reduce CLS\", \"optimize INP\", \"page experience optimization\", or \"fix layout shifts\".
  • 100core-web-vitals
    Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".
  • 100core-web-vitals
    Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".
  • 100core-web-vitals
    Optimize Core Web Vitals (LCP, INP, CLS) for better page experience using field and lab evidence. Use when asked to "improve Core Web Vitals", "fix LCP", "reduce CLS", "optimize INP", "page experience optimization", or "fix layout shifts".

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.