@kood/claude-code 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/index.js +552 -340
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/document-writer.md +73 -306
  4. package/templates/.claude/instructions/agent-patterns/index.md +7 -7
  5. package/templates/.claude/instructions/document-templates/ralph-templates.md +71 -0
  6. package/templates/.claude/instructions/index.md +14 -14
  7. package/templates/.claude/instructions/multi-agent/agent-roster.md +14 -14
  8. package/templates/.claude/instructions/multi-agent/index.md +4 -4
  9. package/templates/.claude/skills/docs-creator/AGENTS.md +54 -176
  10. package/templates/.claude/skills/docs-creator/SKILL.md +98 -464
  11. package/templates/.claude/skills/docs-refactor/AGENTS.md +61 -190
  12. package/templates/.claude/skills/docs-refactor/SKILL.md +67 -443
  13. package/templates/.claude/skills/execute/SKILL.md +540 -13
  14. package/templates/.claude/skills/plan/SKILL.md +84 -18
  15. package/templates/.claude/skills/ralph/SKILL.md +17 -14
  16. package/templates/.claude/skills/refactor/AGENTS.md +269 -0
  17. package/templates/.claude/skills/refactor/SKILL.md +424 -66
  18. package/templates/.claude/skills/stitch-design/README.md +34 -0
  19. package/templates/.claude/skills/stitch-design/SKILL.md +213 -0
  20. package/templates/.claude/skills/stitch-design/examples/DESIGN.md +154 -0
  21. package/templates/.claude/skills/stitch-loop/README.md +54 -0
  22. package/templates/.claude/skills/stitch-loop/SKILL.md +316 -0
  23. package/templates/.claude/skills/stitch-loop/examples/SITE.md +73 -0
  24. package/templates/.claude/skills/stitch-loop/examples/next-prompt.md +25 -0
  25. package/templates/.claude/skills/stitch-loop/resources/baton-schema.md +61 -0
  26. package/templates/.claude/skills/stitch-loop/resources/site-template.md +104 -0
  27. package/templates/.claude/skills/stitch-react/README.md +36 -0
  28. package/templates/.claude/skills/stitch-react/SKILL.md +323 -0
  29. package/templates/.claude/skills/stitch-react/examples/gold-standard-card.tsx +88 -0
  30. package/templates/.claude/skills/stitch-react/package-lock.json +231 -0
  31. package/templates/.claude/skills/stitch-react/package.json +16 -0
  32. package/templates/.claude/skills/stitch-react/resources/architecture-checklist.md +15 -0
  33. package/templates/.claude/skills/stitch-react/resources/component-template.tsx +37 -0
  34. package/templates/.claude/skills/stitch-react/resources/stitch-api-reference.md +14 -0
  35. package/templates/.claude/skills/stitch-react/resources/style-guide.json +24 -0
  36. package/templates/.claude/skills/stitch-react/scripts/fetch-stitch.sh +30 -0
  37. package/templates/.claude/skills/stitch-react/scripts/validate.js +77 -0
  38. package/templates/hono/CLAUDE.md +28 -28
  39. package/templates/hono/docs/architecture.md +24 -24
  40. package/templates/hono/docs/deployment/cloudflare.md +18 -18
  41. package/templates/hono/docs/deployment/docker.md +13 -13
  42. package/templates/hono/docs/deployment/index.md +19 -19
  43. package/templates/hono/docs/deployment/railway.md +32 -32
  44. package/templates/hono/docs/deployment/vercel.md +29 -29
  45. package/templates/hono/docs/guides/conventions.md +57 -57
  46. package/templates/hono/docs/guides/env-setup.md +47 -47
  47. package/templates/hono/docs/guides/getting-started.md +27 -27
  48. package/templates/hono/docs/library/hono/error-handling.md +11 -11
  49. package/templates/hono/docs/library/hono/index.md +4 -4
  50. package/templates/hono/docs/library/hono/middleware.md +18 -18
  51. package/templates/hono/docs/library/hono/rpc.md +7 -7
  52. package/templates/hono/docs/library/hono/validation.md +6 -6
  53. package/templates/hono/docs/library/prisma/cloudflare-d1.md +29 -29
  54. package/templates/hono/docs/library/prisma/config.md +16 -16
  55. package/templates/hono/docs/library/prisma/index.md +32 -32
  56. package/templates/hono/docs/library/t3-env/index.md +22 -22
  57. package/templates/hono/docs/library/zod/index.md +31 -31
  58. package/templates/nextjs/CLAUDE.md +54 -54
  59. package/templates/nextjs/docs/architecture.md +146 -146
  60. package/templates/nextjs/docs/design.md +183 -183
  61. package/templates/nextjs/docs/guides/conventions.md +86 -86
  62. package/templates/nextjs/docs/guides/getting-started.md +28 -28
  63. package/templates/nextjs/docs/guides/routes.md +32 -32
  64. package/templates/nextjs/docs/library/better-auth/index.md +70 -70
  65. package/templates/nextjs/docs/library/nextjs/app-router.md +43 -43
  66. package/templates/nextjs/docs/library/nextjs/caching.md +73 -73
  67. package/templates/nextjs/docs/library/nextjs/index.md +51 -51
  68. package/templates/nextjs/docs/library/nextjs/middleware.md +41 -41
  69. package/templates/nextjs/docs/library/nextjs/route-handlers.md +31 -31
  70. package/templates/nextjs/docs/library/nextjs/server-actions.md +34 -34
  71. package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +20 -20
  72. package/templates/nextjs/docs/library/prisma/config.md +18 -18
  73. package/templates/nextjs/docs/library/prisma/crud.md +17 -17
  74. package/templates/nextjs/docs/library/prisma/index.md +18 -18
  75. package/templates/nextjs/docs/library/prisma/relations.md +16 -16
  76. package/templates/nextjs/docs/library/prisma/schema.md +23 -23
  77. package/templates/nextjs/docs/library/prisma/setup.md +6 -6
  78. package/templates/nextjs/docs/library/prisma/transactions.md +10 -10
  79. package/templates/nextjs/docs/library/tanstack-query/index.md +6 -6
  80. package/templates/nextjs/docs/library/tanstack-query/invalidation.md +20 -20
  81. package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +4 -4
  82. package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +15 -15
  83. package/templates/nextjs/docs/library/tanstack-query/use-query.md +22 -22
  84. package/templates/nextjs/docs/library/zod/complex-types.md +11 -11
  85. package/templates/nextjs/docs/library/zod/index.md +8 -8
  86. package/templates/nextjs/docs/library/zod/transforms.md +11 -11
  87. package/templates/nextjs/docs/library/zod/validation.md +9 -9
  88. package/templates/npx/CLAUDE.md +38 -38
  89. package/templates/npx/docs/library/commander/index.md +12 -12
  90. package/templates/npx/docs/library/fs-extra/index.md +9 -9
  91. package/templates/npx/docs/library/prompts/index.md +3 -3
  92. package/templates/npx/docs/references/patterns.md +12 -12
  93. package/templates/tanstack-start/CLAUDE.md +54 -54
  94. package/templates/tanstack-start/docs/architecture.md +128 -128
  95. package/templates/tanstack-start/docs/design.md +169 -169
  96. package/templates/tanstack-start/docs/guides/conventions.md +43 -43
  97. package/templates/tanstack-start/docs/guides/env-setup.md +35 -35
  98. package/templates/tanstack-start/docs/guides/getting-started.md +19 -19
  99. package/templates/tanstack-start/docs/guides/hooks.md +45 -45
  100. package/templates/tanstack-start/docs/guides/routes.md +54 -54
  101. package/templates/tanstack-start/docs/guides/services.md +45 -45
  102. package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +19 -19
  103. package/templates/tanstack-start/docs/library/prisma/config.md +16 -16
  104. package/templates/tanstack-start/docs/library/prisma/crud.md +17 -17
  105. package/templates/tanstack-start/docs/library/prisma/relations.md +16 -16
  106. package/templates/tanstack-start/docs/library/prisma/schema.md +23 -23
  107. package/templates/tanstack-start/docs/library/prisma/setup.md +6 -6
  108. package/templates/tanstack-start/docs/library/prisma/transactions.md +10 -10
  109. package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +19 -19
  110. package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +4 -4
  111. package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +14 -14
  112. package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +21 -21
  113. package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +9 -9
  114. package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +11 -11
  115. package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +17 -17
  116. package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +5 -5
  117. package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +10 -10
  118. package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +8 -8
  119. package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +9 -9
  120. package/templates/tanstack-start/docs/library/tanstack-start/routing.md +6 -6
  121. package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +18 -18
  122. package/templates/tanstack-start/docs/library/tanstack-start/setup.md +4 -4
  123. package/templates/tanstack-start/docs/library/zod/complex-types.md +11 -11
  124. package/templates/tanstack-start/docs/library/zod/transforms.md +11 -11
  125. package/templates/tanstack-start/docs/library/zod/validation.md +9 -9
