@kood/claude-code 0.1.2 → 0.1.4

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 (63) hide show
  1. package/dist/index.js +129 -5
  2. package/package.json +2 -2
  3. package/templates/hono/CLAUDE.md +20 -2
  4. package/templates/hono/docs/architecture/architecture.md +909 -0
  5. package/templates/hono/docs/commands/git.md +275 -0
  6. package/templates/hono/docs/deployment/cloudflare.md +527 -190
  7. package/templates/hono/docs/deployment/docker.md +514 -0
  8. package/templates/hono/docs/deployment/index.md +179 -214
  9. package/templates/hono/docs/deployment/railway.md +416 -0
  10. package/templates/hono/docs/deployment/vercel.md +567 -0
  11. package/templates/hono/docs/library/ai-sdk/index.md +427 -0
  12. package/templates/hono/docs/library/ai-sdk/openrouter.md +479 -0
  13. package/templates/hono/docs/library/ai-sdk/providers.md +468 -0
  14. package/templates/hono/docs/library/ai-sdk/streaming.md +447 -0
  15. package/templates/hono/docs/library/ai-sdk/structured-output.md +493 -0
  16. package/templates/hono/docs/library/ai-sdk/tools.md +513 -0
  17. package/templates/hono/docs/library/hono/env-setup.md +458 -0
  18. package/templates/hono/docs/library/hono/index.md +1 -3
  19. package/templates/hono/docs/library/pino/index.md +437 -0
  20. package/templates/hono/docs/library/prisma/cloudflare-d1.md +503 -0
  21. package/templates/hono/docs/library/prisma/config.md +362 -0
  22. package/templates/hono/docs/library/prisma/index.md +86 -13
  23. package/templates/hono/docs/skills/gemini-review/SKILL.md +116 -116
  24. package/templates/hono/docs/skills/gemini-review/references/checklists.md +125 -125
  25. package/templates/hono/docs/skills/gemini-review/references/prompt-templates.md +191 -191
  26. package/templates/npx/CLAUDE.md +309 -0
  27. package/templates/npx/docs/commands/git.md +275 -0
  28. package/templates/npx/docs/library/commander/index.md +164 -0
  29. package/templates/npx/docs/library/fs-extra/index.md +171 -0
  30. package/templates/npx/docs/library/prompts/index.md +253 -0
  31. package/templates/npx/docs/mcp/index.md +60 -0
  32. package/templates/npx/docs/skills/gemini-review/SKILL.md +220 -0
  33. package/templates/npx/docs/skills/gemini-review/references/checklists.md +134 -0
  34. package/templates/npx/docs/skills/gemini-review/references/prompt-templates.md +301 -0
  35. package/templates/tanstack-start/CLAUDE.md +43 -5
  36. package/templates/tanstack-start/docs/architecture/architecture.md +134 -4
  37. package/templates/tanstack-start/docs/commands/git.md +275 -0
  38. package/templates/tanstack-start/docs/deployment/cloudflare.md +223 -50
  39. package/templates/tanstack-start/docs/deployment/index.md +320 -30
  40. package/templates/tanstack-start/docs/deployment/nitro.md +195 -14
  41. package/templates/tanstack-start/docs/deployment/railway.md +302 -150
  42. package/templates/tanstack-start/docs/deployment/vercel.md +345 -75
  43. package/templates/tanstack-start/docs/guides/best-practices.md +203 -1
  44. package/templates/tanstack-start/docs/guides/env-setup.md +450 -0
  45. package/templates/tanstack-start/docs/library/ai-sdk/hooks.md +472 -0
  46. package/templates/tanstack-start/docs/library/ai-sdk/index.md +264 -0
  47. package/templates/tanstack-start/docs/library/ai-sdk/openrouter.md +371 -0
  48. package/templates/tanstack-start/docs/library/ai-sdk/providers.md +403 -0
  49. package/templates/tanstack-start/docs/library/ai-sdk/streaming.md +320 -0
  50. package/templates/tanstack-start/docs/library/ai-sdk/structured-output.md +454 -0
  51. package/templates/tanstack-start/docs/library/ai-sdk/tools.md +473 -0
  52. package/templates/tanstack-start/docs/library/pino/index.md +320 -0
  53. package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +404 -0
  54. package/templates/tanstack-start/docs/library/prisma/config.md +377 -0
  55. package/templates/tanstack-start/docs/library/prisma/index.md +3 -5
  56. package/templates/tanstack-start/docs/library/prisma/schema.md +123 -25
  57. package/templates/tanstack-start/docs/library/prisma/setup.md +0 -7
  58. package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +80 -2
  59. package/templates/tanstack-start/docs/skills/gemini-review/SKILL.md +116 -116
  60. package/templates/tanstack-start/docs/skills/gemini-review/references/checklists.md +138 -144
  61. package/templates/tanstack-start/docs/skills/gemini-review/references/prompt-templates.md +186 -187
  62. package/templates/hono/docs/git/index.md +0 -180
  63. package/templates/tanstack-start/docs/git/index.md +0 -203
