技能系统
理解 Hermes skills 的目录、slash command、渐进加载、SKILL.md 格式、Hub 安装和 agent-managed skills。
Hermes 的 skill 是按需加载的知识文档和工作流包。它遵循 progressive disclosure:平时只把名称和描述放进索引,真正需要时再加载完整 SKILL.md 或引用文件,减少 token 占用。
技能目录
所有本地 skill 的主目录是:
~/.hermes/skills/首次安装时,Hermes 会从仓库复制 bundled skills。Hub 安装的 skill、agent 自己创建的 skill,也都会进入这里。agent 可以修改或删除本地 skill。
典型结构:
~/.hermes/skills/
├── mlops/
│ └── axolotl/
│ ├── SKILL.md
│ ├── references/
│ ├── templates/
│ ├── scripts/
│ └── assets/
└── devops/
└── deploy-k8s/
└── SKILL.md外部 skill 目录可以额外扫描,但只读;本地 ~/.hermes/skills/ 仍是写入正本。
skills:
external_dirs:
- ~/.agents/skills
- /home/shared/team-skills
- ${SKILLS_REPO}/skills同名 skill 同时存在时,本地版本优先。
使用方式
安装后的 skill 会自动变成 slash command:
/gif-search funny cats
/github-pr-workflow create a PR for the auth refactor
/plan design a rollout for migrating our auth provider
/excalidraw也可以直接询问 skill 系统:
hermes chat --toolsets skills -q "What skills do you have?"
hermes chat --toolsets skills -q "Show me the axolotl skill"渐进加载
加载层级:
Level 0: skills_list()
Level 1: skill_view(name)
Level 2: skill_view(name, path)Level 0 只看索引;Level 1 加载主文档;Level 2 只加载某个 reference、template 或 script 说明。复杂 skill 应该把大材料拆进 references/,不要全部塞进 SKILL.md。
SKILL.md 格式
最小结构:
---
name: my-skill
description: Brief description of what this skill does
version: 1.0.0
platforms: [macos, linux]
---
# Skill Title
## When to Use
Trigger conditions for this skill.
## Procedure
1. Step one
2. Step two
## Verification
How to confirm it worked.platforms 可限制 macOS、Linux 或 Windows。也可以通过 requires_toolsets、fallback_for_toolsets、requires_tools、fallback_for_tools 控制何时显示。
安全配置和 Hub
Skill 可以声明缺失的环境变量,Hermes 只在本地 CLI 加载该 skill 时安全询问;消息平台不会在聊天里索要密钥。
required_environment_variables:
- name: TENOR_API_KEY
prompt: Tenor API key
required_for: full functionality常用 Hub 命令:
hermes skills browse
hermes skills search kubernetes
hermes skills inspect openai/skills/k8s
hermes skills install openai/skills/k8s
hermes skills list --source hub
hermes skills check
hermes skills update
hermes skills audit
hermes skills uninstall k8sHermes 也能把复杂成功流程沉淀成 agent-managed skill。常用动作为 create、patch、edit、delete、write_file、remove_file,其中小修优先用 patch。