@@ -1,13 +1,13 @@
1
1
  # Routes
2
2
 
3
- > Next.js App Router routing patterns
3
+ > Next.js App Router 라우팅 패턴
4
4
 
5
5
  ---
6
6
 
7
- ## Basic Routing
7
+ ## 기본 라우팅
8
8
 
9
- | File | Route |
10
- |------|-------|
9
+ | 파일 | 라우트 |
10
+ |------|--------|
11
11
  | `app/page.tsx` | `/` |
12
12
  | `app/about/page.tsx` | `/about` |
13
13
  | `app/blog/page.tsx` | `/blog` |
@@ -15,9 +15,9 @@
15
15
 
16
16
  ---
17
17
 
18
- ## Dynamic Routes
18
+ ## 동적 라우트
19
19
 
20
- ### Single Parameter
20
+ ### 단일 파라미터
21
21
 
22
22
  ```typescript
23
23
  // app/posts/[id]/page.tsx
@@ -33,7 +33,7 @@ export default async function PostPage({ params }: PageProps) {
33
33
  return <article>{post.title}</article>
34
34
  }
35
35
 
36
- // Static generation
36
+ // 정적 생성
37
37
  export async function generateStaticParams() {
38
38
  const posts = await prisma.post.findMany({ select: { id: true } })
39
39
  return posts.map(post => ({ id: post.id }))
@@ -57,9 +57,9 @@ export default function DocsPage({ params }: PageProps) {
57
57
 
58
58
  ---
59
59
 
60
- ## Layouts
60
+ ## 레이아웃
61
61
 
62
- ### Root Layout (required)
62
+ ### Root Layout (필수)
63
63
 
64
64
  ```typescript
