@kood/claude-code 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/index.js +552 -340
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/document-writer.md +73 -306
  4. package/templates/.claude/instructions/agent-patterns/index.md +7 -7
  5. package/templates/.claude/instructions/document-templates/ralph-templates.md +71 -0
  6. package/templates/.claude/instructions/index.md +14 -14
  7. package/templates/.claude/instructions/multi-agent/agent-roster.md +14 -14
  8. package/templates/.claude/instructions/multi-agent/index.md +4 -4
  9. package/templates/.claude/skills/docs-creator/AGENTS.md +54 -176
  10. package/templates/.claude/skills/docs-creator/SKILL.md +98 -464
  11. package/templates/.claude/skills/docs-refactor/AGENTS.md +61 -190
  12. package/templates/.claude/skills/docs-refactor/SKILL.md +67 -443
  13. package/templates/.claude/skills/execute/SKILL.md +540 -13
  14. package/templates/.claude/skills/plan/SKILL.md +84 -18
  15. package/templates/.claude/skills/ralph/SKILL.md +17 -14
  16. package/templates/.claude/skills/refactor/AGENTS.md +269 -0
  17. package/templates/.claude/skills/refactor/SKILL.md +424 -66
  18. package/templates/.claude/skills/stitch-design/README.md +34 -0
  19. package/templates/.claude/skills/stitch-design/SKILL.md +213 -0
  20. package/templates/.claude/skills/stitch-design/examples/DESIGN.md +154 -0
  21. package/templates/.claude/skills/stitch-loop/README.md +54 -0
  22. package/templates/.claude/skills/stitch-loop/SKILL.md +316 -0
  23. package/templates/.claude/skills/stitch-loop/examples/SITE.md +73 -0
  24. package/templates/.claude/skills/stitch-loop/examples/next-prompt.md +25 -0
  25. package/templates/.claude/skills/stitch-loop/resources/baton-schema.md +61 -0
  26. package/templates/.claude/skills/stitch-loop/resources/site-template.md +104 -0
  27. package/templates/.claude/skills/stitch-react/README.md +36 -0
  28. package/templates/.claude/skills/stitch-react/SKILL.md +323 -0
  29. package/templates/.claude/skills/stitch-react/examples/gold-standard-card.tsx +88 -0
  30. package/templates/.claude/skills/stitch-react/package-lock.json +231 -0
  31. package/templates/.claude/skills/stitch-react/package.json +16 -0
  32. package/templates/.claude/skills/stitch-react/resources/architecture-checklist.md +15 -0
  33. package/templates/.claude/skills/stitch-react/resources/component-template.tsx +37 -0
  34. package/templates/.claude/skills/stitch-react/resources/stitch-api-reference.md +14 -0
  35. package/templates/.claude/skills/stitch-react/resources/style-guide.json +24 -0
  36. package/templates/.claude/skills/stitch-react/scripts/fetch-stitch.sh +30 -0
  37. package/templates/.claude/skills/stitch-react/scripts/validate.js +77 -0
  38. package/templates/hono/CLAUDE.md +28 -28
  39. package/templates/hono/docs/architecture.md +24 -24
  40. package/templates/hono/docs/deployment/cloudflare.md +18 -18
  41. package/templates/hono/docs/deployment/docker.md +13 -13
  42. package/templates/hono/docs/deployment/index.md +19 -19
  43. package/templates/hono/docs/deployment/railway.md +32 -32
  44. package/templates/hono/docs/deployment/vercel.md +29 -29
  45. package/templates/hono/docs/guides/conventions.md +57 -57
  46. package/templates/hono/docs/guides/env-setup.md +47 -47
  47. package/templates/hono/docs/guides/getting-started.md +27 -27
  48. package/templates/hono/docs/library/hono/error-handling.md +11 -11
  49. package/templates/hono/docs/library/hono/index.md +4 -4
  50. package/templates/hono/docs/library/hono/middleware.md +18 -18
  51. package/templates/hono/docs/library/hono/rpc.md +7 -7
  52. package/templates/hono/docs/library/hono/validation.md +6 -6
  53. package/templates/hono/docs/library/prisma/cloudflare-d1.md +29 -29
  54. package/templates/hono/docs/library/prisma/config.md +16 -16
  55. package/templates/hono/docs/library/prisma/index.md +32 -32
  56. package/templates/hono/docs/library/t3-env/index.md +22 -22
  57. package/templates/hono/docs/library/zod/index.md +31 -31
  58. package/templates/nextjs/CLAUDE.md +54 -54
  59. package/templates/nextjs/docs/architecture.md +146 -146
  60. package/templates/nextjs/docs/design.md +183 -183
  61. package/templates/nextjs/docs/guides/conventions.md +86 -86
  62. package/templates/nextjs/docs/guides/getting-started.md +28 -28
  63. package/templates/nextjs/docs/guides/routes.md +32 -32
  64. package/templates/nextjs/docs/library/better-auth/index.md +70 -70
  65. package/templates/nextjs/docs/library/nextjs/app-router.md +43 -43
  66. package/templates/nextjs/docs/library/nextjs/caching.md +73 -73
  67. package/templates/nextjs/docs/library/nextjs/index.md +51 -51
  68. package/templates/nextjs/docs/library/nextjs/middleware.md +41 -41
  69. package/templates/nextjs/docs/library/nextjs/route-handlers.md +31 -31
  70. package/templates/nextjs/docs/library/nextjs/server-actions.md +34 -34
  71. package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +20 -20
  72. package/templates/nextjs/docs/library/prisma/config.md +18 -18
  73. package/templates/nextjs/docs/library/prisma/crud.md +17 -17
  74. package/templates/nextjs/docs/library/prisma/index.md +18 -18
  75. package/templates/nextjs/docs/library/prisma/relations.md +16 -16
  76. package/templates/nextjs/docs/library/prisma/schema.md +23 -23
  77. package/templates/nextjs/docs/library/prisma/setup.md +6 -6
  78. package/templates/nextjs/docs/library/prisma/transactions.md +10 -10
  79. package/templates/nextjs/docs/library/tanstack-query/index.md +6 -6
  80. package/templates/nextjs/docs/library/tanstack-query/invalidation.md +20 -20
  81. package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +4 -4
  82. package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +15 -15
  83. package/templates/nextjs/docs/library/tanstack-query/use-query.md +22 -22
  84. package/templates/nextjs/docs/library/zod/complex-types.md +11 -11
  85. package/templates/nextjs/docs/library/zod/index.md +8 -8
  86. package/templates/nextjs/docs/library/zod/transforms.md +11 -11
  87. package/templates/nextjs/docs/library/zod/validation.md +9 -9
  88. package/templates/npx/CLAUDE.md +38 -38
  89. package/templates/npx/docs/library/commander/index.md +12 -12
  90. package/templates/npx/docs/library/fs-extra/index.md +9 -9
  91. package/templates/npx/docs/library/prompts/index.md +3 -3
  92. package/templates/npx/docs/references/patterns.md +12 -12
  93. package/templates/tanstack-start/CLAUDE.md +54 -54
  94. package/templates/tanstack-start/docs/architecture.md +128 -128
  95. package/templates/tanstack-start/docs/design.md +169 -169
  96. package/templates/tanstack-start/docs/guides/conventions.md +43 -43
  97. package/templates/tanstack-start/docs/guides/env-setup.md +35 -35
  98. package/templates/tanstack-start/docs/guides/getting-started.md +19 -19
  99. package/templates/tanstack-start/docs/guides/hooks.md +45 -45
  100. package/templates/tanstack-start/docs/guides/routes.md +54 -54
  101. package/templates/tanstack-start/docs/guides/services.md +45 -45
  102. package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +19 -19
  103. package/templates/tanstack-start/docs/library/prisma/config.md +16 -16
  104. package/templates/tanstack-start/docs/library/prisma/crud.md +17 -17
  105. package/templates/tanstack-start/docs/library/prisma/relations.md +16 -16
  106. package/templates/tanstack-start/docs/library/prisma/schema.md +23 -23
  107. package/templates/tanstack-start/docs/library/prisma/setup.md +6 -6
  108. package/templates/tanstack-start/docs/library/prisma/transactions.md +10 -10
  109. package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +19 -19
  110. package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +4 -4
  111. package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +14 -14
  112. package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +21 -21
  113. package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +9 -9
  114. package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +11 -11
  115. package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +17 -17
  116. package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +5 -5
  117. package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +10 -10
  118. package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +8 -8
  119. package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +9 -9
  120. package/templates/tanstack-start/docs/library/tanstack-start/routing.md +6 -6
  121. package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +18 -18
  122. package/templates/tanstack-start/docs/library/tanstack-start/setup.md +4 -4
  123. package/templates/tanstack-start/docs/library/zod/complex-types.md +11 -11
  124. package/templates/tanstack-start/docs/library/zod/transforms.md +11 -11
  125. package/templates/tanstack-start/docs/library/zod/validation.md +9 -9
