@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,26 +1,26 @@
1
- # 코드 컨벤션
1
+ # Code Conventions
2
2
 
3
- > TanStack Start 프로젝트 코드 작성 규칙
3
+ > TanStack Start project coding rules
4
4
 
5
5
  ---
6
6
 
7
7
  <naming>
8
8
 
9
- ## 파일 네이밍
9
+ ## File Naming
10
10
 
11
- > ⚠️ **camelCase 파일명 금지** - 모든 파일명은 **kebab-case** 사용
11
+ > ⚠️ **No camelCase filenames** - All filenames must use **kebab-case**
12
12
 
13
- | 타입 | 규칙 | 예시 |
13
+ | Type | Rule | Example |
14
14
  |------|------|------|
15
- | **일반 파일** | kebab-case | `user-profile.tsx`, `auth-service.ts` |
16
- | **Route 파일** | TanStack Router 규칙 | `__root.tsx`, `index.tsx`, `$id.tsx` |
17
- | **Hook 파일** | `use-` 접두사 + kebab-case | `use-user-filter.ts`, `use-auth.ts` |
18
- | **Component** | PascalCase 컴포넌트, kebab-case 파일 | `UserCard` in `user-card.tsx` |
15
+ | **General Files** | kebab-case | `user-profile.tsx`, `auth-service.ts` |
16
+ | **Route Files** | TanStack Router rules | `__root.tsx`, `index.tsx`, `$id.tsx` |
17
+ | **Hook Files** | `use-` prefix + kebab-case | `use-user-filter.ts`, `use-auth.ts` |
18
+ | **Component** | PascalCase component, kebab-case file | `UserCard` in `user-card.tsx` |
19
19
  | **Server Function** | kebab-case | `get-users.ts`, `create-post.ts` |
20
20
 
21
21
  ```
22
- ❌ camelCase 금지: getUserById.ts, authService.ts, useUserFilter.ts
23
- ✅ kebab-case 필수: get-user-by-id.ts, auth-service.ts, use-user-filter.ts
22
+ No camelCase: getUserById.ts, authService.ts, useUserFilter.ts
23
+ ✅ kebab-case required: get-user-by-id.ts, auth-service.ts, use-user-filter.ts
24
24
  ```
25
25
 
26
26
  </naming>
@@ -29,39 +29,39 @@
29
29
 
30
30
  <typescript>
31
31
 
32
- ## TypeScript 규칙
32
+ ## TypeScript Rules
33
33
 
34
- | 규칙 | 설명 | 예시 |
34
+ | Rule | Description | Example |
35
35
  |------|------|------|
36
- | **함수 선언** | const 함수, 명시적 return type | `const fn = (): ReturnType => {}` |
37
- | **타입 정의** | interface (객체), type (유니온) | `interface User {}`, `type Status = 'a' \| 'b'` |
38
- | **any 금지** | unknown 사용 | `const data: unknown = JSON.parse(str)` |
39
- | **Import 타입** | type import 분리 | `import type { User } from '@/types'` |
36
+ | **Function Declaration** | const function, explicit return type | `const fn = (): ReturnType => {}` |
37
+ | **Type Definition** | interface (objects), type (unions) | `interface User {}`, `type Status = 'a' \| 'b'` |
38
+ | **No any** | Use unknown | `const data: unknown = JSON.parse(str)` |
39
+ | **Import Types** | Separate type imports | `import type { User } from '@/types'` |
40
40
 
41
- ## 패턴
41
+ ## Patterns
42
42
 
