构建 Hermes 插件

构建一个计算器插件,包含工具、钩子和捆绑技能。

步骤

  1. 创建目录:mkdir -p ~/.hermes/plugins/calculator
  2. 编写 plugin.yaml 清单
  3. 编写 schemas.py(工具模式)
  4. 编写 tools.py(工具处理器)
  5. 编写 __init__.py(注册)
  6. 添加钩子和捆绑技能(可选)
  7. 启用:config.yamlplugins.enabled: [calculator]
  8. 激活:/reset

项目结构

~/.hermes/plugins/calculator/
├── plugin.yaml        # 清单
├── __init__.py        # 注册入口
├── schemas.py         # 工具模式
├── tools.py           # 工具处理器
└── skills/            # 可选:捆绑技能
    └── calculator/SKILL.md

详见 workspace zh/guides/build-a-hermes-plugin.md