@kood/claude-code 0.3.6 → 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 +228 -0
  48. package/templates/nextjs/docs/design.md +558 -0
  49. package/templates/nextjs/docs/guides/conventions.md +343 -0
  50. package/templates/nextjs/docs/guides/getting-started.md +367 -0
  51. package/templates/nextjs/docs/guides/routes.md +342 -0
  52. package/templates/nextjs/docs/library/better-auth/index.md +541 -0
  53. package/templates/nextjs/docs/library/nextjs/app-router.md +269 -0
  54. package/templates/nextjs/docs/library/nextjs/caching.md +351 -0
  55. package/templates/nextjs/docs/library/nextjs/index.md +291 -0
  56. package/templates/nextjs/docs/library/nextjs/middleware.md +391 -0
  57. package/templates/nextjs/docs/library/nextjs/route-handlers.md +382 -0
  58. package/templates/nextjs/docs/library/nextjs/server-actions.md +366 -0
  59. package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +76 -0
  60. package/templates/nextjs/docs/library/prisma/config.md +77 -0
  61. package/templates/nextjs/docs/library/prisma/crud.md +90 -0
  62. package/templates/nextjs/docs/library/prisma/index.md +73 -0
  63. package/templates/nextjs/docs/library/prisma/relations.md +69 -0
  64. package/templates/nextjs/docs/library/prisma/schema.md +98 -0
  65. package/templates/nextjs/docs/library/prisma/setup.md +49 -0
  66. package/templates/nextjs/docs/library/prisma/transactions.md +50 -0
  67. package/templates/nextjs/docs/library/tanstack-query/index.md +66 -0
  68. package/templates/nextjs/docs/library/tanstack-query/invalidation.md +54 -0
  69. package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +77 -0
  70. package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +63 -0
  71. package/templates/nextjs/docs/library/tanstack-query/use-query.md +70 -0
  72. package/templates/nextjs/docs/library/zod/complex-types.md +61 -0
  73. package/templates/nextjs/docs/library/zod/index.md +56 -0
  74. package/templates/nextjs/docs/library/zod/transforms.md +51 -0
  75. package/templates/nextjs/docs/library/zod/validation.md +70 -0
  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 -49
  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 +63 -35
  88. package/templates/tanstack-start/docs/guides/routes.md +61 -42
  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
