@zaganjade/pi-multi-skill 1.3.0 → 1.3.2
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 +50 -8
- package/package.json +1 -1
- package/skill-bundles.example.json +17 -17
- package/src/bmad-auto.ts +99 -99
- package/src/build.ts +352 -270
- package/src/bundles.ts +138 -138
- package/src/discover.ts +161 -161
- package/src/index.ts +13 -17
- package/src/metadata.ts +170 -170
- package/src/parse-args.ts +80 -80
- package/src/registry.ts +46 -46
- package/src/suggestions.ts +70 -70
- package/src/types.ts +64 -64
package/src/suggestions.ts
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import type { SkillBundle, SkillInfo } from "./types.ts";
|
|
2
|
-
import { assessBundleAvailability } from "./bundle-status.ts";
|
|
3
|
-
|
|
4
|
-
const SUGGESTIONS: Array<{ pattern: RegExp; bundle: string; reason: string }> =
|
|
5
|
-
[
|
|
6
|
-
{
|
|
7
|
-
pattern: /fail(ing|ed)?\s+test|test\s+fail/i,
|
|
8
|
-
bundle: "debug",
|
|
9
|
-
reason: "failing tests detected",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
pattern: /\bbug\b|\berror\b|\bcrash\b|\bexception\b/i,
|
|
13
|
-
bundle: "debug",
|
|
14
|
-
reason: "bug/error keywords detected",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
pattern: /\bprd\b|product requirement|tech spec/i,
|
|
18
|
-
bundle: "bmad-planning",
|
|
19
|
-
reason: "planning keywords detected",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
pattern: /\barchitect|\bapi design|\bdatabase schema/i,
|
|
23
|
-
bundle: "bmad-solutioning",
|
|
24
|
-
reason: "architecture keywords detected",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
pattern: /\bimplement|\buser story|\bdev-story|\bfeature\b/i,
|
|
28
|
-
bundle: "bmad-build",
|
|
29
|
-
reason: "implementation keywords detected",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
pattern: /\bnew feature|\bbuild\b|\bcreate\b.+\bcomponent/i,
|
|
33
|
-
bundle: "cc-feature",
|
|
34
|
-
reason: "feature development keywords detected",
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
export function suggestSkillBundle(
|
|
39
|
-
text: string,
|
|
40
|
-
bundles?: Map<string, SkillBundle>,
|
|
41
|
-
availableSkills?: SkillInfo[],
|
|
42
|
-
): {
|
|
43
|
-
bundle: string;
|
|
44
|
-
reason: string;
|
|
45
|
-
} | null {
|
|
46
|
-
const sample = text.slice(0, 500);
|
|
47
|
-
for (const entry of SUGGESTIONS) {
|
|
48
|
-
if (!entry.pattern.test(sample)) continue;
|
|
49
|
-
if (bundles && availableSkills) {
|
|
50
|
-
const bundle = bundles.get(entry.bundle);
|
|
51
|
-
if (bundle) {
|
|
52
|
-
const status = assessBundleAvailability(
|
|
53
|
-
entry.bundle,
|
|
54
|
-
bundle,
|
|
55
|
-
availableSkills,
|
|
56
|
-
);
|
|
57
|
-
if (!status.ready) continue;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return { bundle: entry.bundle, reason: entry.reason };
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function formatSuggestionHint(
|
|
66
|
-
bundle: string,
|
|
67
|
-
reason: string,
|
|
68
|
-
): string {
|
|
69
|
-
return `💡 Suggested: /skills @${bundle} (${reason})`;
|
|
70
|
-
}
|
|
1
|
+
import type { SkillBundle, SkillInfo } from "./types.ts";
|
|
2
|
+
import { assessBundleAvailability } from "./bundle-status.ts";
|
|
3
|
+
|
|
4
|
+
const SUGGESTIONS: Array<{ pattern: RegExp; bundle: string; reason: string }> =
|
|
5
|
+
[
|
|
6
|
+
{
|
|
7
|
+
pattern: /fail(ing|ed)?\s+test|test\s+fail/i,
|
|
8
|
+
bundle: "debug",
|
|
9
|
+
reason: "failing tests detected",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
pattern: /\bbug\b|\berror\b|\bcrash\b|\bexception\b/i,
|
|
13
|
+
bundle: "debug",
|
|
14
|
+
reason: "bug/error keywords detected",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
pattern: /\bprd\b|product requirement|tech spec/i,
|
|
18
|
+
bundle: "bmad-planning",
|
|
19
|
+
reason: "planning keywords detected",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
pattern: /\barchitect|\bapi design|\bdatabase schema/i,
|
|
23
|
+
bundle: "bmad-solutioning",
|
|
24
|
+
reason: "architecture keywords detected",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
pattern: /\bimplement|\buser story|\bdev-story|\bfeature\b/i,
|
|
28
|
+
bundle: "bmad-build",
|
|
29
|
+
reason: "implementation keywords detected",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
pattern: /\bnew feature|\bbuild\b|\bcreate\b.+\bcomponent/i,
|
|
33
|
+
bundle: "cc-feature",
|
|
34
|
+
reason: "feature development keywords detected",
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export function suggestSkillBundle(
|
|
39
|
+
text: string,
|
|
40
|
+
bundles?: Map<string, SkillBundle>,
|
|
41
|
+
availableSkills?: SkillInfo[],
|
|
42
|
+
): {
|
|
43
|
+
bundle: string;
|
|
44
|
+
reason: string;
|
|
45
|
+
} | null {
|
|
46
|
+
const sample = text.slice(0, 500);
|
|
47
|
+
for (const entry of SUGGESTIONS) {
|
|
48
|
+
if (!entry.pattern.test(sample)) continue;
|
|
49
|
+
if (bundles && availableSkills) {
|
|
50
|
+
const bundle = bundles.get(entry.bundle);
|
|
51
|
+
if (bundle) {
|
|
52
|
+
const status = assessBundleAvailability(
|
|
53
|
+
entry.bundle,
|
|
54
|
+
bundle,
|
|
55
|
+
availableSkills,
|
|
56
|
+
);
|
|
57
|
+
if (!status.ready) continue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { bundle: entry.bundle, reason: entry.reason };
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function formatSuggestionHint(
|
|
66
|
+
bundle: string,
|
|
67
|
+
reason: string,
|
|
68
|
+
): string {
|
|
69
|
+
return `💡 Suggested: /skills @${bundle} (${reason})`;
|
|
70
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
export type LoadMode = "full" | "meta" | "lazy";
|
|
2
|
-
|
|
3
|
-
export type SkillOrder = "process-first" | "explicit" | "alpha";
|
|
4
|
-
|
|
5
|
-
export interface SkillBundle {
|
|
6
|
-
description: string;
|
|
7
|
-
skills: string[];
|
|
8
|
-
order?: SkillOrder;
|
|
9
|
-
default_mode?: LoadMode;
|
|
10
|
-
/** Human-readable dependency label shown in help/autocomplete. */
|
|
11
|
-
requires?: string;
|
|
12
|
-
/** One-line install instructions when bundle skills are missing. */
|
|
13
|
-
install?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface SkillInfo {
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
filePath: string;
|
|
20
|
-
baseDir: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface SkillMetadata {
|
|
24
|
-
name: string;
|
|
25
|
-
description: string;
|
|
26
|
-
type: "process" | "rigid" | "flexible" | "unknown";
|
|
27
|
-
module: string;
|
|
28
|
-
priority: number;
|
|
29
|
-
commands: string[];
|
|
30
|
-
skillId: string;
|
|
31
|
-
version: string;
|
|
32
|
-
pairsWith: string[];
|
|
33
|
-
conflictsWith: string[];
|
|
34
|
-
tokenBudget?: LoadMode;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface EnrichedSkillInfo extends SkillInfo {
|
|
38
|
-
metadata: SkillMetadata;
|
|
39
|
-
rawContent: string;
|
|
40
|
-
body: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ParsedSkillsArgs {
|
|
44
|
-
skillNames: string[];
|
|
45
|
-
mode: LoadMode;
|
|
46
|
-
auto: boolean;
|
|
47
|
-
parallel: boolean;
|
|
48
|
-
parallelTasks: string[];
|
|
49
|
-
embeddedCommand?: string;
|
|
50
|
-
instructions: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface BuildOptions {
|
|
54
|
-
mode: LoadMode;
|
|
55
|
-
bundles?: string[];
|
|
56
|
-
bmadStatusBlock?: string;
|
|
57
|
-
parallel: boolean;
|
|
58
|
-
parallelTasks?: string[];
|
|
59
|
-
subagentAvailable?: boolean;
|
|
60
|
-
embeddedCommand?: string;
|
|
61
|
-
instructions?: string;
|
|
62
|
-
skippedDuplicates?: string[];
|
|
63
|
-
conflictWarnings?: string[];
|
|
64
|
-
}
|
|
1
|
+
export type LoadMode = "full" | "meta" | "lazy";
|
|
2
|
+
|
|
3
|
+
export type SkillOrder = "process-first" | "explicit" | "alpha";
|
|
4
|
+
|
|
5
|
+
export interface SkillBundle {
|
|
6
|
+
description: string;
|
|
7
|
+
skills: string[];
|
|
8
|
+
order?: SkillOrder;
|
|
9
|
+
default_mode?: LoadMode;
|
|
10
|
+
/** Human-readable dependency label shown in help/autocomplete. */
|
|
11
|
+
requires?: string;
|
|
12
|
+
/** One-line install instructions when bundle skills are missing. */
|
|
13
|
+
install?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface SkillInfo {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
filePath: string;
|
|
20
|
+
baseDir: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SkillMetadata {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
type: "process" | "rigid" | "flexible" | "unknown";
|
|
27
|
+
module: string;
|
|
28
|
+
priority: number;
|
|
29
|
+
commands: string[];
|
|
30
|
+
skillId: string;
|
|
31
|
+
version: string;
|
|
32
|
+
pairsWith: string[];
|
|
33
|
+
conflictsWith: string[];
|
|
34
|
+
tokenBudget?: LoadMode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface EnrichedSkillInfo extends SkillInfo {
|
|
38
|
+
metadata: SkillMetadata;
|
|
39
|
+
rawContent: string;
|
|
40
|
+
body: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ParsedSkillsArgs {
|
|
44
|
+
skillNames: string[];
|
|
45
|
+
mode: LoadMode;
|
|
46
|
+
auto: boolean;
|
|
47
|
+
parallel: boolean;
|
|
48
|
+
parallelTasks: string[];
|
|
49
|
+
embeddedCommand?: string;
|
|
50
|
+
instructions: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface BuildOptions {
|
|
54
|
+
mode: LoadMode;
|
|
55
|
+
bundles?: string[];
|
|
56
|
+
bmadStatusBlock?: string;
|
|
57
|
+
parallel: boolean;
|
|
58
|
+
parallelTasks?: string[];
|
|
59
|
+
subagentAvailable?: boolean;
|
|
60
|
+
embeddedCommand?: string;
|
|
61
|
+
instructions?: string;
|
|
62
|
+
skippedDuplicates?: string[];
|
|
63
|
+
conflictWarnings?: string[];
|
|
64
|
+
}
|