65
65
  // app/layout.tsx
@@ -67,7 +67,7 @@ import { Providers } from "./providers"
67
67
 
68
68
  export default function RootLayout({ children }: { children: React.ReactNode }) {
69
69
  return (
70
- <html lang="en">
70
+ <html lang="ko">
71
71
  <body>
72
72
  <Providers>{children}</Providers>
73
73
  </body>
@@ -76,7 +76,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
76
76
  }
77
77
  ```
78
78
 
79
- ### Nested Layout
79
+ ### 중첩 Layout
80
80
 
81
81
  ```typescript
82
82
  // app/dashboard/layout.tsx
@@ -85,7 +85,7 @@ import { headers } from "next/headers"
85
85
  import { redirect } from "next/navigation"
86
86
 
87
87
  export default async function DashboardLayout({ children }: { children: React.ReactNode }) {
88
- // Auth check
88
+ // 인증 체크
89
89
  const session = await auth.api.getSession({ headers: headers() })
90
90
  if (!session?.user) redirect("/login")
91
91
 
@@ -115,7 +115,7 @@ app/
115
115
  └── page.tsx # /products
116
116
  ```
117
117
 
118
- **Purpose:** Apply different layouts without affecting URLs
118
+ **용도:** URL에 영향 없이 다른 레이아웃 적용
119
119
 
120
120
  ---
121
121
 
@@ -139,8 +139,8 @@ export default function Loading() {
139
139
  export default function Error({ error, reset }: { error: Error; reset: () => void }) {
140
140
  return (
141
141
  <div>
142
- <h2>Error: {error.message}</h2>
143
- <button onClick={reset}>Try again</button>
142
+ <h2>오류 발생: {error.message}</h2>
143
+ <button onClick={reset}>다시 시도</button>
144
144
  </div>
145
145
  )
146
146
  }
@@ -151,7 +151,7 @@ export default function Error({ error, reset }: { error: Error; reset: () => voi
151
151
  ```typescript
152
152
  // app/posts/[id]/not-found.tsx
153
153
  export default function NotFound() {
154
- return <div>Post not found</div>
154
+ return <div>게시글을 찾을 수 없습니다</div>
155
155
  }
156
156
  ```
157
157
 
@@ -159,7 +159,7 @@ export default function NotFound() {
159
159
 
160
160
  ## Metadata
161
161
 
162
- ### Static
162
+ ### 정적
163
163
 
164
164
  ```typescript
165
165
  // app/about/page.tsx
@@ -175,7 +175,7 @@ export default function AboutPage() {
175
175
  }
176
176
  ```
177
177
 
178
- ### Dynamic
178
+ ### 동적
179
179
 
180
180
  ```typescript
181
181
  // app/posts/[id]/page.tsx
@@ -204,7 +204,7 @@ export async function generateMetadata({ params }: { params: { id: string } }):
204
204
 
205
205
  ---
206
206
 
207
- ## Navigation
207
+ ## 네비게이션
208
208
 
209
209
  ### Link
210
210
 
@@ -242,9 +242,9 @@ export function LoginButton() {
242
242
 
243
243
  ---
244
244
 
245
- ## Auth Protection
245
+ ## 인증 보호
246
246
 
247
- ### Check in Layout
247
+ ### Layout에서 체크
248
248
 
249
249
  ```typescript
250
250
  // app/dashboard/layout.tsx
@@ -263,7 +263,7 @@ export default async function DashboardLayout({ children }: { children: React.Re
263
263
  }
264
264
  ```
265
265
 
266
- ### Check in Middleware
266
+ ### Middleware에서 체크
267
267
 
268
268
  ```typescript
269
269
  // middleware.ts
@@ -288,25 +288,25 @@ export const config = {
288
288
 
289
289
  ---
290
290
 
291
- ## Best Practices
291
+ ## 베스트 프랙티스
292
292
 
293
293
  ### ✅ DO
294
294
 
295
295
  ```typescript
296
- // 1. Direct data fetching in Server Components
296
+ // 1. Server Component에서 직접 데이터 페칭
297
297
  export default async function PostsPage() {
298
298
  const posts = await prisma.post.findMany()
299
299
  return <PostsList posts={posts} />
300
300
  }
301
301
 
302
- // 2. Auth check in layout
302
+ // 2. 레이아웃에서 인증 체크
303
303
  export default async function DashboardLayout({ children }) {
304
304
  const session = await auth.api.getSession({ headers: headers() })
305
305
  if (!session?.user) redirect("/login")
306
306
  return <div>{children}</div>
307
307
  }
308
308
 
309
- // 3. Static generation with generateStaticParams
309
+ // 3. generateStaticParams로 정적 생성
310
310
  export async function generateStaticParams() {
311
311
  const posts = await prisma.post.findMany({ select: { id: true } })
312
312
  return posts.map(post => ({ id: post.id }))
@@ -316,26 +316,26 @@ export async function generateStaticParams() {
316
316
  ### ❌ DON'T
317
317
 
318
318
  ```typescript
319
- // 1. async/await in Client Components
319
+ // 1. Client Component에서 async/await
320
320
  "use client"
321
321
  export default async function PostsPage() { // ❌
322
322
  const posts = await prisma.post.findMany()
323
323
  return <PostsList posts={posts} />
324
324
  }
325
325
 
326
- // 2. Repeated auth checks per page
326
+ // 2. 페이지마다 인증 체크 반복
327
327
  export default async function Page1() {
328
- const session = await auth.api.getSession({ headers: headers() }) // ❌ Duplicate
328
+ const session = await auth.api.getSession({ headers: headers() }) // ❌ 중복
329
329
  if (!session) redirect("/login")
330
330
  }
331
331
 
332
- // 3. Hardcoded paths
333
- <Link href="/posts/123">Post</Link> // ❌ Hardcoded
332
+ // 3. 하드코딩된 경로
333
+ <Link href="/posts/123">Post</Link> // ❌ 하드코딩
334
334
  ```
335
335
 
336
336
  ---
337
337
 
338
- ## References
338
+ ## 참조
339
339
 
340
340
  - [App Router](../library/nextjs/app-router.md)
341
341
  - [Server Actions](server-actions.md)
@@ -15,7 +15,7 @@ npm install better-auth
15
15
  ## Minimal Setup
16
16
 
17
17
  ```typescript
18
- // src/lib/auth.ts - Server
18
+ // src/lib/auth.ts - 서버
19
19
  import { betterAuth } from "better-auth"
20
20
  import { prismaAdapter } from "better-auth/adapters/prisma"
21
21
  import { prisma } from "@/database/prisma"
@@ -25,7 +25,7 @@ export const auth = betterAuth({
25
25
  emailAndPassword: { enabled: true },
26
26
  })
27
27
 
28
- // src/lib/auth-client.ts - Client
28
+ // src/lib/auth-client.ts - 클라이언트
29
29
  import { createAuthClient } from "better-auth/react"
30
30
 
31
31
  export const authClient = createAuthClient({
@@ -55,17 +55,17 @@ export const POST = (request: Request) => auth.handler(request)
55
55
  |---------|--------|----------|
56
56
  | Prisma | `better-auth/adapters/prisma` | `postgresql`, `mysql`, `sqlite` |
57
57
  | Drizzle | `better-auth/adapters/drizzle` | `pg`, `mysql2`, `better-sqlite3` |
58
- | Kysely | `better-auth/adapters/kysely` | dialect-based |
58
+ | Kysely | `better-auth/adapters/kysely` | dialect 기반 |
59
59
 
60
60
  ## Auth Config
61
61
 
62
- | Option | Type | Default | Description |
63
- |--------|------|---------|-------------|
64
- | `database` | `Adapter` | required | Database adapter |
65
- | `baseURL` | `string` | `http://localhost:3000` | App URL |
66
- | `basePath` | `string` | `/api/auth` | Auth path |
67
- | `secret` | `string` | environment variable | JWT secret |
68
- | `trustedOrigins` | `string[]` | `[]` | CORS allowed origins |
62
+ | 옵션 | 타입 | 기본값 | 설명 |
63
+ |------|------|--------|------|
64
+ | `database` | `Adapter` | 필수 | DB 어댑터 |
65
+ | `baseURL` | `string` | `http://localhost:3000` | URL |
66
+ | `basePath` | `string` | `/api/auth` | Auth 경로 |
67
+ | `secret` | `string` | 환경변수 | JWT 시크릿 |
68
+ | `trustedOrigins` | `string[]` | `[]` | CORS 허용 오리진 |
69
69
 
70
70
  ## Social Providers
71
71
 
@@ -111,22 +111,22 @@ export const auth = betterAuth({
111
111
 
112
112
  ## Session Config
113
113
 
114
- | Option | Type | Default | Description |
115
- |--------|------|---------|-------------|
116
- | `expiresIn` | `number` | `604800` (7 days) | Session expiration time (seconds) |
117
- | `updateAge` | `number` | `86400` (1 day) | Session update interval (seconds) |
118
- | `cookieCache.enabled` | `boolean` | `true` | Enable cookie cache |
119
- | `cookieCache.maxAge` | `number` | `300` (5 min) | Cache validity (seconds) |
120
- | `cookieCache.strategy` | `'compact' \| 'jwt' \| 'jwe'` | `'compact'` | Cache strategy |
114
+ | 옵션 | 타입 | 기본값 | 설명 |
115
+ |------|------|--------|------|
116
+ | `expiresIn` | `number` | `604800` (7) | 세션 만료 시간 () |
117
+ | `updateAge` | `number` | `86400` (1) | 세션 갱신 주기 () |
118
+ | `cookieCache.enabled` | `boolean` | `true` | 쿠키 캐시 활성화 |
119
+ | `cookieCache.maxAge` | `number` | `300` (5) | 캐시 유효 시간 () |
120
+ | `cookieCache.strategy` | `'compact' \| 'jwt' \| 'jwe'` | `'compact'` | 캐시 전략 |
121
121
 
122
122
  ```typescript
123
123
  export const auth = betterAuth({
124
124
  session: {
125
- expiresIn: 604800, // 7 days
126
- updateAge: 86400, // Update every 1 day
125
+ expiresIn: 604800, // 7
126
+ updateAge: 86400, // 1일마다 갱신
127
127
  cookieCache: {
128
128
  enabled: true,
129
- maxAge: 300, // 5 minutes
129
+ maxAge: 300, // 5
130
130
  strategy: "compact",
131
131
  },
132
132
  },
@@ -136,11 +136,11 @@ export const auth = betterAuth({
136
136
  ## Session Methods
137
137
 
138
138
  ```typescript
139
- // ✅ Client
139
+ // ✅ 클라이언트
140
140
  const session = await authClient.getSession()
141
141
  const session = await authClient.getSession({ query: { disableCookieCache: true } })
142
142
 
143
- // ✅ Server (Server Component)
143
+ // ✅ 서버 (Server Component)
144
144
  import { auth } from "@/lib/auth"
145
145
  import { headers } from "next/headers"
146
146
 
@@ -151,7 +151,7 @@ export default async function Page() {
151
151
  return <div>Welcome {session.user.name}</div>
152
152
  }
153
153
 
154
- // ✅ Server (Server Action)
154
+ // ✅ 서버 (Server Action)
155
155
  "use server"
156
156
 
157
157
  import { auth } from "@/lib/auth"
@@ -162,10 +162,10 @@ export async function getSession() {
162
162
  return session
163
163
  }
164
164
 
165
- // ✅ Update session
165
+ // ✅ 세션 업데이트
166
166
  await authClient.updateUser({ name: "New Name" })
167
167
 
168
- // ✅ Logout
168
+ // ✅ 로그아웃
169
169
  await authClient.signOut()
170
170
  ```
171
171
 
@@ -207,30 +207,30 @@ export const auth = betterAuth({
207
207
  ## Email/Password
208
208
 
209
209
  ```typescript
210
- // ✅ Sign up
210
+ // ✅ 회원가입
211
211
  await authClient.signUp.email({
212
212
  email: "user@example.com",
213
213
  password: "password123",
214
214
  name: "User Name",
215
215
  })
216
216
 
217
- // ✅ Sign in
217
+ // ✅ 로그인
218
218
  await authClient.signIn.email({
219
219
  email: "user@example.com",
220
220
  password: "password123",
221
221
  })
222
222
 
223
- // ✅ Request password reset
223
+ // ✅ 비밀번호 재설정 요청
224
224
  await authClient.forgetPassword({ email: "user@example.com" })
225
225
 
226
- // ✅ Reset password
226
+ // ✅ 비밀번호 재설정
227
227
  await authClient.resetPassword({ token, password: "newpassword" })
228
228
  ```
229
229
 
230
230
  ## Social Login
231
231
 
232
232
  ```typescript
233
- // ✅ Social sign in
233
+ // ✅ 소셜 로그인
234
234
  await authClient.signIn.social({ provider: "google", callbackURL: "/dashboard" })
235
235
  await authClient.signIn.social({ provider: "github", callbackURL: "/dashboard" })
236
236
 
@@ -257,8 +257,8 @@ export const auth = betterAuth({
257
257
  html: `Your code: ${otp}`,
258
258
  })
259
259
  },
260
- period: 300, // 5 minutes
261
- length: 6, // 6 digits
260
+ period: 300, // 5
261
+ length: 6, // 6자리
262
262
  },
263
263
  backupCodeLength: 10,
264
264
  backupCodeCount: 10,
@@ -284,26 +284,26 @@ export const authClient = createAuthClient({
284
284
  ### 2FA Usage
285
285
 
286
286
  ```typescript
287
- // ✅ Enable TOTP
287
+ // ✅ TOTP 활성화
288
288
  const { data } = await authClient.twoFactor.enable({ password: "current-password" })
289
289
  // data: { totpURI: 'otpauth://...', backupCodes: ['ABCD-1234', ...] }
290
290
 
291
- // ✅ Verify TOTP
291
+ // ✅ TOTP 검증
292
292
  await authClient.twoFactor.verifyTotp({ code: "123456" })
293
293
 
294
- // ✅ Send OTP
294
+ // ✅ OTP 전송
295
295
  await authClient.twoFactor.sendOtp()
296
296
 
297
- // ✅ Verify OTP
297
+ // ✅ OTP 검증
298
298
  await authClient.twoFactor.verifyOtp({ code: "123456" })
299
299
 
300
- // ✅ Use backup code
300
+ // ✅ 백업 코드 사용
301
301
  await authClient.twoFactor.useBackupCode({ code: "ABCD-1234" })
302
302
 
303
- // ✅ Regenerate backup codes
303
+ // ✅ 백업 코드 재생성
304
304
  const { data } = await authClient.twoFactor.regenerateBackupCodes({ password: "current-password" })
305
305
 
306
- // ✅ Disable 2FA
306
+ // ✅ 2FA 비활성화
307
307
  await authClient.twoFactor.disable({ password: "current-password" })
308
308
  ```
309
309
 
@@ -315,35 +315,35 @@ await authClient.twoFactor.disable({ password: "current-password" })
315
315
 
316
316
  ## Plugin System
317
317
 
318
- | Plugin | Import | Feature |
319
- |--------|--------|---------|
320
- | `multiSession` | `better-auth/plugins` | Multi-session management |
321
- | `customSession` | `better-auth/plugins` | Extend session fields |
322
- | `twoFactor` | `better-auth/plugins` | Two-factor authentication |
323
- | `captcha` | `better-auth/plugins` | CAPTCHA validation |
318
+ | Plugin | Import | 기능 |
319
+ |--------|--------|------|
320
+ | `multiSession` | `better-auth/plugins` | 다중 세션 관리 |
321
+ | `customSession` | `better-auth/plugins` | 세션 필드 확장 |
322
+ | `twoFactor` | `better-auth/plugins` | 2단계 인증 |
323
+ | `captcha` | `better-auth/plugins` | CAPTCHA 검증 |
324
324
 
325
325
  ## Multi-Session
326
326
 
327
327
  ```typescript
328
- // ✅ Server
328
+ // ✅ 서버
329
329
  import { multiSession } from "better-auth/plugins"
330
330
 
331
331
  export const auth = betterAuth({
332
332
  plugins: [
333
333
  multiSession({
334
- maximumSessions: 5, // Maximum sessions
334
+ maximumSessions: 5, // 최대 세션 수
335
335
  }),
336
336
  ],
337
337
  })
338
338
 
339
- // ✅ Client
339
+ // ✅ 클라이언트
340
340
  import { multiSessionClient } from "better-auth/client/plugins"
341
341
 
342
342
  export const authClient = createAuthClient({
343
343
  plugins: [multiSessionClient()],
344
344
  })
345
345
 
346
- // Usage
346
+ // 사용
347
347
  const sessions = await authClient.multiSession.listSessions()
348
348
  await authClient.multiSession.revokeSession({ sessionId: "session-id" })
349
349
  await authClient.multiSession.revokeOtherSessions()
@@ -352,7 +352,7 @@ await authClient.multiSession.revokeOtherSessions()
352
352
  ## CAPTCHA
353
353
 
354
354
  ```typescript
355
- // ✅ Server
355
+ // ✅ 서버
356
356
  import { captcha } from "better-auth/plugins"
357
357
 
358
358
  export const auth = betterAuth({
@@ -366,7 +366,7 @@ export const auth = betterAuth({
366
366
  ],
367
367
  })
368
368
 
369
- // ✅ Client
369
+ // ✅ 클라이언트
370
370
  import { captchaClient } from "better-auth/client/plugins"
371
371
 
372
372
  export const authClient = createAuthClient({
@@ -387,8 +387,8 @@ export const authClient = createAuthClient({
387
387
  ## SIWE (Ethereum)
388
388
 
389
389
  ```typescript
390
- // Server: siwe({ domain, uri })
391
- // Client:
390
+ // 서버: siwe({ domain, uri })
391
+ // 클라이언트:
392
392
  const { data } = await authClient.siwe.getNonce()
393
393
  const message = await authClient.siwe.prepareMessage({ address: "0x...", nonce: data.nonce })
394
394
  const signature = await signer.signMessage(message)
@@ -398,7 +398,7 @@ await authClient.siwe.signIn({ message, signature })
398
398
  ## Stateless Mode
399
399
 
400
400
  ```typescript
401
- // ✅ Social login only without DB
401
+ // ✅ DB 없이 소셜 로그인만
402
402
  export const auth = betterAuth({
403
403
  socialProviders: {
404
404
  google: {
@@ -441,8 +441,8 @@ export const auth = betterAuth({
441
441
 
442
442
  ## Next.js Integration
443
443
 
444
- | Pattern | Usage |
445
- |---------|-------|
444
+ | 패턴 | 용도 |
445
+ |------|------|
446
446
  | Route Handler | `app/api/auth/[...all]/route.ts` |
447
447
  | Server Component | `auth.api.getSession({ headers })` |
448
448
  | Server Action | `auth.api.getSession({ headers })` |
@@ -518,24 +518,24 @@ export const config = {
518
518
 
519
519
  ## Common Patterns
520
520
 
521
- | Task | Pattern |
522
- |------|---------|
523
- | Sign in | `authClient.signIn.email({ email, password })` |
524
- | Sign up | `authClient.signUp.email({ email, password, name })` |
525
- | Sign out | `authClient.signOut()` |
526
- | Get session | `authClient.getSession()` (client) |
527
- | Get session | `auth.api.getSession({ headers })` (server) |
528
- | Update user | `authClient.updateUser({ name })` |
529
- | Reset password | `authClient.forgetPassword({ email })` → `authClient.resetPassword({ token, password })` |
521
+ | 작업 | 패턴 |
522
+ |------|------|
523
+ | 로그인 | `authClient.signIn.email({ email, password })` |
524
+ | 회원가입 | `authClient.signUp.email({ email, password, name })` |
525
+ | 로그아웃 | `authClient.signOut()` |
526
+ | 세션 조회 | `authClient.getSession()` (클라이언트) |
527
+ | 세션 조회 | `auth.api.getSession({ headers })` (서버) |
528
+ | 사용자 업데이트 | `authClient.updateUser({ name })` |
529
+ | 비밀번호 재설정 | `authClient.forgetPassword({ email })` → `authClient.resetPassword({ token, password })` |
530
530
 
531
531
  ## Do's & Don'ts
532
532
 
533
533
  | ✅ Do | ❌ Don't |
534
534
  |-------|----------|
535
- | Use `auth.api.getSession()` on server | Manipulate session directly on client |
536
- | Use `authClient` on client | Hardcode secrets |
537
- | Manage secrets with environment variables | Store session tokens in localStorage |
538
- | HTTPS required in production | Deploy with HTTP in production |
539
- | Configure `baseURL` per environment | Hardcode absolute paths |
535
+ | `auth.api.getSession()` 서버에서 사용 | 클라이언트에서 직접 세션 조작 |
536
+ | `authClient` 클라이언트에서 사용 | 하드코딩된 시크릿 |
537
+ | 환경변수로 시크릿 관리 | 세션 토큰 로컬스토리지 저장 |
538
+ | HTTPS 프로덕션 필수 | HTTP 프로덕션 배포 |
539
+ | `baseURL` 환경별 설정 | 절대 경로 하드코딩 |
540
540
 
541
541
  </patterns>