@kood/claude-code 0.3.7 → 0.3.9

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 (121) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/code-reviewer.md +138 -123
  4. package/templates/.claude/agents/dependency-manager.md +99 -84
  5. package/templates/.claude/agents/deployment-validator.md +70 -55
  6. package/templates/.claude/agents/git-operator.md +78 -63
  7. package/templates/.claude/agents/implementation-executor.md +109 -94
  8. package/templates/.claude/agents/ko-to-en-translator.md +74 -0
  9. package/templates/.claude/agents/lint-fixer.md +93 -78
  10. package/templates/.claude/agents/refactor-advisor.md +136 -121
  11. package/templates/.claude/commands/agent-creator.md +199 -184
  12. package/templates/.claude/commands/bug-fix.md +207 -192
  13. package/templates/.claude/commands/command-creator.md +69 -53
  14. package/templates/.claude/commands/docs-creator.md +72 -56
  15. package/templates/.claude/commands/docs-refactor.md +41 -25
  16. package/templates/.claude/commands/execute.md +27 -11
  17. package/templates/.claude/commands/git-all.md +46 -31
  18. package/templates/.claude/commands/git-session.md +57 -41
  19. package/templates/.claude/commands/git.md +49 -33
  20. package/templates/.claude/commands/lint-fix.md +153 -137
  21. package/templates/.claude/commands/lint-init.md +76 -60
  22. package/templates/.claude/commands/plan.md +275 -259
  23. package/templates/.claude/commands/prd.md +39 -23
  24. package/templates/.claude/commands/pre-deploy.md +124 -108
  25. package/templates/.claude/commands/refactor.md +162 -146
  26. package/templates/.claude/commands/version-update.md +32 -16
  27. package/templates/hono/CLAUDE.md +28 -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 +54 -51
  48. package/templates/nextjs/docs/architecture.md +812 -0
  49. package/templates/nextjs/docs/design.md +183 -183
  50. package/templates/nextjs/docs/guides/conventions.md +86 -86
  51. package/templates/nextjs/docs/guides/getting-started.md +28 -28
  52. package/templates/nextjs/docs/guides/routes.md +32 -32
  53. package/templates/nextjs/docs/library/better-auth/index.md +70 -70
  54. package/templates/nextjs/docs/library/nextjs/app-router.md +43 -43
  55. package/templates/nextjs/docs/library/nextjs/caching.md +73 -73
  56. package/templates/nextjs/docs/library/nextjs/index.md +51 -51
  57. package/templates/nextjs/docs/library/nextjs/middleware.md +41 -41
  58. package/templates/nextjs/docs/library/nextjs/route-handlers.md +31 -31
  59. package/templates/nextjs/docs/library/nextjs/server-actions.md +34 -34
  60. package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +20 -20
  61. package/templates/nextjs/docs/library/prisma/config.md +18 -18
  62. package/templates/nextjs/docs/library/prisma/crud.md +17 -17
  63. package/templates/nextjs/docs/library/prisma/index.md +18 -18
  64. package/templates/nextjs/docs/library/prisma/relations.md +16 -16
  65. package/templates/nextjs/docs/library/prisma/schema.md +23 -23
  66. package/templates/nextjs/docs/library/prisma/setup.md +6 -6
  67. package/templates/nextjs/docs/library/prisma/transactions.md +10 -10
  68. package/templates/nextjs/docs/library/tanstack-query/index.md +6 -6
  69. package/templates/nextjs/docs/library/tanstack-query/invalidation.md +20 -20
  70. package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +4 -4
  71. package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +15 -15
  72. package/templates/nextjs/docs/library/tanstack-query/use-query.md +22 -22
  73. package/templates/nextjs/docs/library/zod/complex-types.md +11 -11
  74. package/templates/nextjs/docs/library/zod/index.md +8 -8
  75. package/templates/nextjs/docs/library/zod/transforms.md +11 -11
  76. package/templates/nextjs/docs/library/zod/validation.md +9 -9
  77. package/templates/npx/CLAUDE.md +38 -37
  78. package/templates/npx/docs/library/commander/index.md +12 -12
  79. package/templates/npx/docs/library/fs-extra/index.md +9 -9
  80. package/templates/npx/docs/library/prompts/index.md +3 -3
  81. package/templates/npx/docs/references/patterns.md +12 -12
  82. package/templates/tanstack-start/CLAUDE.md +54 -53
  83. package/templates/tanstack-start/docs/architecture.md +128 -128
  84. package/templates/tanstack-start/docs/design.md +169 -169
  85. package/templates/tanstack-start/docs/guides/conventions.md +43 -43
  86. package/templates/tanstack-start/docs/guides/env-setup.md +35 -35
  87. package/templates/tanstack-start/docs/guides/getting-started.md +19 -19
  88. package/templates/tanstack-start/docs/guides/hooks.md +45 -45
  89. package/templates/tanstack-start/docs/guides/routes.md +54 -54
  90. package/templates/tanstack-start/docs/guides/services.md +45 -45
  91. package/templates/tanstack-start/docs/library/better-auth/index.md +68 -68
  92. package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +19 -19
  93. package/templates/tanstack-start/docs/library/prisma/config.md +16 -16
  94. package/templates/tanstack-start/docs/library/prisma/crud.md +17 -17
  95. package/templates/tanstack-start/docs/library/prisma/index.md +17 -17
  96. package/templates/tanstack-start/docs/library/prisma/relations.md +16 -16
  97. package/templates/tanstack-start/docs/library/prisma/schema.md +23 -23
  98. package/templates/tanstack-start/docs/library/prisma/setup.md +6 -6
  99. package/templates/tanstack-start/docs/library/prisma/transactions.md +10 -10
  100. package/templates/tanstack-start/docs/library/t3-env/index.md +21 -160
  101. package/templates/tanstack-start/docs/library/tanstack-query/index.md +6 -6
  102. package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +19 -19
  103. package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +4 -4
  104. package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +14 -14
  105. package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +21 -21
  106. package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +9 -9
  107. package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +11 -11
  108. package/templates/tanstack-start/docs/library/tanstack-router/index.md +18 -18
  109. package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +17 -17
  110. package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +5 -5
  111. package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +10 -10
  112. package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +8 -8
  113. package/templates/tanstack-start/docs/library/tanstack-start/index.md +15 -15
  114. package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +9 -9
  115. package/templates/tanstack-start/docs/library/tanstack-start/routing.md +6 -6
  116. package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +18 -18
  117. package/templates/tanstack-start/docs/library/tanstack-start/setup.md +4 -4
  118. package/templates/tanstack-start/docs/library/zod/complex-types.md +11 -11
  119. package/templates/tanstack-start/docs/library/zod/index.md +8 -8
  120. package/templates/tanstack-start/docs/library/zod/transforms.md +11 -11
  121. package/templates/tanstack-start/docs/library/zod/validation.md +9 -9
