nextjs
Installation
SKILL.md
Next.js Best Practices
App Router (v13+)
- Use Server Components by default
- Add 'use client' only when needed
- Use loading.tsx for loading states
- Use error.tsx for error boundaries
- Use layout.tsx for shared layouts
- Use route groups (folder) for organization
Data Fetching
- Fetch in Server Components when possible
- Use React Suspense for streaming
- Use generateStaticParams for static generation
- Use revalidate for ISR
- Use Next.js cache() for request deduplication