@kood/claude-code 0.1.7 → 0.1.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 (49) hide show
  1. package/dist/index.js +118 -3
  2. package/package.json +8 -2
  3. package/templates/hono/CLAUDE.md +53 -326
  4. package/templates/hono/docs/architecture/architecture.md +93 -747
  5. package/templates/hono/docs/deployment/cloudflare.md +59 -513
  6. package/templates/hono/docs/deployment/docker.md +41 -356
  7. package/templates/hono/docs/deployment/index.md +49 -190
  8. package/templates/hono/docs/deployment/railway.md +36 -306
  9. package/templates/hono/docs/deployment/vercel.md +49 -434
  10. package/templates/hono/docs/library/ai-sdk/index.md +53 -290
  11. package/templates/hono/docs/library/ai-sdk/openrouter.md +19 -387
  12. package/templates/hono/docs/library/ai-sdk/providers.md +28 -394
  13. package/templates/hono/docs/library/ai-sdk/streaming.md +52 -353
  14. package/templates/hono/docs/library/ai-sdk/structured-output.md +63 -395
  15. package/templates/hono/docs/library/ai-sdk/tools.md +62 -431
  16. package/templates/hono/docs/library/hono/env-setup.md +24 -313
  17. package/templates/hono/docs/library/hono/error-handling.md +34 -295
  18. package/templates/hono/docs/library/hono/index.md +24 -122
  19. package/templates/hono/docs/library/hono/middleware.md +21 -188
  20. package/templates/hono/docs/library/hono/rpc.md +40 -341
  21. package/templates/hono/docs/library/hono/validation.md +35 -195
  22. package/templates/hono/docs/library/pino/index.md +42 -333
  23. package/templates/hono/docs/library/prisma/cloudflare-d1.md +64 -367
  24. package/templates/hono/docs/library/prisma/config.md +19 -260
  25. package/templates/hono/docs/library/prisma/index.md +64 -320
  26. package/templates/hono/docs/library/zod/index.md +53 -257
  27. package/templates/npx/CLAUDE.md +58 -276
  28. package/templates/npx/docs/references/patterns.md +160 -0
  29. package/templates/tanstack-start/CLAUDE.md +0 -4
  30. package/templates/tanstack-start/docs/architecture/architecture.md +44 -589
  31. package/templates/tanstack-start/docs/design/index.md +119 -12
  32. package/templates/tanstack-start/docs/guides/conventions.md +103 -0
  33. package/templates/tanstack-start/docs/guides/env-setup.md +34 -340
  34. package/templates/tanstack-start/docs/guides/getting-started.md +22 -209
  35. package/templates/tanstack-start/docs/guides/hooks.md +166 -0
  36. package/templates/tanstack-start/docs/guides/routes.md +166 -0
  37. package/templates/tanstack-start/docs/guides/services.md +143 -0
  38. package/templates/tanstack-start/docs/library/tanstack-query/index.md +18 -2
  39. package/templates/tanstack-start/docs/library/zod/index.md +16 -1
  40. package/templates/tanstack-start/docs/design/accessibility.md +0 -163
  41. package/templates/tanstack-start/docs/design/color.md +0 -93
  42. package/templates/tanstack-start/docs/design/spacing.md +0 -122
  43. package/templates/tanstack-start/docs/design/typography.md +0 -80
  44. package/templates/tanstack-start/docs/guides/best-practices.md +0 -950
  45. package/templates/tanstack-start/docs/guides/husky-lint-staged.md +0 -303
  46. package/templates/tanstack-start/docs/guides/prettier.md +0 -189
  47. package/templates/tanstack-start/docs/guides/project-templates.md +0 -710
  48. package/templates/tanstack-start/docs/library/tanstack-query/setup.md +0 -48
  49. package/templates/tanstack-start/docs/library/zod/basic-types.md +0 -74
