본문으로 건너뛰기
cccskills
무료GitHub에 공개

performance-auditing

Lighthouse audits, bundle analysis, image optimization, font loading, Core Web Vitals tracking, and performance monitoring setup.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Vercel
설치 방법 보기

포함된 파일(1)

  • SKILL.md7.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Performance Auditing

When to use this skill

  • Running Lighthouse audits and interpreting results
  • Analyzing bundle size and finding bloat
  • Optimizing images, fonts, and scripts
  • Tracking Core Web Vitals (LCP, CLS, INP, FCP, TTFB)
  • Investigating slow page loads
  • Reducing Time to Interactive (TTI)
  • Setting up performance budgets and alerting
  • Reviewing Umami analytics for performance trends

Performance targets

MetricTargetMeasurement
LCP (Largest Contentful Paint)< 2.5sChrome DevTools / Lighthouse
CLS (Cumulative Layout Shift)< 0.1Chrome DevTools / Lighthouse
INP (Interaction to Next Paint)< 200msChrome DevTools / Lighthouse
FCP (First Contentful Paint)< 1.8sLighthouse
TTFB (Time to First Byte)< 800msLighthouse
Total bundle size< 250KB gzippednpm run build output
Lighthouse Performance score≥ 95Lighthouse

Workflow

1. Lighthouse audit

Run locally:

# Start the production build
npm run build && npm run start

# Run Lighthouse (requires Chrome)
npx lighthouse http://localhost:3000 --output html --view

Run against deployed site:

npx lighthouse https://namias.tech --output html --view

Interpret the report:

  • Performance score (0-100): ≥ 95 is excellent
  • Opportunities: Specific suggestions with estimated savings
  • Diagnostics: Additional performance best practices
  • Passed audits: Things that are already good

2. Bundle analysis

Check build output:

npm run build 2>&1 | grep -E "First Load|shared|Route"

Understanding the output:

Route (app)                    Size     First Load JS
┌ ○ /                          5.2 kB        89 kB
├ ○ /projects                  3.1 kB        87 kB
└ λ /api/chat                  0.1 kB        87 kB
+ First Load JS shared by      85 kB
  • ○ = Static (prerendered)
  • λ = Dynamic (server-rendered)
  • First Load JS = shared bundle + page-specific code

Identify bloat:

  1. Check which pages have the largest First Load JS
  2. Look for large dependencies in the bundle
  3. Use dynamic imports for heavy components

3. Image optimization

Checklist:

  • All images use next/image with width and height
  • Remote images have sizes prop for responsive loading
  • Images use priority for above-the-fold content (hero, project covers)
  • Format is WebP or AVIF (configured in next.config.js)
  • No layout shift (explicit dimensions on all images)

Current image config (next.config.js):

formats: ['image/webp', 'image/avif'],
deviceSizes: [320, 480, 640, 768, 1024, 1280, 1536],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384, 512, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
qualities: [75, 85],

Sanity image optimization:

The media gateway (/api/media/[...path]) handles Sanity image optimization:

/api/media/sanity/<image-id>?w=800&q=80&auto=format

Parameters: w (width), q (quality), auto=format (automatic format selection)

4. Font optimization

Current setup:

  • Font: Inter (system-ui fallback)
  • Loading: next/font with display: swap

Check font loading:

  1. DevTools → Network → filter by font
  2. Fonts should load with 200 status (not 304 from cache)
  3. No FOIT (Flash of Invisible Text) -- display: swap prevents this
  4. Font files should be < 100KB each

Font optimization tips:

  • Use font-display: swap (already configured)
  • Preload critical fonts: <link rel="preload" as="font">
  • Subset fonts to include only needed characters
  • Use font-size-adjust for fallback font consistency

5. Script optimization

Checklist:

  • No unnecessary third-party scripts
  • Analytics (Umami) loads with defer or async
  • No render-blocking scripts
  • Dynamic imports for heavy libraries (e.g., chart libraries)
  • Service worker doesn't block page load

Third-party script audit:

