next-best-practices
하는 일
이 스킬은 에이전트에게 Next.js 앱을 만드는 최신 규칙을 알려 줍니다. 파일, 데이터, 오류에 관한 최신 관례를 코드에 적용하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Next.js 페이지, 라우트, 레이아웃을 시작하거나 검토할 때.
- ✓서버 컴포넌트와 클라이언트 컴포넌트의 경계를 확인하고 싶을 때.
- ✓오래된 Next.js 프로젝트를 최신 비동기 패턴으로 업데이트할 때.
스킬 링크
https://github.com/Kiranism/next-shadcn-dashboard-starter/blob/main/.agents/skills/next-best-practices/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Next.js 페이지를 검토하고, 현재 모범 사례를 따르는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 코드를 읽고 파일 구조, 컴포넌트 경계, 비동기 값, 오류 페이지, 이미지와 폰트 사용에 관한 규칙과 비교합니다. 현재 버전에 맞는 수정안을 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Next.js Best Practices
Apply these rules when writing or reviewing Next.js code.
File Conventions
See file-conventions.md for:
- Project structure and special files
- Route segments (dynamic, catch-all, groups)
- Parallel and intercepting routes
- Middleware rename in v16 (middleware → proxy)
RSC Boundaries
Detect invalid React Server Component patterns.
See rsc-boundaries.md for:
- Async client component detection (invalid)
- Non-serializable props detection
- Server Action exceptions
Async Patterns
Next.js 15+ async API changes.
See async-patterns.md for:
- Async
paramsandsearchParams - Async
cookies()andheaders() - Migration codemod
Runtime Selection
See runtime-selection.md for:
- Default to Node.js runtime
- When Edge runtime is appropriate
Directives
See directives.md for:
'use client','use server'(React)'use cache'(Next.js)
Functions
See functions.md for:
- Navigation hooks:
useRouter,usePathname,useSearchParams,useParams - Server functions:
cookies,headers,draftMode,after - Generate functions:
generateStaticParams,generateMetadata
Error Handling
See error-handling.md for:
error.tsx,global-error.tsx,not-found.tsxredirect,permanentRedirect,notFoundforbidden,unauthorized(auth errors)unstable_rethrowfor catch blocks
Data Patterns
See data-patterns.md for:
- Server Components vs Server Actions vs Route Handlers
- Avoiding data waterfalls (
Promise.all, Suspense, preload) - Client component data fetching
Route Handlers
See route-handlers.md for:
route.tsbasics- GET handler conflicts with
page.tsx - Environment behavior (no React DOM)
- When to use vs Server Actions
Metadata & OG Images
See metadata.md for:
- Static and dynamic metadata
generateMetadatafunction- OG image generation with
next/og - File-based metadata conventions
Image Optimization
See image.md for:
- Always use
next/imageover<img> - Remote images configuration
- Responsive
sizesattribute - Blur placeholders
- Priority loading for LCP
Font Optimization
See font.md for:
next/fontsetup- Google Fonts, local fonts
- Tailwind CSS integration
- Preloading subsets
Bundling
See bundling.md for:
- Server-incompatible packages
- CSS imports (not link tags)
- Polyfills (already included)
- ESM/CommonJS issues
- Bundle analysis
Scripts
See scripts.md for:
next/scriptvs native script tags- Inline scripts need
id - Loading strategies
- Google Analytics with
@next/third-parties
Hydration Errors
See hydration-error.md for:
- Common causes (browser APIs, dates, invalid HTML)
- Debugging with error overlay
- Fixes for each cause
Suspense Boundaries
See suspense-boundaries.md for:
- CSR bailout with
useSearchParamsandusePathname - Which hooks require Suspense boundaries
Parallel & Intercepting Routes
See parallel-routes.md for:
- Modal patterns with
@slotand(.)interceptors default.tsxfor fallbacks- Closing modals correctly with
router.back()
Self-Hosting
See self-hosting.md for:
output: 'standalone'for Docker- Cache handlers for multi-instance ISR
- What works vs needs extra setup
Debug Tricks
See debug-tricks.md for:
- MCP endpoint for AI-assisted debugging
- Rebuild specific routes with
--debug-build-paths
자주 묻는 질문
최신 Next.js 버전까지 다루나요?
스킬은 Next.js 15 이후 패턴을 다루며, 16 버전의 미들웨어 이름 변경도 포함합니다.
서버 컴포넌트란 무엇인가요?
서버에서 실행되는 페이지 부분이며, 클라이언트 코드와 함께 쓸 수 있는 경우와 없는 경우에 대한 규칙이 있습니다.
오류 페이지도 다루나요?
네. 오류 페이지, 전역 오류, 찾을 수 없음 페이지에 관한 규칙을 포함합니다.
상세 정보
작성자의 원본 설명
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
인기도
- GitHub 스타
- 7.2k
- 순위
- #13310
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
kiranism-shadcn-dashboard
7.2k에이전트가 Next.js 관리자 대시보드에 페이지, 표, 양식, 내비게이션, 테마를 추가하고 템플릿 고유의 패턴을 따르도록 돕습니다.
tanstack-form
7.2k에이전트가 React와 다른 프레임워크에서 필드 검사, 반복 필드, 스키마 검증을 갖춘 타입 안전한 폼을 만들도록 돕습니다.
tanstack-query
7.2k에이전트가 React 앱에서 TanStack Query로 데이터를 불러오고 업데이트하도록 돕습니다. Suspense 로딩, 캐싱, 데이터 변경을 포함합니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.