@@ -1,18 +1,18 @@
1
- # 코드 컨벤션
1
+ # Code Conventions
2
2
 
3
- > Hono 프로젝트 코드 작성 규칙
3
+ > Code writing rules for Hono projects
4
4
 
5
5
  ---
6
6
 
7
7
  <naming>
8
8
 
9
- ## 파일 네이밍
9
+ ## File Naming
10
10
 
11
- | 타입 | 규칙 | 예시 |
12
- |------|------|------|
13
- | **일반 파일** | kebab-case | `user-service.ts`, `auth-middleware.ts` |
14
- | **Route 파일** | kebab-case | `users.ts`, `posts.ts` |
15
- | **타입 파일** | kebab-case | `user-types.ts`, `api-types.ts` |
11
+ | Type | Rule | Example |
12
+ |------|------|---------|
13
+ | **General Files** | kebab-case | `user-service.ts`, `auth-middleware.ts` |
14
+ | **Route Files** | kebab-case | `users.ts`, `posts.ts` |
15
+ | **Type Files** | kebab-case | `user-types.ts`, `api-types.ts` |
16
16
 
17
17
  </naming>
18
18
 
@@ -20,39 +20,39 @@
20
20
 
21
21
  <typescript>
22
22
 
23
- ## TypeScript 규칙
23
+ ## TypeScript Rules
24
24
 
25
- | 규칙 | 설명 | 예시 |
26
- |------|------|------|
27
- | **함수 선언** | const 함수, 명시적 return type | `const fn = (): ReturnType => {}` |
28
- | **타입 정의** | interface (객체), type (유니온) | `interface User {}`, `type Status = 'a' \| 'b'` |
29
- | **any 금지** | unknown 사용 | `const data: unknown = JSON.parse(str)` |
30
- | **Import 타입** | type import 분리 | `import type { User } from '@/types'` |
25
+ | Rule | Description | Example |
26
+ |------|-------------|---------|
27
+ | **Function Declaration** | const functions, explicit return types | `const fn = (): ReturnType => {}` |
28
+ | **Type Definition** | interface (objects), type (unions) | `interface User {}`, `type Status = 'a' \| 'b'` |
29
+ | **No any** | Use unknown instead | `const data: unknown = JSON.parse(str)` |
30
+ | **Import Types** | Separate type imports | `import type { User } from '@/types'` |
31
31
 
32
- ## 패턴
32
+ ## Patterns
33
33
 
34
34
  ```typescript
35
- // ✅ const 함수, 명시적 타입
35
+ // ✅ const function with explicit type
36
36
  const getUserById = async (id: string): Promise<User | null> => {
37
37
  return prisma.user.findUnique({ where: { id } })
38
38
  }
39
39
 
40
- // ✅ 간단한 함수도 명시적 타입
40
+ // ✅ Even simple functions should have explicit types
41
41
  const formatDate = (date: Date): string => {
42
42
  return date.toISOString()
43
43
  }
44
44
 
45
- // ✅ any 금지 → unknown 사용
45
+ // ✅ No any → use unknown
46
46
  const parseJSON = (data: string): unknown => {
47
47
  return JSON.parse(data)
48
48
  }
49
49
 
50
- // ❌ any 사용 금지
50
+ // ❌ Don't use any
51
51
  const badParse = (data: string): any => { // ❌
52
52
  return JSON.parse(data)
53
53
  }
54
54
 
55
- // ❌ function 키워드 금지
55
+ // ❌ Don't use function keyword
56
56
  function badFunction() { // ❌
57
57
  return 'use const arrow function'
58
58
  }
@@ -64,7 +64,7 @@ function badFunction() { // ❌
64
64
 
65
65
  <imports>
66
66
 
67
- ## Import 순서
67
+ ## Import Order
68
68
 
69
69
  ```typescript
70
70
  // 1. External libraries
@@ -88,12 +88,12 @@ import type { Context } from 'hono'
88
88
 
89
89
  <comments>
90
90
 
91
- ## 한글 주석 (묶음 단위)
91
+ ## Korean Comments (Per Code Block)
92
92
 
93
93
  ```typescript
94
- // ✅ 코드 묶음 단위 주석
94
+ // ✅ Comments per code block
95
95
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
96
- // 사용자 조회
96
+ // Retrieve users
97
97
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
98
98
  users.get('/', async (c) => {
99
99
  const users = await prisma.user.findMany()
@@ -108,7 +108,7 @@ users.get('/:id', async (c) => {
108
108
  })
109
109
 
110
110
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
111
- // 사용자 생성/수정
111
+ // Create/Update users
112
112
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
113
113
  users.post('/', zValidator('json', createUserSchema), async (c) => {
114
114
  const data = c.req.valid('json')
@@ -118,10 +118,10 @@ users.post('/', zValidator('json', createUserSchema), async (c) => {
118
118
  ```
119
119
 
120
120
  ```typescript
121
- // ❌ 세세한 주석 (금지)
122
- users.get('/', async (c) => { // 사용자 목록 조회
123
- const users = await prisma.user.findMany() // DB에서 조회
124
- return c.json({ users }) // JSON 반환
121
+ // ❌ Granular comments (prohibited)
122
+ users.get('/', async (c) => { // Retrieve user list
123
+ const users = await prisma.user.findMany() // Query from DB
124
+ return c.json({ users }) // Return JSON
125
125
  })
126
126
  ```
127
127
 