# Check what scripts load
# DevTools → Network → filter by JS
# Look for external domains loading scripts

Current scripts: Umami analytics only (lightweight, self-hosted)

6. CSS optimization

Checklist:

  • Tailwind purges unused classes (configured by default)
  • No transition: all (Vercel guideline)
  • Animations use only transform and opacity
  • No unused CSS (check with PurgeCSS)
  • Critical CSS is inlined (Next.js does this automatically)

Check CSS size:

npm run build 2>&1 | grep -i css

7. React performance

Checklist:

  • useMemo on expensive computations
  • useCallback on functions passed to child components
  • No unnecessary re-renders (check with React DevTools Profiler)
  • Components use React.memo where beneficial
  • Lists have stable key props (not index)
  • Code splitting with next/dynamic for heavy components

Common performance anti-patterns:

// BAD: creating new object/function on every render
<Component style={{ color: 'red' }} onClick={() => handleClick()} />

// GOOD: memoize
const style = useMemo(() => ({ color: 'red' }), []);
const handleClick = useCallback(() => doSomething(), []);
<Component style={style} onClick={handleClick} />

8. Network optimization

Checklist:

  • API responses are cached where possible
  • SWR revalidation intervals are reasonable
  • No redundant API calls
  • GZIP/Brotli compression enabled (Vercel does this automatically)
  • HTTP/2 enabled (Vercel default)

Quick performance checklist

# 1. Build and check output
npm run build 2>&1 | grep -E "First Load|shared"

# 2. Start production server
npm run start

# 3. Run Lighthouse
npx lighthouse http://localhost:3000 --output html --view

# 4. Check bundle in DevTools
# DevTools → Network → Size column

# 5. Check for layout shift
# DevTools → Rendering → Layout Shift Regions

Common mistakes

  • Using useEffect for data fetching instead of SWR with SSR
  • Not setting priority on above-the-fold images
  • Loading heavy libraries eagerly instead of dynamically
  • Not cleaning up event listeners and subscriptions
  • Using JSON.parse without error handling (blocks main thread)

Performance budget

MetricTargetWarning threshold
LCP< 2.5s> 4.0s
CLS< 0.1> 0.25
INP< 200ms> 300ms
FCP< 1.8s> 3.0s
TTFB< 800ms> 1.5s
Total bundle< 250KB gzipped> 350KB
Lighthouse score≥ 95< 90

Performance monitoring

The portfolio uses Umami (cloud.umami.is) for analytics. To review performance trends:

  1. Umami dashboard → Events → filter by performance-related custom events
  2. Chrome DevTools → Performance tab for runtime profiling
  3. Lighthouse CI for automated performance gates

Setting up alerts

If implementing performance alerts (e.g., via Umami custom events or Vercel Analytics):

  1. Define thresholds from the budget table above
  2. Instrument key metrics (LCP, CLS, INP) via web-vitals library
  3. Send to Umami as custom events or to a logging endpoint
  4. Set up alerting rules in the monitoring dashboard

Delivery checks

  • Lighthouse Performance score ≥ 95
  • LCP < 2.5s
  • CLS < 0.1
  • INP < 200ms
  • No render-blocking resources
  • All images optimized with next/image
  • Bundle size < 250KB gzipped
  • No console warnings about performance

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit and fix accessibility issues across the portfolio to ensure WCAG 2.1 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new blog post document in the Sanity studio. Use when the user wants to write a blog post, publish an article, or schedule a future post.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new certification document in the Sanity studio. Use when the user wants to add a credential, certificate, or professional accreditation to the Certifications collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Adds a new skill MD file to the studio's skills collection. Use when the user wants to author a new step-by-step recipe for the studio's in-app Skills tool or the .agents mirror.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new project document in the Sanity studio. Use when the user wants to add a new portfolio project, a case study, or a work sample to the Projects collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new experience document in the Sanity studio. Use when the user wants to add a job, role, internship, or work history entry to the Experience collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

PP-Namias의 스킬 모두 보기

이 스킬의 문제 신고