@zaganjade/pi-multi-skill 1.0.0 → 1.3.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 +453 -17
- package/package.json +9 -3
- package/skill-bundles.example.json +17 -0
- package/skill-bundles.example.yaml +9 -0
- package/src/bmad-auto.ts +99 -0
- package/src/bmad-status.ts +125 -0
- package/src/build.ts +270 -0
- package/src/bundle-status.ts +178 -0
- package/src/bundles.ts +138 -0
- package/src/completions.ts +184 -0
- package/src/conflicts.ts +26 -0
- package/src/discover.ts +161 -0
- package/src/index.ts +287 -345
- package/src/metadata.ts +170 -0
- package/src/parse-args.ts +80 -0
- package/src/registry.ts +46 -0
- package/src/stats.ts +164 -0
- package/src/subagents.ts +75 -0
- package/src/suggestions.ts +70 -0
- package/src/types.ts +64 -0
- package/src/yaml-bundles.ts +97 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { LoadMode, SkillBundle, SkillOrder } from "./types.ts";
|
|
2
|
+
|
|
3
|
+
/** Minimal YAML parser for skill-bundles.yaml (bundles map only). */
|
|
4
|
+
export function parseYamlBundles(content: string): Record<string, SkillBundle> {
|
|
5
|
+
const bundles: Record<string, SkillBundle> = {};
|
|
6
|
+
const lines = content.replace(/\r\n/g, "\n").split("\n");
|
|
7
|
+
|
|
8
|
+
let inBundles = false;
|
|
9
|
+
let currentName: string | null = null;
|
|
10
|
+
let current: Partial<SkillBundle> & { skills?: string[] } = {};
|
|
11
|
+
let inSkillsList = false;
|
|
12
|
+
|
|
13
|
+
const flush = () => {
|
|
14
|
+
if (!currentName || !current.description || !current.skills?.length) {
|
|
15
|
+
currentName = null;
|
|
16
|
+
current = {};
|
|
17
|
+
inSkillsList = false;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
bundles[currentName] = {
|
|
21
|
+
description: current.description,
|
|
22
|
+
skills: current.skills,
|
|
23
|
+
order: current.order,
|
|
24
|
+
default_mode: current.default_mode,
|
|
25
|
+
};
|
|
26
|
+
currentName = null;
|
|
27
|
+
current = {};
|
|
28
|
+
inSkillsList = false;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
for (const raw of lines) {
|
|
32
|
+
const line = raw.replace(/\t/g, " ");
|
|
33
|
+
if (!line.trim() || line.trim().startsWith("#")) continue;
|
|
34
|
+
|
|
35
|
+
if (/^bundles:\s*$/.test(line)) {
|
|
36
|
+
inBundles = true;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (!inBundles) continue;
|
|
40
|
+
|
|
41
|
+
const bundleMatch = line.match(/^ ([\w-]+):\s*$/);
|
|
42
|
+
if (bundleMatch) {
|
|
43
|
+
flush();
|
|
44
|
+
currentName = bundleMatch[1];
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (!currentName) continue;
|
|
49
|
+
|
|
50
|
+
const descMatch = line.match(/^ description:\s*(.+)$/);
|
|
51
|
+
if (descMatch) {
|
|
52
|
+
current.description = descMatch[1].trim().replace(/^["']|["']$/g, "");
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const orderMatch = line.match(/^ order:\s*(\S+)/);
|
|
57
|
+
if (orderMatch) {
|
|
58
|
+
current.order = orderMatch[1] as SkillOrder;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const modeMatch = line.match(/^ default_mode:\s*(\S+)/);
|
|
63
|
+
if (modeMatch) {
|
|
64
|
+
current.default_mode = modeMatch[1] as LoadMode;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (/^ skills:\s*$/.test(line)) {
|
|
69
|
+
inSkillsList = true;
|
|
70
|
+
current.skills = [];
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const inlineSkills = line.match(/^ skills:\s*\[(.*)\]\s*$/);
|
|
75
|
+
if (inlineSkills) {
|
|
76
|
+
current.skills = inlineSkills[1]
|
|
77
|
+
.split(",")
|
|
78
|
+
.map((s) => s.trim().replace(/^["']|["']$/g, ""))
|
|
79
|
+
.filter(Boolean);
|
|
80
|
+
inSkillsList = false;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (inSkillsList) {
|
|
85
|
+
const itemMatch = line.match(/^ -\s+(.+)$/);
|
|
86
|
+
if (itemMatch) {
|
|
87
|
+
current.skills ??= [];
|
|
88
|
+
current.skills.push(
|
|
89
|
+
itemMatch[1].trim().replace(/^["']|["']$/g, ""),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
flush();
|
|
96
|
+
return bundles;
|
|
97
|
+
}
|