holy-agents-kits 0.2.0 → 0.2.1
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 +3 -0
- package/bin/cli.js +17 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/cli.js
CHANGED
|
@@ -35,15 +35,28 @@ function skillNames() {
|
|
|
35
35
|
.sort();
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function readDescription(frontmatter) {
|
|
39
|
+
const lines = frontmatter.split(/\r?\n/);
|
|
40
|
+
const start = lines.findIndex((line) => line.startsWith("description:"));
|
|
41
|
+
if (start < 0) return "";
|
|
42
|
+
const inline = lines[start].slice("description:".length).trim();
|
|
43
|
+
if (inline && !["|", "|-", ">", ">-"].includes(inline)) return inline;
|
|
44
|
+
const parts = [];
|
|
45
|
+
for (let i = start + 1; i < lines.length; i++) {
|
|
46
|
+
if (!/^\s+\S/.test(lines[i])) break;
|
|
47
|
+
parts.push(lines[i].trim());
|
|
48
|
+
}
|
|
49
|
+
return parts.join(" ");
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
function summarize(name) {
|
|
39
53
|
const text = fs.readFileSync(path.join(SKILLS_DIR, name, "SKILL.md"), "utf8");
|
|
40
54
|
const frontmatter = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
41
55
|
if (!frontmatter) return "";
|
|
42
|
-
const
|
|
43
|
-
if (!line) return "";
|
|
44
|
-
const desc = line[1].trim();
|
|
56
|
+
const desc = readDescription(frontmatter[1]);
|
|
45
57
|
const end = desc.indexOf("。");
|
|
46
|
-
|
|
58
|
+
const summary = end > 0 ? desc.slice(0, end) : desc;
|
|
59
|
+
return summary.length > 100 ? summary.slice(0, 100) + "…" : summary;
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
function copyDir(src, dest) {
|