@@ -131,14 +131,14 @@ users.get('/', async (c) => { // 사용자 목록 조회
131
131
 
132
132
  <error_handling>
133
133
 
134
- ## 에러 처리 패턴
134
+ ## Error Handling Patterns
135
135
 
136
- ### HTTPException 사용
136
+ ### Using HTTPException
137
137
 
138
138
  ```typescript
139
139
  import { HTTPException } from 'hono/http-exception'
140
140
 
141
- // ✅ HTTPException 사용
141
+ // ✅ Use HTTPException
142
142
  users.get('/:id', async (c) => {
143
143
  const id = c.req.param('id')
144
144
  const user = await prisma.user.findUnique({ where: { id } })
@@ -150,7 +150,7 @@ users.get('/:id', async (c) => {
150
150
  return c.json({ user })
151
151
  })
152
152
 
153
- // ❌ 일반 Error 사용 금지
153
+ // ❌ Don't use generic Error
154
154
  users.get('/:id', async (c) => {
155
155
  const id = c.req.param('id')
156
156
  const user = await prisma.user.findUnique({ where: { id } })
@@ -163,7 +163,7 @@ users.get('/:id', async (c) => {
163
163
  })
164
164
  ```
165
165
 
166
- ### 전역 에러 핸들러
166
+ ### Global Error Handler
167
167
 
168
168
  ```typescript
169
169
  // src/index.ts
@@ -204,7 +204,7 @@ app.notFound((c) => {
204
204
  })
205
205
  ```
206
206
 
207
- ### 커스텀 에러 클래스
207
+ ### Custom Error Classes
208
208
 
209
209
  ```typescript
210
210
  // lib/errors.ts
@@ -228,7 +228,7 @@ export class UnauthorizedError extends HTTPException {
228
228
  }
229
229
  }
230
230
 
231
- // 사용
231
+ // Usage
232
232
  import { NotFoundError } from '@/lib/errors'
233
233
 
234
234
  users.get('/:id', async (c) => {
@@ -244,15 +244,15 @@ users.get('/:id', async (c) => {
244
244
 
245
245
  <validation>
246
246
 
247
- ## Validation 패턴
247
+ ## Validation Patterns
248
248
 
249
- ### zValidator 사용
249
+ ### Using zValidator
250
250
 
251
251
  ```typescript
252
252
  import { zValidator } from '@hono/zod-validator'
253
253
  import { z } from 'zod'
254
254
 
255
- // ✅ zValidator 사용
255
+ // ✅ Use zValidator
256
256
  const createUserSchema = z.object({
257
257
  name: z.string().min(1).trim(),
258
258
  email: z.email(),
@@ -260,12 +260,12 @@ const createUserSchema = z.object({
260
260
  })
261
261
 
262
262
  users.post('/', zValidator('json', createUserSchema), async (c) => {
263
- const data = c.req.valid('json') // 타입 안전
263
+ const data = c.req.valid('json') // Type-safe
264
264
  const user = await prisma.user.create({ data })
265
265
  return c.json({ user }, 201)
266
266
  })
267
267
 
268
- // ❌ 수동 검증 금지
268
+ // ❌ Don't manually validate
269
269
  users.post('/', async (c) => {
270
270
  const body = await c.req.json()
271
271
 
@@ -278,7 +278,7 @@ users.post('/', async (c) => {
278
278
  })
279
279
  ```
280
280
 
281
- ### 여러 Validator
281
+ ### Multiple Validators
282
282
 
283
283
  ```typescript
284
284
  // Query Params
@@ -306,17 +306,17 @@ users.post('/', zValidator('json', createUserSchema), (c) => {
306
306
 
307
307
  <examples>
308
308
 
309
- ## 파일명 예시
309
+ ## File Naming Examples
310
310
 
311
- | 타입 | ❌ 잘못된 예시 | ✅ 올바른 예시 |
312
- |------|---------------|---------------|
311
+ | Type | ❌ Incorrect | ✅ Correct |
312
+ |------|-------------|-----------|
313
313
  | Route | `Users.ts` | `users.ts` |
314
314
  | Service | `userService.ts` | `user-service.ts` |
315
315
  | Middleware | `authMiddleware.ts` | `auth-middleware.ts` |
316
316
  | Utility | `formatUtils.ts` | `format-utils.ts` |
317
317
  | Type | `UserTypes.ts` | `user-types.ts` |
318
318
 
319
- ## 디렉토리 구조
319
+ ## Directory Structure
320
320
 
321
321
  ```
322
322
  src/
@@ -325,19 +325,19 @@ src/
325
325
  │ ├── posts.ts # /posts/*
326
326
  │ └── auth.ts # /auth/*
327
327
  ├── middleware/
328
- │ ├── auth.ts # 인증 미들웨어
329
- │ ├── logger.ts # 로깅 미들웨어
330
- │ └── cors.ts # CORS 미들웨어
328
+ │ ├── auth.ts # Authentication middleware
329
+ │ ├── logger.ts # Logging middleware
330
+ │ └── cors.ts # CORS middleware
331
331
  ├── services/
332
- │ ├── user-service.ts # 사용자 비즈니스 로직
333
- │ └── post-service.ts # 게시글 비즈니스 로직
332
+ │ ├── user-service.ts # User business logic
333
+ │ └── post-service.ts # Post business logic
334
334
  ├── lib/
335
- │ ├── prisma.ts # Prisma 클라이언트
336
- │ ├── env.ts # 환경 변수
337
- │ └── errors.ts # 커스텀 에러
335
+ │ ├── prisma.ts # Prisma client
336
+ │ ├── env.ts # Environment variables
337
+ │ └── errors.ts # Custom errors
338
338
  └── types/
339
- ├── user-types.ts # 사용자 타입
340
- └── api-types.ts # API 타입
339
+ ├── user-types.ts # User types
340
+ └── api-types.ts # API types
341
341
  ```
342
342
 
343
343
  </examples>
@@ -1,6 +1,6 @@
1
- # 환경 변수 설정
1
+ # Environment Variables
2
2
 
3
- > Hono 환경 변수 관리 (Node.js, Cloudflare Workers)
3
+ > Managing Hono environment variables (Node.js, Cloudflare Workers)
4
4
 
5
5
  <instructions>
6
6
  @../library/t3-env/index.md
@@ -10,9 +10,9 @@
10
10
 
11
11
  <runtime_differences>
12
12
 
13
- | 런타임 | 환경 변수 접근 | 용도 |
14
- |--------|---------------|------|
15
- | **Node.js** | `process.env.*` | 일반 서버 |
13
+ | Runtime | Environment Access | Use Case |
14
+ |---------|-------------------|----------|
15
+ | **Node.js** | `process.env.*` | General server |
16
16
  | **Cloudflare Workers** | `c.env.*` (Bindings) | Edge Runtime |
17
17
  | **Deno** | `Deno.env.get()` | Deno Runtime |
18
18
  | **Bun** | `process.env.*` | Bun Runtime |
@@ -23,22 +23,22 @@
23
23
 
24
24
  <file_structure>
25
25
 
26
- ## 환경 파일 구조
26
+ ## Environment File Structure
27
27
 
28
28
  ```
29
- ├── .env # 기본 (커밋 O)
30
- ├── .env.development # 개발 (커밋 O)
31
- ├── .env.production # 프로덕션 (커밋 O)
32
- ├── .env.local # 로컬 오버라이드 (커밋 X)
33
- └── src/lib/env.ts # 검증 타입 (t3-env)
29
+ ├── .env # Defaults (commit YES)
30
+ ├── .env.development # Development (commit YES)
31
+ ├── .env.production # Production (commit YES)
32
+ ├── .env.local # Local override (commit NO)
33
+ └── src/lib/env.ts # Validation & types (t3-env)
34
34
  ```
35
35
 
36
- | 우선순위 | 파일 | 설명 |
37
- |----------|------|------|
38
- | 1 | `.env.{mode}.local` | 최우선 (gitignore) |
39
- | 2 | `.env.local` | 로컬 오버라이드 |
40
- | 3 | `.env.{mode}` | 환경별 설정 |
41
- | 4 | `.env` | 기본 설정 |
36
+ | Priority | File | Description |
37
+ |----------|------|-------------|
38
+ | 1 | `.env.{mode}.local` | Highest priority (gitignore) |
39
+ | 2 | `.env.local` | Local override |
40
+ | 3 | `.env.{mode}` | Environment-specific |
41
+ | 4 | `.env` | Defaults |
42
42
 
43
43
  </file_structure>
44
44
 
@@ -46,9 +46,9 @@
46
46
 
47
47
  <patterns>
48
48
 
49
- ## 환경 파일 예시
49
+ ## Environment File Examples
50
50
 
51
- ### .env.local (gitignore, 시크릿)
51
+ ### .env.local (gitignore, secrets)
52
52
 
53
53
  ```env
54
54
  DATABASE_URL=postgresql://user:password@localhost:5432/myapp
@@ -72,9 +72,9 @@ PORT=8080
72
72
  LOG_LEVEL=info
73
73
  ```
74
74
 
75
- ## Node.js 환경 변수
75
+ ## Node.js Environment Variables
76
76
 
77
- ### 타입 안전한 환경 변수 (t3-env)
77
+ ### Type-safe Environment Variables (t3-env)
78
78
 
79
79
  ```typescript
80
80
  // src/lib/env.ts
@@ -94,7 +94,7 @@ export const env = createEnv({
94
94
  })
95
95
  ```
96
96
 
97
- ### 사용 예시
97
+ ### Usage Example
98
98
 
99
99
  ```typescript
100
100
  // src/index.ts
@@ -116,9 +116,9 @@ export default {
116
116
  }
117
117
  ```
118
118
 
119
- ## Cloudflare Workers 환경 변수
119
+ ## Cloudflare Workers Environment Variables
120
120
 
121
- ### Bindings 타입 정의
121
+ ### Bindings Type Definition
122
122
 
123
123
  ```typescript
124
124
  // src/types/index.ts
@@ -139,12 +139,12 @@ compatibility_date = "2024-01-01"
139
139
  [vars]
140
140
  NODE_ENV = "production"
141
141
 
142
- # 시크릿은 wrangler secret put 명령어로 설정
142
+ # Set secrets with wrangler secret put command
143
143
  # wrangler secret put DATABASE_URL
144
144
  # wrangler secret put JWT_SECRET
145
145
  ```
146
146
 
147
- ### 사용 예시
147
+ ### Usage Example
148
148
 
149
149
  ```typescript
150
150
  // src/index.ts
@@ -154,7 +154,7 @@ import type { Bindings } from './types'
154
154
  const app = new Hono<{ Bindings: Bindings }>()
155
155
 
156
156
  app.get('/', (c) => {
157
- // c.env를 통해 환경 변수 접근
157
+ // Access environment variables via c.env
158
158
  const dbUrl = c.env.DATABASE_URL
159
159
  const jwtSecret = c.env.JWT_SECRET
160
160
 
@@ -167,7 +167,7 @@ app.get('/', (c) => {
167
167
  export default app
168
168
  ```
169
169
 
170
- ### 미들웨어에서 사용
170
+ ### Using in Middleware
171
171
 
172
172
  ```typescript
173
173
  // src/middleware/auth.ts
@@ -186,26 +186,26 @@ export const authMiddleware = createMiddleware<{
186
186
  const token = c.req.header('Authorization')?.replace('Bearer ', '')
187
187
  if (!token) throw new HTTPException(401, { message: 'Unauthorized' })
188
188
 
189
- // JWT Secret 사용
189
+ // Use JWT Secret
190
190
  const jwtSecret = c.env.JWT_SECRET
191
- // JWT 검증 로직...
191
+ // JWT verification logic...
192
192
 
193
193
  c.set('userId', 'user-id')
194
194
  await next()
195
195
  })
196
196
  ```
197
197
 
198
- ## Cloudflare Workers 시크릿 설정
198
+ ## Cloudflare Workers Secrets Management
199
199
 
200
200
  ```bash
201
- # 시크릿 추가
201
+ # Add secret
202
202
  wrangler secret put DATABASE_URL
203
203
  wrangler secret put JWT_SECRET
204
204
 
205
- # 시크릿 목록 확인
205
+ # List secrets
206
206
  wrangler secret list
207
207
 
208
- # 시크릿 삭제
208
+ # Delete secret
209
209
  wrangler secret delete DATABASE_URL
210
210
  ```
211
211
 
@@ -218,14 +218,14 @@ wrangler secret delete DATABASE_URL
218
218
  ## .gitignore
219
219
 
220
220
  ```gitignore
221
- # 시크릿 포함 (절대 커밋 X)
221
+ # Contains secrets (NEVER commit)
222
222
  .env.local
223
223
  .env.*.local
224
224
 
225
225
  # Cloudflare Workers
226
226
  .dev.vars
227
227
 
228
- # 공개 설정 (커밋 O)
228
+ # Public config (commit OK)
229
229
  !.env
230
230
  !.env.development
231
231
  !.env.production
@@ -237,7 +237,7 @@ wrangler secret delete DATABASE_URL
237
237
 
238
238
  <typescript_types>
239
239
 
240
- ## TypeScript 타입
240
+ ## TypeScript Types
241
241
 
242
242
  ### Node.js
243
243
 
@@ -286,13 +286,13 @@ export type Bindings = {
286
286
 
287
287
  <best_practices>
288
288
 
289
- | 원칙 | 설명 |
290
- |------|------|
291
- | **시크릿 분리** | `.env.local`에만 시크릿 저장, 커밋 금지 |
292
- | **타입 안전성** | t3-env 또는 Zod 검증 |
293
- | **기본값** | `.env`에 안전한 기본값 설정 |
294
- | **문서화** | `.env.example` 파일로 필수 변수 목록 제공 |
295
- | **런타임별 차이** | Node.js `process.env`, Cloudflare `c.env` |
289
+ | Principle | Description |
290
+ |-----------|-------------|
291
+ | **Separate Secrets** | Store secrets only in `.env.local`, never commit |
292
+ | **Type Safety** | Validate with t3-env or Zod |
293
+ | **Defaults** | Set safe defaults in `.env` |
294
+ | **Documentation** | Provide required variables list via `.env.example` |
295
+ | **Runtime Differences** | Node.js uses `process.env`, Cloudflare uses `c.env` |
296
296
 
297
297
  </best_practices>
298
298
 
@@ -300,7 +300,7 @@ export type Bindings = {
300
300
 
301
301
  <cloudflare_specific>
302
302
 
303
- ## Cloudflare Workers 추가 기능
303
+ ## Cloudflare Workers Additional Features
304
304
 
305
305
  ### KV Namespace
306
306
 
@@ -310,7 +310,7 @@ export type Bindings = {
310
310
  binding = "MY_KV"
311
311
  id = "your-kv-id"
312
312
 
313
- // 사용
313
+ // Usage
314
314
  app.get('/cache/:key', async (c) => {
315
315
  const key = c.req.param('key')
316
316
  const value = await c.env.MY_KV.get(key)
@@ -327,7 +327,7 @@ binding = "DB"
327
327
  database_name = "my-database"
328
328
  database_id = "your-db-id"
329
329
 
330
- // 사용
330
+ // Usage
331
331
  app.get('/users', async (c) => {
332
332
  const { results } = await c.env.DB.prepare('SELECT * FROM users').all()
333
333
  return c.json({ users: results })
@@ -1,6 +1,6 @@
1
1
  # Getting Started
2
2
 
3
- > Hono 프로젝트 빠른 시작
3
+ > Quick start for Hono projects
4
4
 
5
5
  <instructions>
6
6
  @conventions.md
@@ -12,10 +12,10 @@
12
12
 
13
13
  <prerequisites>
14
14
 
15
- | 요구사항 | 버전 |
16
- |----------|------|
15
+ | Requirement | Version |
16
+ |-------------|---------|
17
17
  | Node.js | 18+ |
18
- | 패키지 관리자 | npm / yarn / pnpm |
18
+ | Package Manager | npm / yarn / pnpm |
19
19
 
20
20
  </prerequisites>
21
21
 
@@ -23,13 +23,13 @@
23
23
 
24
24
  <installation>
25
25
 
26
- ## 프로젝트 생성
26
+ ## Create Project
27
27
 
28
28
  ```bash
29
29
  # npm
30
30
  npm create hono@latest my-app
31
31
 
32
- # 템플릿 선택
32
+ # Select template
33
33
  ? Which template do you want to use?
34
34
  ❯ cloudflare-workers
35
35
  nodejs
@@ -40,7 +40,7 @@ cd my-app
40
40
  npm install
41
41
  ```
42
42
 
43
- ## 필수 패키지
43
+ ## Required Packages
44
44
 
45
45
  ```bash
46
46
  # Validation (Zod 4.x)
@@ -60,11 +60,11 @@ npm install @t3-oss/env-core
60
60
 
61
61
  <project_setup>
62
62
 
63
- ## 프로젝트 구조
63
+ ## Project Structure
64
64
 
65
65
  ```
66
66
  src/
67
- ├── index.ts # App 진입점
67
+ ├── index.ts # App entry point
68
68
  ├── routes/
69
69
  │ ├── index.ts # Root routes
70
70
  │ ├── users.ts # /users/*
@@ -82,7 +82,7 @@ src/
82
82
  └── index.ts
83
83
  ```
84
84
 
85
- ## App 설정
85
+ ## App Configuration
86
86
 
87
87
  ```typescript
88
88
  // src/index.ts
@@ -101,15 +101,15 @@ type Bindings = {
101
101
 
102
102
  const app = new Hono<{ Bindings: Bindings }>()
103
103
 
104
- // 미들웨어
104
+ // Middleware
105
105
  app.use('*', logger())
106
106
  app.use('*', cors())
107
107
 
108
- // 라우트
108
+ // Routes
109
109
  app.route('/users', users)
110
110
  app.route('/posts', posts)
111
111
 
112
- // 에러 핸들러
112
+ // Error handler
113
113
  app.onError((err, c) => {
114
114
  if (err instanceof HTTPException) {
115
115
  return c.json({ error: err.message }, err.status)
@@ -123,7 +123,7 @@ app.notFound((c) => c.json({ error: 'Not Found' }, 404))
123
123
  export default app
124
124
  ```
125
125
 
126
- ## 라우트 예시
126
+ ## Route Example
127
127
 
128
128
  ```typescript
129
129
  // src/routes/users.ts
@@ -171,7 +171,7 @@ users.post('/', zValidator('json', createUserSchema), async (c) => {
171
171
  export default users
172
172
  ```
173
173
 
174
- ## 미들웨어 예시
174
+ ## Middleware Example
175
175
 
176
176
  ```typescript
177
177
  // src/middleware/auth.ts
@@ -190,7 +190,7 @@ export const authMiddleware = createMiddleware<{ Variables: Variables }>(
190
190
  throw new HTTPException(401, { message: 'Unauthorized' })
191
191
  }
192
192
 
193
- // JWT 검증 로직
193
+ // JWT verification logic
194
194
  // const decoded = await verifyJWT(token)
195
195
 
196
196
  c.set('userId', 'user-id')
@@ -207,10 +207,10 @@ export const authMiddleware = createMiddleware<{ Variables: Variables }>(
207
207
 
208
208
  | Command | Description |
209
209
  |---------|-------------|
210
- | `npm run dev` | 개발 서버 시작 |
211
- | `npm run build` | 프로덕션 빌드 |
212
- | `npm start` | 프로덕션 서버 실행 |
213
- | `npm run deploy` | 배포 (Cloudflare Workers ) |
210
+ | `npm run dev` | Start development server |
211
+ | `npm run build` | Build for production |
212
+ | `npm start` | Run production server |
213
+ | `npm run deploy` | Deploy (Cloudflare Workers, etc.) |
214
214
 
215
215
  </commands>
216
216
 
@@ -218,13 +218,13 @@ export const authMiddleware = createMiddleware<{ Variables: Variables }>(
218
218
 
219
219
  <next_steps>
220
220
 
221
- | 문서 | 내용 |
222
- |------|------|
223
- | [conventions.md](./conventions.md) | 코드 컨벤션, 파일명 규칙 |
224
- | [env-setup.md](./env-setup.md) | 환경 변수 설정 |
225
- | [../library/hono/](../library/hono/) | Hono API 상세 가이드 |
226
- | [../library/prisma/](../library/prisma/) | Prisma ORM 사용법 |
227
- | [../deployment/](../deployment/) | 배포 가이드 |
221
+ | Document | Content |
222
+ |----------|---------|
223
+ | [conventions.md](./conventions.md) | Code conventions, file naming rules |
224
+ | [env-setup.md](./env-setup.md) | Environment variable setup |
225
+ | [../library/hono/](../library/hono/) | Detailed Hono API guide |
226
+ | [../library/prisma/](../library/prisma/) | Prisma ORM usage |
227
+ | [../deployment/](../deployment/) | Deployment guides |
228
228
 
229
229
  </next_steps>
230
230