package/dist/index.js CHANGED
@@ -62,13 +62,21 @@ var copySingleTemplate = async (template, targetDir) => {
62
62
  counter.files++;
63
63
  }
64
64
  const docsSrc = path.join(templatePath, "docs");
65
+ const docsDest = path.join(targetDir, "docs");
65
66
  if (await fs.pathExists(docsSrc)) {
66
- await copyRecursive(docsSrc, path.join(targetDir, "docs"), counter);
67
+ if (await fs.pathExists(docsDest)) {
68
+ await fs.remove(docsDest);
69
+ }
70
+ await copyRecursive(docsSrc, docsDest, counter);
67
71
  }
68
72
  return counter;
69
73
  };
70
74
  var copyMultipleTemplates = async (templates, targetDir) => {
71
75
  const counter = { files: 0, directories: 0 };
76
+ const docsDir = path.join(targetDir, "docs");
77
+ if (await fs.pathExists(docsDir)) {
78
+ await fs.remove(docsDir);
79
+ }
72
80
  for (const template of templates) {
73
81
  const templatePath = getTemplatePath(template);
74
82
  if (!await fs.pathExists(templatePath)) {
@@ -175,11 +183,64 @@ var checkExistingSkills = async (targetDir, skills) => {
175
183
  }
176
184
  return existingSkills;
177
185
  };
186
+ var getCommandsPath = (template) => {
187
+ return path.join(getTemplatePath(template), "docs", "commands");
188
+ };
189
+ var listAvailableCommands = async (template) => {
190
+ const commandsPath = getCommandsPath(template);
191
+ if (!await fs.pathExists(commandsPath)) {
192
+ return [];
193
+ }
194
+ const items = await fs.readdir(commandsPath);
195
+ const commands = [];
196
+ for (const item of items) {
197
+ const itemPath = path.join(commandsPath, item);
198
+ const stat = await fs.stat(itemPath);
199
+ if (stat.isFile() && item.endsWith(".md")) {
200
+ commands.push(item.replace(".md", ""));
201
+ }
202
+ }
203
+ return commands;
204
+ };
205
+ var copyCommands = async (template, targetDir) => {
206
+ const commandsPath = getCommandsPath(template);
207
+ const targetCommandsDir = path.join(targetDir, ".claude", "commands");
208
+ if (!await fs.pathExists(commandsPath)) {
209
+ return { files: 0, commands: [] };
210
+ }
211
+ let files = 0;
212
+ const installedCommands = [];
213
+ await fs.ensureDir(targetCommandsDir);
214
+ const items = await fs.readdir(commandsPath);
215
+ for (const item of items) {
216
+ const srcPath = path.join(commandsPath, item);
217
+ const stat = await fs.stat(srcPath);
218
+ if (stat.isFile() && item.endsWith(".md")) {
219
+ const destPath = path.join(targetCommandsDir, item);
220
+ await fs.copy(srcPath, destPath);
221
+ files++;
222
+ installedCommands.push(item.replace(".md", ""));
223
+ }
224
+ }
225
+ return { files, commands: installedCommands };
226
+ };
227
+ var checkExistingCommands = async (targetDir, commands) => {
228
+ const existingCommands = [];
229
+ const targetCommandsDir = path.join(targetDir, ".claude", "commands");
230
+ for (const command of commands) {
231
+ const commandPath = path.join(targetCommandsDir, `${command}.md`);
232
+ if (await fs.pathExists(commandPath)) {
233
+ existingCommands.push(command);
234
+ }
235
+ }
236
+ return existingCommands;
237
+ };
178
238
 
179
239
  // src/commands/init.ts
180
240
  var TEMPLATE_DESCRIPTIONS = {
181
241
  "tanstack-start": "TanStack Start + React \uD480\uC2A4\uD0DD \uD504\uB85C\uC81D\uD2B8",
182
- hono: "Hono \uC11C\uBC84 \uD504\uB808\uC784\uC6CC\uD06C \uD504\uB85C\uC81D\uD2B8"
242
+ hono: "Hono \uC11C\uBC84 \uD504\uB808\uC784\uC6CC\uD06C \uD504\uB85C\uC81D\uD2B8",
243
+ npx: "NPX CLI \uB3C4\uAD6C \uD504\uB85C\uC81D\uD2B8"
183
244
  };
184
245
  var init = async (options) => {
185
246
  const targetDir = options.cwd || process.cwd();
@@ -236,6 +297,7 @@ var init = async (options) => {
236
297
  let totalFiles = 0;
237
298
  let totalDirectories = 0;
238
299
  const allSkills = [];
300
+ const allCommands = [];
239
301
  logger.blank();
240
302
  try {
241
303
  if (isSingleTemplate) {
@@ -249,6 +311,8 @@ var init = async (options) => {
249
311
  logger.success(`${template}: ${result.files} files copied`);
250
312
  const availableSkills = await listAvailableSkills(template);
251
313
  allSkills.push(...availableSkills);
314
+ const availableCommands = await listAvailableCommands(template);
315
+ allCommands.push(...availableCommands);
252
316
  } else {
253
317
  logger.info(`Installing ${templates.length} templates...`);
254
318
  logger.step(`Target: ${targetDir}/docs/`);
@@ -264,6 +328,12 @@ var init = async (options) => {
264
328
  allSkills.push(skill);
265
329
  }
266
330
  }
331
+ const availableCommands = await listAvailableCommands(template);
332
+ for (const command of availableCommands) {
333
+ if (!allCommands.includes(command)) {
334
+ allCommands.push(command);
335
+ }
336
+ }
267
337
  }
268
338
  }
269
339
  } catch (error) {
@@ -309,6 +379,44 @@ var init = async (options) => {
309
379
  logger.blank();
310
380
  }
311
381
  }
382
+ if (allCommands.length > 0) {
383
+ let installCommands = options.commands;
384
+ if (installCommands === void 0) {
385
+ logger.blank();
386
+ const response = await prompts({
387
+ type: "confirm",
388
+ name: "installCommands",
389
+ message: `Install Claude Code commands? (${allCommands.join(", ")})`,
390
+ initial: true
391
+ });
392
+ installCommands = response.installCommands;
393
+ }
394
+ if (installCommands) {
395
+ const existingCommands = await checkExistingCommands(
396
+ targetDir,
397
+ allCommands
398
+ );
399
+ if (existingCommands.length > 0 && !options.force) {
400
+ logger.warn("The following commands already exist:");
401
+ existingCommands.forEach((c) => logger.step(c));
402
+ logger.blank();
403
+ const response = await prompts({
404
+ type: "confirm",
405
+ name: "overwrite",
406
+ message: "Overwrite existing commands?",
407
+ initial: false
408
+ });
409
+ if (!response.overwrite) {
410
+ logger.info("Skipping commands installation.");
411
+ } else {
412
+ await installAllCommands(templates, targetDir);
413
+ }
414
+ } else {
415
+ await installAllCommands(templates, targetDir);
416
+ }
417
+ logger.blank();
418
+ }
419
+ }
312
420
  logger.success("Claude Code documentation installed!");
313
421
  logger.blank();
314
422
  logger.info("Installed templates:");
@@ -334,14 +442,29 @@ var installAllSkills = async (templates, targetDir) => {
334
442
  logger.step(`Location: .claude/skills/`);
335
443
  }
336
444
  };
445
+ var installAllCommands = async (templates, targetDir) => {
446
+ const installedCommands = [];
447
+ for (const template of templates) {
448
+ const commandsResult = await copyCommands(template, targetDir);
449
+ for (const command of commandsResult.commands) {
450
+ if (!installedCommands.includes(command)) {
451
+ installedCommands.push(command);
452
+ }
453
+ }
454
+ }
455
+ if (installedCommands.length > 0) {
456
+ logger.success(`Commands installed: ${installedCommands.join(", ")}`);
457
+ logger.step(`Location: .claude/commands/`);
458
+ }
459
+ };
337
460
 
338
461
  // src/index.ts
339
462
  var program = new Command();
340
- program.name("claude-code").description("Claude Code documentation installer for projects").version("1.0.0");
463
+ program.name("claude-code").description("Claude Code documentation installer for projects").version("0.1.4");
341
464
  program.option(
342
465
  "-t, --template <names>",
343
466
  "template names (comma-separated: tanstack-start,hono)"
344
- ).option("-f, --force", "overwrite existing files without prompting").option("-s, --skills", "install Claude Code skills").option("--no-skills", "skip skills installation").option("--cwd <path>", "target directory (default: current directory)").option("--list", "list available templates").action(async (options) => {
467
+ ).option("-f, --force", "overwrite existing files without prompting").option("-s, --skills", "install Claude Code skills").option("--no-skills", "skip skills installation").option("-c, --commands", "install Claude Code commands").option("--no-commands", "skip commands installation").option("--cwd <path>", "target directory (default: current directory)").option("--list", "list available templates").action(async (options) => {
345
468
  banner();
346
469
  if (options.list) {
347
470
  const templates = await listAvailableTemplates();
@@ -354,7 +477,8 @@ program.option(
354
477
  templates: options.template?.split(",").map((t) => t.trim()),
355
478
  force: options.force,
356
479
  cwd: options.cwd,
357
- skills: options.skills
480
+ skills: options.skills,
481
+ commands: options.commands
358
482
  });
359
483
  });
360
484
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kood/claude-code",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Claude Code documentation installer for projects",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
@@ -44,4 +44,4 @@
44
44
  "engines": {
45
45
  "node": ">=18"
46
46
  }
47
- }
47
+ }
@@ -52,6 +52,24 @@
52
52
  ✅ 코드베이스 검색 시 sgrep 사용 필수
53
53
  ```
54
54
 
55
+ ### 코드 작성 규칙
56
+ ```
57
+ ✅ 모든 한글 텍스트는 UTF-8 인코딩 유지
58
+ ✅ 코드 묶음 단위로 한글 주석 작성 (너무 세세하게 X)
59
+ ✅ Prisma Multi-File 모든 요소에 한글 주석 필수
60
+ ```
61
+
62
+ ### Prisma Multi-File 구조 (필수)
63
+ ```
64
+ prisma/
65
+ ├── schema/
66
+ │ ├── +base.prisma # datasource, generator 설정
67
+ │ ├── +enum.prisma # 모든 enum 정의
68
+ │ ├── user.prisma # User 모델
69
+ │ ├── post.prisma # Post 모델
70
+ │ └── ... # 기타 모델별 파일
71
+ ```
72
+
55
73
  ---
56
74
 
57
75
  ## ✅ ALWAYS DO (필수 실행)
@@ -110,7 +128,7 @@ docs: API 문서 업데이트
110
128
 
111
129
  | 작업 | 문서 경로 | 필독 여부 |
112
130
  |------|----------|----------|
113
- | **Git 규칙** | `docs/git/index.md` | 🔴 필수 |
131
+ | **Git 규칙** | `docs/git/git.md` | 🔴 필수 |
114
132
  | **MCP 도구** | `docs/mcp/` | 🔴 필수 |
115
133
  | **Gemini Review** | `docs/skills/gemini-review/` | 🟡 복잡한 작업 시 |
116
134
  | **API 개발** | `docs/library/hono/` | 🔴 필수 |
@@ -371,6 +389,6 @@ const data = await res.json() // { users: [] }
371
389
  ## 🔗 Quick Links
372
390
 
373
391
  - [Hono 가이드](./docs/library/hono/index.md)
374
- - [Git 규칙](./docs/git/index.md)
392
+ - [Git 규칙](./docs/git/git.md)
375
393
  - [MCP 가이드](./docs/mcp/index.md)
376
394
  - [배포 가이드](./docs/deployment/index.md)