@kood/claude-code 0.1.6 → 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.
- package/dist/index.js +109 -216
- package/package.json +8 -2
- package/templates/hono/CLAUDE.md +59 -328
- package/templates/hono/docs/architecture/architecture.md +93 -747
- package/templates/hono/docs/deployment/cloudflare.md +59 -513
- package/templates/hono/docs/deployment/docker.md +41 -356
- package/templates/hono/docs/deployment/index.md +54 -190
- package/templates/hono/docs/deployment/railway.md +36 -306
- package/templates/hono/docs/deployment/vercel.md +49 -434
- package/templates/hono/docs/library/ai-sdk/index.md +53 -290
- package/templates/hono/docs/library/ai-sdk/openrouter.md +19 -387
- package/templates/hono/docs/library/ai-sdk/providers.md +28 -394
- package/templates/hono/docs/library/ai-sdk/streaming.md +52 -353
- package/templates/hono/docs/library/ai-sdk/structured-output.md +63 -395
- package/templates/hono/docs/library/ai-sdk/tools.md +62 -431
- package/templates/hono/docs/library/hono/env-setup.md +24 -313
- package/templates/hono/docs/library/hono/error-handling.md +34 -295
- package/templates/hono/docs/library/hono/index.md +29 -121
- package/templates/hono/docs/library/hono/middleware.md +21 -188
- package/templates/hono/docs/library/hono/rpc.md +40 -341
- package/templates/hono/docs/library/hono/validation.md +35 -195
- package/templates/hono/docs/library/pino/index.md +42 -333
- package/templates/hono/docs/library/prisma/cloudflare-d1.md +64 -367
- package/templates/hono/docs/library/prisma/config.md +19 -260
- package/templates/hono/docs/library/prisma/index.md +67 -320
- package/templates/hono/docs/library/zod/index.md +53 -257
- package/templates/npx/CLAUDE.md +62 -274
- package/templates/npx/docs/references/patterns.md +160 -0
- package/templates/tanstack-start/CLAUDE.md +100 -256
- package/templates/tanstack-start/docs/architecture/architecture.md +44 -589
- package/templates/tanstack-start/docs/deployment/cloudflare.md +37 -424
- package/templates/tanstack-start/docs/deployment/index.md +57 -286
- package/templates/tanstack-start/docs/deployment/nitro.md +36 -318
- package/templates/tanstack-start/docs/deployment/railway.md +40 -409
- package/templates/tanstack-start/docs/deployment/vercel.md +43 -465
- package/templates/tanstack-start/docs/design/components.md +77 -311
- package/templates/tanstack-start/docs/design/index.md +113 -69
- package/templates/tanstack-start/docs/design/safe-area.md +51 -250
- package/templates/tanstack-start/docs/design/tailwind-setup.md +45 -359
- package/templates/tanstack-start/docs/guides/conventions.md +103 -0
- package/templates/tanstack-start/docs/guides/env-setup.md +34 -340
- package/templates/tanstack-start/docs/guides/getting-started.md +22 -209
- package/templates/tanstack-start/docs/guides/hooks.md +166 -0
- package/templates/tanstack-start/docs/guides/routes.md +166 -0
- package/templates/tanstack-start/docs/guides/services.md +143 -0
- package/templates/tanstack-start/docs/library/better-auth/2fa.md +27 -115
- package/templates/tanstack-start/docs/library/better-auth/advanced.md +22 -105
- package/templates/tanstack-start/docs/library/better-auth/index.md +17 -66
- package/templates/tanstack-start/docs/library/better-auth/plugins.md +11 -88
- package/templates/tanstack-start/docs/library/better-auth/session.md +12 -92
- package/templates/tanstack-start/docs/library/better-auth/setup.md +9 -91
- package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +30 -358
- package/templates/tanstack-start/docs/library/prisma/config.md +27 -327
- package/templates/tanstack-start/docs/library/prisma/crud.md +46 -174
- package/templates/tanstack-start/docs/library/prisma/index.md +23 -113
- package/templates/tanstack-start/docs/library/prisma/relations.md +31 -153
- package/templates/tanstack-start/docs/library/prisma/schema.md +40 -217
- package/templates/tanstack-start/docs/library/prisma/setup.md +12 -112
- package/templates/tanstack-start/docs/library/prisma/transactions.md +20 -110
- package/templates/tanstack-start/docs/library/tanstack-query/index.md +26 -97
- package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +28 -107
- package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +44 -146
- package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +33 -127
- package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +49 -149
- package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +19 -112
- package/templates/tanstack-start/docs/library/tanstack-start/index.md +33 -80
- package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +28 -106
- package/templates/tanstack-start/docs/library/tanstack-start/routing.md +21 -118
- package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +34 -246
- package/templates/tanstack-start/docs/library/tanstack-start/setup.md +6 -39
- package/templates/tanstack-start/docs/library/zod/complex-types.md +32 -156
- package/templates/tanstack-start/docs/library/zod/index.md +31 -144
- package/templates/tanstack-start/docs/library/zod/transforms.md +20 -129
- package/templates/tanstack-start/docs/library/zod/validation.md +39 -155
- package/templates/hono/docs/commands/git.md +0 -145
- package/templates/hono/docs/mcp/context7.md +0 -106
- package/templates/hono/docs/mcp/index.md +0 -176
- package/templates/hono/docs/mcp/sequential-thinking.md +0 -101
- package/templates/hono/docs/mcp/serena.md +0 -269
- package/templates/hono/docs/mcp/sgrep.md +0 -105
- package/templates/hono/docs/skills/gemini-review/SKILL.md +0 -220
- package/templates/hono/docs/skills/gemini-review/references/checklists.md +0 -136
- package/templates/hono/docs/skills/gemini-review/references/prompt-templates.md +0 -303
- package/templates/npx/docs/commands/git.md +0 -145
- package/templates/npx/docs/mcp/index.md +0 -60
- package/templates/npx/docs/skills/gemini-review/SKILL.md +0 -220
- package/templates/npx/docs/skills/gemini-review/references/checklists.md +0 -134
- package/templates/npx/docs/skills/gemini-review/references/prompt-templates.md +0 -301
- package/templates/tanstack-start/docs/commands/git.md +0 -145
- package/templates/tanstack-start/docs/design/accessibility.md +0 -433
- package/templates/tanstack-start/docs/design/color.md +0 -235
- package/templates/tanstack-start/docs/design/spacing.md +0 -341
- package/templates/tanstack-start/docs/design/typography.md +0 -324
- package/templates/tanstack-start/docs/guides/best-practices.md +0 -950
- package/templates/tanstack-start/docs/guides/husky-lint-staged.md +0 -303
- package/templates/tanstack-start/docs/guides/prettier.md +0 -189
- package/templates/tanstack-start/docs/guides/project-templates.md +0 -710
- package/templates/tanstack-start/docs/library/tanstack-query/setup.md +0 -107
- package/templates/tanstack-start/docs/library/zod/basic-types.md +0 -186
- package/templates/tanstack-start/docs/mcp/context7.md +0 -204
- package/templates/tanstack-start/docs/mcp/index.md +0 -177
- package/templates/tanstack-start/docs/mcp/sequential-thinking.md +0 -180
- package/templates/tanstack-start/docs/mcp/serena.md +0 -269
- package/templates/tanstack-start/docs/mcp/sgrep.md +0 -174
- package/templates/tanstack-start/docs/skills/gemini-review/SKILL.md +0 -220
- package/templates/tanstack-start/docs/skills/gemini-review/references/checklists.md +0 -144
- package/templates/tanstack-start/docs/skills/gemini-review/references/prompt-templates.md +0 -292
package/dist/index.js
CHANGED
|
@@ -88,8 +88,26 @@ var copyMultipleTemplates = async (templates, targetDir) => {
|
|
|
88
88
|
counter
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
+
const indexContent = generateIndexClaudeMd(templates);
|
|
92
|
+
await fs.writeFile(path.join(targetDir, "CLAUDE.md"), indexContent);
|
|
93
|
+
counter.files++;
|
|
91
94
|
return counter;
|
|
92
95
|
};
|
|
96
|
+
var generateIndexClaudeMd = (templates) => {
|
|
97
|
+
const templateLinks = templates.map((t) => `- [${t}](docs/${t}/CLAUDE.md)`).join("\n");
|
|
98
|
+
return `# CLAUDE.md
|
|
99
|
+
|
|
100
|
+
> \uC774 \uD504\uB85C\uC81D\uD2B8\uB294 \uC5EC\uB7EC \uD15C\uD50C\uB9BF\uC758 Claude Code \uBB38\uC11C\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.
|
|
101
|
+
|
|
102
|
+
## \uD15C\uD50C\uB9BF \uBB38\uC11C
|
|
103
|
+
|
|
104
|
+
${templateLinks}
|
|
105
|
+
|
|
106
|
+
## \uC0AC\uC6A9\uBC95
|
|
107
|
+
|
|
108
|
+
\uAC01 \uD15C\uD50C\uB9BF\uC758 \`CLAUDE.md\`\uB97C \uCC38\uC870\uD558\uC5EC \uD574\uB2F9 \uAE30\uC220 \uC2A4\uD0DD\uC758 \uAC00\uC774\uB4DC\uB77C\uC778\uC744 \uD655\uC778\uD558\uC138\uC694.
|
|
109
|
+
`;
|
|
110
|
+
};
|
|
93
111
|
var checkExistingFiles = async (targetDir) => {
|
|
94
112
|
const existingFiles = [];
|
|
95
113
|
const claudeMd = path.join(targetDir, "CLAUDE.md");
|
|
@@ -118,122 +136,59 @@ var listAvailableTemplates = async () => {
|
|
|
118
136
|
}
|
|
119
137
|
return templates;
|
|
120
138
|
};
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
var listAvailableSkills = async (template) => {
|
|
125
|
-
const skillsPath = getSkillsPath(template);
|
|
126
|
-
if (!await fs.pathExists(skillsPath)) {
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
const items = await fs.readdir(skillsPath);
|
|
130
|
-
const skills = [];
|
|
131
|
-
for (const item of items) {
|
|
132
|
-
const itemPath = path.join(skillsPath, item);
|
|
133
|
-
const stat = await fs.stat(itemPath);
|
|
134
|
-
if (stat.isDirectory()) {
|
|
135
|
-
skills.push(item);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return skills;
|
|
139
|
-
};
|
|
140
|
-
var copySkills = async (template, targetDir) => {
|
|
141
|
-
const skillsPath = getSkillsPath(template);
|
|
139
|
+
var copySkills = async (templates, targetDir) => {
|
|
140
|
+
const counter = { files: 0, directories: 0 };
|
|
142
141
|
const targetSkillsDir = path.join(targetDir, ".claude", "skills");
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const copyRecursive2 = async (src, dest) => {
|
|
150
|
-
const stat = await fs.stat(src);
|
|
151
|
-
if (stat.isDirectory()) {
|
|
152
|
-
await fs.ensureDir(dest);
|
|
153
|
-
directories++;
|
|
154
|
-
const items = await fs.readdir(src);
|
|
155
|
-
for (const item of items) {
|
|
156
|
-
await copyRecursive2(path.join(src, item), path.join(dest, item));
|
|
157
|
-
}
|
|
158
|
-
} else {
|
|
159
|
-
await fs.copy(src, dest);
|
|
160
|
-
files++;
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
const skillItems = await fs.readdir(skillsPath);
|
|
164
|
-
for (const skill of skillItems) {
|
|
165
|
-
const skillSrcPath = path.join(skillsPath, skill);
|
|
166
|
-
const skillDestPath = path.join(targetSkillsDir, skill);
|
|
167
|
-
const stat = await fs.stat(skillSrcPath);
|
|
168
|
-
if (stat.isDirectory()) {
|
|
169
|
-
await copyRecursive2(skillSrcPath, skillDestPath);
|
|
170
|
-
installedSkills.push(skill);
|
|
142
|
+
for (const template of templates) {
|
|
143
|
+
const templatePath = getTemplatePath(template);
|
|
144
|
+
const skillsSrc = path.join(templatePath, "docs", "skills");
|
|
145
|
+
if (await fs.pathExists(skillsSrc)) {
|
|
146
|
+
await fs.ensureDir(targetSkillsDir);
|
|
147
|
+
await copyRecursive(skillsSrc, targetSkillsDir, counter);
|
|
171
148
|
}
|
|
172
149
|
}
|
|
173
|
-
return
|
|
150
|
+
return counter;
|
|
174
151
|
};
|
|
175
|
-
var
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
for (const
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
152
|
+
var copyCommands = async (templates, targetDir) => {
|
|
153
|
+
const counter = { files: 0, directories: 0 };
|
|
154
|
+
const targetCommandsDir = path.join(targetDir, ".claude", "commands");
|
|
155
|
+
for (const template of templates) {
|
|
156
|
+
const templatePath = getTemplatePath(template);
|
|
157
|
+
const commandsSrc = path.join(templatePath, "docs", "commands");
|
|
158
|
+
if (await fs.pathExists(commandsSrc)) {
|
|
159
|
+
await fs.ensureDir(targetCommandsDir);
|
|
160
|
+
await copyRecursive(commandsSrc, targetCommandsDir, counter);
|
|
182
161
|
}
|
|
183
162
|
}
|
|
184
|
-
return
|
|
185
|
-
};
|
|
186
|
-
var getCommandsPath = (template) => {
|
|
187
|
-
return path.join(getTemplatePath(template), "docs", "commands");
|
|
163
|
+
return counter;
|
|
188
164
|
};
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const stat = await fs.stat(itemPath);
|
|
199
|
-
if (stat.isFile() && item.endsWith(".md")) {
|
|
200
|
-
commands.push(item.replace(".md", ""));
|
|
165
|
+
var checkSkillsAndCommandsExist = async (templates) => {
|
|
166
|
+
let hasSkills = false;
|
|
167
|
+
let hasCommands = false;
|
|
168
|
+
for (const template of templates) {
|
|
169
|
+
const templatePath = getTemplatePath(template);
|
|
170
|
+
const skillsSrc = path.join(templatePath, "docs", "skills");
|
|
171
|
+
const commandsSrc = path.join(templatePath, "docs", "commands");
|
|
172
|
+
if (await fs.pathExists(skillsSrc)) {
|
|
173
|
+
hasSkills = true;
|
|
201
174
|
}
|
|
202
|
-
|
|
203
|
-
|
|
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", ""));
|
|
175
|
+
if (await fs.pathExists(commandsSrc)) {
|
|
176
|
+
hasCommands = true;
|
|
223
177
|
}
|
|
224
178
|
}
|
|
225
|
-
return {
|
|
179
|
+
return { hasSkills, hasCommands };
|
|
226
180
|
};
|
|
227
|
-
var
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
181
|
+
var checkExistingClaudeFiles = async (targetDir) => {
|
|
182
|
+
const existingFiles = [];
|
|
183
|
+
const skillsDir = path.join(targetDir, ".claude", "skills");
|
|
184
|
+
const commandsDir = path.join(targetDir, ".claude", "commands");
|
|
185
|
+
if (await fs.pathExists(skillsDir)) {
|
|
186
|
+
existingFiles.push(".claude/skills/");
|
|
187
|
+
}
|
|
188
|
+
if (await fs.pathExists(commandsDir)) {
|
|
189
|
+
existingFiles.push(".claude/commands/");
|
|
235
190
|
}
|
|
236
|
-
return
|
|
191
|
+
return existingFiles;
|
|
237
192
|
};
|
|
238
193
|
|
|
239
194
|
// src/commands/init.ts
|
|
@@ -296,8 +251,6 @@ var init = async (options) => {
|
|
|
296
251
|
const isSingleTemplate = templates.length === 1;
|
|
297
252
|
let totalFiles = 0;
|
|
298
253
|
let totalDirectories = 0;
|
|
299
|
-
const allSkills = [];
|
|
300
|
-
const allCommands = [];
|
|
301
254
|
logger.blank();
|
|
302
255
|
try {
|
|
303
256
|
if (isSingleTemplate) {
|
|
@@ -309,10 +262,6 @@ var init = async (options) => {
|
|
|
309
262
|
totalFiles = result.files;
|
|
310
263
|
totalDirectories = result.directories;
|
|
311
264
|
logger.success(`${template}: ${result.files} files copied`);
|
|
312
|
-
const availableSkills = await listAvailableSkills(template);
|
|
313
|
-
allSkills.push(...availableSkills);
|
|
314
|
-
const availableCommands = await listAvailableCommands(template);
|
|
315
|
-
allCommands.push(...availableCommands);
|
|
316
265
|
} else {
|
|
317
266
|
logger.info(`Installing ${templates.length} templates...`);
|
|
318
267
|
logger.step(`Target: ${targetDir}/docs/`);
|
|
@@ -322,18 +271,6 @@ var init = async (options) => {
|
|
|
322
271
|
totalDirectories = result.directories;
|
|
323
272
|
for (const template of templates) {
|
|
324
273
|
logger.success(`${template}: installed to docs/${template}/`);
|
|
325
|
-
const availableSkills = await listAvailableSkills(template);
|
|
326
|
-
for (const skill of availableSkills) {
|
|
327
|
-
if (!allSkills.includes(skill)) {
|
|
328
|
-
allSkills.push(skill);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
const availableCommands = await listAvailableCommands(template);
|
|
332
|
-
for (const command of availableCommands) {
|
|
333
|
-
if (!allCommands.includes(command)) {
|
|
334
|
-
allCommands.push(command);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
274
|
}
|
|
338
275
|
}
|
|
339
276
|
} catch (error) {
|
|
@@ -344,127 +281,83 @@ var init = async (options) => {
|
|
|
344
281
|
}
|
|
345
282
|
logger.blank();
|
|
346
283
|
logger.success(`Total: ${totalFiles} files, ${totalDirectories} directories`);
|
|
347
|
-
if (
|
|
348
|
-
|
|
349
|
-
|
|
284
|
+
if (options.skills || options.commands) {
|
|
285
|
+
const { hasSkills, hasCommands } = await checkSkillsAndCommandsExist(templates);
|
|
286
|
+
const existingClaudeFiles = await checkExistingClaudeFiles(targetDir);
|
|
287
|
+
if (existingClaudeFiles.length > 0 && !options.force) {
|
|
288
|
+
logger.warn("The following .claude files/folders already exist:");
|
|
289
|
+
existingClaudeFiles.forEach((f) => logger.step(f));
|
|
350
290
|
logger.blank();
|
|
351
291
|
const response = await prompts({
|
|
352
292
|
type: "confirm",
|
|
353
|
-
name: "
|
|
354
|
-
message:
|
|
355
|
-
initial:
|
|
293
|
+
name: "overwrite",
|
|
294
|
+
message: "Overwrite existing .claude files?",
|
|
295
|
+
initial: false
|
|
356
296
|
});
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
if (installSkills) {
|
|
360
|
-
const existingSkills = await checkExistingSkills(targetDir, allSkills);
|
|
361
|
-
if (existingSkills.length > 0 && !options.force) {
|
|
362
|
-
logger.warn("The following skills already exist:");
|
|
363
|
-
existingSkills.forEach((s) => logger.step(s));
|
|
364
|
-
logger.blank();
|
|
365
|
-
const response = await prompts({
|
|
366
|
-
type: "confirm",
|
|
367
|
-
name: "overwrite",
|
|
368
|
-
message: "Overwrite existing skills?",
|
|
369
|
-
initial: false
|
|
370
|
-
});
|
|
371
|
-
if (!response.overwrite) {
|
|
372
|
-
logger.info("Skipping skills installation.");
|
|
373
|
-
} else {
|
|
374
|
-
await installAllSkills(templates, targetDir);
|
|
375
|
-
}
|
|
297
|
+
if (!response.overwrite) {
|
|
298
|
+
logger.info("Skipping skills/commands installation.");
|
|
376
299
|
} else {
|
|
377
|
-
await
|
|
300
|
+
await installSkillsAndCommands();
|
|
378
301
|
}
|
|
379
|
-
|
|
380
|
-
|
|
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;
|
|
302
|
+
} else {
|
|
303
|
+
await installSkillsAndCommands();
|
|
393
304
|
}
|
|
394
|
-
|
|
395
|
-
|
|
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));
|
|
305
|
+
async function installSkillsAndCommands() {
|
|
306
|
+
if (options.skills && hasSkills) {
|
|
402
307
|
logger.blank();
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
308
|
+
logger.info("Installing skills...");
|
|
309
|
+
const skillsResult = await copySkills(templates, targetDir);
|
|
310
|
+
totalFiles += skillsResult.files;
|
|
311
|
+
totalDirectories += skillsResult.directories;
|
|
312
|
+
logger.success(
|
|
313
|
+
`Skills: ${skillsResult.files} files, ${skillsResult.directories} directories`
|
|
314
|
+
);
|
|
315
|
+
} else if (options.skills && !hasSkills) {
|
|
316
|
+
logger.warn("No skills found in selected templates.");
|
|
317
|
+
}
|
|
318
|
+
if (options.commands && hasCommands) {
|
|
319
|
+
logger.blank();
|
|
320
|
+
logger.info("Installing commands...");
|
|
321
|
+
const commandsResult = await copyCommands(templates, targetDir);
|
|
322
|
+
totalFiles += commandsResult.files;
|
|
323
|
+
totalDirectories += commandsResult.directories;
|
|
324
|
+
logger.success(
|
|
325
|
+
`Commands: ${commandsResult.files} files, ${commandsResult.directories} directories`
|
|
326
|
+
);
|
|
327
|
+
} else if (options.commands && !hasCommands) {
|
|
328
|
+
logger.warn("No commands found in selected templates.");
|
|
416
329
|
}
|
|
417
|
-
logger.blank();
|
|
418
330
|
}
|
|
419
331
|
}
|
|
332
|
+
logger.blank();
|
|
420
333
|
logger.success("Claude Code documentation installed!");
|
|
421
334
|
logger.blank();
|
|
422
335
|
logger.info("Installed templates:");
|
|
423
336
|
templates.forEach((t) => logger.step(t));
|
|
337
|
+
if (options.skills || options.commands) {
|
|
338
|
+
logger.blank();
|
|
339
|
+
logger.info("Installed extras:");
|
|
340
|
+
if (options.skills) {
|
|
341
|
+
logger.step("Skills \u2192 .claude/skills/");
|
|
342
|
+
}
|
|
343
|
+
if (options.commands) {
|
|
344
|
+
logger.step("Commands \u2192 .claude/commands/");
|
|
345
|
+
}
|
|
346
|
+
}
|
|
424
347
|
logger.blank();
|
|
425
348
|
logger.info("Next steps:");
|
|
426
349
|
logger.step("Read CLAUDE.md for project guidelines");
|
|
427
350
|
logger.step("Explore docs/ for detailed documentation");
|
|
428
351
|
logger.blank();
|
|
429
352
|
};
|
|
430
|
-
var installAllSkills = async (templates, targetDir) => {
|
|
431
|
-
const installedSkills = [];
|
|
432
|
-
for (const template of templates) {
|
|
433
|
-
const skillsResult = await copySkills(template, targetDir);
|
|
434
|
-
for (const skill of skillsResult.skills) {
|
|
435
|
-
if (!installedSkills.includes(skill)) {
|
|
436
|
-
installedSkills.push(skill);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
if (installedSkills.length > 0) {
|
|
441
|
-
logger.success(`Skills installed: ${installedSkills.join(", ")}`);
|
|
442
|
-
logger.step(`Location: .claude/skills/`);
|
|
443
|
-
}
|
|
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
|
-
};
|
|
460
353
|
|
|
461
354
|
// src/index.ts
|
|
462
355
|
var program = new Command();
|
|
463
|
-
program.name("claude-code").description("Claude Code documentation installer for projects").version("0.1.
|
|
356
|
+
program.name("claude-code").description("Claude Code documentation installer for projects").version("0.1.9");
|
|
464
357
|
program.option(
|
|
465
358
|
"-t, --template <names>",
|
|
466
359
|
"template names (comma-separated: tanstack-start,hono)"
|
|
467
|
-
).option("-f, --force", "overwrite existing files without prompting").option("
|
|
360
|
+
).option("-f, --force", "overwrite existing files without prompting").option("--cwd <path>", "target directory (default: current directory)").option("--list", "list available templates").option("-s, --skills", "install skills to .claude/skills/").option("-c, --commands", "install commands to .claude/commands/").action(async (options) => {
|
|
468
361
|
banner();
|
|
469
362
|
if (options.list) {
|
|
470
363
|
const templates = await listAvailableTemplates();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kood/claude-code",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Claude Code documentation installer for projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"copy-templates": "node scripts/copy-templates.js",
|
|
13
13
|
"build": "tsup && npm run copy-templates",
|
|
14
14
|
"dev": "npm run build && node dist/index.js",
|
|
15
|
+
"lint": "eslint src/",
|
|
16
|
+
"lint:fix": "eslint src/ --fix",
|
|
15
17
|
"prepublishOnly": "npm run build"
|
|
16
18
|
},
|
|
17
19
|
"keywords": [
|
|
@@ -38,10 +40,14 @@
|
|
|
38
40
|
"@types/fs-extra": "^11.0.4",
|
|
39
41
|
"@types/node": "^22.10.0",
|
|
40
42
|
"@types/prompts": "^2.4.9",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.50.1",
|
|
44
|
+
"@typescript-eslint/parser": "^8.50.1",
|
|
45
|
+
"eslint": "^9.39.2",
|
|
46
|
+
"globals": "^16.5.0",
|
|
41
47
|
"tsup": "^8.3.5",
|
|
42
48
|
"typescript": "^5.7.2"
|
|
43
49
|
},
|
|
44
50
|
"engines": {
|
|
45
51
|
"node": ">=18"
|
|
46
52
|
}
|
|
47
|
-
}
|
|
53
|
+
}
|