@take-out/cli 0.1.45 → 0.1.47
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/README.md +4 -4
- package/dist/cjs/commands/skills.cjs +49 -191
- package/dist/cjs/commands/skills.js +41 -150
- package/dist/cjs/commands/skills.js.map +2 -2
- package/dist/esm/commands/skills.js +43 -157
- package/dist/esm/commands/skills.js.map +1 -1
- package/dist/esm/commands/skills.mjs +49 -191
- package/dist/esm/commands/skills.mjs.map +1 -1
- package/package.json +4 -4
- package/src/commands/skills.ts +65 -292
- package/types/commands/skills.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -88,8 +88,8 @@ takeout skills generate --clean # clean and regenerate
|
|
|
88
88
|
The `skills generate` command generates Claude Code skills from your documentation:
|
|
89
89
|
|
|
90
90
|
1. scans docs from both `./docs/` (local) and package docs
|
|
91
|
-
2.
|
|
92
|
-
3.
|
|
91
|
+
2. only docs with YAML frontmatter containing `name` and `description` become skills
|
|
92
|
+
3. those docs are symlinked into `.claude/skills/`
|
|
93
93
|
|
|
94
94
|
**adding frontmatter to docs (recommended):**
|
|
95
95
|
|
|
@@ -104,8 +104,8 @@ description: What this skill does. Keywords for when Claude should use it.
|
|
|
104
104
|
content here...
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
docs with frontmatter get symlinked directly
|
|
108
|
-
|
|
107
|
+
docs with frontmatter get symlinked directly, so edits to the source doc update
|
|
108
|
+
the skill automatically. docs without that frontmatter are skipped.
|
|
109
109
|
|
|
110
110
|
**regenerating skills:**
|
|
111
111
|
|
|
@@ -37,111 +37,10 @@ module.exports = __toCommonJS(skills_exports);
|
|
|
37
37
|
var import_node_fs = require("node:fs"),
|
|
38
38
|
import_node_module = require("node:module"),
|
|
39
39
|
import_node_path = require("node:path"),
|
|
40
|
-
import_node_url = require("node:url"),
|
|
41
40
|
import_citty = require("citty"),
|
|
42
|
-
import_picocolors = __toESM(require("picocolors"), 1)
|
|
43
|
-
import_script_utils = require("../utils/script-utils.cjs");
|
|
41
|
+
import_picocolors = __toESM(require("picocolors"), 1);
|
|
44
42
|
const import_meta = {},
|
|
45
|
-
|
|
46
|
-
name: "onboard",
|
|
47
|
-
description: "setup wizard for new projects"
|
|
48
|
-
}, {
|
|
49
|
-
name: "docs",
|
|
50
|
-
description: "view documentation"
|
|
51
|
-
}, {
|
|
52
|
-
name: "env:setup",
|
|
53
|
-
description: "setup environment variables"
|
|
54
|
-
}, {
|
|
55
|
-
name: "run",
|
|
56
|
-
description: "run scripts in parallel"
|
|
57
|
-
}, {
|
|
58
|
-
name: "script",
|
|
59
|
-
description: "manage and run scripts"
|
|
60
|
-
}, {
|
|
61
|
-
name: "sync",
|
|
62
|
-
description: "sync fork with upstream takeout"
|
|
63
|
-
}, {
|
|
64
|
-
name: "changed",
|
|
65
|
-
description: "show changes since last sync"
|
|
66
|
-
}, {
|
|
67
|
-
name: "skills",
|
|
68
|
-
description: "manage claude code skills"
|
|
69
|
-
}, {
|
|
70
|
-
name: "completion",
|
|
71
|
-
description: "shell completion setup"
|
|
72
|
-
}];
|
|
73
|
-
function findScriptsPackageRoot() {
|
|
74
|
-
try {
|
|
75
|
-
const resolved = import_meta.resolve("@take-out/scripts/package.json"),
|
|
76
|
-
packageJsonPath = (0, import_node_url.fileURLToPath)(new URL(resolved));
|
|
77
|
-
return (0, import_node_path.join)(packageJsonPath, "..", "src");
|
|
78
|
-
} catch {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function buildSummaryDescription(localScripts, builtInScripts) {
|
|
83
|
-
const categories = /* @__PURE__ */new Set(),
|
|
84
|
-
keywords = /* @__PURE__ */new Set();
|
|
85
|
-
for (const [name] of [...localScripts, ...builtInScripts]) keywords.add(name), name.includes("/") && categories.add(name.split("/")[0]);
|
|
86
|
-
for (const cmd of BUILTIN_COMMANDS) keywords.add(cmd.name);
|
|
87
|
-
return `CLI scripts and commands reference for the tko (takeout) CLI. Use when the user asks to run scripts, manage the project, or needs to know what commands are available. tko, takeout, CLI, scripts, commands, bun tko, project tasks, automation, ${[...categories].sort().join(", ")}, ${[...keywords].sort().join(", ")}`.slice(0, 2048);
|
|
88
|
-
}
|
|
89
|
-
function buildSummaryContent(localScripts, builtInScripts, metadata) {
|
|
90
|
-
const description = buildSummaryDescription(localScripts, builtInScripts),
|
|
91
|
-
lines = [];
|
|
92
|
-
lines.push("---"), lines.push("name: tko-scripts"), lines.push(`description: ${description}`), lines.push("---"), lines.push(""), lines.push("# tko CLI - scripts & commands"), lines.push(""), lines.push("run with `bun tko <command>` or `bun tko <script-name>`."), lines.push(""), lines.push("## built-in commands"), lines.push("");
|
|
93
|
-
for (const cmd of BUILTIN_COMMANDS) lines.push(` ${cmd.name} - ${cmd.description}`);
|
|
94
|
-
lines.push("");
|
|
95
|
-
const formatSection = (title, scripts) => {
|
|
96
|
-
if (scripts.size === 0) return;
|
|
97
|
-
const categories = /* @__PURE__ */new Map(),
|
|
98
|
-
rootScripts = [];
|
|
99
|
-
for (const [name] of scripts) if (name.includes("/")) {
|
|
100
|
-
const category = name.split("/")[0];
|
|
101
|
-
categories.has(category) || categories.set(category, []), categories.get(category).push(name);
|
|
102
|
-
} else rootScripts.push(name);
|
|
103
|
-
lines.push(`## ${title}`), lines.push("");
|
|
104
|
-
for (const name of rootScripts) {
|
|
105
|
-
const meta = metadata.get(name),
|
|
106
|
-
desc = meta?.description ? ` - ${meta.description}` : "",
|
|
107
|
-
args = meta?.args?.length ? ` [${meta.args.join(", ")}]` : "";
|
|
108
|
-
lines.push(` ${name}${desc}${args}`);
|
|
109
|
-
}
|
|
110
|
-
for (const [category, categoryScripts] of categories) {
|
|
111
|
-
lines.push(""), lines.push(` ${category}/`);
|
|
112
|
-
for (const name of categoryScripts) {
|
|
113
|
-
const shortName = name.substring(category.length + 1),
|
|
114
|
-
meta = metadata.get(name),
|
|
115
|
-
desc = meta?.description ? ` - ${meta.description}` : "",
|
|
116
|
-
args = meta?.args?.length ? ` [${meta.args.join(", ")}]` : "";
|
|
117
|
-
lines.push(` ${shortName}${desc}${args}`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
lines.push("");
|
|
121
|
-
};
|
|
122
|
-
return formatSection("local scripts", localScripts), formatSection("built-in scripts", builtInScripts), lines.push("## usage"), lines.push(""), lines.push("```bash"), lines.push("bun tko <command> # run a built-in command"), lines.push("bun tko <script-name> # execute direct script"), lines.push("bun tko <group> <script> # execute nested script (e.g. bun tko aws health)"), lines.push("bun tko run s1 s2 s3 # run multiple scripts in parallel"), lines.push("bun tko script new <path> # create a new script"), lines.push("```"), lines.push(""), lines.join(`
|
|
123
|
-
`);
|
|
124
|
-
}
|
|
125
|
-
async function generateSummary(cwd) {
|
|
126
|
-
const skillsDir = (0, import_node_path.join)(cwd, ".claude", "skills"),
|
|
127
|
-
skillDir = (0, import_node_path.join)(skillsDir, "tko-scripts"),
|
|
128
|
-
skillFile = (0, import_node_path.join)(skillDir, "SKILL.md"),
|
|
129
|
-
localScripts = (0, import_script_utils.discoverScripts)((0, import_script_utils.getLocalScriptsDir)()),
|
|
130
|
-
builtInDir = findScriptsPackageRoot(),
|
|
131
|
-
builtInScripts = builtInDir ? (0, import_script_utils.discoverScripts)(builtInDir) : /* @__PURE__ */new Map(),
|
|
132
|
-
allScripts = new Map([...localScripts, ...builtInScripts]),
|
|
133
|
-
metadata = await (0, import_script_utils.getAllScriptMetadata)(allScripts),
|
|
134
|
-
totalScripts = localScripts.size + builtInScripts.size;
|
|
135
|
-
console.info(import_picocolors.default.dim(`found ${totalScripts} scripts (${localScripts.size} local, ${builtInScripts.size} built-in) + ${BUILTIN_COMMANDS.length} commands`));
|
|
136
|
-
const content = buildSummaryContent(localScripts, builtInScripts, metadata);
|
|
137
|
-
try {
|
|
138
|
-
if ((0, import_node_fs.readFileSync)(skillFile, "utf-8") === content) return console.info(` ${import_picocolors.default.dim("tko-scripts")} ${import_picocolors.default.dim("unchanged")}`), !1;
|
|
139
|
-
} catch {}
|
|
140
|
-
return (0, import_node_fs.existsSync)(skillDir) || (0, import_node_fs.mkdirSync)(skillDir, {
|
|
141
|
-
recursive: !0
|
|
142
|
-
}), (0, import_node_fs.writeFileSync)(skillFile, content), console.info(` ${import_picocolors.default.green("\u2713")} tko-scripts`), !0;
|
|
143
|
-
}
|
|
144
|
-
const require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
43
|
+
require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
145
44
|
let DOCS_DIR;
|
|
146
45
|
try {
|
|
147
46
|
DOCS_DIR = (0, import_node_path.dirname)(require2.resolve("@take-out/docs/package.json"));
|
|
@@ -163,37 +62,6 @@ function isDevOnly(content) {
|
|
|
163
62
|
const frontmatter = content.slice(3, endIndex);
|
|
164
63
|
return /\bdev:\s*true\b/.test(frontmatter);
|
|
165
64
|
}
|
|
166
|
-
function extractDocMeta(content) {
|
|
167
|
-
const lines = content.split(`
|
|
168
|
-
`);
|
|
169
|
-
let title = "",
|
|
170
|
-
description = "",
|
|
171
|
-
startLine = 0;
|
|
172
|
-
if (lines[0]?.trim() === "---") {
|
|
173
|
-
for (let i = 1; i < lines.length; i++) if (lines[i]?.trim() === "---") {
|
|
174
|
-
startLine = i + 1;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
for (let i = startLine; i < lines.length; i++) {
|
|
179
|
-
const trimmed = lines[i]?.trim() || "";
|
|
180
|
-
if (!title && trimmed.startsWith("# ")) {
|
|
181
|
-
title = trimmed.slice(2).trim();
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
if (title && trimmed && !trimmed.startsWith("#")) {
|
|
185
|
-
description = trimmed;
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
title,
|
|
191
|
-
description
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function toSkillName(name) {
|
|
195
|
-
return name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 64);
|
|
196
|
-
}
|
|
197
65
|
function collectAllDocs(cwd) {
|
|
198
66
|
const docs = [],
|
|
199
67
|
seen = /* @__PURE__ */new Set(),
|
|
@@ -224,13 +92,10 @@ function collectAllDocs(cwd) {
|
|
|
224
92
|
}
|
|
225
93
|
async function generateDocSkills(cwd, clean) {
|
|
226
94
|
const skillsDir = (0, import_node_path.join)(cwd, ".claude", "skills"),
|
|
227
|
-
docs = collectAllDocs(cwd)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
unchanged: 0
|
|
232
|
-
};
|
|
233
|
-
if (console.info(import_picocolors.default.dim(`found ${docs.length} documentation files`)), clean && (0, import_node_fs.existsSync)(skillsDir)) {
|
|
95
|
+
docs = collectAllDocs(cwd),
|
|
96
|
+
localDocsDir = (0, import_node_path.join)(cwd, "docs"),
|
|
97
|
+
expectedSkillNames = /* @__PURE__ */new Set();
|
|
98
|
+
if (docs.length === 0 ? console.info(import_picocolors.default.yellow("no documentation files found")) : console.info(import_picocolors.default.dim(`found ${docs.length} documentation files`)), clean && (0, import_node_fs.existsSync)(skillsDir)) {
|
|
234
99
|
const existing = (0, import_node_fs.readdirSync)(skillsDir);
|
|
235
100
|
for (const dir of existing) dir.startsWith(SKILL_PREFIX) && (0, import_node_fs.rmSync)((0, import_node_path.join)(skillsDir, dir), {
|
|
236
101
|
recursive: !0
|
|
@@ -241,16 +106,20 @@ async function generateDocSkills(cwd, clean) {
|
|
|
241
106
|
});
|
|
242
107
|
let symlinked = 0,
|
|
243
108
|
generated = 0,
|
|
244
|
-
unchanged = 0
|
|
109
|
+
unchanged = 0,
|
|
110
|
+
removed = 0,
|
|
111
|
+
skipped = 0;
|
|
245
112
|
const isDev = !!process.env.IS_TAMAGUI_DEV;
|
|
246
113
|
for (const doc of docs) {
|
|
247
114
|
const content = (0, import_node_fs.readFileSync)(doc.path, "utf-8");
|
|
248
115
|
if (isDevOnly(content) && !isDev) continue;
|
|
249
|
-
|
|
116
|
+
const hasFrontmatter = hasSkillFrontmatter(content);
|
|
117
|
+
if (hasFrontmatter) {
|
|
250
118
|
const nameMatch = content.match(/^---\s*\nname:\s*([^\n]+)/m);
|
|
251
119
|
if (!nameMatch) continue;
|
|
252
|
-
const skillName = nameMatch[1].trim()
|
|
253
|
-
|
|
120
|
+
const skillName = nameMatch[1].trim();
|
|
121
|
+
expectedSkillNames.add(skillName);
|
|
122
|
+
const skillDir = (0, import_node_path.join)(skillsDir, skillName),
|
|
254
123
|
skillFile = (0, import_node_path.join)(skillDir, "SKILL.md");
|
|
255
124
|
(0, import_node_fs.existsSync)(skillDir) || (0, import_node_fs.mkdirSync)(skillDir, {
|
|
256
125
|
recursive: !0
|
|
@@ -264,56 +133,44 @@ async function generateDocSkills(cwd, clean) {
|
|
|
264
133
|
(0, import_node_fs.symlinkSync)(relativePath, skillFile), symlinked++;
|
|
265
134
|
const sourceLabel = doc.source === "local" ? import_picocolors.default.blue("local") : import_picocolors.default.dim("package");
|
|
266
135
|
console.info(` ${import_picocolors.default.green("\u27F7")} ${skillName} ${sourceLabel} ${import_picocolors.default.dim("(symlink)")}`);
|
|
267
|
-
} else {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
skillDir = (0, import_node_path.join)(skillsDir, skillName),
|
|
271
|
-
skillFile = (0, import_node_path.join)(skillDir, "SKILL.md");
|
|
272
|
-
(0, import_node_fs.existsSync)(skillDir) || (0, import_node_fs.mkdirSync)(skillDir, {
|
|
273
|
-
recursive: !0
|
|
274
|
-
});
|
|
275
|
-
const {
|
|
276
|
-
title,
|
|
277
|
-
description
|
|
278
|
-
} = extractDocMeta(content),
|
|
279
|
-
skillDescription = description ? `${title}. ${description}`.slice(0, 1024) : title.slice(0, 1024),
|
|
280
|
-
skillContent = `---
|
|
281
|
-
name: ${skillName}
|
|
282
|
-
description: ${skillDescription}
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
${content}
|
|
286
|
-
`;
|
|
287
|
-
let shouldWrite = !0;
|
|
288
|
-
try {
|
|
289
|
-
(0, import_node_fs.lstatSync)(skillFile).isSymbolicLink() ? (0, import_node_fs.unlinkSync)(skillFile) : (0, import_node_fs.readFileSync)(skillFile, "utf-8") === skillContent && (unchanged++, shouldWrite = !1);
|
|
290
|
-
} catch {}
|
|
291
|
-
if (!shouldWrite) continue;
|
|
292
|
-
(0, import_node_fs.writeFileSync)(skillFile, skillContent), generated++;
|
|
293
|
-
const sourceLabel = doc.source === "local" ? import_picocolors.default.blue("local") : import_picocolors.default.dim("package");
|
|
294
|
-
console.info(` ${import_picocolors.default.green("\u2713")} ${skillName} ${sourceLabel} ${import_picocolors.default.dim("(generated)")}`);
|
|
136
|
+
} else if (!hasFrontmatter) {
|
|
137
|
+
skipped++, console.info(` ${import_picocolors.default.yellow("!")} skipped ${import_picocolors.default.dim(doc.name)} ${import_picocolors.default.dim("(missing skill frontmatter)")}`);
|
|
138
|
+
continue;
|
|
295
139
|
}
|
|
296
140
|
}
|
|
141
|
+
for (const dir of (0, import_node_fs.readdirSync)(skillsDir)) {
|
|
142
|
+
if (expectedSkillNames.has(dir)) continue;
|
|
143
|
+
const skillDir = (0, import_node_path.join)(skillsDir, dir),
|
|
144
|
+
skillFile = (0, import_node_path.join)(skillDir, "SKILL.md");
|
|
145
|
+
if (dir.startsWith(SKILL_PREFIX)) {
|
|
146
|
+
(0, import_node_fs.rmSync)(skillDir, {
|
|
147
|
+
recursive: !0,
|
|
148
|
+
force: !0
|
|
149
|
+
}), removed++, console.info(` ${import_picocolors.default.red("\u2715")} ${dir} ${import_picocolors.default.dim("(removed stale generated skill)")}`);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
let shouldUnlink = !1;
|
|
153
|
+
try {
|
|
154
|
+
if ((0, import_node_fs.lstatSync)(skillFile).isSymbolicLink()) {
|
|
155
|
+
const linkTarget = (0, import_node_fs.readlinkSync)(skillFile),
|
|
156
|
+
resolvedTarget = (0, import_node_path.resolve)(skillDir, linkTarget);
|
|
157
|
+
shouldUnlink = resolvedTarget.startsWith(`${localDocsDir}/`) || !!DOCS_DIR && resolvedTarget.startsWith(`${DOCS_DIR}/`);
|
|
158
|
+
}
|
|
159
|
+
} catch {}
|
|
160
|
+
shouldUnlink && ((0, import_node_fs.unlinkSync)(skillFile), (0, import_node_fs.readdirSync)(skillDir).length === 0 && (0, import_node_fs.rmdirSync)(skillDir), removed++, console.info(` ${import_picocolors.default.red("\u2715")} ${dir} ${import_picocolors.default.dim("(removed stale symlink)")}`));
|
|
161
|
+
}
|
|
297
162
|
return {
|
|
298
163
|
symlinked,
|
|
299
164
|
generated,
|
|
300
|
-
unchanged
|
|
165
|
+
unchanged,
|
|
166
|
+
removed,
|
|
167
|
+
skipped
|
|
301
168
|
};
|
|
302
169
|
}
|
|
303
|
-
const
|
|
304
|
-
meta: {
|
|
305
|
-
name: "scripts",
|
|
306
|
-
description: "Generate a skill summarizing all tko scripts and commands"
|
|
307
|
-
},
|
|
308
|
-
async run() {
|
|
309
|
-
const cwd = process.cwd();
|
|
310
|
-
console.info(), console.info(import_picocolors.default.bold(import_picocolors.default.cyan("Generate scripts skill"))), console.info(), await generateSummary(cwd), console.info();
|
|
311
|
-
}
|
|
312
|
-
}),
|
|
313
|
-
generateCommand = (0, import_citty.defineCommand)({
|
|
170
|
+
const generateCommand = (0, import_citty.defineCommand)({
|
|
314
171
|
meta: {
|
|
315
172
|
name: "generate",
|
|
316
|
-
description: "Generate
|
|
173
|
+
description: "Generate Claude Code skills from documentation"
|
|
317
174
|
},
|
|
318
175
|
args: {
|
|
319
176
|
clean: {
|
|
@@ -335,12 +192,14 @@ const scriptsCommand = (0, import_citty.defineCommand)({
|
|
|
335
192
|
console.info(), console.info(import_picocolors.default.bold(import_picocolors.default.cyan("Generate all skills"))), console.info();
|
|
336
193
|
let symlinked = 0,
|
|
337
194
|
generated = 0,
|
|
338
|
-
unchanged = 0
|
|
195
|
+
unchanged = 0,
|
|
196
|
+
removed = 0,
|
|
197
|
+
skipped = 0;
|
|
339
198
|
if (!args["skip-internal-docs"]) {
|
|
340
199
|
const docStats = await generateDocSkills(cwd, args.clean);
|
|
341
|
-
symlinked = docStats.symlinked, generated = docStats.generated, unchanged = docStats.unchanged, console.info();
|
|
200
|
+
symlinked = docStats.symlinked, generated = docStats.generated, unchanged = docStats.unchanged, removed = docStats.removed, skipped = docStats.skipped, console.info();
|
|
342
201
|
}
|
|
343
|
-
|
|
202
|
+
console.info(), console.info(import_picocolors.default.bold("summary:")), symlinked > 0 && console.info(` ${import_picocolors.default.green(`${symlinked} symlinked`)}`), generated > 0 && console.info(` ${import_picocolors.default.yellow(`${generated} generated`)} ${import_picocolors.default.dim("(add frontmatter to enable symlink)")}`), skipped > 0 && console.info(` ${import_picocolors.default.yellow(`${skipped} skipped`)} ${import_picocolors.default.dim("(missing skill frontmatter)")}`), unchanged > 0 && console.info(` ${import_picocolors.default.dim(`${unchanged} unchanged`)}`), removed > 0 && console.info(` ${import_picocolors.default.red(`${removed} removed`)}`), console.info(import_picocolors.default.dim(` skills in ${skillsDir}`)), console.info();
|
|
344
203
|
}
|
|
345
204
|
}),
|
|
346
205
|
skillsCommand = (0, import_citty.defineCommand)({
|
|
@@ -349,7 +208,6 @@ const scriptsCommand = (0, import_citty.defineCommand)({
|
|
|
349
208
|
description: "Manage Claude Code skills"
|
|
350
209
|
},
|
|
351
210
|
subCommands: {
|
|
352
|
-
generate: generateCommand
|
|
353
|
-
scripts: scriptsCommand
|
|
211
|
+
generate: generateCommand
|
|
354
212
|
}
|
|
355
213
|
});
|
|
@@ -25,84 +25,8 @@ __export(skills_exports, {
|
|
|
25
25
|
skillsCommand: () => skillsCommand
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(skills_exports);
|
|
28
|
-
var import_node_fs = require("node:fs"), import_node_module = require("node:module"), import_node_path = require("node:path"),
|
|
29
|
-
const import_meta = {},
|
|
30
|
-
{ name: "onboard", description: "setup wizard for new projects" },
|
|
31
|
-
{ name: "docs", description: "view documentation" },
|
|
32
|
-
{ name: "env:setup", description: "setup environment variables" },
|
|
33
|
-
{ name: "run", description: "run scripts in parallel" },
|
|
34
|
-
{ name: "script", description: "manage and run scripts" },
|
|
35
|
-
{ name: "sync", description: "sync fork with upstream takeout" },
|
|
36
|
-
{ name: "changed", description: "show changes since last sync" },
|
|
37
|
-
{ name: "skills", description: "manage claude code skills" },
|
|
38
|
-
{ name: "completion", description: "shell completion setup" }
|
|
39
|
-
];
|
|
40
|
-
function findScriptsPackageRoot() {
|
|
41
|
-
try {
|
|
42
|
-
const resolved = import_meta.resolve("@take-out/scripts/package.json"), packageJsonPath = (0, import_node_url.fileURLToPath)(new URL(resolved));
|
|
43
|
-
return (0, import_node_path.join)(packageJsonPath, "..", "src");
|
|
44
|
-
} catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function buildSummaryDescription(localScripts, builtInScripts) {
|
|
49
|
-
const categories = /* @__PURE__ */ new Set(), keywords = /* @__PURE__ */ new Set();
|
|
50
|
-
for (const [name] of [...localScripts, ...builtInScripts])
|
|
51
|
-
keywords.add(name), name.includes("/") && categories.add(name.split("/")[0]);
|
|
52
|
-
for (const cmd of BUILTIN_COMMANDS)
|
|
53
|
-
keywords.add(cmd.name);
|
|
54
|
-
return `CLI scripts and commands reference for the tko (takeout) CLI. Use when the user asks to run scripts, manage the project, or needs to know what commands are available. tko, takeout, CLI, scripts, commands, bun tko, project tasks, automation, ${[...categories].sort().join(", ")}, ${[...keywords].sort().join(", ")}`.slice(0, 2048);
|
|
55
|
-
}
|
|
56
|
-
function buildSummaryContent(localScripts, builtInScripts, metadata) {
|
|
57
|
-
const description = buildSummaryDescription(localScripts, builtInScripts), lines = [];
|
|
58
|
-
lines.push("---"), lines.push("name: tko-scripts"), lines.push(`description: ${description}`), lines.push("---"), lines.push(""), lines.push("# tko CLI - scripts & commands"), lines.push(""), lines.push("run with `bun tko <command>` or `bun tko <script-name>`."), lines.push(""), lines.push("## built-in commands"), lines.push("");
|
|
59
|
-
for (const cmd of BUILTIN_COMMANDS)
|
|
60
|
-
lines.push(` ${cmd.name} - ${cmd.description}`);
|
|
61
|
-
lines.push("");
|
|
62
|
-
const formatSection = (title, scripts) => {
|
|
63
|
-
if (scripts.size === 0) return;
|
|
64
|
-
const categories = /* @__PURE__ */ new Map(), rootScripts = [];
|
|
65
|
-
for (const [name] of scripts)
|
|
66
|
-
if (name.includes("/")) {
|
|
67
|
-
const category = name.split("/")[0];
|
|
68
|
-
categories.has(category) || categories.set(category, []), categories.get(category).push(name);
|
|
69
|
-
} else
|
|
70
|
-
rootScripts.push(name);
|
|
71
|
-
lines.push(`## ${title}`), lines.push("");
|
|
72
|
-
for (const name of rootScripts) {
|
|
73
|
-
const meta = metadata.get(name), desc = meta?.description ? ` - ${meta.description}` : "", args = meta?.args?.length ? ` [${meta.args.join(", ")}]` : "";
|
|
74
|
-
lines.push(` ${name}${desc}${args}`);
|
|
75
|
-
}
|
|
76
|
-
for (const [category, categoryScripts] of categories) {
|
|
77
|
-
lines.push(""), lines.push(` ${category}/`);
|
|
78
|
-
for (const name of categoryScripts) {
|
|
79
|
-
const shortName = name.substring(category.length + 1), meta = metadata.get(name), desc = meta?.description ? ` - ${meta.description}` : "", args = meta?.args?.length ? ` [${meta.args.join(", ")}]` : "";
|
|
80
|
-
lines.push(` ${shortName}${desc}${args}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
lines.push("");
|
|
84
|
-
};
|
|
85
|
-
return formatSection("local scripts", localScripts), formatSection("built-in scripts", builtInScripts), lines.push("## usage"), lines.push(""), lines.push("```bash"), lines.push("bun tko <command> # run a built-in command"), lines.push("bun tko <script-name> # execute direct script"), lines.push(
|
|
86
|
-
"bun tko <group> <script> # execute nested script (e.g. bun tko aws health)"
|
|
87
|
-
), lines.push("bun tko run s1 s2 s3 # run multiple scripts in parallel"), lines.push("bun tko script new <path> # create a new script"), lines.push("```"), lines.push(""), lines.join(`
|
|
88
|
-
`);
|
|
89
|
-
}
|
|
90
|
-
async function generateSummary(cwd) {
|
|
91
|
-
const skillsDir = (0, import_node_path.join)(cwd, ".claude", "skills"), skillDir = (0, import_node_path.join)(skillsDir, "tko-scripts"), skillFile = (0, import_node_path.join)(skillDir, "SKILL.md"), localScripts = (0, import_script_utils.discoverScripts)((0, import_script_utils.getLocalScriptsDir)()), builtInDir = findScriptsPackageRoot(), builtInScripts = builtInDir ? (0, import_script_utils.discoverScripts)(builtInDir) : /* @__PURE__ */ new Map(), allScripts = new Map([...localScripts, ...builtInScripts]), metadata = await (0, import_script_utils.getAllScriptMetadata)(allScripts), totalScripts = localScripts.size + builtInScripts.size;
|
|
92
|
-
console.info(
|
|
93
|
-
import_picocolors.default.dim(
|
|
94
|
-
`found ${totalScripts} scripts (${localScripts.size} local, ${builtInScripts.size} built-in) + ${BUILTIN_COMMANDS.length} commands`
|
|
95
|
-
)
|
|
96
|
-
);
|
|
97
|
-
const content = buildSummaryContent(localScripts, builtInScripts, metadata);
|
|
98
|
-
try {
|
|
99
|
-
if ((0, import_node_fs.readFileSync)(skillFile, "utf-8") === content)
|
|
100
|
-
return console.info(` ${import_picocolors.default.dim("tko-scripts")} ${import_picocolors.default.dim("unchanged")}`), !1;
|
|
101
|
-
} catch {
|
|
102
|
-
}
|
|
103
|
-
return (0, import_node_fs.existsSync)(skillDir) || (0, import_node_fs.mkdirSync)(skillDir, { recursive: !0 }), (0, import_node_fs.writeFileSync)(skillFile, content), console.info(` ${import_picocolors.default.green("\u2713")} tko-scripts`), !0;
|
|
104
|
-
}
|
|
105
|
-
const require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
28
|
+
var import_node_fs = require("node:fs"), import_node_module = require("node:module"), import_node_path = require("node:path"), import_citty = require("citty"), import_picocolors = __toESM(require("picocolors"), 1);
|
|
29
|
+
const import_meta = {}, require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
106
30
|
let DOCS_DIR;
|
|
107
31
|
try {
|
|
108
32
|
DOCS_DIR = (0, import_node_path.dirname)(require2.resolve("@take-out/docs/package.json"));
|
|
@@ -124,33 +48,6 @@ function isDevOnly(content) {
|
|
|
124
48
|
const frontmatter = content.slice(3, endIndex);
|
|
125
49
|
return /\bdev:\s*true\b/.test(frontmatter);
|
|
126
50
|
}
|
|
127
|
-
function extractDocMeta(content) {
|
|
128
|
-
const lines = content.split(`
|
|
129
|
-
`);
|
|
130
|
-
let title = "", description = "", startLine = 0;
|
|
131
|
-
if (lines[0]?.trim() === "---") {
|
|
132
|
-
for (let i = 1; i < lines.length; i++)
|
|
133
|
-
if (lines[i]?.trim() === "---") {
|
|
134
|
-
startLine = i + 1;
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
for (let i = startLine; i < lines.length; i++) {
|
|
139
|
-
const trimmed = lines[i]?.trim() || "";
|
|
140
|
-
if (!title && trimmed.startsWith("# ")) {
|
|
141
|
-
title = trimmed.slice(2).trim();
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
if (title && trimmed && !trimmed.startsWith("#")) {
|
|
145
|
-
description = trimmed;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return { title, description };
|
|
150
|
-
}
|
|
151
|
-
function toSkillName(name) {
|
|
152
|
-
return name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 64);
|
|
153
|
-
}
|
|
154
51
|
function collectAllDocs(cwd) {
|
|
155
52
|
const docs = [], seen = /* @__PURE__ */ new Set(), localDocsDir = (0, import_node_path.join)(cwd, "docs");
|
|
156
53
|
if ((0, import_node_fs.existsSync)(localDocsDir)) {
|
|
@@ -170,24 +67,25 @@ function collectAllDocs(cwd) {
|
|
|
170
67
|
return docs;
|
|
171
68
|
}
|
|
172
69
|
async function generateDocSkills(cwd, clean) {
|
|
173
|
-
const skillsDir = (0, import_node_path.join)(cwd, ".claude", "skills"), docs = collectAllDocs(cwd);
|
|
174
|
-
if (docs.length === 0)
|
|
175
|
-
return console.info(import_picocolors.default.yellow("no documentation files found")), { symlinked: 0, generated: 0, unchanged: 0 };
|
|
176
|
-
if (console.info(import_picocolors.default.dim(`found ${docs.length} documentation files`)), clean && (0, import_node_fs.existsSync)(skillsDir)) {
|
|
70
|
+
const skillsDir = (0, import_node_path.join)(cwd, ".claude", "skills"), docs = collectAllDocs(cwd), localDocsDir = (0, import_node_path.join)(cwd, "docs"), expectedSkillNames = /* @__PURE__ */ new Set();
|
|
71
|
+
if (docs.length === 0 ? console.info(import_picocolors.default.yellow("no documentation files found")) : console.info(import_picocolors.default.dim(`found ${docs.length} documentation files`)), clean && (0, import_node_fs.existsSync)(skillsDir)) {
|
|
177
72
|
const existing = (0, import_node_fs.readdirSync)(skillsDir);
|
|
178
73
|
for (const dir of existing)
|
|
179
74
|
dir.startsWith(SKILL_PREFIX) && (0, import_node_fs.rmSync)((0, import_node_path.join)(skillsDir, dir), { recursive: !0 });
|
|
180
75
|
}
|
|
181
76
|
(0, import_node_fs.existsSync)(skillsDir) || (0, import_node_fs.mkdirSync)(skillsDir, { recursive: !0 });
|
|
182
|
-
let symlinked = 0, generated = 0, unchanged = 0;
|
|
77
|
+
let symlinked = 0, generated = 0, unchanged = 0, removed = 0, skipped = 0;
|
|
183
78
|
const isDev = !!process.env.IS_TAMAGUI_DEV;
|
|
184
79
|
for (const doc of docs) {
|
|
185
80
|
const content = (0, import_node_fs.readFileSync)(doc.path, "utf-8");
|
|
186
81
|
if (isDevOnly(content) && !isDev) continue;
|
|
187
|
-
|
|
82
|
+
const hasFrontmatter = hasSkillFrontmatter(content);
|
|
83
|
+
if (hasFrontmatter) {
|
|
188
84
|
const nameMatch = content.match(/^---\s*\nname:\s*([^\n]+)/m);
|
|
189
85
|
if (!nameMatch) continue;
|
|
190
|
-
const skillName = nameMatch[1].trim()
|
|
86
|
+
const skillName = nameMatch[1].trim();
|
|
87
|
+
expectedSkillNames.add(skillName);
|
|
88
|
+
const skillDir = (0, import_node_path.join)(skillsDir, skillName), skillFile = (0, import_node_path.join)(skillDir, "SKILL.md");
|
|
191
89
|
(0, import_node_fs.existsSync)(skillDir) || (0, import_node_fs.mkdirSync)(skillDir, { recursive: !0 });
|
|
192
90
|
const relativePath = (0, import_node_path.relative)(skillDir, doc.path);
|
|
193
91
|
let shouldCreate = !0;
|
|
@@ -201,44 +99,36 @@ async function generateDocSkills(cwd, clean) {
|
|
|
201
99
|
console.info(
|
|
202
100
|
` ${import_picocolors.default.green("\u27F7")} ${skillName} ${sourceLabel} ${import_picocolors.default.dim("(symlink)")}`
|
|
203
101
|
);
|
|
204
|
-
} else {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const { title, description } = extractDocMeta(content), skillDescription = description ? `${title}. ${description}`.slice(0, 1024) : title.slice(0, 1024), skillContent = `---
|
|
208
|
-
name: ${skillName}
|
|
209
|
-
description: ${skillDescription}
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
${content}
|
|
213
|
-
`;
|
|
214
|
-
let shouldWrite = !0;
|
|
215
|
-
try {
|
|
216
|
-
(0, import_node_fs.lstatSync)(skillFile).isSymbolicLink() ? (0, import_node_fs.unlinkSync)(skillFile) : (0, import_node_fs.readFileSync)(skillFile, "utf-8") === skillContent && (unchanged++, shouldWrite = !1);
|
|
217
|
-
} catch {
|
|
218
|
-
}
|
|
219
|
-
if (!shouldWrite) continue;
|
|
220
|
-
(0, import_node_fs.writeFileSync)(skillFile, skillContent), generated++;
|
|
221
|
-
const sourceLabel = doc.source === "local" ? import_picocolors.default.blue("local") : import_picocolors.default.dim("package");
|
|
222
|
-
console.info(
|
|
223
|
-
` ${import_picocolors.default.green("\u2713")} ${skillName} ${sourceLabel} ${import_picocolors.default.dim("(generated)")}`
|
|
102
|
+
} else if (!hasFrontmatter) {
|
|
103
|
+
skipped++, console.info(
|
|
104
|
+
` ${import_picocolors.default.yellow("!")} skipped ${import_picocolors.default.dim(doc.name)} ${import_picocolors.default.dim("(missing skill frontmatter)")}`
|
|
224
105
|
);
|
|
106
|
+
continue;
|
|
225
107
|
}
|
|
226
108
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
109
|
+
for (const dir of (0, import_node_fs.readdirSync)(skillsDir)) {
|
|
110
|
+
if (expectedSkillNames.has(dir)) continue;
|
|
111
|
+
const skillDir = (0, import_node_path.join)(skillsDir, dir), skillFile = (0, import_node_path.join)(skillDir, "SKILL.md");
|
|
112
|
+
if (dir.startsWith(SKILL_PREFIX)) {
|
|
113
|
+
(0, import_node_fs.rmSync)(skillDir, { recursive: !0, force: !0 }), removed++, console.info(` ${import_picocolors.default.red("\u2715")} ${dir} ${import_picocolors.default.dim("(removed stale generated skill)")}`);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
let shouldUnlink = !1;
|
|
117
|
+
try {
|
|
118
|
+
if ((0, import_node_fs.lstatSync)(skillFile).isSymbolicLink()) {
|
|
119
|
+
const linkTarget = (0, import_node_fs.readlinkSync)(skillFile), resolvedTarget = (0, import_node_path.resolve)(skillDir, linkTarget);
|
|
120
|
+
shouldUnlink = resolvedTarget.startsWith(`${localDocsDir}/`) || !!DOCS_DIR && resolvedTarget.startsWith(`${DOCS_DIR}/`);
|
|
121
|
+
}
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
124
|
+
shouldUnlink && ((0, import_node_fs.unlinkSync)(skillFile), (0, import_node_fs.readdirSync)(skillDir).length === 0 && (0, import_node_fs.rmdirSync)(skillDir), removed++, console.info(` ${import_picocolors.default.red("\u2715")} ${dir} ${import_picocolors.default.dim("(removed stale symlink)")}`));
|
|
237
125
|
}
|
|
238
|
-
|
|
126
|
+
return { symlinked, generated, unchanged, removed, skipped };
|
|
127
|
+
}
|
|
128
|
+
const generateCommand = (0, import_citty.defineCommand)({
|
|
239
129
|
meta: {
|
|
240
130
|
name: "generate",
|
|
241
|
-
description: "Generate
|
|
131
|
+
description: "Generate Claude Code skills from documentation"
|
|
242
132
|
},
|
|
243
133
|
args: {
|
|
244
134
|
clean: {
|
|
@@ -255,14 +145,16 @@ const scriptsCommand = (0, import_citty.defineCommand)({
|
|
|
255
145
|
async run({ args }) {
|
|
256
146
|
const cwd = process.cwd(), skillsDir = (0, import_node_path.join)(cwd, ".claude", "skills");
|
|
257
147
|
console.info(), console.info(import_picocolors.default.bold(import_picocolors.default.cyan("Generate all skills"))), console.info();
|
|
258
|
-
let symlinked = 0, generated = 0, unchanged = 0;
|
|
148
|
+
let symlinked = 0, generated = 0, unchanged = 0, removed = 0, skipped = 0;
|
|
259
149
|
if (!args["skip-internal-docs"]) {
|
|
260
150
|
const docStats = await generateDocSkills(cwd, args.clean);
|
|
261
|
-
symlinked = docStats.symlinked, generated = docStats.generated, unchanged = docStats.unchanged, console.info();
|
|
151
|
+
symlinked = docStats.symlinked, generated = docStats.generated, unchanged = docStats.unchanged, removed = docStats.removed, skipped = docStats.skipped, console.info();
|
|
262
152
|
}
|
|
263
|
-
|
|
153
|
+
console.info(), console.info(import_picocolors.default.bold("summary:")), symlinked > 0 && console.info(` ${import_picocolors.default.green(`${symlinked} symlinked`)}`), generated > 0 && console.info(
|
|
264
154
|
` ${import_picocolors.default.yellow(`${generated} generated`)} ${import_picocolors.default.dim("(add frontmatter to enable symlink)")}`
|
|
265
|
-
),
|
|
155
|
+
), skipped > 0 && console.info(
|
|
156
|
+
` ${import_picocolors.default.yellow(`${skipped} skipped`)} ${import_picocolors.default.dim("(missing skill frontmatter)")}`
|
|
157
|
+
), unchanged > 0 && console.info(` ${import_picocolors.default.dim(`${unchanged} unchanged`)}`), removed > 0 && console.info(` ${import_picocolors.default.red(`${removed} removed`)}`), console.info(import_picocolors.default.dim(` skills in ${skillsDir}`)), console.info();
|
|
266
158
|
}
|
|
267
159
|
}), skillsCommand = (0, import_citty.defineCommand)({
|
|
268
160
|
meta: {
|
|
@@ -270,8 +162,7 @@ const scriptsCommand = (0, import_citty.defineCommand)({
|
|
|
270
162
|
description: "Manage Claude Code skills"
|
|
271
163
|
},
|
|
272
164
|
subCommands: {
|
|
273
|
-
generate: generateCommand
|
|
274
|
-
scripts: scriptsCommand
|
|
165
|
+
generate: generateCommand
|
|
275
166
|
}
|
|
276
167
|
});
|
|
277
168
|
//# sourceMappingURL=skills.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/skills.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,qBAYO,oBACP,qBAA8B,wBAC9B,mBAAiD,sBAEjD,eAA8B,kBAC9B,oBAAe;AArBf,wBAyBMA,eAAU,kCAAc,YAAY,GAAG;AAC7C,IAAI;AACJ,IAAI;AACF,iBAAW,0BAAQA,SAAQ,QAAQ,6BAA6B,CAAC;AACnE,QAAQ;AACN,aAAW;AACb;AAEA,MAAM,eAAe;AAErB,SAAS,oBAAoB,SAA0B;AACrD,MAAI,CAAC,QAAQ,WAAW,KAAK,EAAG,QAAO;AACvC,QAAM,WAAW,QAAQ,QAAQ,OAAO,CAAC;AACzC,MAAI,aAAa,GAAI,QAAO;AAC5B,QAAM,cAAc,QAAQ,MAAM,GAAG,QAAQ;AAC7C,SAAO,YAAY,SAAS,OAAO,KAAK,YAAY,SAAS,cAAc;AAC7E;AAEA,SAAS,UAAU,SAA0B;AAC3C,MAAI,CAAC,QAAQ,WAAW,KAAK,EAAG,QAAO;AACvC,QAAM,WAAW,QAAQ,QAAQ,OAAO,CAAC;AACzC,MAAI,aAAa,GAAI,QAAO;AAC5B,QAAM,cAAc,Q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