@@ -1,26 +1,26 @@
1
- # Code Conventions
1
+ # 코드 컨벤션
2
2
 
3
- > TanStack Start project coding rules
3
+ > TanStack Start 프로젝트 코드 작성 규칙
4
4
 
5
5
  ---
6
6
 
7
7
  <naming>
8
8
 
9
- ## File Naming
9
+ ## 파일 네이밍
10
10
 
11
- > ⚠️ **No camelCase filenames** - All filenames must use **kebab-case**
11
+ > ⚠️ **camelCase 파일명 금지** - 모든 파일명은 **kebab-case** 사용
12
12
 
13
- | Type | Rule | Example |
13
+ | 타입 | 규칙 | 예시 |
14
14
  |------|------|------|
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` |
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` |
19
19
  | **Server Function** | kebab-case | `get-users.ts`, `create-post.ts` |
20
20
 
21
21
  ```
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
22
+ ❌ camelCase 금지: getUserById.ts, authService.ts, useUserFilter.ts
23
+ ✅ kebab-case 필수: 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 Rules
32
+ ## TypeScript 규칙
33
33
 
34
- | Rule | Description | Example |
34
+ | 규칙 | 설명 | 예시 |
35
35
  |------|------|------|
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'` |
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'` |
40
40
 
41
- ## Patterns
41
+ ## 패턴
42
42
 