43
43
  ```typescript
44
- // ✅ const 함수, 명시적 타입
44
+ // ✅ const function, explicit type
45
45
  const getUserById = async (id: string): Promise<User> => {
46
46
  return prisma.user.findUnique({ where: { id } })
47
47
  }
48
48
 
49
- // ✅ 간단한 함수도 명시적 타입
49
+ // ✅ Simple functions also need explicit types
50
50
  const formatDate = (date: Date): string => {
51
51
  return date.toISOString()
52
52
  }
53
53
 
54
- // ✅ any 금지 → unknown 사용
54
+ // ✅ No any → use unknown
55
55
  const parseJSON = (data: string): unknown => {
56
56
  return JSON.parse(data)
57
57
  }
58
58
 
59
- // ❌ any 사용 금지
59
+ // ❌ No any
60
60
  const badParse = (data: string): any => { // ❌
61
61
  return JSON.parse(data)
62
62
  }
63
63
 
64
- // ❌ function 키워드 금지
64
+ // ❌ No function keyword
65
65
  function badFunction() { // ❌
66
66
  return 'use const arrow function'
67
67
  }
@@ -73,7 +73,7 @@ function badFunction() { // ❌
73
73
 
74
74
  <imports>
75
75
 
76
- ## Import 순서
76
+ ## Import Order
77
77
 
78
78
  ```typescript
79
79
  // 1. External libraries
@@ -101,19 +101,19 @@ import type { UseUsersReturn } from './-hooks/use-users'
101
101
 
102
102
  <comments>
103
103
 
104
- ## 한글 주석 (묶음 단위)
104
+ ## Korean Comments (Code Blocks)
105
105
 
106
106
  ```typescript
107
- // ✅ 코드 묶음 단위 주석
107
+ // ✅ Comments per code block
108
108
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109
- // 사용자 관련 상태
109
+ // User-related state
110
110
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
111
111
  const [user, setUser] = useState<User | null>(null)
112
112
  const [isLoading, setIsLoading] = useState(false)
113
113
  const [error, setError] = useState<Error | null>(null)
114
114
 
115
115
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
116
- // 데이터 조회
116
+ // Data fetching
117
117
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
118
  const { data: users } = useQuery({
119
119
  queryKey: ['users'],
@@ -122,10 +122,10 @@ const { data: users } = useQuery({
122
122
  ```
123
123
 
124
124
  ```typescript
125
- // ❌ 세세한 주석 (금지)
126
- const [user, setUser] = useState(null) // 사용자 상태
127
- const [isLoading, setIsLoading] = useState(false) // 로딩 상태
128
- const [error, setError] = useState(null) // 에러 상태
125
+ // ❌ Line-by-line comments (forbidden)
126
+ const [user, setUser] = useState(null) // User state
127
+ const [isLoading, setIsLoading] = useState(false) // Loading state
128
+ const [error, setError] = useState(null) // Error state
129
129
  ```
130
130
 
131
131
  </comments>
@@ -134,7 +134,7 @@ const [error, setError] = useState(null) // 에러 상태
134
134
 
135
135
  <error_handling>
136
136
 
137
- ## 에러 처리 패턴
137
+ ## Error Handling Pattern
138
138
 
139
139
  ```typescript
140
140
  // lib/errors.ts
@@ -168,7 +168,7 @@ export class UnauthorizedError extends AppError {
168
168
  }
169
169
  ```
170
170
 
171
- ## 사용 예시
171
+ ## Usage Example
172
172
 
