nextjs15-init
Use when user wants to create a new Next.js 15 project (Todo/Blog/Dashboard/E-commerce/Custom domain) with App Router, ShadCN, Zustand, Tanstack Query, and modern Next.js stack
$ Installieren
git clone https://github.com/bear2u/my-skills /tmp/my-skills && cp -r /tmp/my-skills/.claude/skills/nextjs15-init ~/.claude/skills/my-skills// tip: Run this command in your terminal to install the skill
name: nextjs15-init description: Use when user wants to create a new Next.js 15 project (Todo/Blog/Dashboard/E-commerce/Custom domain) with App Router, ShadCN, Zustand, Tanstack Query, and modern Next.js stack
NextJS 15 Init Skill
๋๋ฉ์ธ ๊ธฐ๋ฐ Next.js 15 ํ๋ก์ ํธ๋ฅผ ์์ฑํ๊ณ ํ๋์ ์ธ ์คํ์ผ๋ก ์๋ ์ค์ ํฉ๋๋ค. Todo, Blog, Dashboard, E-commerce ๋๋ Custom ๋๋ฉ์ธ์ ์ ํํ์ฌ App Router ๊ธฐ๋ฐ์ ์์ ํ CRUD ์ฑ์ ์ฆ์ ์์ฑํ ์ ์์ต๋๋ค.
Quick Start
์คํฌ ์คํ ์ ๋ค์ ์ ๋ณด๋ฅผ ์ ๋ ฅ๋ฐ์ต๋๋ค:
- ํด๋๋ช (์: my-todo-app)
- ํ๋ก์ ํธ๋ช (์: todo-app)
- ๋๋ฉ์ธ ์ ํ (Todo/Blog/Dashboard/E-commerce/Custom)
- ์คํ ํ๋ฆฌ์ (Minimal/Essential/Full Stack/Custom)
๊ทธ ํ ์๋์ผ๋ก ๋ค์ ๋จ๊ณ๊ฐ ์คํ๋ฉ๋๋ค:
# 1. Next.js 15 ํ๋ก์ ํธ ์์ฑ (App Router, TypeScript, Tailwind)
npx create-next-app@latest [ํด๋๋ช
] --typescript --tailwind --app --use-npm
# 2. ํจํค์ง ์ค์น
npm install
# 3. ๋๋ฉ์ธ๋ณ App Router ๊ตฌ์กฐ ์๋ ์์ฑ
# - app/[domain]/ (ํ์ด์ง)
# - components/[domain]/ (์ปดํฌ๋ํธ)
# - lib/stores/[domain].ts (Zustand ์คํ ์ด)
# - lib/api/[domain].ts (API ๋ก์ง)
# - lib/validations/[domain].ts (Zod ์คํค๋ง)
# 4. ์ฝ๋ ํ์ง ๊ฒ์ฆ (ํ์)
npm run lint
# 5. ๊ฐ๋ฐ ์๋ฒ ์คํ
npm run dev
Task Instructions
IMPORTANT: ์ด ์คํฌ์ ๋ํํ์ผ๋ก ์งํ๋ฉ๋๋ค.
Step 1: ๋๋ฉ์ธ ๋ฐ ํ๋ก์ ํธ ์ค์ ์ง๋ฌธ
๋จผ์ ์ฌ์ฉ์์๊ฒ ์ด๋ ๊ฒ ๋ฌผ์ด๋ณด์ธ์:
"Next.js 15 ์ฑ์ ์์ฑํฉ๋๋ค. ๋ค์ ์ ๋ณด๋ฅผ ์๋ ค์ฃผ์ธ์:
1. ๋๋ฉ์ธ(์ํฐํฐ) ์ ํ
์ด๋ค ๋๋ฉ์ธ์ ์ฑ์ ๋ง๋์๊ฒ ์ต๋๊น?
A) Todo (ํ ์ผ ๊ด๋ฆฌ)
- ํ๋: title, description, completed, createdAt, updatedAt
- ๊ธฐ๋ฅ: CRUD, ํํฐ๋ง(์ ์ฒด/์งํ์ค/์๋ฃ), ์ฒดํฌ๋ฐ์ค ํ ๊ธ
- API: /api/todos (GET, POST, PATCH, DELETE)
B) Blog (๋ธ๋ก๊ทธ/CMS)
- ํ๋: title, content, excerpt, slug, published, createdAt, updatedAt
- ๊ธฐ๋ฅ: CRUD, ๊ธ ์์ฑ/์์ , ๋ชฉ๋ก/์์ธ ํ์ด์ง, ๊ฒ์
- API: /api/posts (GET, POST, PATCH, DELETE)
C) Dashboard (๋์๋ณด๋/์ด๋๋ฏผ)
- ํ๋: ํต๊ณ, ์ฐจํธ ๋ฐ์ดํฐ, ์ฌ์ฉ์ ๊ด๋ฆฌ
- ๊ธฐ๋ฅ: ๋ฐ์ดํฐ ์๊ฐํ, ํ ์ด๋ธ, ํํฐ๋ง, ํ์ด์ง๋ค์ด์
- API: /api/analytics, /api/users
D) E-commerce (์ผํ๋ชฐ)
- ํ๋: name, price, description, images, stock, category
- ๊ธฐ๋ฅ: ์ํ ๋ชฉ๋ก/์์ธ, ์ฅ๋ฐ๊ตฌ๋, ์ฃผ๋ฌธ
- API: /api/products, /api/cart, /api/orders
E) Custom (์ง์ ์ ์)
- ์ํฐํฐ๋ช ๊ณผ ํ๋๋ฅผ ์ง์ ์ ๋ ฅ
2. ํ๋ก์ ํธ ์ ๋ณด
- ํด๋๋ช
: ํ๋ก์ ํธ๋ฅผ ์์ฑํ ํด๋ ์ด๋ฆ (๊ธฐ๋ณธ๊ฐ: [๋๋ฉ์ธ]-app, ์: todo-app)
- ์ด ํด๋์ Next.js ํ๋ก์ ํธ๊ฐ ์์ฑ๋ฉ๋๋ค
- ํ๋ก์ ํธ๋ช
: Next.js ํ๋ก์ ํธ ์ด๋ฆ (๊ธฐ๋ณธ๊ฐ: ํด๋๋ช
๊ณผ ๋์ผ)
- package.json์ name ํ๋์ ์ฌ์ฉ๋ฉ๋๋ค
3. ์คํ ํ๋ฆฌ์ ์ ํ
๋ค์ ์ค ํ๋๋ฅผ ์ ํํด์ฃผ์ธ์:
A) Essential (๊ถ์ฅ)
- โ Next.js 15 (App Router)
- โ TypeScript
- โ Tailwind CSS
- โ ShadCN/ui (UI ์ปดํฌ๋ํธ)
- โ Zustand (ํด๋ผ์ด์ธํธ ์ํ ๊ด๋ฆฌ)
- โ React Hook Form + Zod (ํผ ๊ด๋ฆฌ + ๊ฒ์ฆ)
- โ Lucide Icons
- โ Tanstack Query ์ ์ธ
- โ Prisma ์ ์ธ
- โ NextAuth ์ ์ธ
B) Minimal (๊ฐ์ฅ ๋จ์)
- โ Next.js 15 (App Router)
- โ TypeScript
- โ Tailwind CSS
- โ ShadCN ์ ์ธ
- โ Zustand ์ ์ธ
- โ React Hook Form ์ ์ธ
- โ ๊ธฐํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ์ธ
C) Full Stack (๋ชจ๋ ๊ธฐ๋ฅ)
- โ Next.js 15 (App Router)
- โ TypeScript
- โ Tailwind CSS
- โ ShadCN/ui
- โ Zustand (ํด๋ผ์ด์ธํธ ์ํ)
- โ Tanstack Query (์๋ฒ ์ํ)
- โ React Hook Form + Zod
- โ Drizzle ORM (TypeScript-first ORM)
- โ Better Auth (์ธ์ฆ)
- โ Framer Motion (์ ๋๋ฉ์ด์ )
- โ Lucide Icons
D) Custom (์ง์ ์ ํ)
- ๊ฐ ๊ธฐ๋ฅ์ ๊ฐ๋ณ์ ์ผ๋ก ์ ํ
์ด๋ค ๋๋ฉ์ธ๊ณผ ํ๋ฆฌ์ ์ ์ ํํ์๊ฒ ์ต๋๊น? (๋๋ฉ์ธ: A/B/C/D/E, ํ๋ฆฌ์ : A/B/C/D)"
Step 2: Custom ์ ํ ์ ์ถ๊ฐ ์ง๋ฌธ
2-1. Custom ๋๋ฉ์ธ (E) ์ ํ ์:
- ์ํฐํฐ๋ช : ์ํฐํฐ ์ด๋ฆ์ ์ ๋ ฅํ์ธ์ (์: Product, Post, User)
- ํ๋ ์ ์: ๊ฐ ํ๋๋ฅผ ์
๋ ฅํ์ธ์ (ํ์: ํ๋๋ช
:ํ์
, ์: title:string, price:number, isActive:boolean)
- ์ง์ ํ์ : string, number, boolean, Date
- createdAt, updatedAt์ ์๋ ์ถ๊ฐ๋จ
- ์ฃผ์ ๊ธฐ๋ฅ: ํํฐ๋ง/์ ๋ ฌ ๊ธฐ์ค์ด ๋ ํ๋๋ฅผ ์ ํํ์ธ์
2-2. Custom ์คํ ํ๋ฆฌ์ (D) ์ ํ ์:
๋ค์ ์ง๋ฌธ๋ค์ ์์ฐจ์ ์ผ๋ก ํ์ธ์:
- UI ์ปดํฌ๋ํธ: ShadCN/ui๋ฅผ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
- ์ํ ๊ด๋ฆฌ: Zustand๋ฅผ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
- ์๋ฒ ์ํ: Tanstack Query๋ฅผ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
- ํผ ๊ด๋ฆฌ: React Hook Form + Zod๋ฅผ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
- ๋ฐ์ดํฐ๋ฒ ์ด์ค: Drizzle ORM์ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
- ์ธ์ฆ: Better Auth๋ฅผ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
- ์ ๋๋ฉ์ด์ : Framer Motion์ ์ฌ์ฉํ์๊ฒ ์ต๋๊น? (์/์๋์ค)
Step 3: ์ ํ๋ ๋๋ฉ์ธ๊ณผ ์คํ์ ๋ฐ๋ผ ํ๋ก์ ํธ ์์ฑ
-
Next.js 15 ํ๋ก์ ํธ ์์ฑ:
- ์ฌ์ฉ์๊ฐ ์ง์ ํ ํด๋๋ช ์ผ๋ก ํ๋ก์ ํธ ์์ฑ
- ๋ช
๋ น์ด:
npx create-next-app@latest [ํด๋๋ช ] --typescript --tailwind --app --use-npm - ํด๋๋ช
๊ณผ ํ๋ก์ ํธ๋ช
์ด ๋ค๋ฅธ ๊ฒฝ์ฐ, ์์ฑ ํ package.json์
nameํ๋๋ฅผ ์์
-
์ ํ๋ ํจํค์ง ์ค์น:
npm install [ํจํค์ง๋ค] -
ํด๋ ๊ตฌ์กฐ ์์ฑ: App Router ๊ธฐ๋ฐ ๊ตฌ์กฐ
app/ โโโ (auth)/ โโโ [domain]/ โโโ api/[domain]/ โโโ layout.tsx โโโ page.tsx components/ โโโ ui/ (ShadCN) โโโ [domain]/ โโโ layouts/ lib/ โโโ db/ (Prisma) โโโ stores/ (Zustand) โโโ api/ โโโ utils/ โโโ validations/ (Zod) -
๋๋ฉ์ธ๋ณ ๋ณด์ผ๋ฌํ๋ ์ดํธ ์์ฑ:
A) Todo: title, description, completed, createdAt, updatedAt
- API Routes: /api/todos (CRUD)
- Pages: /todos (๋ฆฌ์คํธ), /todos/[id] (์์ธ)
- Components: TodoList, TodoItem, TodoForm
- Store: useTodoStore (Zustand)
- Validation: todoSchema (Zod)
B) Blog: title, content, excerpt, slug, published, createdAt, updatedAt
- API Routes: /api/posts (CRUD)
- Pages: /blog (๋ชฉ๋ก), /blog/[slug] (์์ธ), /blog/write (์์ฑ)
- Components: PostList, PostCard, PostEditor
- Store: usePostStore (Zustand)
- Validation: postSchema (Zod)
C) Dashboard: ํต๊ณ, ์ฐจํธ, ์ฌ์ฉ์ ๊ด๋ฆฌ
- API Routes: /api/analytics, /api/users
- Pages: /dashboard (๋ฉ์ธ), /dashboard/users (์ฌ์ฉ์)
- Components: Chart, StatsCard, DataTable
- Store: useDashboardStore (Zustand)
- Validation: userSchema (Zod)
D) E-commerce: name, price, description, images, stock, category
- API Routes: /api/products, /api/cart, /api/orders
- Pages: /products (๋ชฉ๋ก), /products/[id] (์์ธ), /cart (์ฅ๋ฐ๊ตฌ๋)
- Components: ProductCard, ProductGrid, Cart
- Store: useCartStore, useProductStore (Zustand)
- Validation: productSchema, cartSchema (Zod)
E) Custom: ์ฌ์ฉ์ ์ ์ ํ๋
- API Routes: ๊ธฐ๋ณธ CRUD
- Pages: ๊ธฐ๋ณธ List/Detail
- Components: ๊ธฐ๋ณธ CRUD ์ปดํฌ๋ํธ
- Store: ๊ธฐ๋ณธ store
- Validation: ๊ธฐ๋ณธ schema
-
ShadCN ์ค์น ๋ฐ ๊ตฌ์ฑ (Essential ์ด์):
npx shadcn@latest init npx shadcn@latest add button card input form table -
์ฝ๋ ๊ฒ์ฆ ๋ฐ ์ค๋ฅ ์์ :
a.
npm run lint์คํb. ๋ฐ๊ฒฌ๋ ์ค๋ฅ ์์ :
- Import ๊ฒฝ๋ก: @/ alias ์ฌ์ฉ (tsconfig.json ์ค์ )
- TypeScript ํ์ : ๋ชจ๋ ํ์ ๋ช ์
- ESLint ๊ท์น: ์ฌ์ฉํ์ง ์๋ ๋ณ์, import ์ ๊ฑฐ
- Next.js ๊ท์น: metadata, generateStaticParams ๋ฑ
- 'use client' ์ง์์ด: useState, useEffect ๋ฑ React Hooks ์ฌ์ฉ ์ ํ์ผ ์ต์๋จ์ ์ถ๊ฐ
c.
npm run build๋๋pnpm build์คํd. ๋น๋ ์ค๋ฅ ์์ :
- TypeScript ํ์ ์ค๋ฅ: ํ์ ๋ถ์ผ์น, nullable ์ฒดํฌ ๋๋ฝ ๋ฑ
- ๋ชจ๋ import ์ค๋ฅ: ๊ฒฝ๋ก ํ์ธ, ํจํค์ง ์ค์น ํ์ธ
- Server/Client Component ์ค๋ฅ: ์ ์ ํ 'use client' ์ง์์ด ์ถ๊ฐ
- Dynamic import ์ค๋ฅ: server-only ์ฝ๋๊ฐ ํด๋ผ์ด์ธํธ์์ ์ฌ์ฉ๋์ง ์๋๋ก ํ์ธ
e. ์ฌ๊ฒ์ฆ: lint์ build ๋ชจ๋ ์ฑ๊ณตํ ๋๊น์ง ๋ฐ๋ณต
f. ๋ชฉํ:
npm run lint๊ฒฐ๊ณผ๊ฐ "0 errors"npm run build๋๋pnpm build์ฑ๊ณต
โ CRITICAL: ์ด ๋จ๊ณ๋ ํ์์ ๋๋ค. lint์ build ๋ชจ๋ ์ฑ๊ณตํด์ผ ๋ค์ ๋จ๊ณ๋ก ์งํํ ์ ์์ต๋๋ค.
Step 4: ์ต์ข ๊ฒ์ฆ ๋ฐ ์๋ด
โ CRITICAL: ์ด ๋จ๊ณ๋ ํ๋ก์ ํธ ์๋ฃ์ ํ์ ์กฐ๊ฑด์ ๋๋ค. lint์ build ๋ชจ๋ ์ฑ๊ณตํด์ผ ํฉ๋๋ค.
-
ESLint ๊ฒ์ฆ:
npm run lint-
โ ์ฑ๊ณต ์์:
โ No ESLint warnings or errors -
โ ์คํจ ์์ (error๊ฐ ์์ผ๋ฉด ๋ฐ๋์ ์์ ):
Error: 'useState' is defined but never used Error: Missing return type on function
-
-
ํ๋ก๋์ ๋น๋ ๊ฒ์ฆ:
npm run build๋๋ pnpm ์ฌ์ฉ ์:
pnpm build-
โ ์ฑ๊ณต ์์:
โ Compiled successfully โ Linting and checking validity of types โ Collecting page data โ Generating static pages -
โ ์คํจ ์์ (๋น๋ ์๋ฌ ๋ฐ์ ์ ๋ฐ๋์ ์์ ):
Type error: Property 'xyz' does not exist on type 'ABC' Error: Module not found: Can't resolve '@/...'
์ค์: ๋น๋๊ฐ ์คํจํ๋ฉด TypeScript ํ์ ์ค๋ฅ๋ import ๊ฒฝ๋ก ๋ฌธ์ ๋ฅผ ์์ ํ๊ณ ๋ค์ ๋น๋ํด์ผ ํฉ๋๋ค.
-
-
๊ฒ์ฆ ๊ฒฐ๊ณผ ์์ฝ (lint์ build ๋ชจ๋ ์ฑ๊ณต ์):
โ Next.js 15 ํ๋ก์ ํธ ์์ฑ ์๋ฃ! โ ํจํค์ง ์ค์น ์๋ฃ (ShadCN, Zustand, Tanstack Query ๋ฑ) โ ESLint ๊ฒ์ฆ ํต๊ณผ (0 errors) โ TypeScript ๋น๋ ์ฑ๊ณต โ ํ๋ก๋์ ๋น๋ ์๋ฃ -
ํ๋ก์ ํธ ์ ๋ณด ์ ๊ณต:
- ํด๋๋ช : [์ฌ์ฉ์ ์ ๋ ฅ๊ฐ] (์: my-todo-app)
- ํ๋ก์ ํธ๋ช : [์ฌ์ฉ์ ์ ๋ ฅ๊ฐ] (์: todo-app)
- ๋๋ฉ์ธ: [์ ํ๋ ๋๋ฉ์ธ] (Todo/Blog/Dashboard/E-commerce/Custom)
- ์ ํ๋ ์คํ: [ํ๋ฆฌ์ ๋ช ] (ShadCN, Zustand, Tanstack Query ๋ฑ)
- ์ฃผ์ ๊ธฐ๋ฅ: [๋๋ฉ์ธ] CRUD, API Routes, ํ์ ์์ ์ฑ
- ์์ฑ๋ ํ์ผ: XX๊ฐ TypeScript ํ์ผ (app, components, lib)
-
์คํ ๋ฐฉ๋ฒ ์๋ด:
cd [ํด๋๋ช ] npm run dev # http://localhost:3000 ์์ ํ์ธ -
๋ค์ ๋จ๊ณ ์ ์ (์ ํ์ฌํญ, ๋๋ฉ์ธ๋ณ):
- Todo: ํญ๋ชฉ ์ถ๊ฐ/์์ /์ญ์ , ํํฐ๋ง(์ ์ฒด/์งํ์ค/์๋ฃ), ์๋ฃ ํ ๊ธ
- Blog: ๊ธ ์์ฑ/์์ , ๋ชฉ๋ก/์์ธ ํ์ด์ง, ๊ฒ์, ํ๊ทธ
- Dashboard: ๋ฐ์ดํฐ ์๊ฐํ, ์ฐจํธ, ์ฌ์ฉ์ ๊ด๋ฆฌ, ํํฐ๋ง
- E-commerce: ์ํ ๋ชฉ๋ก/์์ธ, ์ฅ๋ฐ๊ตฌ๋, ์ฃผ๋ฌธ, ์นดํ ๊ณ ๋ฆฌ
- ๊ณตํต: TypeScript ํ์ ์์ ์ฑ, API ํ ์คํธ, ๋ฐฐํฌ (Vercel)
Core Principles
- App Router: Next.js 15 App Router ๊ธฐ๋ฐ ๊ตฌ์กฐ
- ํ์ ์์ ์ฑ: TypeScript Strict Mode
- ์ปดํฌ๋ํธ ์ฌ์ฌ์ฉ: ShadCN/ui ํ์ฉ
- ์ํ ๊ด๋ฆฌ: Zustand (ํด๋ผ์ด์ธํธ), Tanstack Query (์๋ฒ)
- ์ฝ๋ ํ์ง: ESLint + Prettier
- ํผ ๊ฒ์ฆ: React Hook Form + Zod
Reference Files
references/setup-guide.md - ์์ ํ ๊ฐ์ด๋
- ๊ธฐ๋ณธ ์ ์ (๋๋ฉ์ธ๋ณ CRUD, API Routes, ์ปดํฌ๋ํธ)
- ์ ํ ์ต์ : ShadCN, Zustand, Tanstack Query, Drizzle ORM, Better Auth, Framer Motion
Notes
- ๋ํํ ์คํฌ: ์ฌ์ฉ์์๊ฒ ๋๋ฉ์ธ๊ณผ ํ๋ฆฌ์ ์ ํ์ ํตํด ๋ง์ถคํ ์ฑ ๊ตฌ์ฑ
- ๋๋ฉ์ธ ์ง์: Todo, Blog, Dashboard, E-commerce, Custom (์ฌ์ฉ์ ์ ์)
- ํ๋ฆฌ์ ์ ๊ณต: Full Stack, Essential, Minimal, Custom
- ์ ํ ๊ฐ๋ฅ ๊ธฐ๋ฅ: ShadCN, Zustand, Tanstack Query, Drizzle ORM, Better Auth, Framer Motion
- ๊ธฐ๋ณธ ํฌํจ: Next.js 15 (App Router), TypeScript, Tailwind CSS, ESLint
- ํ๋ซํผ: Web (Vercel ์ต์ ํ)
- ํ์ง ๋ณด์ฆ:
- ๋ชจ๋ ํ๋ก์ ํธ๋
npm run lintํต๊ณผ ํ์ - TypeScript Strict Mode
- ํ์ ์์ ์ฑ ๋ณด์ฅ
- App Router ํจํด ์ค์
- ๋๋ฉ์ธ๋ณ ์ต์ ํ๋ UI/UX
- ๋ชจ๋ ํ๋ก์ ํธ๋
Repository
