8.1 技能系统设计

技能文件格式

1
2
3
4
5
6
7
8
9
10
---
name: "coding-assistant"
description: "帮助编程任务"
category: "development"
tags: ["code", "programming"]
---

# 编程助手

这是一个专业的编程助手技能...

技能加载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
export class SkillLoader {
async loadFromDirectory(dir: string): Promise<Skill[]> {
const files = await glob(`${dir}/**/SKILL.md`);
const skills: Skill[] = [];

for (const file of files) {
const content = await fs.readFile(file, 'utf-8');
const skill = this.parseSkill(content);
skills.push(skill);
}

return skills;
}
}

导航

上一篇: 7.3 会话管理

下一篇: 8.2 技能加载机制