@kood/claude-code 0.2.4 → 0.3.0

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 (130) hide show
  1. package/dist/index.js +13 -8
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/code-reviewer.md +371 -19
  4. package/templates/.claude/agents/dependency-manager.md +197 -0
  5. package/templates/.claude/agents/deployment-validator.md +136 -0
  6. package/templates/.claude/agents/git-operator.md +147 -0
  7. package/templates/.claude/agents/implementation-executor.md +202 -0
  8. package/templates/.claude/agents/lint-fixer.md +155 -0
  9. package/templates/.claude/agents/refactor-advisor.md +339 -29
  10. package/templates/.claude/commands/agent-creator.md +355 -0
  11. package/templates/.claude/commands/docs-creator.md +404 -163
  12. package/templates/.claude/commands/docs-refactor.md +400 -113
  13. package/templates/.claude/commands/execute.md +357 -185
  14. package/templates/.claude/commands/git-all.md +16 -70
  15. package/templates/.claude/commands/git-session.md +36 -68
  16. package/templates/.claude/commands/git.md +20 -69
  17. package/templates/.claude/commands/lint-fix.md +164 -107
  18. package/templates/.claude/commands/lint-init.md +142 -168
  19. package/templates/.claude/commands/plan.md +300 -84
  20. package/templates/.claude/commands/prd.md +613 -0
  21. package/templates/.claude/commands/pre-deploy.md +242 -0
  22. package/templates/.claude/commands/subagent-creator.md +118 -0
  23. package/templates/.claude/commands/version-update.md +45 -57
  24. package/templates/hono/CLAUDE.md +99 -54
  25. package/templates/hono/docs/guides/conventions.md +352 -0
  26. package/templates/hono/docs/guides/env-setup.md +347 -0
  27. package/templates/hono/docs/guides/getting-started.md +239 -0
  28. package/templates/hono/docs/library/hono/error-handling.md +20 -29
  29. package/templates/hono/docs/library/hono/index.md +25 -52
  30. package/templates/hono/docs/library/hono/middleware.md +16 -75
  31. package/templates/hono/docs/library/hono/rpc.md +7 -35
  32. package/templates/hono/docs/library/hono/validation.md +25 -45
  33. package/templates/hono/docs/library/t3-env/index.md +374 -0
  34. package/templates/npx/CLAUDE.md +165 -65
  35. package/templates/npx/docs/library/commander/index.md +10 -73
  36. package/templates/npx/docs/library/fs-extra/index.md +21 -113
  37. package/templates/npx/docs/library/prompts/index.md +30 -176
  38. package/templates/npx/docs/references/patterns.md +75 -48
  39. package/templates/tanstack-start/CLAUDE.md +101 -77
  40. package/templates/tanstack-start/docs/architecture.md +427 -0
  41. package/templates/tanstack-start/docs/design.md +558 -0
  42. package/templates/tanstack-start/docs/guides/conventions.md +132 -32
  43. package/templates/tanstack-start/docs/guides/env-setup.md +127 -62
  44. package/templates/tanstack-start/docs/guides/getting-started.md +81 -20
  45. package/templates/tanstack-start/docs/guides/hooks.md +241 -36
  46. package/templates/tanstack-start/docs/guides/routes.md +213 -61
  47. package/templates/tanstack-start/docs/guides/services.md +260 -24
  48. package/templates/tanstack-start/docs/library/better-auth/index.md +469 -16
  49. package/templates/tanstack-start/docs/library/t3-env/index.md +307 -0
  50. package/templates/tanstack-start/docs/library/tanstack-query/index.md +12 -21
  51. package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +22 -35
  52. package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +7 -24
  53. package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +26 -39
  54. package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +23 -26
  55. package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +32 -147
  56. package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +25 -167
  57. package/templates/tanstack-start/docs/library/tanstack-router/index.md +39 -74
  58. package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +46 -116
  59. package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +35 -154
  60. package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +32 -171
  61. package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +7 -15
  62. package/templates/tanstack-start/docs/library/tanstack-start/routing.md +16 -23
  63. package/templates/tanstack-start/docs/library/zod/complex-types.md +12 -31
  64. package/templates/tanstack-start/docs/library/zod/index.md +18 -35
  65. package/templates/tanstack-start/docs/library/zod/transforms.md +11 -25
  66. package/templates/tanstack-start/docs/library/zod/validation.md +12 -34
  67. package/templates/.claude/agents/debug-detective.md +0 -37
  68. package/templates/.claude/agents/test-writer.md +0 -41
  69. package/templates/.claude/commands/feedback.md +0 -199
  70. package/templates/.claude/commands/ts-fix.md +0 -176
  71. package/templates/.claude/skills/command-creator/LICENSE.txt +0 -202
  72. package/templates/.claude/skills/command-creator/SKILL.md +0 -245
  73. package/templates/.claude/skills/command-creator/scripts/init_command.py +0 -244
  74. package/templates/.claude/skills/command-creator/scripts/package_command.py +0 -125
  75. package/templates/.claude/skills/command-creator/scripts/quick_validate.py +0 -143
  76. package/templates/.claude/skills/frontend-design/SKILL.md +0 -310
  77. package/templates/.claude/skills/frontend-design/references/animation-patterns.md +0 -446
  78. package/templates/.claude/skills/frontend-design/references/colors-2026.md +0 -244
  79. package/templates/.claude/skills/frontend-design/references/typography-2026.md +0 -302
  80. package/templates/.claude/skills/gemini-review/SKILL.md +0 -118
  81. package/templates/.claude/skills/gemini-review/references/checklists.md +0 -129
  82. package/templates/.claude/skills/gemini-review/references/prompt-templates.md +0 -274
  83. package/templates/.claude/skills/skill-creator/LICENSE.txt +0 -202
  84. package/templates/.claude/skills/skill-creator/SKILL.md +0 -184
  85. package/templates/.claude/skills/skill-creator/scripts/init_skill.py +0 -303
  86. package/templates/.claude/skills/skill-creator/scripts/package_skill.py +0 -110
  87. package/templates/.claude/skills/skill-creator/scripts/quick_validate.py +0 -65
  88. package/templates/hono/docs/library/ai-sdk/index.md +0 -190
  89. package/templates/hono/docs/library/ai-sdk/openrouter.md +0 -111
  90. package/templates/hono/docs/library/ai-sdk/providers.md +0 -102
  91. package/templates/hono/docs/library/ai-sdk/streaming.md +0 -146
  92. package/templates/hono/docs/library/ai-sdk/structured-output.md +0 -161
  93. package/templates/hono/docs/library/ai-sdk/tools.md +0 -144
  94. package/templates/hono/docs/library/drizzle/cloudflare-d1.md +0 -247
  95. package/templates/hono/docs/library/drizzle/config.md +0 -167
  96. package/templates/hono/docs/library/drizzle/index.md +0 -259
  97. package/templates/hono/docs/library/hono/env-setup.md +0 -169
  98. package/templates/hono/docs/library/pino/index.md +0 -146
  99. package/templates/tanstack-start/docs/architecture/architecture.md +0 -243
  100. package/templates/tanstack-start/docs/deployment/cloudflare.md +0 -132
  101. package/templates/tanstack-start/docs/deployment/index.md +0 -163
  102. package/templates/tanstack-start/docs/deployment/nitro.md +0 -110
  103. package/templates/tanstack-start/docs/deployment/railway.md +0 -147
  104. package/templates/tanstack-start/docs/deployment/vercel.md +0 -135
  105. package/templates/tanstack-start/docs/design/components.md +0 -175
  106. package/templates/tanstack-start/docs/design/index.md +0 -151
  107. package/templates/tanstack-start/docs/design/safe-area.md +0 -118
  108. package/templates/tanstack-start/docs/design/tailwind-setup.md +0 -156
  109. package/templates/tanstack-start/docs/library/ai-sdk/hooks.md +0 -472
  110. package/templates/tanstack-start/docs/library/ai-sdk/index.md +0 -264
  111. package/templates/tanstack-start/docs/library/ai-sdk/openrouter.md +0 -371
  112. package/templates/tanstack-start/docs/library/ai-sdk/providers.md +0 -403
  113. package/templates/tanstack-start/docs/library/ai-sdk/streaming.md +0 -320
  114. package/templates/tanstack-start/docs/library/ai-sdk/structured-output.md +0 -454
  115. package/templates/tanstack-start/docs/library/ai-sdk/tools.md +0 -473
  116. package/templates/tanstack-start/docs/library/better-auth/2fa.md +0 -48
  117. package/templates/tanstack-start/docs/library/better-auth/advanced.md +0 -55
  118. package/templates/tanstack-start/docs/library/better-auth/plugins.md +0 -34
  119. package/templates/tanstack-start/docs/library/better-auth/session.md +0 -47
  120. package/templates/tanstack-start/docs/library/better-auth/setup.md +0 -41
  121. package/templates/tanstack-start/docs/library/drizzle/cloudflare-d1.md +0 -147
  122. package/templates/tanstack-start/docs/library/drizzle/config.md +0 -118
  123. package/templates/tanstack-start/docs/library/drizzle/crud.md +0 -205
  124. package/templates/tanstack-start/docs/library/drizzle/index.md +0 -79
  125. package/templates/tanstack-start/docs/library/drizzle/relations.md +0 -202
  126. package/templates/tanstack-start/docs/library/drizzle/schema.md +0 -154
  127. package/templates/tanstack-start/docs/library/drizzle/setup.md +0 -96
  128. package/templates/tanstack-start/docs/library/drizzle/transactions.md +0 -127
  129. package/templates/tanstack-start/docs/library/pino/index.md +0 -320
  130. /package/templates/hono/docs/{architecture/architecture.md → architecture.md} +0 -0
@@ -1,371 +0,0 @@
1
- # AI SDK - OpenRouter
2
-
3
- > **상위 문서**: [AI SDK](./index.md) | [프로바이더](./providers.md)
4
-
5
- ---
6
-
7
- ## 개요
8
-
9
- [OpenRouter](https://openrouter.ai/)는 Anthropic, Google, Meta, Mistral 등 주요 AI 프로바이더의 수백 개 모델에 단일 API로 접근할 수 있는 통합 게이트웨이입니다.
10
-
11
- ### 주요 장점
12
-
13
- | 장점 | 설명 |
14
- |------|------|
15
- | **통합 API** | 하나의 API 키로 수백 개 모델 접근 |
16
- | **비용 효율** | 월정액 없이 사용량 기반 과금 |
17
- | **투명한 가격** | 모델별 토큰당 비용 명확히 표시 |
18
- | **고가용성** | 엔터프라이즈급 인프라와 자동 장애 조치 |
19
- | **최신 모델** | 새 모델 출시 즉시 사용 가능 |
20
-
21
- ---
22
-
23
- ## 설치
24
-
25
- ```bash
26
- npm install @openrouter/ai-sdk-provider
27
- ```
28
-
29
- ---
30
-
31
- ## 기본 설정
32
-
33
- ### Provider 인스턴스 생성
34
-
35
- ```typescript
36
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
37
-
38
- const openrouter = createOpenRouter({
39
- apiKey: process.env.OPENROUTER_API_KEY,
40
- })
41
- ```
42
-
43
- API 키는 [OpenRouter Dashboard](https://openrouter.ai/keys)에서 발급받을 수 있습니다.
44
-
45
- ### 환경 변수
46
-
47
- ```bash
48
- # .env
49
- OPENROUTER_API_KEY=sk-or-v1-...
50
- ```
51
-
52
- ---
53
-
54
- ## 모델 사용
55
-
56
- ### Chat 모델 (권장)
57
-
58
- ```typescript
59
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
60
- import { generateText } from 'ai'
61
-
62
- const openrouter = createOpenRouter({
63
- apiKey: process.env.OPENROUTER_API_KEY,
64
- })
65
-
66
- const { text } = await generateText({
67
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
68
- prompt: 'Hello!',
69
- })
70
- ```
71
-
72
- ### Completion 모델
73
-
74
- ```typescript
75
- const { text } = await generateText({
76
- model: openrouter.completion('meta-llama/llama-3.1-405b-instruct'),
77
- prompt: 'Write a poem.',
78
- })
79
- ```
80
-
81
- ---
82
-
83
- ## 인기 모델
84
-
85
- | 모델 ID | 설명 |
86
- |---------|------|
87
- | `anthropic/claude-3.5-sonnet` | Claude 3.5 Sonnet |
88
- | `anthropic/claude-3-opus` | Claude 3 Opus |
89
- | `openai/gpt-4o` | GPT-4o |
90
- | `openai/gpt-4-turbo` | GPT-4 Turbo |
91
- | `google/gemini-pro-1.5` | Gemini Pro 1.5 |
92
- | `meta-llama/llama-3.1-405b-instruct` | Llama 3.1 405B |
93
- | `meta-llama/llama-3.1-70b-instruct` | Llama 3.1 70B |
94
- | `mistralai/mistral-large` | Mistral Large |
95
- | `cohere/command-r-plus` | Command R+ |
96
-
97
- 전체 모델 목록: [OpenRouter Models](https://openrouter.ai/docs#models)
98
-
99
- ---
100
-
101
- ## 스트리밍
102
-
103
- ### streamText
104
-
105
- ```typescript
106
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
107
- import { streamText } from 'ai'
108
-
109
- const openrouter = createOpenRouter({
110
- apiKey: process.env.OPENROUTER_API_KEY,
111
- })
112
-
113
- const result = streamText({
114
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
115
- prompt: 'Write a short story about AI.',
116
- })
117
-
118
- for await (const chunk of result.textStream) {
119
- process.stdout.write(chunk)
120
- }
121
- ```
122
-
123
- ### React에서 사용
124
-
125
- ```tsx
126
- 'use client'
127
-
128
- import { useChat } from '@ai-sdk/react'
129
-
130
- export default function Chat() {
131
- const { messages, input, handleInputChange, handleSubmit } = useChat({
132
- api: '/api/chat',
133
- })
134
-
135
- return (
136
- <div>
137
- {messages.map((m) => (
138
- <div key={m.id}>
139
- <strong>{m.role}:</strong> {m.content}
140
- </div>
141
- ))}
142
-
143
- <form onSubmit={handleSubmit}>
144
- <input value={input} onChange={handleInputChange} />
145
- <button type="submit">Send</button>
146
- </form>
147
- </div>
148
- )
149
- }
150
- ```
151
-
152
- ---
153
-
154
- ## API Route 설정
155
-
156
- ### TanStack Start API Route
157
-
158
- ```typescript
159
- // app/routes/api/chat.ts
160
- import { createAPIFileRoute } from '@tanstack/react-start/api'
161
- import { streamText, convertToModelMessages } from 'ai'
162
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
163
-
164
- const openrouter = createOpenRouter({
165
- apiKey: process.env.OPENROUTER_API_KEY,
166
- })
167
-
168
- export const APIRoute = createAPIFileRoute('/api/chat')({
169
- POST: async ({ request }) => {
170
- const { messages, model } = await request.json()
171
-
172
- const result = streamText({
173
- model: openrouter.chat(model ?? 'anthropic/claude-3.5-sonnet'),
174
- messages: convertToModelMessages(messages),
175
- })
176
-
177
- return result.toUIMessageStreamResponse()
178
- },
179
- })
180
- ```
181
-
182
- ### 모델 선택 UI
183
-
184
- ```tsx
185
- 'use client'
186
-
187
- import { useChat } from '@ai-sdk/react'
188
- import { useState } from 'react'
189
-
190
- const MODELS = [
191
- { id: 'anthropic/claude-3.5-sonnet', name: 'Claude 3.5 Sonnet' },
192
- { id: 'openai/gpt-4o', name: 'GPT-4o' },
193
- { id: 'google/gemini-pro-1.5', name: 'Gemini Pro 1.5' },
194
- { id: 'meta-llama/llama-3.1-70b-instruct', name: 'Llama 3.1 70B' },
195
- ]
196
-
197
- export default function Chat() {
198
- const [selectedModel, setSelectedModel] = useState(MODELS[0].id)
199
-
200
- const { messages, input, handleInputChange, handleSubmit } = useChat({
201
- api: '/api/chat',
202
- body: {
203
- model: selectedModel,
204
- },
205
- })
206
-
207
- return (
208
- <div>
209
- <select
210
- value={selectedModel}
211
- onChange={(e) => setSelectedModel(e.target.value)}
212
- >
213
- {MODELS.map((model) => (
214
- <option key={model.id} value={model.id}>
215
- {model.name}
216
- </option>
217
- ))}
218
- </select>
219
-
220
- {messages.map((m) => (
221
- <div key={m.id}>
222
- <strong>{m.role}:</strong> {m.content}
223
- </div>
224
- ))}
225
-
226
- <form onSubmit={handleSubmit}>
227
- <input value={input} onChange={handleInputChange} />
228
- <button type="submit">Send</button>
229
- </form>
230
- </div>
231
- )
232
- }
233
- ```
234
-
235
- ---
236
-
237
- ## 구조화된 출력
238
-
239
- ```typescript
240
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
241
- import { generateObject } from 'ai'
242
- import { z } from 'zod'
243
-
244
- const openrouter = createOpenRouter({
245
- apiKey: process.env.OPENROUTER_API_KEY,
246
- })
247
-
248
- const { object } = await generateObject({
249
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
250
- schema: z.object({
251
- name: z.string(),
252
- age: z.number(),
253
- skills: z.array(z.string()),
254
- }),
255
- prompt: 'Generate a developer profile.',
256
- })
257
- ```
258
-
259
- ---
260
-
261
- ## 도구 사용
262
-
263
- ```typescript
264
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
265
- import { generateText, tool } from 'ai'
266
- import { z } from 'zod'
267
-
268
- const openrouter = createOpenRouter({
269
- apiKey: process.env.OPENROUTER_API_KEY,
270
- })
271
-
272
- const { text, toolCalls } = await generateText({
273
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
274
- prompt: 'What is the weather in Seoul?',
275
- tools: {
276
- getWeather: tool({
277
- description: 'Get weather for a location',
278
- inputSchema: z.object({
279
- location: z.string(),
280
- }),
281
- execute: async ({ location }) => {
282
- return { temperature: 22, condition: 'Sunny' }
283
- },
284
- }),
285
- },
286
- })
287
- ```
288
-
289
- ---
290
-
291
- ## 고급 설정
292
-
293
- ### 커스텀 헤더
294
-
295
- ```typescript
296
- const openrouter = createOpenRouter({
297
- apiKey: process.env.OPENROUTER_API_KEY,
298
- headers: {
299
- 'HTTP-Referer': 'https://your-app.com',
300
- 'X-Title': 'Your App Name',
301
- },
302
- })
303
- ```
304
-
305
- ### 모델 파라미터
306
-
307
- ```typescript
308
- const result = await generateText({
309
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
310
- prompt: 'Hello!',
311
- temperature: 0.7,
312
- maxTokens: 1000,
313
- topP: 0.9,
314
- })
315
- ```
316
-
317
- ---
318
-
319
- ## 비용 관리
320
-
321
- ### 사용량 추적
322
-
323
- ```typescript
324
- const result = await generateText({
325
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
326
- prompt: 'Hello!',
327
- })
328
-
329
- console.log('Token usage:', result.usage)
330
- // { promptTokens: 10, completionTokens: 50, totalTokens: 60 }
331
- ```
332
-
333
- ### 모델별 비용
334
-
335
- OpenRouter 대시보드에서 실시간으로 모델별 비용을 확인할 수 있습니다:
336
- - [OpenRouter Dashboard](https://openrouter.ai/dashboard)
337
-
338
- ---
339
-
340
- ## 에러 처리
341
-
342
- ```typescript
343
- import { createOpenRouter } from '@openrouter/ai-sdk-provider'
344
- import { generateText } from 'ai'
345
-
346
- const openrouter = createOpenRouter({
347
- apiKey: process.env.OPENROUTER_API_KEY,
348
- })
349
-
350
- try {
351
- const { text } = await generateText({
352
- model: openrouter.chat('anthropic/claude-3.5-sonnet'),
353
- prompt: 'Hello!',
354
- })
355
- } catch (error) {
356
- if (error instanceof Error) {
357
- console.error('OpenRouter Error:', error.message)
358
- }
359
- }
360
- ```
361
-
362
- ---
363
-
364
- ## 리소스
365
-
366
- - [OpenRouter 공식 문서](https://openrouter.ai/docs)
367
- - [OpenRouter 대시보드](https://openrouter.ai/dashboard)
368
- - [API 키 발급](https://openrouter.ai/keys)
369
- - [모델 목록](https://openrouter.ai/docs#models)
370
- - [GitHub 저장소](https://github.com/OpenRouterTeam/ai-sdk-provider)
371
- - [상태 페이지](https://status.openrouter.ai)