173
173
  ```typescript
174
174
  // services/user/queries.ts
@@ -188,9 +188,9 @@ export const getUserById = createServerFn({ method: 'GET' })
188
188
 
189
189
  <examples>
190
190
 
191
- ## 파일명 예시
191
+ ## Filename Examples
192
192
 
193
- | 타입 | ❌ 잘못된 예시 | ✅ 올바른 예시 |
193
+ | Type | ❌ Wrong | ✅ Correct |
194
194
  |------|---------------|---------------|
195
195
  | Component | `UserProfile.tsx` | `user-profile.tsx` |
196
196
  | Service | `authService.ts` | `auth-service.ts` |
@@ -198,14 +198,14 @@ export const getUserById = createServerFn({ method: 'GET' })
198
198
  | Utility | `formatUtils.ts` | `format-utils.ts` |
199
199
  | Type | `UserTypes.ts` | `user-types.ts` |
200
200
 
201
- ## Route 파일명
201
+ ## Route Filenames
202
202
 
203
- | 경로 | 파일명 | 설명 |
203
+ | Path | Filename | Description |
204
204
  |------|--------|------|
205
- | `/` | `index.tsx` | 인덱스 라우트 |
206
- | `/users` | `users/index.tsx` | 사용자 목록 |
207
- | `/users/:id` | `users/$id.tsx` | 동적 라우트 |
208
- | `/posts/:slug` | `posts/$slug.tsx` | URL 파라미터 |
209
- | Layout | `__root.tsx` | Root 레이아웃 |
205
+ | `/` | `index.tsx` | Index route |
206
+ | `/users` | `users/index.tsx` | User list |
207
+ | `/users/:id` | `users/$id.tsx` | Dynamic route |
208
+ | `/posts/:slug` | `posts/$slug.tsx` | URL parameter |
209
+ | Layout | `__root.tsx` | Root layout |
210
210
 
211
211
  </examples>
@@ -1,6 +1,6 @@
1
- # 환경 변수 설정
1
+ # Environment Variables Setup
2
2
 
3
- > TanStack Start (Vite 기반) 환경 변수 관리
3
+ > TanStack Start (Vite-based) Environment Variables Management
4
4
 
5
5
  <instructions>
6
6
  @../library/t3-env/index.md
@@ -10,10 +10,10 @@
10
10
 
11
11
  <environment_types>
12
12
 
13
- | 접근 방식 | 위치 | 용도 | 노출 |
14
- |-----------|------|------|------|
15
- | `process.env.*` | Server Function | DB, API 키, 시크릿 | ❌ 서버만 |
16
- | `import.meta.env.VITE_*` | 클라이언트 + 서버 | 공개 설정 | ✅ 브라우저 노출 |
13
+ | Access Method | Location | Purpose | Exposure |
14
+ |---------------|----------|---------|----------|
15
+ | `process.env.*` | Server Function | DB, API keys, secrets | ❌ Server only |
16
+ | `import.meta.env.VITE_*` | Client + Server | Public configuration | ✅ Browser exposed |
17
17
 
18
18
  </environment_types>
19
19
 
@@ -21,22 +21,22 @@
21
21
 
22
22
  <file_structure>
23
23
 
24
- ## 환경 파일 구조
24
+ ## Environment File Structure
25
25
 
26
26
  ```
27
- ├── .env # 기본 (커밋 O)
28
- ├── .env.development # 개발 (커밋 O)
29
- ├── .env.production # 프로덕션 (커밋 O)
30
- ├── .env.local # 로컬 오버라이드 (커밋 X)
31
- └── src/lib/env.ts # 검증 타입 (t3-env)
27
+ ├── .env # Default (commit )
28
+ ├── .env.development # Development (commit )
29
+ ├── .env.production # Production (commit )
30
+ ├── .env.local # Local override (commit )
31
+ └── src/lib/env.ts # Validation and types (t3-env)
32
32
  ```
33
33
 
34
- | 우선순위 | 파일 | 설명 |
35
- |----------|------|------|
36
- | 1 | `.env.{mode}.local` | 최우선 (gitignore) |
37
- | 2 | `.env.local` | 로컬 오버라이드 |
38
- | 3 | `.env.{mode}` | 환경별 설정 |
39
- | 4 | `.env` | 기본 설정 |
34
+ | Priority | File | Description |
35
+ |----------|------|-------------|
36
+ | 1 | `.env.{mode}.local` | Highest priority (gitignore) |
37
+ | 2 | `.env.local` | Local override |
38
+ | 3 | `.env.{mode}` | Environment-specific config |
39
+ | 4 | `.env` | Default config |
40
40
 
41
41
  </file_structure>
42
42
 
@@ -44,9 +44,9 @@
44
44
 
45
45
  <patterns>
46
46
 
47
- ## 환경 파일 예시
47
+ ## Environment File Examples
48
48
 
49
- ### .env.local (gitignore, 시크릿)
49
+ ### .env.local (gitignore, secrets)
50
50
 
51
51
  ```env
52
52
  DATABASE_URL=postgresql://user:password@localhost:5432/myapp
@@ -70,7 +70,7 @@ VITE_APP_NAME=My App
70
70
  VITE_API_URL=https://api.myapp.com
71
71
  ```
72
72
 
73
- ## 타입 안전한 환경 변수 (t3-env)
73
+ ## Type-Safe Environment Variables (t3-env)
74
74
 
75
75
  ```typescript
76
76
  // src/lib/env.ts
@@ -106,7 +106,7 @@ export const env = createEnv({
106
106
  })
107
107
  ```
108
108
 
109
- ## 사용 예시
109
+ ## Usage Examples
110
110
 
111
111
  ### Server Function
112
112
 
@@ -118,13 +118,13 @@ import { prisma } from '@/database/prisma'
118
118
 
119
119
  export const getUsers = createServerFn({ method: 'GET' })
120
120
  .handler(async () => {
121
- // env.DATABASE_URL 서버에서만 사용 가능
121
+ // env.DATABASE_URL is only available on server
122
122
  console.log('DB URL:', env.DATABASE_URL)
123
123
  return prisma.user.findMany()
124
124
  })
125
125
  ```
126
126
 
127
- ### 클라이언트 컴포넌트
127
+ ### Client Component
128
128
 
129
129
  ```tsx
130
130
  // components/app-header.tsx
@@ -149,11 +149,11 @@ export const AppHeader = (): JSX.Element => {
149
149
  ## .gitignore
150
150
 
151
151
  ```gitignore
152
- # 시크릿 포함 (절대 커밋 X)
152
+ # Contains secrets (never commit)
153
153
  .env.local
154
154
  .env.*.local
155
155
 
156
- # 공개 설정 (커밋 O)
156
+ # Public config (safe to commit)
157
157
  !.env
158
158
  !.env.development
159
159
  !.env.production