@@ -1,303 +0,0 @@
1
- # Husky + lint-staged
2
-
3
- > Git 커밋 시 자동 코드 검사 및 포맷팅
4
-
5
- ---
6
-
7
- ## 🚀 Quick Reference
8
-
9
- ### 설치 (복사용)
10
-
11
- ```bash
12
- # 패키지 설치
13
- yarn add -D husky lint-staged
14
-
15
- # Husky 초기화
16
- npx husky init
17
-
18
- # pre-commit 훅 설정
19
- echo "npx lint-staged" > .husky/pre-commit
20
- ```
21
-
22
- ---
23
-
24
- ## 설치 단계별 가이드
25
-
26
- ### 1. 패키지 설치
27
-
28
- ```bash
29
- yarn add -D husky lint-staged
30
- ```
31
-
32
- ### 2. Husky 초기화
33
-
34
- ```bash
35
- npx husky init
36
- ```
37
-
38
- 이 명령어는:
39
- - `.husky/` 디렉토리 생성
40
- - `package.json`에 `prepare` 스크립트 추가
41
- - 기본 `pre-commit` 훅 생성
42
-
43
- ### 3. pre-commit 훅 설정
44
-
45
- ```bash
46
- echo "npx lint-staged" > .husky/pre-commit
47
- ```
48
-
49
- ---
50
-
51
- ## 설정 파일
52
-
53
- ### package.json
54
-
55
- ```json
56
- {
57
- "scripts": {
58
- "prepare": "husky"
59
- },
60
- "lint-staged": {
61
- "*.{js,jsx,ts,tsx}": [
62
- "prettier --write"
63
- ],
64
- "*.{json,yml,yaml}": [
65
- "prettier --write"
66
- ],
67
- "*.{css,scss}": [
68
- "prettier --write"
69
- ]
70
- }
71
- }
72
- ```
73
-
74
- ### 또는 .lintstagedrc.json (별도 파일)
75
-
76
- ```json
77
- {
78
- "*.{js,jsx,ts,tsx}": [
79
- "prettier --write"
80
- ],
81
- "*.{json,yml,yaml}": [
82
- "prettier --write"
83
- ],
84
- "*.{css,scss}": [
85
- "prettier --write"
86
- ]
87
- }
88
- ```
89
-
90
- **주의**: `*.md` 파일은 lint-staged에서 제외 (Prettier가 테이블 등을 이상하게 변형함)
91
-
92
- ---
93
-
94
- ## 고급 설정
95
-
96
- ### TypeScript 타입 체크 포함
97
-
98
- ```json
99
- {
100
- "lint-staged": {
101
- "*.{ts,tsx}": [
102
- "prettier --write",
103
- "bash -c 'tsc --noEmit'"
104
- ],
105
- "*.{js,jsx}": [
106
- "prettier --write"
107
- ]
108
- }
109
- }
110
- ```
111
-
112
- ### ESLint 포함 (선택)
113
-
114
- ```json
115
- {
116
- "lint-staged": {
117
- "*.{js,jsx,ts,tsx}": [
118
- "eslint --fix",
119
- "prettier --write"
120
- ]
121
- }
122
- }
123
- ```
124
-
125
- ### 테스트 포함 (선택)
126
-
127
- ```json
128
- {
129
- "lint-staged": {
130
- "*.{ts,tsx}": [
131
- "prettier --write",
132
- "vitest related --run"
133
- ]
134
- }
135
- }
136
- ```
137
-
138
- ---
139
-
140
- ## 디렉토리 구조
141
-
142
- ```
143
- project/
144
- ├── .husky/
145
- │ ├── _/
146
- │ │ └── husky.sh
147
- │ └── pre-commit # 커밋 전 실행
148
- ├── package.json # lint-staged 설정
149
- └── .prettierrc # Prettier 설정
150
- ```
151
-
152
- ---
153
-
154
- ## .husky/pre-commit 예시
155
-
156
- ### 기본 (lint-staged만)
157
-
158
- ```bash
159
- npx lint-staged
160
- ```
161
-
162
- ### 추가 검사 포함
163
-
164
- ```bash
165
- #!/bin/sh
166
-
167
- # lint-staged 실행
168
- npx lint-staged
169
-
170
- # 타입 체크 (전체)
171
- echo "Running type check..."
172
- npx tsc --noEmit
173
- ```
174
-
175
- ---
176
-
177
- ## 작동 흐름
178
-
179
- ```
180
- git commit -m "feat: 새 기능"
181
-
182
- .husky/pre-commit 실행
183
-
184
- lint-staged 실행
185
-
186
- 스테이징된 파일만 처리:
187
- - *.ts, *.tsx → prettier --write
188
- - *.json, *.md → prettier --write
189
-
190
- 변경된 파일 자동 스테이징
191
-
192
- 커밋 완료
193
- ```
194
-
195
- ---
196
-
197
- ## 문제 해결
198
-
199
- ### 훅이 실행되지 않을 때
200
-
201
- ```bash
202
- # Husky 재설치
203
- rm -rf .husky
204
- npx husky init
205
- echo "npx lint-staged" > .husky/pre-commit
206
- ```
207
-
208
- ### 권한 문제
209
-
210
- ```bash
211
- chmod +x .husky/pre-commit
212
- ```
213
-
214
- ### lint-staged 캐시 문제
215
-
216
- ```bash
217
- # 캐시 삭제
218
- rm -rf node_modules/.cache/lint-staged
219
- ```
220
-
221
- ### 훅 우회 (긴급 시에만)
222
-
223
- ```bash
224
- git commit -m "fix: 긴급 수정" --no-verify
225
- ```
226
-
227
- **주의**: `--no-verify`는 정말 긴급한 상황에서만 사용
228
-
229
- ---
230
-
231
- ## 팀 설정
232
-
233
- ### 새 팀원 온보딩
234
-
235
- ```bash
236
- # 클론 후 실행
237
- yarn install # prepare 스크립트가 자동으로 husky 설정
238
- ```
239
-
240
- ### CI/CD에서 Husky 비활성화
241
-
242
- ```bash
243
- # CI 환경에서
244
- HUSKY=0 yarn install
245
- ```
246
-
247
- 또는 package.json:
248
-
249
- ```json
250
- {
251
- "scripts": {
252
- "prepare": "husky || true"
253
- }
254
- }
255
- ```
256
-
257
- ---
258
-
259
- ## 권장 설정 조합
260
-
261
- ### 최소 설정
262
-
263
- ```json
264
- {
265
- "lint-staged": {
266
- "*": ["prettier --write --ignore-unknown"]
267
- }
268
- }
269
- ```
270
-
271
- ### 표준 설정 (권장)
272
-
273
- ```json
274
- {
275
- "lint-staged": {
276
- "*.{js,jsx,ts,tsx}": ["prettier --write"],
277
- "*.{json,yml,yaml,css,scss}": ["prettier --write"]
278
- }
279
- }
280
- ```
281
-
282
- ### 엄격한 설정
283
-
284
- ```json
285
- {
286
- "lint-staged": {
287
- "*.{ts,tsx}": [
288
- "prettier --write",
289
- "bash -c 'tsc --noEmit'"
290
- ],
291
- "*.{js,jsx}": ["prettier --write"],
292
- "*.{json,yml,yaml,css,scss}": ["prettier --write"]
293
- }
294
- }
295
- ```
296
-
297
- ---
298
-
299
- ## 참고
300
-
301
- - [Husky 공식 문서](https://typicode.github.io/husky/)
302
- - [lint-staged 공식 문서](https://github.com/lint-staged/lint-staged)
303
- - [Prettier 설정](./prettier.md)
@@ -1,189 +0,0 @@
1
- # Prettier 설정
2
-
3
- > 코드 포맷팅 표준화
4
-
5
- ---
6
-
7
- ## 🚀 Quick Reference
8
-
9
- ### .prettierrc (복사용)
10
-
11
- ```json
12
- {
13
- "semi": true,
14
- "singleQuote": true,
15
- "jsxSingleQuote": true,
16
- "tabWidth": 2,
17
- "trailingComma": "all",
18
- "printWidth": 80,
19
- "arrowParens": "always",
20
- "endOfLine": "lf",
21
- "importOrder": [
22
- "^react$",
23
- "^react-dom$",
24
- "^@tanstack/(.*)$",
25
- "<THIRD_PARTY_MODULES>",
26
- "^@/(.*)$",
27
- "^[./]"
28
- ],
29
- "importOrderSeparation": true,
30
- "importOrderSortSpecifiers": true,
31
- "plugins": [
32
- "@trivago/prettier-plugin-sort-imports",
33
- "prettier-plugin-tailwindcss"
34
- ]
35
- }
36
- ```
37
-
38
- ---
39
-
40
- ## 설치
41
-
42
- ```bash
43
- yarn add -D prettier @trivago/prettier-plugin-sort-imports prettier-plugin-tailwindcss
44
- ```
45
-
46
- ---
47
-
48
- ## 설정 옵션 설명
49
-
50
- ### 기본 포맷팅
51
-
52
- | 옵션 | 값 | 설명 |
53
- |------|-----|------|
54
- | `semi` | `true` | 세미콜론 사용 |
55
- | `singleQuote` | `true` | 문자열에 작은따옴표 |
56
- | `jsxSingleQuote` | `true` | JSX에서도 작은따옴표 |
57
- | `tabWidth` | `2` | 들여쓰기 2칸 |
58
- | `trailingComma` | `"all"` | 모든 곳에 trailing comma |
59
- | `printWidth` | `80` | 줄 너비 80자 |
60
- | `arrowParens` | `"always"` | 화살표 함수 괄호 항상 사용 |
61
- | `endOfLine` | `"lf"` | Unix 줄바꿈 (LF) |
62
-
63
- ### Import 정렬
64
-
65
- | 옵션 | 설명 |
66
- |------|------|
67
- | `importOrder` | import 순서 규칙 |
68
- | `importOrderSeparation` | 그룹 간 빈 줄 추가 |
69
- | `importOrderSortSpecifiers` | import 내 알파벳 정렬 |
70
-
71
- ### Import 순서 규칙
72
-
73
- ```
74
- 1. react, react-dom
75
- 2. @tanstack/* (TanStack 라이브러리)
76
- 3. <THIRD_PARTY_MODULES> (기타 외부 모듈)
77
- 4. @/* (내부 모듈)
78
- 5. ./* (상대 경로)
79
- ```
80
-
81
- ---
82
-
83
- ## 플러그인
84
-
85
- ### @trivago/prettier-plugin-sort-imports
86
-
87
- import 문 자동 정렬
88
-
89
- ```typescript
90
- // Before
91
- import { useState } from 'react';
92
- import { Button } from '@/components/ui';
93
- import { useQuery } from '@tanstack/react-query';
94
- import axios from 'axios';
95
-
96
- // After
97
- import { useState } from 'react';
98
-
99
- import { useQuery } from '@tanstack/react-query';
100
-
101
- import axios from 'axios';
102
-
103
- import { Button } from '@/components/ui';
104
- ```
105
-
106
- ### prettier-plugin-tailwindcss
107
-
108
- Tailwind 클래스 자동 정렬
109
-
110
- ```tsx
111
- // Before
112
- <div className="p-4 flex text-white bg-blue-500 items-center">
113
-
114
- // After
115
- <div className="flex items-center bg-blue-500 p-4 text-white">
116
- ```
117
-
118
- ---
119
-
120
- ## 스크립트
121
-
122
- ### package.json
123
-
124
- ```json
125
- {
126
- "scripts": {
127
- "format": "prettier --write .",
128
- "format:check": "prettier --check ."
129
- }
130
- }
131
- ```
132
-
133
- ### 사용
134
-
135
- ```bash
136
- # 전체 포맷팅
137
- yarn format
138
-
139
- # 포맷팅 검사만
140
- yarn format:check
141
- ```
142
-
143
- ---
144
-
145
- ## .prettierignore
146
-
147
- ```
148
- node_modules/
149
- .output/
150
- dist/
151
- build/
152
- .next/
153
- coverage/
154
- *.min.js
155
- *.min.css
156
- *.md
157
- pnpm-lock.yaml
158
- yarn.lock
159
- package-lock.json
160
- generated/
161
- ```
162
-
163
- **주의**: `*.md` 파일은 Prettier 포맷팅에서 제외 (테이블 등이 이상하게 변형됨)
164
-
165
- ---
166
-
167
- ## VSCode 설정
168
-
169
- ### .vscode/settings.json
170
-
171
- ```json
172
- {
173
- "editor.defaultFormatter": "esbenp.prettier-vscode",
174
- "editor.formatOnSave": true,
175
- "editor.codeActionsOnSave": {
176
- "source.organizeImports": "never"
177
- }
178
- }
179
- ```
180
-
181
- **주의**: `source.organizeImports`는 `"never"`로 설정 (Prettier 플러그인과 충돌 방지)
182
-
183
- ---
184
-
185
- ## 참고
186
-
187
- - [Prettier 공식 문서](https://prettier.io/docs/en/index.html)
188
- - [@trivago/prettier-plugin-sort-imports](https://github.com/trivago/prettier-plugin-sort-imports)
189
- - [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss)