Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)8.2k · #12537

nextjs-react-expert

Skill này làm gì

Skill này cung cấp cho AI của bạn một bộ quy tắc hiệu năng cho ứng dụng React và Next.js. Dành cho lập trình viên có trang tải chậm hoặc cảm giác chậm chạp.

Khi nào nên dùng

  • ✓Khi một trang React hoặc Next.js tải chậm hoặc mất quá nhiều thời gian để tương tác được.
  • ✓Khi bạn muốn giảm kích thước mã JavaScript gửi đến trình duyệt.
  • ✓Khi bạn muốn rà soát một component React xem có vấn đề hiệu năng không.

Liên kết skill

https://github.com/vudovn/ag-kit/blob/main/.agents/skills/nextjs-react-expert/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/vudovn/ag-kit/blob/main/.agents/skills/nextjs-react-expert/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Trang Next.js của tôi tải chậm. Hãy rà soát và sửa các vấn đề hiệu năng lớn nhất trước.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill liệt kê các quy tắc theo mức ảnh hưởng, bắt đầu từ những quy tắc quan trọng nhất như loại bỏ waterfall khi tải. AI đọc đúng phần liên quan và áp dụng các sửa đổi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Next.js & React Performance Expert

From Vercel Engineering - 58 optimization rules prioritized by impact, plus Next.js 16 Cache Components Philosophy: Eliminate waterfalls first, optimize bundles second, then micro-optimize.


🎯 Selective Reading Rule (MANDATORY)

Read ONLY sections relevant to your task! Check the content map below and load what you need.

🔴 For performance reviews: Start with CRITICAL sections (1-2), then move to HIGH/MEDIUM.


📑 Content Map

File Impact Rules When to Read
1-async-eliminating-waterfalls.md 🔴 CRITICAL 6 rules Slow page loads, sequential API calls, data fetching waterfalls
2-bundle-bundle-size-optimization.md 🔴 CRITICAL 5 rules Large bundle size, slow Time to Interactive, First Load issues
3-server-server-side-performance.md 🟠 HIGH 7 rules Slow SSR, API route optimization, server-side waterfalls
4-client-client-side-data-fetching.md 🟡 MEDIUM-HIGH 4 rules Client data management, SWR patterns, deduplication
5-rerender-re-render-optimization.md 🟡 MEDIUM 12 rules Excessive re-renders, React performance, memoization
6-rendering-rendering-performance.md 🟡 MEDIUM 9 rules Rendering bottlenecks, virtualization, image optimization
7-js-javascript-performance.md ⚪ LOW-MEDIUM 12 rules Micro-optimizations, caching, loop performance
8-advanced-advanced-patterns.md 🔵 VARIABLE 3 rules Advanced React patterns, useLatest, init-once
9-cache-components.md 🔴 CRITICAL 4 sections Next.js 16+ Only: use cache, cacheLife, PPR, cacheTag

Total: 58 rules across 8 categories, plus Section 9 (Cache Components) for Next.js 16+


🚀 Quick Decision Tree

What's your performance issue?

🐌 Slow page loads / Long Time to Interactive
  → Read Section 1: Eliminating Waterfalls
  → Read Section 2: Bundle Size Optimization

📦 Large bundle size (> 200KB)
  → Read Section 2: Bundle Size Optimization
  → Check: Dynamic imports, barrel imports, tree-shaking

🖥️ Slow Server-Side Rendering
  → Read Section 3: Server-Side Performance
  → Check: Parallel data fetching, streaming

🔄 Too many re-renders / UI lag
  → Read Section 5: Re-render Optimization
  → Check: React.memo, useMemo, useCallback

🎨 Rendering performance issues
  → Read Section 6: Rendering Performance
  → Check: Virtualization, layout thrashing

🌐 Client-side data fetching problems
  → Read Section 4: Client-Side Data Fetching
  → Check: SWR deduplication, localStorage

✨ Need advanced patterns
  → Read Section 8: Advanced Patterns

🚀 **Next.js 16+ Performance (Caching & PPR)**
  → Read Section 9: Cache Components

📊 Impact Priority Guide

Use this order when doing comprehensive optimization:

1️⃣ CRITICAL (Biggest Gains - Do First):
   ├─ Section 1: Eliminating Waterfalls
   │  └─ Each waterfall adds full network latency (100-500ms+)
   └─ Section 2: Bundle Size Optimization
      └─ Affects Time to Interactive and Largest Contentful Paint

2️⃣ HIGH (Significant Impact - Do Second):
   └─ Section 3: Server-Side Performance
      └─ Eliminates server-side waterfalls, faster response times

3️⃣ MEDIUM (Moderate Gains - Do Third):
   ├─ Section 4: Client-Side Data Fetching
   ├─ Section 5: Re-render Optimization
   └─ Section 6: Rendering Performance

4️⃣ LOW (Polish - Do Last):
   ├─ Section 7: JavaScript Performance
   └─ Section 8: Advanced Patterns

🔥 **MODERN (Next.js 16+):**
   └─ Section 9: Cache Components (Replaces most traditional revalidation)

🔗 Related Skills

Need Skill
API design patterns @[skills/api-patterns]
Database optimization @[skills/database-design]
Testing strategies @[skills/testing-patterns]
UI/UX design principles @[skills/frontend-design]
TypeScript patterns @[skills/typescript-expert]
D
Câu hỏi thường gặp

Nên sửa vấn đề nào trước?

Skill nói nên bắt đầu với các mục nghiêm trọng, như waterfall khi tải và bundle lớn.

Nó có bao gồm tốc độ phía máy chủ không?

Có. Nó có một phần về hiệu năng phía máy chủ.

Nó chỉ dành cho Next.js à?

Không. Nó cũng bao gồm hiệu năng React, và bổ sung các quy tắc riêng cho Next.js.

Chi tiết

Mô tả gốc của tác giả

React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.

repo: vudovn/ag-kit

Độ phổ biến

Sao GitHub
8.2k
Vị trí xếp hạng
#12537
Giấy phép
MIT
Cập nhật
18/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự