MCPcopy Create free account
hub / github.com/astercloud/aster / Load

Method Load

pkg/skills/loader.go:36–47  ·  view source on GitHub ↗

Load 加载技能定义

(ctx context.Context, skillPath string)

Source from the content-addressed store, hash-verified

34
35// Load 加载技能定义
36func (sl *SkillLoader) Load(ctx context.Context, skillPath string) (*SkillDefinition, error) {
37 // skillPath 可能是 "consistency-checker" 或 "quality-assurance/consistency-checker"
38 // 需要找到对应的 SKILL.md 文件
39 fullPath := filepath.Join(sl.baseDir, skillPath, "SKILL.md")
40
41 content, err := sl.fs.Read(ctx, fullPath)
42 if err != nil {
43 return nil, fmt.Errorf("read skill file: %w", err)
44 }
45
46 return sl.parse(skillPath, content)
47}
48
49// parse 解析技能文件
50func (sl *SkillLoader) parse(name, content string) (*SkillDefinition, error) {

Callers 1

LoadMultipleMethod · 0.95

Calls 3

parseMethod · 0.95
ReadMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected