Next.js + TypeScript + Tailwind CSS + Biome + pnpm + shadcn/ui 기반 프로젝트 초기화. "/init", "/init my-app" 등의 요청 시 사용합니다.
인터랙티브하게 옵션을 선택하며 Next.js 프로젝트를 생성합니다.
AskUserQuestion으로 다음을 질문합니다. $ARGUMENTS가 있으면 프로젝트 이름 질문은 스킵합니다.
질문 1 (프로젝트 이름, $ARGUMENTS 없을 때만):
질문 2 (추가 옵션, multiSelect: true):
질문 3 (src 디렉토리):
pnpm create next-app@latest <project-name> \
--typescript --tailwind --eslint=false \
--app --import-alias="@/*" \
--use-pnpm --turbopack \
[--src-dir | --no-src-dir]
--src-dir 또는 --no-src-dir는 인터뷰 응답에 따라 결정# ESLint 관련 패키지 제거 (존재하는 것만)
pnpm remove eslint eslint-config-next @eslint/eslintrc 2>/dev/null || true
# .eslintrc* 파일 제거
rm -f .eslintrc* eslint.config.*
# Biome 설치
pnpm add -D @biomejs/biome
# biome.json 생성
pnpm biome init
biome.json을 다음과 같이 커스터마이즈:
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
biome.json의
$schema버전은pnpm biome init이 생성한 값을 유지합니다.
package.json scripts에 추가:
{
"lint": "biome check .",
"lint:fix": "biome check --write .",
"format": "biome format --write ."
}
pnpm dlx shadcn@latest init -d
pnpm add -D lefthook
pnpm lefthook install
lefthook.yml 생성:
pre-commit:
commands:
check:
glob: "*.{js,ts,jsx,tsx,json,css}"
run: pnpm biome check --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
stage_fixed: true
pnpm add @t3-oss/env-nextjs zod
src/env.ts (또는 env.ts) 생성:
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
server: {},
client: {},
runtimeEnv: {},
});
pnpm add next-themes
src/components/theme-provider.tsx (또는 components/theme-provider.tsx) 생성:
"use client";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import type { ComponentProps } from "react";
export function ThemeProvider({
children,
...props
}: ComponentProps<typeof NextThemesProvider>) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
layout.tsx에 ThemeProvider 적용:
import { ThemeProvider } from "@/components/theme-provider";
// body 내부를 ThemeProvider로 감싸기
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
{children}
</ThemeProvider>
globals.css: Tailwind 지시어만 남기고 나머지 삭제
@import "tailwindcss";
page.tsx: 기본 보일러플레이트를 심플한 내용으로 교체
export default function Home() {
return (
<div className="flex min-h-svh items-center justify-center">
<h1 className="text-4xl font-bold">Hello, World!</h1>
</div>
);
}
layout.tsx: 불필요한 font import나 metadata 외 보일러플레이트 정리README.md: 프로젝트명으로 업데이트.gitignore 확인하여 누락된 항목 추가 (.env*.local 등)public/ 내 기본 SVG 파일 삭제pnpm biome check --write .
git add -A && git commit -m "chore: 프로젝트 초기화"
src/env.ts vs env.ts)pnpm create next-app이 실패하면 사용자에게 Node.js/pnpm 설치 확인 요청Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer