Skills¶
Skill 是能力封装型组件,可被 LLM 调用,语义上不同于 Action。采用目录式组织,参考 Agent Skills 规范。
目录结构¶
最小结构只需 SKILL.md。
SKILL.md¶
SKILL.md 是 skill 主入口。Frontmatter 可选。
带 frontmatter:
---
name: repo-explorer
description: Explore repository structure and summarize key modules.
---
# Repo Explorer
1. List key files and directories.
2. Read only the most relevant files first.
3. Summarize findings before taking action.
无 frontmatter:
Frontmatter 可选字段:name、description、license、compatibility、metadata、allowed-tools。
加载规则¶
| 阶段 | 行为 |
|---|---|
| 发现 | 读取 SKILL.md frontmatter;无 frontmatter 则从目录名和正文推断元数据 |
| 注册 | 将 skill catalog 注入 system prompt |
| 激活 | 通过 Skill 工具读取完整 SKILL.md |
| 资源访问 | 调用 Skill({ name, resource_path }) 读取目录内资源文件 |
优先级: .openharness/skills/* > settings.skill_dirs 声明顺序。
同名冲突处理遵循 settings 中的优先级规则。
Skill 工具语义¶
name必须命中当前 session/agent 可见的 skill- Skill 内容视为按需加载,不属于初始 system prompt