<< All versions
Skill v1.0.1
currentAutomated scan100/100nth5693/gemini-kit/performance
3 files
──Details
PublishedNovember 6, 2026 at 05:51 PM
Content Hashsha256:414720f858794a53...
Git SHA9f3e793d9506
Bump Typepatch
──Files
Files (1 file, 2.6 KB)
SKILL.md2.6 KBactive
SKILL.md · 135 lines · 2.6 KB
metadata: version: "1.0.1"
Performance Optimization Skill
Overview
Performance profiling, optimization techniques, and caching strategies.
Core Web Vitals
LCP (Largest Contentful Paint) < 2.5s
typescript
// Optimize images<Imagesrc="/hero.jpg"alt="Hero"priority // Preloadsizes="100vw"placeholder="blur"/>// Preload critical resources<link rel="preload" href="/fonts/inter.woff2" as="font" crossOrigin="" />
CLS (Cumulative Layout Shift) < 0.1
css
/* Reserve space for images */img {aspect-ratio: 16 / 9;width: 100%;height: auto;}/* Skeleton loaders */.skeleton {background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);animation: shimmer 1.5s infinite;}
INP (Interaction to Next Paint) < 200ms
typescript
// Defer non-critical workimport { startTransition } from 'react';startTransition(() => {setExpensiveState(newValue);});// Use web workers for heavy computationconst worker = new Worker('/heavy-task.js');worker.postMessage(data);
JavaScript Optimization
Code Splitting
typescript
// Dynamic importsconst HeavyComponent = lazy(() => import('./HeavyComponent'));// Route-based splitting (Next.js does this automatically)import dynamic from 'next/dynamic';const Chart = dynamic(() => import('./Chart'), { ssr: false });
Bundle Analysis
bash
# Next.jsnpx @next/bundle-analyzer# Webpacknpx webpack-bundle-analyzer stats.json
Tree Shaking
typescript
// ❌ Import entire libraryimport _ from 'lodash';_.debounce(fn, 300);// ✅ Import specific functionimport debounce from 'lodash/debounce';debounce(fn, 300);
Caching Strategies
HTTP Caching
typescript
// Static assets (1 year)Cache-Control: public, max-age=31536000, immutable// API responses (5 minutes with revalidation)Cache-Control: public, max-age=300, stale-while-revalidate=60
React Query / SWR
typescript
const { data } = useQuery({queryKey: ['users'],queryFn: fetchUsers,staleTime: 5 * 60 * 1000, // 5 minutescacheTime: 30 * 60 * 1000, // 30 minutes});
Service Worker
typescript
// Cache-first strategy for static assetsself.addEventListener('fetch', (event) => {event.respondWith(caches.match(event.request).then((cached) => {return cached || fetch(event.request);}));});
Database Query Optimization
sql
-- Add indexesCREATE INDEX idx_posts_user_date ON posts(user_id, created_at DESC);-- Avoid N+1SELECT posts.*, users.nameFROM postsJOIN users ON posts.user_id = users.id;-- Use EXPLAIN ANALYZEEXPLAIN ANALYZE SELECT * FROM posts WHERE user_id = 123;