@@ -165,7 +165,7 @@ export const AppHeader = (): JSX.Element => {
165
165
 
166
166
  <typescript_types>
167
167
 
168
- ## TypeScript 타입 (Vite)
168
+ ## TypeScript Types (Vite)
169
169
 
170
170
  ```typescript
171
171
  // src/vite-env.d.ts
@@ -181,7 +181,7 @@ interface ImportMeta {
181
181
  }
182
182
  ```
183
183
 
184
- **참고:** t3-env 사용 자동으로 타입 추론됨
184
+ **Note:** Types are automatically inferred when using t3-env
185
185
 
186
186
  </typescript_types>
187
187
 
@@ -189,13 +189,13 @@ interface ImportMeta {
189
189
 
190
190
  <best_practices>
191
191
 
192
- | 원칙 | 설명 |
193
- |------|------|
194
- | **시크릿 분리** | `.env.local`에만 시크릿 저장, 커밋 금지 |
195
- | **공개 변수** | `VITE_` 접두사 사용, 브라우저 노출 허용 |
196
- | **타입 안전성** | t3-env 또는 Zod 검증 |
197
- | **기본값** | `.env`에 안전한 기본값 설정 |
198
- | **문서화** | `.env.example` 파일로 필수 변수 목록 제공 |
192
+ | Principle | Description |
193
+ |-----------|-------------|
194
+ | **Separate Secrets** | Store secrets only in `.env.local`, never commit |
195
+ | **Public Variables** | Use `VITE_` prefix, safe for browser exposure |
196
+ | **Type Safety** | Validate with t3-env or Zod |
197
+ | **Default Values** | Set safe defaults in `.env` |
198
+ | **Documentation** | Provide required variable list in `.env.example` |
199
199
 
200
200
  </best_practices>
201
201
 
@@ -1,6 +1,6 @@
1
1
  # Getting Started
2
2
 
3
- > TanStack Start 프로젝트 빠른 시작
3
+ > TanStack Start project quick start
4
4
 
5
5
  <instructions>
6
6
  @conventions.md
@@ -12,10 +12,10 @@
12
12
 
13
13
  <prerequisites>
14
14
 
15
- | 요구사항 | 버전 |
15
+ | Requirement | Version |
16
16
  |----------|------|
17
17
  | Node.js | 18+ |
18
- | 패키지 관리자 | Yarn / npm / pnpm |
18
+ | Package Manager | Yarn / npm / pnpm |
19
19
 
20
20
  </prerequisites>
21
21
 
@@ -23,7 +23,7 @@
23
23
 
24
24
  <installation>
25
25
 
26
- ## 프로젝트 생성
26
+ ## Create Project
27
27
 
28
28
  ```bash
29
29
  npx create-tsrouter-app@latest my-app --template start
@@ -31,7 +31,7 @@ cd my-app
31
31
  yarn install
32
32
  ```
33
33
 
34
- ## 필수 패키지
34
+ ## Required Packages
35
35
 
36
36
  ```bash
37
37
  # Database (Prisma 7.x)
@@ -51,7 +51,7 @@ yarn add @tanstack/react-query
51
51
 
52
52
  <project_setup>
53
53
 
54
- ## 프로젝트 구조
54
+ ## Project Structure
55
55
 
56
56
  ```
57
57
  src/
@@ -59,8 +59,8 @@ src/
59
59
  │ ├── __root.tsx # Root Layout
60
60
  │ └── index.tsx # Home Page
61
61
  ├── lib/
62
- │ └── query-client.ts # Query Client 설정
63
- └── app.config.ts # TanStack Start 설정
62
+ │ └── query-client.ts # Query Client setup
63
+ └── app.config.ts # TanStack Start config
64
64
  ```
65
65
 
66
66
  ## app.config.ts
@@ -121,7 +121,7 @@ const HomePage = (): JSX.Element => {
121
121
  }
122
122
  ```
123
123
 
124
- ## Query Client 설정
124
+ ## Query Client Setup
125
125
 
126
126
  ```typescript
127
127
  // src/lib/query-client.ts
@@ -131,7 +131,7 @@ export const createQueryClient = (): QueryClient => {
131
131
  return new QueryClient({
132
132
  defaultOptions: {
133
133
  queries: {
134
- staleTime: 60 * 1000, // 1
134
+ staleTime: 60 * 1000, // 1 minute
135
135
  retry: 1,
136
136
  },
137
137
  },
@@ -147,9 +147,9 @@ export const createQueryClient = (): QueryClient => {
147
147
 
148
148
  | Command | Description |
149
149
  |---------|-------------|
150
- | `yarn dev` | 개발 서버 시작 (http://localhost:3000) |
151
- | `yarn build` | 프로덕션 빌드 |
152
- | `yarn start` | 프로덕션 서버 실행 |
150
+ | `yarn dev` | Start development server (http://localhost:3000) |
151
+ | `yarn build` | Production build |
152
+ | `yarn start` | Start production server |
153
153
 
154
154
  </commands>
155
155
 
@@ -157,13 +157,13 @@ export const createQueryClient = (): QueryClient => {
157
157
 
158
158
  <next_steps>
159
159
 
160
- | 문서 | 내용 |
160
+ | Document | Content |
161
161
  |------|------|
162
- | [conventions.md](./conventions.md) | 코드 컨벤션, 파일명 규칙 |
163
- | [env-setup.md](./env-setup.md) | 환경 변수 설정 |
164
- | [routes.md](./routes.md) | 라우트 구조, 파일 기반 라우팅 |
165
- | [services.md](./services.md) | Server Functions, 데이터 레이어 |
166
- | [hooks.md](./hooks.md) | Custom Hook 패턴 |
162
+ | [conventions.md](./conventions.md) | Code conventions, naming rules |
163
+ | [env-setup.md](./env-setup.md) | Environment variable setup |
164
+ | [routes.md](./routes.md) | Route structure, file-based routing |
165
+ | [services.md](./services.md) | Server Functions, data layer |
166
+ | [hooks.md](./hooks.md) | Custom Hook patterns |
167
167
 
168
168
  </next_steps>
169
169
 
@@ -1,6 +1,6 @@
1
- # Custom Hook 패턴
1
+ # Custom Hook Patterns
2
2
 
3
- > 페이지/섹션의 모든 로직, 상태, 라이프사이클 중앙화
3
+ > Centralize all logic, state, and lifecycle for pages/sections
4
4
 
5
5
  <instructions>
6
6
  @../library/tanstack-router/hooks.md
@@ -12,26 +12,26 @@
12
12
 
13
13
  <mandatory_separation>
14
14
 
15
- ## ⚠️ 필수 규칙: Custom Hook 분리
15
+ ## ⚠️ Required Rule: Custom Hook Separation
16
16
 
17
- **모든 페이지는 Custom Hook을 `-hooks/` 폴더에 분리해야 합니다.**
17
+ **All pages must separate Custom Hooks into `-hooks/` folder.**
18
18
 
19
- - 페이지 크기(줄 수)와 **무관**하게 반드시 분리
20
- - 10줄짜리 간단한 페이지도 Hook 분리 필수
21
- - 페이지 컴포넌트는 오직 UI 렌더링만 담당
19
+ - Must be separated **regardless of page size** (line count)
20
+ - Even simple 10-line pages require Hook separation
21
+ - Page components should only handle UI rendering
22
22
 
23
23
  ```typescript
24
- // ✅ 올바른 구조
24
+ // ✅ Correct structure
25
25
  routes/users/
26
- ├── index.tsx // UI
26
+ ├── index.tsx // UI only
27
27
  ├── -hooks/
28
- │ └── use-users.ts // 모든 로직
28
+ │ └── use-users.ts // All logic
29
29
  ├── -components/
30
30
  └── -functions/
31
31
 
32
- // ❌ 잘못된 구조
32
+ // ❌ Wrong structure
33
33
  routes/users/
34
- └── index.tsx // UI + 로직 혼재
34
+ └── index.tsx // UI + logic mixed
35
35
  ```
36
36
 
37
37
  </mandatory_separation>
@@ -40,16 +40,16 @@ routes/users/
40
40
 
41
41
  <hook_order>
42
42
 
43
- ## Hook 내부 순서 (필수)
43
+ ## Hook Internal Order (Required)
44
44
 
45
- | 순서 | Hook 타입 | 예시 |
46
- |------|-----------|------|
45
+ | Order | Hook Type | Examples |
46
+ |-------|-----------|----------|
47
47
  | 1 | State | `useState`, zustand store |
48
48
  | 2 | Global Hooks | `useParams`, `useNavigate`, `useQueryClient` |
49
49
  | 3 | React Query | `useQuery` → `useMutation` |
50
50
  | 4 | Event Handlers | `handleCreate`, `handleDelete` |
51
- | 5 | useMemo | 계산된 |
52
- | 6 | useEffect | 부수 효과 |
51
+ | 5 | useMemo | Computed values |
52
+ | 6 | useEffect | Side effects |
53
53
 
54
54
  </hook_order>
55
55
 
@@ -57,7 +57,7 @@ routes/users/
57
57
 
58
58
  <patterns>
59
59
 
60
- ## Page Hook 패턴
60
+ ## Page Hook Pattern
61
61
 
62
62
  ```typescript
63
63
  // routes/users/-hooks/use-users.ts
@@ -159,7 +159,7 @@ export const useUsers = (): UseUsersReturn => {
159
159
  }
160
160
  ```
161
161
 
162
- ## Filter Hook 패턴
162
+ ## Filter Hook Pattern
163
163
 
164
164
  ```typescript
165
165
  // routes/users/-hooks/use-user-filter.ts
@@ -186,7 +186,7 @@ export const useUserFilter = (): UseUserFilterReturn => {
186
186
  }
187
187
  ```
188
188
 
189
- ## Form Hook 패턴
189
+ ## Form Hook Pattern
190
190
 
191
191
  ```typescript
192
192
  // routes/users/-hooks/use-user-form.ts
@@ -255,24 +255,24 @@ export const useUserForm = (): UseUserFormReturn => {
255
255
 
256
256
  <anti_patterns>
257
257
 
258
- ## ❌ 잘못된 순서
258
+ ## ❌ Wrong Order
259
259
 
260
260
  ```typescript
261
- // ❌ 순서가 뒤섞인 잘못된 예시
261
+ // ❌ Mixed order (wrong example)
262
262
  export const useBadHook = () => {
263
- const queryClient = useQueryClient() // ❌ Global Hook 먼저
263
+ const queryClient = useQueryClient() // ❌ Global Hook first
264
264
 
265
- useEffect(() => { /* ... */ }, []) // ❌ useEffect 중간에
265
+ useEffect(() => { /* ... */ }, []) // ❌ useEffect in the middle
266
266
 
267
- const [state, setState] = useState() // ❌ State 나중에
267
+ const [state, setState] = useState() // ❌ State later
268
268
 
269
- const { data } = useQuery({ /* ... */ }) // ❌ Query Effect 다음에
269
+ const { data } = useQuery({ /* ... */ }) // ❌ Query after Effect
270
270
 
271
- const computed = useMemo(() => {}, []) // ❌ useMemo 위치 잘못됨
271
+ const computed = useMemo(() => {}, []) // ❌ useMemo wrong position
272
272
  }
273
273
  ```
274
274
 
275
- ## ✅ 올바른 순서
275
+ ## ✅ Correct Order
276
276
 
277
277
  ```typescript
278
278
  export const useGoodHook = () => {
@@ -306,12 +306,12 @@ export const useGoodHook = () => {
306
306
 
307
307
  ## TanStack Router Hooks
308
308
 
309
- | Hook | 용도 | 예시 |
310
- |------|------|------|
311
- | `useParams` | URL 파라미터 | `const { id } = useParams({ from: '/users/$id' })` |
312
- | `useNavigate` | 프로그래밍 방식 네비게이션 | `navigate({ to: '/users' })` |
309
+ | Hook | Purpose | Example |
310
+ |------|---------|---------|
311
+ | `useParams` | URL parameters | `const { id } = useParams({ from: '/users/$id' })` |
312
+ | `useNavigate` | Programmatic navigation | `navigate({ to: '/users' })` |
313
313
  | `useSearch` | Search params | `const { page } = useSearch({ from: '/users' })` |
314
- | `useLoaderData` | Loader 데이터 | `const user = Route.useLoaderData()` |
314
+ | `useLoaderData` | Loader data | `const user = Route.useLoaderData()` |
315
315
  | `useRouteContext` | Route context | `const { auth } = useRouteContext({ from: '__root__' })` |
316
316
 
317
317
  ```typescript
@@ -342,11 +342,11 @@ export const useUserDetail = () => {
342
342
 
343
343
  ## TanStack Query Hooks
344
344
 
345
- | Hook | 용도 | 특징 |
346
- |------|------|------|
347
- | `useQuery` | 데이터 조회 (GET) | 자동 캐싱, 재검증 |
348
- | `useMutation` | 데이터 변경 (POST/PUT/DELETE) | 성공 캐시 무효화 |
349
- | `useQueryClient` | 캐시 제어 | `invalidateQueries`, `setQueryData` |
345
+ | Hook | Purpose | Features |
346
+ |------|---------|----------|
347
+ | `useQuery` | Data fetching (GET) | Auto caching, revalidation |
348
+ | `useMutation` | Data modification (POST/PUT/DELETE) | Cache invalidation on success |
349
+ | `useQueryClient` | Cache control | `invalidateQueries`, `setQueryData` |
350
350
 
351
351
  ```typescript
352
352
  import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
@@ -378,13 +378,13 @@ export const useUsers = () => {
378
378
 
379
379
  <best_practices>
380
380
 
381
- | 원칙 | 설명 |
382
- |------|------|
383
- | **순서 준수** | State → Global → Query → Handlers → Memo → Effect |
384
- | **타입 정의** | Return 타입 명시 (interface) |
385
- | **단일 책임** | 하나의 Hook 하나의 관심사 |
386
- | **useCallback** | Event handler는 useCallback으로 메모이제이션 |
387
- | **명확한 네이밍** | `use-users.ts`, `use-user-filter.ts` |
381
+ | Principle | Description |
382
+ |-----------|-------------|
383
+ | **Order Compliance** | State → Global → Query → Handlers → Memo → Effect |
384
+ | **Type Definition** | Explicit return type (interface) |
385
+ | **Single Responsibility** | One Hook, one concern |
386
+ | **useCallback** | Memoize event handlers with useCallback |
387
+ | **Clear Naming** | `use-users.ts`, `use-user-filter.ts` |
388
388
 
389
389
  </best_practices>
390
390