43
43
  ```typescript
44
- // ✅ const function, explicit type
44
+ // ✅ const 함수, 명시적 타입
45
45
  const getUserById = async (id: string): Promise<User> => {
46
46
  return prisma.user.findUnique({ where: { id } })
47
47
  }
48
48
 
49
- // ✅ Simple functions also need explicit types
49
+ // ✅ 간단한 함수도 명시적 타입
50
50
  const formatDate = (date: Date): string => {
51
51
  return date.toISOString()
52
52
  }
53
53
 
54
- // ✅ No any → use unknown
54
+ // ✅ any 금지 unknown 사용
55
55
  const parseJSON = (data: string): unknown => {
56
56
  return JSON.parse(data)
57
57
  }
58
58
 
59
- // ❌ No any
59
+ // ❌ any 사용 금지
60
60
  const badParse = (data: string): any => { // ❌
61
61
  return JSON.parse(data)
62
62
  }
63
63
 
64
- // ❌ No function keyword
64
+ // ❌ function 키워드 금지
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 Order
76
+ ## Import 순서
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
- ## Korean Comments (Code Blocks)
104
+ ## 한글 주석 (묶음 단위)
105
105
 
106
106
  ```typescript
107
- // ✅ Comments per code block
107
+ // ✅ 코드 묶음 단위 주석
108
108
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109
- // User-related state
109
+ // 사용자 관련 상태
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
- // Data fetching
116
+ // 데이터 조회
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
- // ❌ 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
125
+ // ❌ 세세한 주석 (금지)
126
+ const [user, setUser] = useState(null) // 사용자 상태
127
+ const [isLoading, setIsLoading] = useState(false) // 로딩 상태
128
+ const [error, setError] = useState(null) // 에러 상태
129
129
  ```
130
130
 
131
131
  </comments>
@@ -134,7 +134,7 @@ const [error, setError] = useState(null) // Error state
134
134
 
135
135
  <error_handling>
136
136
 
137
- ## Error Handling Pattern
137
+ ## 에러 처리 패턴
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
- ## Usage Example
171
+ ## 사용 예시
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
- ## Filename Examples
191
+ ## 파일명 예시
192
192
 
193
- | Type | ❌ Wrong | ✅ Correct |
193
+ | 타입 | ❌ 잘못된 예시 | ✅ 올바른 예시 |
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 Filenames
201
+ ## Route 파일명
202
202
 
203
- | Path | Filename | Description |
203
+ | 경로 | 파일명 | 설명 |
204
204
  |------|--------|------|
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 |
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 레이아웃 |
210
210
 
211
211
  </examples>
@@ -1,6 +1,6 @@
1
- # Environment Variables Setup
1
+ # 환경 변수 설정
2
2
 
3
- > TanStack Start (Vite-based) Environment Variables Management
3
+ > TanStack Start (Vite 기반) 환경 변수 관리
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
- | 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 |
13
+ | 접근 방식 | 위치 | 용도 | 노출 |
14
+ |-----------|------|------|------|
15
+ | `process.env.*` | Server Function | DB, API 키, 시크릿 | ❌ 서버만 |
16
+ | `import.meta.env.VITE_*` | 클라이언트 + 서버 | 공개 설정 | ✅ 브라우저 노출 |
17
17
 
18
18
  </environment_types>
19
19
 
@@ -21,22 +21,22 @@
21
21
 
22
22
  <file_structure>
23
23
 
24
- ## Environment File Structure
24
+ ## 환경 파일 구조
25
25
 
26
26
  ```
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)
27
+ ├── .env # 기본 (커밋 O)
28
+ ├── .env.development # 개발 (커밋 O)
29
+ ├── .env.production # 프로덕션 (커밋 O)
30
+ ├── .env.local # 로컬 오버라이드 (커밋 X)
31
+ └── src/lib/env.ts # 검증 타입 (t3-env)
32
32
  ```
33
33
 
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 |
34
+ | 우선순위 | 파일 | 설명 |
35
+ |----------|------|------|
36
+ | 1 | `.env.{mode}.local` | 최우선 (gitignore) |
37
+ | 2 | `.env.local` | 로컬 오버라이드 |
38
+ | 3 | `.env.{mode}` | 환경별 설정 |
39
+ | 4 | `.env` | 기본 설정 |
40
40
 
41
41
  </file_structure>
42
42
 
@@ -44,9 +44,9 @@
44
44
 
45
45
  <patterns>
46
46
 
47
- ## Environment File Examples
47
+ ## 환경 파일 예시
48
48
 
49
- ### .env.local (gitignore, secrets)
49
+ ### .env.local (gitignore, 시크릿)
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
- ## Type-Safe Environment Variables (t3-env)
73
+ ## 타입 안전한 환경 변수 (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
- ## Usage Examples
109
+ ## 사용 예시
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 is only available on server
121
+ // env.DATABASE_URL 서버에서만 사용 가능
122
122
  console.log('DB URL:', env.DATABASE_URL)
123
123
  return prisma.user.findMany()
124
124
  })
125
125
  ```
