S05 Skill Loading - 技能按需加载流程图
本文档描述 s05_skill_loading.py 的技能按需加载机制和执行流程。
1. 系统架构概览
加载中...
2. 两层注入架构
加载中...
3. 技能文件结构
加载中...
4. SkillLoader 类结构
加载中...
5. 技能加载流程 (_load_all)
加载中...
6. Frontmatter 解析流程 (_parse_frontmatter)
加载中...
7. 技能调用时序图
加载中...
8. 数据结构
skills 字典结构
skills = {
"pdf": {
"meta": {
"name": "pdf",
"description": "Process PDF files...",
"tags": "file-processing"
},
"body": "# PDF 处理\n\n## 步骤 1:...",
"path": "skills/pdf/SKILL.md"
},
"code-review": {
# ... 类似结构
}
}
SKILL.md 文件格式
---
name: pdf
description: Process PDF files and extract content
tags: file-processing
---
# PDF 处理技能
## 步骤 1: 检查 PDF 是否存在
...
## 步骤 2: 提取文本内容
...
get_descriptions 返回格式
- pdf: Process PDF files and extract content [file-processing]
- code-review: Review code for best practices [code-quality]
get_content 返回格式
<skill name="pdf">
# PDF 处理技能
## 步骤 1: 检查 PDF 是否存在
...
## 步骤 2: 提取文本内容
...
</skill>