Langsung ke konten
Skillpedia
Website & UI (frontend)48k Β· #6155

web-performance-optimization

Fungsinya

Tool ini membantu membuat website atau aplikasi Anda lebih cepat. Tool ini mengidentifikasi dan memperbaiki masalah yang membuat halaman lambat dimuat atau interaksinya terasa lamban.

Kapan dipakai

  • βœ“Jika website Anda membutuhkan waktu terlalu lama untuk dimuat.
  • βœ“Jika animasi atau tombol di website Anda tidak responsif.
  • βœ“Jika Anda ingin meningkatkan skor website Anda di tes kecepatan.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/web-performance-optimization/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/web-performance-optimization/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara membuat website saya lebih cepat agar termuat dalam waktu kurang dari 2 detik?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Tool ini menganalisis website Anda, menemukan hambatan kecepatan (seperti gambar berukuran besar atau kode yang lambat), lalu menyarankan atau menerapkan perbaikan. Ini mencakup optimasi gambar, penggunaan teknik caching, dan penataan ulang kode.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Web Performance Optimization

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

  • Use when website or app is loading slowly
  • Use when optimizing for Core Web Vitals (LCP, INP, CLS)
  • Use when reducing JavaScript bundle size
  • Use when reducing main-thread blocking and slow interactions (INP)
  • Use when optimizing images and assets
  • Use when implementing caching strategies
  • Use when debugging performance bottlenecks
  • Use when preparing for performance audits

Examples

Example 1: Optimizing Core Web Vitals

## Performance Audit Results

### Current Metrics (Before Optimization)
- **LCP (Largest Contentful Paint):** 4.2s ❌ (should be < 2.5s)
- **INP (Interaction to Next Paint):** 350ms ❌ (should be ≀ 200ms)
- **CLS (Cumulative Layout Shift):** 0.25 ❌ (should be < 0.1)
- **Lighthouse Score:** 62/100

### Issues Identified

1. **LCP Issue:** Hero image (2.5MB) loads slowly
2. **INP Issue:** Large JavaScript bundle (850KB) blocks main thread
3. **CLS Issue:** Images without dimensions cause layout shifts

### Optimization Plan

#### Fix LCP (Largest Contentful Paint)

**Problem:** Hero image is 2.5MB and loads slowly

**Solutions:**
\`\`\`html
<!-- Before: Unoptimized image -->
<img src="/hero.jpg" alt="Hero">

<!-- After: Optimized with modern formats -->
<picture>
  <source srcset="/hero.avif" type="image/avif">
  <source srcset="/hero.webp" type="image/webp">
  <img 
    src="/hero.jpg" 
    alt="Hero"
    width="1200" 
    height="600"
    loading="eager"
    fetchpriority="high"
  >
</picture>
\`\`\`

**Additional optimizations:**
- Compress image to < 200KB
- Use CDN for faster delivery
- Preload hero image: `<link rel="preload" as="image" href="/hero.avif">`

#### Fix INP (Interaction to Next Paint)

**Problem:** 850KB JavaScript bundle blocks main thread

**Solutions:**

1. **Code Splitting:**
\`\`\`javascript
// Before: Everything in one bundle
import { HeavyComponent } from './HeavyComponent';
import { Analytics } from './analytics';
import { ChatWidget } from './chat';

// After: Lazy load non-critical code
const HeavyComponent = lazy(() => import('./HeavyComponent'));
const ChatWidget = lazy(() => import('./chat'));

// Load analytics after page interactive
if (typeof window !== 'undefined') {
  window.addEventListener('load', () => {
    import('./analytics').then(({ Analytics }) => {
      Analytics.init();
    });
  });
}
\`\`\`

2. **Remove Unused Dependencies:**
\`\`\`bash
# Analyze bundle
npx webpack-bundle-analyzer

# Remove unused packages
npm uninstall moment  # Use date-fns instead (smaller)
npm install date-fns
\`\`\`

3. **Defer Non-Critical Scripts:**
\`\`\`html
<!-- Before: Blocks rendering -->
<script src="/analytics.js"></script>

<!-- After: Deferred -->
<script src="/analytics.js" defer></script>
\`\`\`

#### Fix CLS (Cumulative Layout Shift)

**Problem:** Images without dimensions cause layout shifts

**Solutions:**
\`\`\`html
<!-- Before: No dimensions -->
<img src="/product.jpg" alt="Product">

<!-- After: With dimensions -->
<img 
  src="/product.jpg" 
  alt="Product"
  width="400" 
  height="300"
  style="aspect-ratio: 4/3;"
>
\`\`\`

**For dynamic content:**
\`\`\`css
/* Reserve space for content that loads later */
.skeleton-loader {
  min-height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
\`\`\`

### Results After Optimization

- **LCP:** 1.8s βœ… (improved by 57%)
- **INP:** 150ms βœ… (improved by 57%)
- **CLS:** 0.05 βœ… (improved by 80%)
- **Lighthouse Score:** 94/100 βœ…

Example 2: Reducing JavaScript Bundle Size

## Bundle Size Optimization

### Current State
- **Total Bundle:** 850KB (gzipped: 280KB)
- **Main Bundle:** 650KB
- **Vendor Bundle:** 200KB
- **Load Time (3G):** 8.2s

### Analysis

\`\`\`bash
# Analyze bundle composition
npx webpack-bundle-analyzer dist/stats.json
\`\`\`

**Findings:**
1. Moment.js: 67KB (can replace with date-fns: 12KB)
2. Lodash: 72KB (using entire library, only need 5 functions)

…
Pertanyaan umum

Apa itu 'Core Web Vitals'?

Ini adalah metrik penting dari Google yang mengukur pengalaman pengguna, dari sisi kecepatan memuat halaman, interaktivitas, dan stabilitas tampilan.

Apa itu 'bundle size'?

Ini adalah total ukuran file kode (seperti JavaScript) yang harus diunduh browser untuk menampilkan website Anda. Semakin kecil file-nya, semakin cepat pemuatannya.

Apa itu 'caching'?

Ini adalah teknik untuk menyimpan sementara bagian-bagian website di browser pengguna atau di server. Dengan begitu, pemuatan pada kunjungan berikutnya menjadi lebih cepat karena tidak semuanya perlu diunduh ulang.

Detail

Deskripsi asli dari pembuat

Optimize website and web application performance including loading speed, Core Web Vitals, bundle size, caching strategies, and runtime performance

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#6155
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa