@kood/claude-code 0.3.7 → 0.3.8

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 (120) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/code-reviewer.md +124 -124
  4. package/templates/.claude/agents/dependency-manager.md +85 -85
  5. package/templates/.claude/agents/deployment-validator.md +56 -56
  6. package/templates/.claude/agents/git-operator.md +64 -64
  7. package/templates/.claude/agents/implementation-executor.md +95 -95
  8. package/templates/.claude/agents/ko-to-en-translator.md +74 -0
  9. package/templates/.claude/agents/lint-fixer.md +78 -78
  10. package/templates/.claude/agents/refactor-advisor.md +122 -122
  11. package/templates/.claude/commands/agent-creator.md +185 -185
  12. package/templates/.claude/commands/bug-fix.md +193 -193
  13. package/templates/.claude/commands/command-creator.md +54 -54
  14. package/templates/.claude/commands/docs-creator.md +57 -57
  15. package/templates/.claude/commands/docs-refactor.md +26 -26
  16. package/templates/.claude/commands/execute.md +12 -12
  17. package/templates/.claude/commands/git-all.md +32 -32
  18. package/templates/.claude/commands/git-session.md +42 -42
  19. package/templates/.claude/commands/git.md +34 -34
  20. package/templates/.claude/commands/lint-fix.md +138 -138
  21. package/templates/.claude/commands/lint-init.md +61 -61
  22. package/templates/.claude/commands/plan.md +260 -260
  23. package/templates/.claude/commands/prd.md +24 -24
  24. package/templates/.claude/commands/pre-deploy.md +109 -109
  25. package/templates/.claude/commands/refactor.md +147 -147
  26. package/templates/.claude/commands/version-update.md +17 -17
  27. package/templates/hono/CLAUDE.md +27 -27
  28. package/templates/hono/docs/architecture.md +24 -24
  29. package/templates/hono/docs/deployment/cloudflare.md +18 -18
  30. package/templates/hono/docs/deployment/docker.md +13 -13
  31. package/templates/hono/docs/deployment/index.md +19 -19
  32. package/templates/hono/docs/deployment/railway.md +32 -32
  33. package/templates/hono/docs/deployment/vercel.md +29 -29
  34. package/templates/hono/docs/guides/conventions.md +57 -57
  35. package/templates/hono/docs/guides/env-setup.md +47 -47
  36. package/templates/hono/docs/guides/getting-started.md +27 -27
  37. package/templates/hono/docs/library/hono/error-handling.md +11 -11
  38. package/templates/hono/docs/library/hono/index.md +4 -4
  39. package/templates/hono/docs/library/hono/middleware.md +18 -18
  40. package/templates/hono/docs/library/hono/rpc.md +7 -7
  41. package/templates/hono/docs/library/hono/validation.md +6 -6
  42. package/templates/hono/docs/library/prisma/cloudflare-d1.md +29 -29
  43. package/templates/hono/docs/library/prisma/config.md +16 -16
  44. package/templates/hono/docs/library/prisma/index.md +32 -32
  45. package/templates/hono/docs/library/t3-env/index.md +22 -22
  46. package/templates/hono/docs/library/zod/index.md +31 -31
  47. package/templates/nextjs/CLAUDE.md +51 -51
  48. package/templates/nextjs/docs/design.md +183 -183
  49. package/templates/nextjs/docs/guides/conventions.md +86 -86
  50. package/templates/nextjs/docs/guides/getting-started.md +28 -28
  51. package/templates/nextjs/docs/guides/routes.md +32 -32
  52. package/templates/nextjs/docs/library/better-auth/index.md +70 -70
  53. package/templates/nextjs/docs/library/nextjs/app-router.md +43 -43
  54. package/templates/nextjs/docs/library/nextjs/caching.md +73 -73
  55. package/templates/nextjs/docs/library/nextjs/index.md +51 -51
  56. package/templates/nextjs/docs/library/nextjs/middleware.md +41 -41
  57. package/templates/nextjs/docs/library/nextjs/route-handlers.md +31 -31
  58. package/templates/nextjs/docs/library/nextjs/server-actions.md +34 -34
  59. package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +20 -20
  60. package/templates/nextjs/docs/library/prisma/config.md +18 -18
  61. package/templates/nextjs/docs/library/prisma/crud.md +17 -17
  62. package/templates/nextjs/docs/library/prisma/index.md +18 -18
  63. package/templates/nextjs/docs/library/prisma/relations.md +16 -16
  64. package/templates/nextjs/docs/library/prisma/schema.md +23 -23
  65. package/templates/nextjs/docs/library/prisma/setup.md +6 -6
  66. package/templates/nextjs/docs/library/prisma/transactions.md +10 -10
  67. package/templates/nextjs/docs/library/tanstack-query/index.md +6 -6
  68. package/templates/nextjs/docs/library/tanstack-query/invalidation.md +20 -20
  69. package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +4 -4
  70. package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +15 -15
  71. package/templates/nextjs/docs/library/tanstack-query/use-query.md +22 -22
  72. package/templates/nextjs/docs/library/zod/complex-types.md +11 -11
  73. package/templates/nextjs/docs/library/zod/index.md +8 -8
  74. package/templates/nextjs/docs/library/zod/transforms.md +11 -11
  75. package/templates/nextjs/docs/library/zod/validation.md +9 -9
  76. package/templates/npx/CLAUDE.md +37 -37
  77. package/templates/npx/docs/library/commander/index.md +12 -12
  78. package/templates/npx/docs/library/fs-extra/index.md +9 -9
  79. package/templates/npx/docs/library/prompts/index.md +3 -3
  80. package/templates/npx/docs/references/patterns.md +12 -12
  81. package/templates/tanstack-start/CLAUDE.md +53 -53
  82. package/templates/tanstack-start/docs/architecture.md +128 -128
  83. package/templates/tanstack-start/docs/design.md +169 -169
  84. package/templates/tanstack-start/docs/guides/conventions.md +43 -43
  85. package/templates/tanstack-start/docs/guides/env-setup.md +35 -35
  86. package/templates/tanstack-start/docs/guides/getting-started.md +19 -19
  87. package/templates/tanstack-start/docs/guides/hooks.md +45 -45
  88. package/templates/tanstack-start/docs/guides/routes.md +54 -54
  89. package/templates/tanstack-start/docs/guides/services.md +45 -45
  90. package/templates/tanstack-start/docs/library/better-auth/index.md +68 -68
  91. package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +19 -19
  92. package/templates/tanstack-start/docs/library/prisma/config.md +16 -16
  93. package/templates/tanstack-start/docs/library/prisma/crud.md +17 -17
  94. package/templates/tanstack-start/docs/library/prisma/index.md +17 -17
  95. package/templates/tanstack-start/docs/library/prisma/relations.md +16 -16
  96. package/templates/tanstack-start/docs/library/prisma/schema.md +23 -23
  97. package/templates/tanstack-start/docs/library/prisma/setup.md +6 -6
  98. package/templates/tanstack-start/docs/library/prisma/transactions.md +10 -10
  99. package/templates/tanstack-start/docs/library/t3-env/index.md +21 -160
  100. package/templates/tanstack-start/docs/library/tanstack-query/index.md +6 -6
  101. package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +19 -19
  102. package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +4 -4
  103. package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +14 -14
  104. package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +21 -21
  105. package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +9 -9
  106. package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +11 -11
  107. package/templates/tanstack-start/docs/library/tanstack-router/index.md +18 -18
  108. package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +17 -17
  109. package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +5 -5
  110. package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +10 -10
  111. package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +8 -8
  112. package/templates/tanstack-start/docs/library/tanstack-start/index.md +15 -15
  113. package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +9 -9
  114. package/templates/tanstack-start/docs/library/tanstack-start/routing.md +6 -6
  115. package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +18 -18
  116. package/templates/tanstack-start/docs/library/tanstack-start/setup.md +4 -4
  117. package/templates/tanstack-start/docs/library/zod/complex-types.md +11 -11
  118. package/templates/tanstack-start/docs/library/zod/index.md +8 -8
  119. package/templates/tanstack-start/docs/library/zod/transforms.md +11 -11
  120. 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 라우팅 패턴
3
+ > Next.js App Router routing patterns
4
4
 
5
5
  ---
6
6
 
7
- ## 기본 라우팅
7
+ ## Basic Routing
8
8
 
9
- | 파일 | 라우트 |
10
- |------|--------|
9
+ | File | Route |
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
- ## 동적 라우트
18
+ ## Dynamic Routes
19
19
 
20
- ### 단일 파라미터
20
+ ### Single Parameter
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
- // 정적 생성
36
+ // Static generation
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
- ## 레이아웃
60
+ ## Layouts
61
61
 
62
- ### Root Layout (필수)
62
+ ### Root Layout (required)
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="ko">
70
+ <html lang="en">
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
- ### 중첩 Layout
79
+ ### Nested 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
- // 인증 체크
88
+ // Auth check
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
- **용도:** URL에 영향 없이 다른 레이아웃 적용
118
+ **Purpose:** Apply different layouts without affecting URLs
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.message}</h2>
143
- <button onClick={reset}>다시 시도</button>
142
+ <h2>Error: {error.message}</h2>
143
+ <button onClick={reset}>Try again</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>게시글을 찾을 수 없습니다</div>
154
+ return <div>Post not found</div>
155
155
  }
156
156
  ```
157
157
 
@@ -159,7 +159,7 @@ export default function NotFound() {
159
159
 
160
160
  ## Metadata
161
161
 
162
- ### 정적
162
+ ### Static
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
- ### 동적
178
+ ### Dynamic
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
- ## 네비게이션
207
+ ## Navigation
208
208
 
209
209
  ### Link
210
210
 
@@ -242,9 +242,9 @@ export function LoginButton() {
242
242
 
243
243
  ---
244
244
 
245
- ## 인증 보호
245
+ ## Auth Protection
246
246
 
247
- ### Layout에서 체크
247
+ ### Check in 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
- ### Middleware에서 체크
266
+ ### Check in Middleware
267
267
 
268
268
  ```typescript
269
269
  // middleware.ts
@@ -288,25 +288,25 @@ export const config = {
288
288
 
289
289
  ---
290
290
 
291
- ## 베스트 프랙티스
291
+ ## Best Practices
292
292
 
293
293
  ### ✅ DO
294
294
 
295
295
  ```typescript
296
- // 1. Server Component에서 직접 데이터 페칭
296
+ // 1. Direct data fetching in Server Components
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. 레이아웃에서 인증 체크
302
+ // 2. Auth check in layout
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. generateStaticParams로 정적 생성
309
+ // 3. Static generation with 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. Client Component에서 async/await
319
+ // 1. async/await in Client Components
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. 페이지마다 인증 체크 반복
326
+ // 2. Repeated auth checks per page
327
327
  export default async function Page1() {
328
- const session = await auth.api.getSession({ headers: headers() }) // ❌ 중복
328
+ const session = await auth.api.getSession({ headers: headers() }) // ❌ Duplicate
329
329
  if (!session) redirect("/login")
330
330
  }
331
331
 
332
- // 3. 하드코딩된 경로
333
- <Link href="/posts/123">Post</Link> // ❌ 하드코딩
332
+ // 3. Hardcoded paths
333
+ <Link href="/posts/123">Post</Link> // ❌ Hardcoded
334
334
  ```
335
335
 
336
336
  ---
337
337
 
338
- ## 참조
338
+ ## References
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 - 서버
18
+ // src/lib/auth.ts - Server
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 - 클라이언트
28
+ // src/lib/auth-client.ts - Client
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 기반 |
58
+ | Kysely | `better-auth/adapters/kysely` | dialect-based |
59
59
 
60
60
  ## Auth Config
61
61
 
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 허용 오리진 |
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 |
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
- | 옵션 | 타입 | 기본값 | 설명 |
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'` | 캐시 전략 |
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 |
121
121
 
122
122
  ```typescript
123
123
  export const auth = betterAuth({
124
124
  session: {
125
- expiresIn: 604800, // 7
126
- updateAge: 86400, // 1일마다 갱신
125
+ expiresIn: 604800, // 7 days
126
+ updateAge: 86400, // Update every 1 day
127
127
  cookieCache: {
128
128
  enabled: true,
129
- maxAge: 300, // 5
129
+ maxAge: 300, // 5 minutes
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
- // ✅ 클라이언트
139
+ // ✅ Client
140
140
  const session = await authClient.getSession()
141
141
  const session = await authClient.getSession({ query: { disableCookieCache: true } })
142
142
 
143
- // ✅ 서버 (Server Component)
143
+ // ✅ Server (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 Action)
154
+ // ✅ Server (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
- // ✅ 세션 업데이트
165
+ // ✅ Update session
166
166
  await authClient.updateUser({ name: "New Name" })
167
167
 
168
- // ✅ 로그아웃
168
+ // ✅ Logout
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
- // ✅ 회원가입
210
+ // ✅ Sign up
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
- // ✅ 로그인
217
+ // ✅ Sign in
218
218
  await authClient.signIn.email({
219
219
  email: "user@example.com",
220
220
  password: "password123",
221
221
  })
222
222
 
223
- // ✅ 비밀번호 재설정 요청
223
+ // ✅ Request password reset
224
224
  await authClient.forgetPassword({ email: "user@example.com" })
225
225
 
226
- // ✅ 비밀번호 재설정
226
+ // ✅ Reset password
227
227
  await authClient.resetPassword({ token, password: "newpassword" })
228
228
  ```
229
229
 
230
230
  ## Social Login
231
231
 
232
232
  ```typescript
233
- // ✅ 소셜 로그인
233
+ // ✅ Social sign in
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
261
- length: 6, // 6자리
260
+ period: 300, // 5 minutes
261
+ length: 6, // 6 digits
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
- // ✅ TOTP 활성화
287
+ // ✅ Enable TOTP
288
288
  const { data } = await authClient.twoFactor.enable({ password: "current-password" })
289
289
  // data: { totpURI: 'otpauth://...', backupCodes: ['ABCD-1234', ...] }
290
290
 
291
- // ✅ TOTP 검증
291
+ // ✅ Verify TOTP
292
292
  await authClient.twoFactor.verifyTotp({ code: "123456" })
293
293
 
294
- // ✅ OTP 전송
294
+ // ✅ Send OTP
295
295
  await authClient.twoFactor.sendOtp()
296
296
 
297
- // ✅ OTP 검증
297
+ // ✅ Verify OTP
298
298
  await authClient.twoFactor.verifyOtp({ code: "123456" })
299
299
 
300
- // ✅ 백업 코드 사용
300
+ // ✅ Use backup code
301
301
  await authClient.twoFactor.useBackupCode({ code: "ABCD-1234" })
302
302
 
303
- // ✅ 백업 코드 재생성
303
+ // ✅ Regenerate backup codes
304
304
  const { data } = await authClient.twoFactor.regenerateBackupCodes({ password: "current-password" })
305
305
 
306
- // ✅ 2FA 비활성화
306
+ // ✅ Disable 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 | 기능 |
319
- |--------|--------|------|
320
- | `multiSession` | `better-auth/plugins` | 다중 세션 관리 |
321
- | `customSession` | `better-auth/plugins` | 세션 필드 확장 |
322
- | `twoFactor` | `better-auth/plugins` | 2단계 인증 |
323
- | `captcha` | `better-auth/plugins` | CAPTCHA 검증 |
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 |
324
324
 
325
325
  ## Multi-Session
326
326
 
327
327
  ```typescript
328
- // ✅ 서버
328
+ // ✅ Server
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, // 최대 세션 수
334
+ maximumSessions: 5, // Maximum sessions
335
335
  }),
336
336
  ],
337
337
  })
338
338
 
339
- // ✅ 클라이언트
339
+ // ✅ Client
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
- // 사용
346
+ // Usage
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
- // ✅ 서버
355
+ // ✅ Server
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
- // ✅ 클라이언트
369
+ // ✅ Client
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
- // 서버: siwe({ domain, uri })
391
- // 클라이언트:
390
+ // Server: siwe({ domain, uri })
391
+ // Client:
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
- // ✅ DB 없이 소셜 로그인만
401
+ // ✅ Social login only without 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
- | 패턴 | 용도 |
445
- |------|------|
444
+ | Pattern | Usage |
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
- | 작업 | 패턴 |
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 })` |
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 })` |
530
530
 
531
531
  ## Do's & Don'ts
532
532
 
533
533
  | ✅ Do | ❌ Don't |
534
534
  |-------|----------|
535
- | `auth.api.getSession()` 서버에서 사용 | 클라이언트에서 직접 세션 조작 |
536
- | `authClient` 클라이언트에서 사용 | 하드코딩된 시크릿 |
537
- | 환경변수로 시크릿 관리 | 세션 토큰 로컬스토리지 저장 |
538
- | HTTPS 프로덕션 필수 | HTTP 프로덕션 배포 |
539
- | `baseURL` 환경별 설정 | 절대 경로 하드코딩 |
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 |
540
540
 
541
541
  </patterns>