@@ -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 = async ({ request }: { request: Request }) => auth.handler(re
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 | DB 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
 
@@ -107,22 +107,22 @@ export const auth = betterAuth({
107
107
 
108
108
  ## Session Config
109
109
 
110
- | 옵션 | 타입 | 기본값 | 설명 |
111
- |------|------|--------|------|
112
- | `expiresIn` | `number` | `604800` (7) | 세션 만료 시간 () |
113
- | `updateAge` | `number` | `86400` (1) | 세션 갱신 주기 () |
114
- | `cookieCache.enabled` | `boolean` | `true` | 쿠키 캐시 활성화 |
115
- | `cookieCache.maxAge` | `number` | `300` (5) | 캐시 유효 시간 () |
116
- | `cookieCache.strategy` | `'compact' \| 'jwt' \| 'jwe'` | `'compact'` | 캐시 전략 |
110
+ | Option | Type | Default | Description |
111
+ |--------|------|---------|-------------|
112
+ | `expiresIn` | `number` | `604800` (7 days) | Session expiration time (seconds) |
113
+ | `updateAge` | `number` | `86400` (1 day) | Session renewal period (seconds) |
114
+ | `cookieCache.enabled` | `boolean` | `true` | Enable cookie cache |
115
+ | `cookieCache.maxAge` | `number` | `300` (5 min) | Cache validity time (seconds) |
116
+ | `cookieCache.strategy` | `'compact' \| 'jwt' \| 'jwe'` | `'compact'` | Cache strategy |
117
117
 
118
118
  ```typescript
119
119
  export const auth = betterAuth({
120
120
  session: {
121
- expiresIn: 604800, // 7
122
- updateAge: 86400, // 1일마다 갱신
121
+ expiresIn: 604800, // 7 days
122
+ updateAge: 86400, // Renew every day
123
123
  cookieCache: {
124
124
  enabled: true,
125
- maxAge: 300, // 5
125
+ maxAge: 300, // 5 minutes
126
126
  strategy: 'compact',
127
127
  },
128
128
  },
@@ -132,21 +132,21 @@ export const auth = betterAuth({
132
132
  ## Session Methods
133
133
 
134
134
  ```typescript
135
- // ✅ 클라이언트
135
+ // ✅ Client
136
136
  const session = await authClient.getSession()
137
137
  const session = await authClient.getSession({ query: { disableCookieCache: true } })
138
138
 
139
- // ✅ 서버 (TanStack Start)
139
+ // ✅ Server (TanStack Start)
140
140
  export const getSession = createServerFn({ method: 'GET' })
141
141
  .handler(async ({ request }) => {
142
142
  const session = await auth.api.getSession({ headers: request.headers })
143
143
  return session
144
144
  })
145
145
 
146
- // ✅ 세션 업데이트
146
+ // ✅ Update session
147
147
  await authClient.updateUser({ name: 'New Name' })
148
148
 
149
- // ✅ 로그아웃
149
+ // ✅ Sign out
150
150
  await authClient.signOut()
151
151
  ```
152
152
 
@@ -188,30 +188,30 @@ export const auth = betterAuth({
188
188
  ## Email/Password
189
189
 
190
190
  ```typescript
191
- // ✅ 회원가입
191
+ // ✅ Sign up
192
192
  await authClient.signUp.email({
193
193
  email: 'user@example.com',
194
194
  password: 'password123',
195
195
  name: 'User Name',
196
196
  })
197
197
 
198
- // ✅ 로그인
198
+ // ✅ Sign in
199
199
  await authClient.signIn.email({
200
200
  email: 'user@example.com',
201
201
  password: 'password123',
202
202
  })
203
203
 
204
- // ✅ 비밀번호 재설정 요청
204
+ // ✅ Request password reset
205
205
  await authClient.forgetPassword({ email: 'user@example.com' })
206
206
 
207
- // ✅ 비밀번호 재설정
207
+ // ✅ Reset password
208
208
  await authClient.resetPassword({ token, password: 'newpassword' })
209
209
  ```
210
210
 
211
211
  ## Social Login
212
212
 
213
213
  ```typescript
214
- // ✅ 소셜 로그인
214
+ // ✅ Social sign in
215
215
  await authClient.signIn.social({ provider: 'google', callbackURL: '/dashboard' })
216
216
  await authClient.signIn.social({ provider: 'github', callbackURL: '/dashboard' })
217
217
 
@@ -265,26 +265,26 @@ export const authClient = createAuthClient({
265
265
  ### 2FA Usage
266
266
 
267
267
  ```typescript
268
- // ✅ TOTP 활성화
268
+ // ✅ Enable TOTP
269
269
  const { data } = await authClient.twoFactor.enable({ password: 'current-password' })
270
270
  // data: { totpURI: 'otpauth://...', backupCodes: ['ABCD-1234', ...] }
271
271
 
272
- // ✅ TOTP 검증
272
+ // ✅ Verify TOTP
273
273
  await authClient.twoFactor.verifyTotp({ code: '123456' })
274
274
 
275
- // ✅ OTP 전송
275
+ // ✅ Send OTP
276
276
  await authClient.twoFactor.sendOtp()
277
277
 
278
- // ✅ OTP 검증
278
+ // ✅ Verify OTP
279
279
  await authClient.twoFactor.verifyOtp({ code: '123456' })
280
280
 
281
- // ✅ 백업 코드 사용
281
+ // ✅ Use backup code
282
282
  await authClient.twoFactor.useBackupCode({ code: 'ABCD-1234' })
283
283
 
284
- // ✅ 백업 코드 재생성
284
+ // ✅ Regenerate backup codes
285
285
  const { data } = await authClient.twoFactor.regenerateBackupCodes({ password: 'current-password' })
286
286
 
287
- // ✅ 2FA 비활성화
287
+ // ✅ Disable 2FA
288
288
  await authClient.twoFactor.disable({ password: 'current-password' })
289
289
  ```
290
290
 
@@ -296,35 +296,35 @@ await authClient.twoFactor.disable({ password: 'current-password' })
296
296
 
297
297
  ## Plugin System
298
298
 
299
- | Plugin | Import | 기능 |
300
- |--------|--------|------|
301
- | `multiSession` | `better-auth/plugins` | 다중 세션 관리 |
302
- | `customSession` | `better-auth/plugins` | 세션 필드 확장 |
303
- | `twoFactor` | `better-auth/plugins` | 2단계 인증 |
304
- | `captcha` | `better-auth/plugins` | CAPTCHA 검증 |
299
+ | Plugin | Import | Features |
300
+ |--------|--------|----------|
301
+ | `multiSession` | `better-auth/plugins` | Multi-session management |
302
+ | `customSession` | `better-auth/plugins` | Session field extension |
303
+ | `twoFactor` | `better-auth/plugins` | Two-factor authentication |
304
+ | `captcha` | `better-auth/plugins` | CAPTCHA verification |
305
305
 
306
306
  ## Multi-Session
307
307
 
308
308
  ```typescript
309
- // ✅ 서버
309
+ // ✅ Server
310
310
  import { multiSession } from 'better-auth/plugins'
311
311
 
312
312
  export const auth = betterAuth({
313
313
  plugins: [
314
314
  multiSession({
315
- maximumSessions: 5, // 최대 세션
315
+ maximumSessions: 5, // Maximum number of sessions
316
316
  }),
317
317
  ],
318
318
  })
319
319
 
320
- // ✅ 클라이언트
320
+ // ✅ Client
321
321
  import { multiSessionClient } from 'better-auth/client/plugins'
322
322
 
323
323
  export const authClient = createAuthClient({
324
324
  plugins: [multiSessionClient()],
325
325
  })
326
326
 
327
- // 사용
327
+ // Usage
328
328
  const sessions = await authClient.multiSession.listSessions()
329
329
  await authClient.multiSession.revokeSession({ sessionId: 'session-id' })
330
330
  await authClient.multiSession.revokeOtherSessions()
@@ -333,7 +333,7 @@ await authClient.multiSession.revokeOtherSessions()
333
333
  ## CAPTCHA
334
334
 
335
335
  ```typescript
336
- // ✅ 서버
336
+ // ✅ Server
337
337
  import { captcha } from 'better-auth/plugins'
338
338
 
339
339
  export const auth = betterAuth({
@@ -347,7 +347,7 @@ export const auth = betterAuth({
347
347
  ],
348
348
  })
349
349
 
350
- // ✅ 클라이언트
350
+ // ✅ Client
351
351
  import { captchaClient } from 'better-auth/client/plugins'
352
352
 
353
353
  export const authClient = createAuthClient({
@@ -368,8 +368,8 @@ export const authClient = createAuthClient({
368
368
  ## SIWE (Ethereum)
369
369
 
370
370
  ```typescript
371
- // 서버: siwe({ domain, uri })
372
- // 클라이언트:
371
+ // Server: siwe({ domain, uri })
372
+ // Client:
373
373
  const { data } = await authClient.siwe.getNonce()
374
374
  const message = await authClient.siwe.prepareMessage({ address: '0x...', nonce: data.nonce })
375
375
  const signature = await signer.signMessage(message)
@@ -379,7 +379,7 @@ await authClient.siwe.signIn({ message, signature })
379
379
  ## Stateless Mode
380
380
 
381
381
  ```typescript
382
- // ✅ DB 없이 소셜 로그인만
382
+ // ✅ Social login without DB
383
383
  export const auth = betterAuth({
384
384
  socialProviders: {
385
385
  google: {
@@ -422,8 +422,8 @@ export const auth = betterAuth({
422
422
 
423
423
  ## TanStack Start Integration
424
424
 
425
- | 패턴 | 용도 |
426
- |------|------|
425
+ | Pattern | Purpose |
426
+ |---------|---------|
427
427
  | API Handler | `src/routes/api/auth/$.ts` |
428
428
  | Server Function | `createServerFn` + `auth.api.getSession` |
429
429
  | Middleware | `auth.api.getSession` + redirect |
@@ -431,7 +431,7 @@ export const auth = betterAuth({
431
431
  ### Server Function Pattern
432
432
 
433
433
  ```typescript
434
- // ✅ 인증 체크 Server Function
434
+ // ✅ Auth check Server Function
435
435
  export const requireAuth = createServerFn({ method: 'GET' })
436
436
  .handler(async ({ request }) => {
437
437
  const session = await auth.api.getSession({ headers: request.headers })
@@ -441,7 +441,7 @@ export const requireAuth = createServerFn({ method: 'GET' })
441
441
  return session.user
442
442
  })
443
443
 
444
- // ✅ 보호된 데이터 조회
444
+ // ✅ Fetch protected data
445
445
  export const getProtectedData = createServerFn({ method: 'GET' })
446
446
  .handler(async ({ request }) => {
447
447
  const user = await requireAuth()
@@ -465,23 +465,23 @@ export const Route = createFileRoute('/dashboard')({
465
465
 
466
466
  ## Common Patterns
467
467
 
468
- | 작업 | 패턴 |
469
- |------|------|
470
- | 로그인 | `authClient.signIn.email({ email, password })` |
471
- | 회원가입 | `authClient.signUp.email({ email, password, name })` |
472
- | 로그아웃 | `authClient.signOut()` |
473
- | 세션 조회 | `authClient.getSession()` |
474
- | 사용자 업데이트 | `authClient.updateUser({ name })` |
475
- | 비밀번호 재설정 | `authClient.forgetPassword({ email })` → `authClient.resetPassword({ token, password })` |
468
+ | Action | Pattern |
469
+ |--------|---------|
470
+ | Sign in | `authClient.signIn.email({ email, password })` |
471
+ | Sign up | `authClient.signUp.email({ email, password, name })` |
472
+ | Sign out | `authClient.signOut()` |
473
+ | Get session | `authClient.getSession()` |
474
+ | Update user | `authClient.updateUser({ name })` |
475
+ | Reset password | `authClient.forgetPassword({ email })` → `authClient.resetPassword({ token, password })` |
476
476
 
477
477
  ## Do's & Don'ts
478
478
 
479
479
  | ✅ Do | ❌ Don't |
480
480
  |-------|----------|
481
- | `auth.api.getSession()` 서버에서 사용 | 클라이언트에서 직접 세션 조작 |
482
- | `authClient` 클라이언트에서 사용 | 하드코딩된 시크릿 |
483
- | 환경변수로 시크릿 관리 | 세션 토큰 로컬스토리지 저장 |
484
- | HTTPS 프로덕션 필수 | HTTP 프로덕션 배포 |
485
- | `baseURL` 환경별 설정 | 절대 경로 하드코딩 |
481
+ | Use `auth.api.getSession()` on server | Directly manipulate sessions on client |
482
+ | Use `authClient` on client | Hardcode secrets |
483
+ | Manage secrets via environment variables | Store session tokens in localStorage |
484
+ | HTTPS required in production | Deploy production with HTTP |
485
+ | Configure `baseURL` per environment | Hardcode absolute paths |
486
486
 
487
487
  </patterns>
@@ -1,17 +1,17 @@
1
1
  # Prisma - Cloudflare D1
2
2
 
3
- SQLite 기반 서버리스 DB. 일반 Prisma 마이그레이션과 다른 워크플로우.
3
+ SQLite-based serverless database. Different workflow from regular Prisma migrations.
4
4
 
5
- ⚠️ 트랜잭션 미지원 | prisma migrate 불가 - wrangler 사용 | Preview 상태
5
+ ⚠️ No transaction support | Can't use prisma migrate - use wrangler | Preview status
6
6
 
7
- ## 설정
7
+ ## Configuration
8
8
 
9
9
  ```prisma
10
10
  // schema.prisma
11
11
  generator client {
12
12
  provider = "prisma-client"
13
13
  output = "../src/generated/prisma"
14
- runtime = "cloudflare" // 필수
14
+ runtime = "cloudflare" // Required
15
15
  }
16
16
 
17
17
  datasource db {
@@ -26,7 +26,7 @@ datasource db {
26
26
  }
27
27
  ```
28
28
 
29
- ## 사용법
29
+ ## Usage
30
30
 
31
31
  ```typescript
32
32
  import { PrismaClient } from './generated/prisma'
@@ -44,33 +44,33 @@ export default {
44
44
  }
45
45
  ```
46
46
 
47
- ## 마이그레이션 워크플로우
47
+ ## Migration Workflow
48
48
 
49
49
  ```bash
50
- # 1. D1 생성
50
+ # 1. Create D1
51
51
  npx wrangler d1 create my-database
52
52
 
53
- # 2. 마이그레이션 생성
53
+ # 2. Create migration
54
54
  npx wrangler d1 migrations create my-database init
55
55
 
56
- # 3. SQL 생성 (초기)
56
+ # 3. Generate SQL (initial)
57
57
  npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script --output prisma/migrations/0001.sql
58
58
 
59
- # 4. SQL 생성 (후속)
59
+ # 4. Generate SQL (subsequent)
60
60
  npx prisma migrate diff --from-local-d1 --to-schema-datamodel prisma/schema.prisma --script
61
61
 
62
- # 5. 적용
63
- npx wrangler d1 migrations apply my-database --local # 로컬
64
- npx wrangler d1 migrations apply my-database --remote # 프로덕션
62
+ # 5. Apply
63
+ npx wrangler d1 migrations apply my-database --local # Local
64
+ npx wrangler d1 migrations apply my-database --remote # Production
65
65
 
66
- # 6. Client 생성
66
+ # 6. Generate Client
67
67
  npx prisma generate
68
68
  ```
69
69
 
70
- ## 제한사항
70
+ ## Limitations
71
71
 
72
- | 항목 | 일반 SQLite | D1 |
72
+ | Feature | Regular SQLite | D1 |
73
73
  |------|-------------|-----|
74
- | 마이그레이션 | prisma migrate | wrangler d1 |
75
- | 트랜잭션 | ✅ | ❌ |
76
- | 접속 | 직접 | HTTP 어댑터 |
74
+ | Migration | prisma migrate | wrangler d1 |
75
+ | Transactions | ✅ | ❌ |
76
+ | Connection | Direct | HTTP adapter |
@@ -1,8 +1,8 @@
1
- # Prisma - Config 파일
1
+ # Prisma - Config File
2
2
 
3
- Prisma v7 `prisma.config.ts` 설정.
3
+ Prisma v7 `prisma.config.ts` configuration.
4
4
 
5
- ## Multi-File 스키마 (필수)
5
+ ## Multi-File Schema (Required)
6
6
 
7
7
  ```typescript
8
8
  // prisma.config.ts
@@ -11,7 +11,7 @@ import path from 'node:path'
11
11
  import { defineConfig, env } from 'prisma/config'
12
12
 
13
13
  export default defineConfig({
14
- schema: path.join('prisma', 'schema'), // 폴더 경로!
14
+ schema: path.join('prisma', 'schema'), // folder path!
15
15
  migrations: {
16
16
  path: 'prisma/migrations',
17
17
  seed: 'tsx prisma/seed.ts',
@@ -22,16 +22,16 @@ export default defineConfig({
22
22
  })
23
23
  ```
24
24
 
25
- ## 폴더 구조
25
+ ## Folder Structure
26
26
 
27
27
  ```
28
- 프로젝트/
28
+ project/
29
29
  ├── prisma.config.ts
30
30
  ├── prisma/
31
31
  │ ├── schema/
32
32
  │ │ ├── +base.prisma # datasource, generator
33
- │ │ ├── +enum.prisma # enum 정의
34
- │ │ └── user.prisma # 모델
33
+ │ │ ├── +enum.prisma # enum definitions
34
+ │ │ └── user.prisma # models
35
35
  │ └── migrations/
36
36
  ```
37
37
 
@@ -49,17 +49,17 @@ generator client {
49
49
  }
50
50
  ```
51
51
 
52
- ## 설정 옵션
52
+ ## Configuration Options
53
53
 
54
- | 옵션 | 설명 |
54
+ | Option | Description |
55
55
  |------|------|
56
- | `schema` | 스키마 폴더 경로 |
57
- | `datasource.url` | DB URL (필수) |
56
+ | `schema` | Schema folder path |
57
+ | `datasource.url` | DB URL (required) |
58
58
  | `datasource.shadowDatabaseUrl` | Shadow DB URL |
59
- | `migrations.path` | 마이그레이션 폴더 |
60
- | `migrations.seed` | 시드 명령어 |
59
+ | `migrations.path` | Migrations folder |
60
+ | `migrations.seed` | Seed command |
61
61
 
62
- ## 시드 파일
62
+ ## Seed File
63
63
 
64
64
  ```typescript
65
65
  // prisma/seed.ts
@@ -69,7 +69,7 @@ const prisma = new PrismaClient()
69
69
 
70
70
  async function main() {
71
71
  await prisma.user.create({
72
- data: { email: 'admin@example.com', name: '관리자', role: 'ADMIN' },
72
+ data: { email: 'admin@example.com', name: 'Admin', role: 'ADMIN' },
73
73
  })
74
74
  }
75
75
 
@@ -1,14 +1,14 @@
1
- # Prisma - CRUD 작업
1
+ # Prisma - CRUD Operations
2
2
 
3
3
  ## Create
4
4
 
5
5
  ```typescript
6
- // 단일
6
+ // Single
7
7
  const user = await prisma.user.create({
8
8
  data: { email: 'alice@prisma.io', name: 'Alice' },
9
9
  })
10
10
 
11
- // 관계 포함
11
+ // With relations
12
12
  const user = await prisma.user.create({
13
13
  data: {
14
14
  email: 'bob@prisma.io',
@@ -27,22 +27,22 @@ posts: { create: [{
27
27
  ## Read
28
28
 
29
29
  ```typescript
30
- // 단일
30
+ // Single
31
31
  const user = await prisma.user.findUnique({ where: { email } })
32
32
 
33
- // 다중
33
+ // Multiple
34
34
  const users = await prisma.user.findMany({ where: { name: 'Alice' } })
35
35
 
36
- // 관계 포함
36
+ // With relations
37
37
  const users = await prisma.user.findMany({ where: { role: 'ADMIN' }, include: { posts: true } })
38
38
 
39
- // 필드 선택
39
+ // Field selection
40
40
  const user = await prisma.user.findUnique({
41
41
  where: { email },
42
42
  select: { email: true, posts: { select: { title: true } } },
43
43
  })
44
44
 
45
- // 관계로 필터
45
+ // Filter by relations
46
46
  const users = await prisma.user.findMany({
47
47
  where: { posts: { some: { published: false } } },
48
48
  })
@@ -51,10 +51,10 @@ const users = await prisma.user.findMany({
51
51
  ## Update
52
52
 
53
53
  ```typescript
54
- // 단일
54
+ // Single
55
55
  const user = await prisma.user.update({ where: { id }, data: { name: 'Updated' } })
56
56
 
57
- // 다중
57
+ // Multiple
58
58
  await prisma.user.updateMany({ where: { role: 'USER' }, data: { role: 'ADMIN' } })
59
59
 
60
60
  // Upsert
@@ -69,22 +69,22 @@ const user = await prisma.user.upsert({
69
69
 
70
70
  ```typescript
71
71
  await prisma.user.delete({ where: { id } })
72
- await prisma.user.deleteMany({}) // 전체
73
- await prisma.post.deleteMany({ where: { published: false } }) // 조건부
72
+ await prisma.user.deleteMany({}) // All
73
+ await prisma.post.deleteMany({ where: { published: false } }) // Conditional
74
74
  ```
75
75
 
76
- ## 필터 연산자
76
+ ## Filter Operators
77
77
 
78
78
  ```typescript
79
- // 문자열
79
+ // String
80
80
  { contains: 'prisma', startsWith: 'A', endsWith: 'io' }
81
81
 
82
- // 숫자
82
+ // Number
83
83
  { gt: 18, gte: 18, lt: 65, lte: 65 }
84
84
 
85
- // 배열
85
+ // Array
86
86
  { in: [1, 2, 3], notIn: [4, 5] }
87
87
 
88
- // 논리
88
+ // Logical
89
89
  { OR: [...], AND: [...], NOT: {...} }
90
90
  ```
@@ -15,7 +15,7 @@
15
15
  ## Quick Reference
16
16
 
17
17
  ```typescript
18
- import { PrismaClient } from './generated/prisma' // v7 경로!
18
+ import { PrismaClient } from './generated/prisma' // v7 path!
19
19
  export const prisma = new PrismaClient()
20
20
 
21
21
  // CRUD
@@ -24,34 +24,34 @@ const user = await prisma.user.create({ data: { email, name } })
24
24
  const updated = await prisma.user.update({ where: { id }, data: { name } })
25
25
  const deleted = await prisma.user.delete({ where: { id } })
26
26
 
27
- // 관계 포함
27
+ // Include relations
28
28
  const userWithPosts = await prisma.user.findUnique({
29
29
  where: { id },
30
30
  include: { posts: true },
31
31
  })
32
32
  ```
33
33
 
34
- ### v7 schema.prisma (⚠️ 중요)
34
+ ### v7 schema.prisma (⚠️ Important)
35
35
 
36
36
  ```prisma
37
37
  generator client {
38
- provider = "prisma-client" // v7! (prisma-client-js 아님)
39
- output = "../generated/prisma" // output 필수!
38
+ provider = "prisma-client" // v7! (not prisma-client-js)
39
+ output = "../generated/prisma" // output is required!
40
40
  }
41
41
  ```
42
42
 
43
- ### ⛔ Claude Code 금지
43
+ ### ⛔ Claude Code Forbidden
44
44
 
45
- | 금지 사항 |
45
+ | Forbidden Actions |
46
46
  |----------|
47
- | prisma db push 자동 실행 |
48
- | prisma migrate 자동 실행 |
49
- | prisma generate 자동 실행 |
50
- | schema.prisma 임의 변경 |
47
+ | Auto-run prisma db push |
48
+ | Auto-run prisma migrate |
49
+ | Auto-run prisma generate |
50
+ | Unauthorized schema.prisma modifications |
51
51
 
52
52
  ---
53
53
 
54
- ## Prisma Client 설정
54
+ ## Prisma Client Setup
55
55
 
56
56
  ```typescript
57
57
  // lib/prisma.ts
@@ -62,12 +62,12 @@ export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: ['query'
62
62
  if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
63
63
  ```
64
64
 
65
- ## 마이그레이션 명령어
65
+ ## Migration Commands
66
66
 
67
67
  ```bash
68
- npx prisma migrate dev --name init # 개발 마이그레이션
69
- npx prisma migrate deploy # 프로덕션 마이그레이션
70
- npx prisma db push # 스키마 동기화 (개발용)
71
- npx prisma generate # Client 생성
68
+ npx prisma migrate dev --name init # Development migration
69
+ npx prisma migrate deploy # Production migration
70
+ npx prisma db push # Schema sync (dev only)
71
+ npx prisma generate # Generate Client
72
72
  npx prisma studio # GUI
73
73
  ```