126
126
 
127
- ### Client Component
127
+ ### 클라이언트 컴포넌트
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
- # Contains secrets (never commit)
152
+ # 시크릿 포함 (절대 커밋 X)
153
153
  .env.local
154
154
  .env.*.local
155
155
 
156
- # Public config (safe to commit)
156
+ # 공개 설정 (커밋 O)
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 Types (Vite)
168
+ ## TypeScript 타입 (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
- **Note:** Types are automatically inferred when using t3-env
184
+ **참고:** 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
- | 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` |
192
+ | 원칙 | 설명 |
193
+ |------|------|
194
+ | **시크릿 분리** | `.env.local`에만 시크릿 저장, 커밋 금지 |
195
+ | **공개 변수** | `VITE_` 접두사 사용, 브라우저 노출 허용 |
196
+ | **타입 안전성** | t3-env 또는 Zod 검증 |
197
+ | **기본값** | `.env`에 안전한 기본값 설정 |
198
+ | **문서화** | `.env.example` 파일로 필수 변수 목록 제공 |
199
199
 
200
200
  </best_practices>
201
201
 
@@ -1,6 +1,6 @@
1
1
  # Getting Started
2
2
 
3
- > TanStack Start project quick start
3
+ > TanStack Start 프로젝트 빠른 시작
4
4
 
5
5
  <instructions>
6
6
  @conventions.md
@@ -12,10 +12,10 @@
12
12
 
13
13
  <prerequisites>
14
14
 
15
- | Requirement | Version |
15
+ | 요구사항 | 버전 |
16
16
  |----------|------|
17
17
  | Node.js | 18+ |
18
- | Package Manager | Yarn / npm / pnpm |
18
+ | 패키지 관리자 | Yarn / npm / pnpm |
19
19
 
20
20
  </prerequisites>
21
21
 
@@ -23,7 +23,7 @@
23
23
 
24
24
  <installation>
25
25
 
26
- ## Create Project
26
+ ## 프로젝트 생성
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
- ## Required Packages
34
+ ## 필수 패키지
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
- ## Project Structure
54
+ ## 프로젝트 구조
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 setup
63
- └── app.config.ts # TanStack Start config
62
+ │ └── query-client.ts # Query Client 설정
63
+ └── app.config.ts # TanStack Start 설정
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 Setup
124
+ ## Query Client 설정
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 minute
134
+ staleTime: 60 * 1000, // 1
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` | Start development server (http://localhost:3000) |
151
- | `yarn build` | Production build |
152
- | `yarn start` | Start production server |
150
+ | `yarn dev` | 개발 서버 시작 (http://localhost:3000) |
151
+ | `yarn build` | 프로덕션 빌드 |
152
+ | `yarn start` | 프로덕션 서버 실행 |
153
153
 
154
154
  </commands>
155
155
 
@@ -157,13 +157,13 @@ export const createQueryClient = (): QueryClient => {
157
157
 
158
158
  <next_steps>
159
159
 
160
- | Document | Content |
160
+ | 문서 | 내용 |
161
161
  |------|------|
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 |
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 패턴 |
167
167
 
168
168
  </next_steps>
169
169
 
@@ -1,6 +1,6 @@
1
- # Custom Hook Patterns
1
+ # Custom Hook 패턴
2
2
 
3
- > Centralize all logic, state, and lifecycle for pages/sections
3
+ > 페이지/섹션의 모든 로직, 상태, 라이프사이클 중앙화
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
- ## ⚠️ Required Rule: Custom Hook Separation
15
+ ## ⚠️ 필수 규칙: Custom Hook 분리
16
16
 
17
- **All pages must separate Custom Hooks into `-hooks/` folder.**
17
+ **모든 페이지는 Custom Hook을 `-hooks/` 폴더에 분리해야 합니다.**
18
18
 
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
19
+ - 페이지 크기(줄 수)와 **무관**하게 반드시 분리
20
+ - 10줄짜리 간단한 페이지도 Hook 분리 필수
21
+ - 페이지 컴포넌트는 오직 UI 렌더링만 담당
22
22
 
23
23
  ```typescript
24
- // ✅ Correct structure
24
+ // ✅ 올바른 구조
25
25
  routes/users/
26
- ├── index.tsx // UI only
26
+ ├── index.tsx // UI
27
27
  ├── -hooks/
28
- │ └── use-users.ts // All logic
28
+ │ └── use-users.ts // 모든 로직
29
29
  ├── -components/
30
30
  └── -functions/
31
31
 
32
- // ❌ Wrong structure
32
+ // ❌ 잘못된 구조
33
33
  routes/users/
34
- └── index.tsx // UI + logic mixed
34
+ └── index.tsx // UI + 로직 혼재
35
35
  ```
36
36
 
37
37
  </mandatory_separation>
@@ -40,16 +40,16 @@ routes/users/
40
40
 
41
41
  <hook_order>
42
42
 
43
- ## Hook Internal Order (Required)
43
+ ## Hook 내부 순서 (필수)
44
44
 
45
- | Order | Hook Type | Examples |
46
- |-------|-----------|----------|
45
+ | 순서 | Hook 타입 | 예시 |
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 | Computed values |
52
- | 6 | useEffect | Side effects |
51
+ | 5 | useMemo | 계산된 |
52
+ | 6 | useEffect | 부수 효과 |
53
53
 
54
54
  </hook_order>
55
55
 
@@ -57,7 +57,7 @@ routes/users/
57
57
 
58
58
  <patterns>
59
59
 
60
- ## Page Hook Pattern
60
+ ## Page Hook 패턴
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 Pattern
162
+ ## Filter Hook 패턴
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 Pattern
189
+ ## Form Hook 패턴
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
- ## ❌ Wrong Order
258
+ ## ❌ 잘못된 순서
259
259
 
260
260
  ```typescript
261
- // ❌ Mixed order (wrong example)
261
+ // ❌ 순서가 뒤섞인 잘못된 예시
262
262
  export const useBadHook = () => {
263
- const queryClient = useQueryClient() // ❌ Global Hook first
263
+ const queryClient = useQueryClient() // ❌ Global Hook 먼저
264
264
 
265
- useEffect(() => { /* ... */ }, []) // ❌ useEffect in the middle
265
+ useEffect(() => { /* ... */ }, []) // ❌ useEffect 중간에
266
266
 
267
- const [state, setState] = useState() // ❌ State later
267
+ const [state, setState] = useState() // ❌ State 나중에
268
268
 
269
- const { data } = useQuery({ /* ... */ }) // ❌ Query after Effect
269
+ const { data } = useQuery({ /* ... */ }) // ❌ Query Effect 다음에
270
270
 
271
- const computed = useMemo(() => {}, []) // ❌ useMemo wrong position
271
+ const computed = useMemo(() => {}, []) // ❌ useMemo 위치 잘못됨
272
272
  }
273
273
  ```
274
274
 
275
- ## ✅ Correct Order
275
+ ## ✅ 올바른 순서
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 | Purpose | Example |
310
- |------|---------|---------|
311
- | `useParams` | URL parameters | `const { id } = useParams({ from: '/users/$id' })` |
312
- | `useNavigate` | Programmatic navigation | `navigate({ to: '/users' })` |
309
+ | Hook | 용도 | 예시 |
310
+ |------|------|------|
311
+ | `useParams` | URL 파라미터 | `const { id } = useParams({ from: '/users/$id' })` |
312
+ | `useNavigate` | 프로그래밍 방식 네비게이션 | `navigate({ to: '/users' })` |
313
313
  | `useSearch` | Search params | `const { page } = useSearch({ from: '/users' })` |
314
- | `useLoaderData` | Loader data | `const user = Route.useLoaderData()` |
314
+ | `useLoaderData` | Loader 데이터 | `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 | 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` |
345
+ | Hook | 용도 | 특징 |
346
+ |------|------|------|
347
+ | `useQuery` | 데이터 조회 (GET) | 자동 캐싱, 재검증 |
348
+ | `useMutation` | 데이터 변경 (POST/PUT/DELETE) | 성공 캐시 무효화 |
349
+ | `useQueryClient` | 캐시 제어 | `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
- | 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` |
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` |
388
388
 
389
389
  </best_practices>
390
390