Hermes Agent Skills 进阶全攻略:从 SKILL.md 到 GEPA 自进化与 Skill Bundles 工作流(2026)
2026 年 Nous Research 的 Hermes Agent 凭 16 万 GitHub Stars 与「the agent that grows with you」理念,把 Skills 程序性记忆推上 AI Agent 主流。本文面向已入门 Hermes 的开发者与小团队技术负责人:从 Skills≠Memory≠Prompts 决策矩阵出发,拆解 SKILL.md 渐进加载、Skill Bundles 工作流、条件激活、Tap 发布与 GEPA+DSPy 自进化,附开源生态对比表、五步 Runbook 与 FAQ,并说明为何 Skill 复利需要 Mac 云 7×24 常驻节点。
目录
- 1. 引言:Hermes 2026 与程序性记忆
- 2. Skills vs Memory vs Prompts 对比
- 3. 痛点拆解:进阶 Skill 体系的隐性成本
- 4. SKILL.md 格式与 Progressive Disclosure
- 5. Skill Bundles 工作流
- 6. 条件激活(Conditional Activation)
- 7. Skills Hub 与开源生态
- 8. 发布 Skill Tap
- 9. GEPA + DSPy 自进化
- 10. Plugin 技能
- 11. 进阶编写技巧
- 12. 博客工作流实战案例
- 13. 五步 Runbook
- 14. FAQ
- 15. 延伸阅读与资源
- 16. 结论:Skill 复利需要 7×24 的 Mac 节点
1. 引言:Hermes 2026 与程序性记忆
2026 年初,Nous Research 发布 Hermes Agent,两个月内 GitHub Star 突破 16 万,成为 AI Agent 领域增速最快的开源项目之一。它的核心卖点不是更大的模型,而是一个理念:「the agent that grows with you」——Agent 会随着使用越来越懂你。
这一切的底层实现,就是它的技能(Skills)系统。与传统「一次性 Prompt」不同,Hermes 的技能体系是一套有标准、可进化、跨会话持久的程序性记忆。本文不聊基础入门,直接进入进阶区域:渐进加载如何控制 Token 成本、条件激活如何感知环境、Skill Bundles 如何一键触发复杂工作流、GEPA+DSPy 如何让 Skills 自动进化,以及开源社区有哪些现成仓库可直接 Tap。
2. Skills vs Memory vs Prompts 对比
在构建 Skill 体系之前,先厘清三者的边界——这是后续编写、Bundle 设计与 GEPA 进化的前提。
| 维度 | 普通 Prompt | Memory(记忆) | Skills(技能) |
|---|---|---|---|
| 持久性 | 当前对话 | 跨会话,永久 | 跨会话,永久 |
| 加载时机 | 每次都在上下文中 | 每次会话自动注入 | 按需加载(关键差异) |
| Token 成本 | 每次消耗 | 小而稳定 | 激活前零消耗 |
| 内容类型 | 任意意图描述 | 用户偏好/事实 | 程序性步骤(如何做某件事) |
| 谁来维护 | 用户手动 | Agent 自动 | 用户 + Agent 均可 |
| 可共享性 | 不方便 | 私有 | 可发布为社区 Tap |
核心记忆口诀:Prompt = 便利贴(当次有效);Memory = 便签本(永久笔记,随时在手边);Skill = SOP 手册(步骤化流程,需要时翻阅)。
3. 痛点拆解:进阶 Skill 体系的隐性成本
- Token 与 Prompt Cache 的隐性账单:Level 0 虽仅约 3K Token(全部技能 name+description 合计),但误写 description 会导致 LLM 频繁加载 Level 1 全文;Skill 热更新若不加策略,会击穿 Prompt Cache,单次会话成本可翻倍。
- 跨设备与团队同步断层:
~/.hermes/skills/默认本地散落,无 Tap 与 Git 版本控制时,团队成员各自维护 Skill,GEPA 进化产物无法共享,程序性记忆无法复利。 - 7×24 轨迹采集与 GEPA 的数据前提:GEPA 依赖 SQLite 执行轨迹库;Gateway 频繁离线(笔记本合盖、Docker VPS 休眠、WSL2 断连)会导致 sessiondb 样本不足,$2–10/次的进化运行得不到有效反馈。
硬核数据(2026-06):Hermes GitHub 160k+ Stars;GEPA 单次优化约 $2–10(纯 API,无需 GPU);Skill 文件 GEPA 护栏上限 15KB;Level 0 全技能索引约 ~3K Token。
4. SKILL.md 格式与 Progressive Disclosure
所有 Hermes Skills 遵循 agentskills.io 开放标准,确保跨 Agent 可移植(Hermes、Claude Code、Cursor 均可使用)。
4.1 Frontmatter 与目录结构
---
name: my-skill # 必填:小写字母+连字符,≤64字符
description: | # 必填:≤1024字符,建议以"Use when..."开头
Use when the user needs to [...].
Handles [...] and [...].
version: 1.0.0
license: MIT
compatibility: Requires git, docker
allowed-tools: Bash(git:*) Read
metadata:
hermes:
tags: [devops, automation]
category: software-development
related_skills: [github-pr-workflow, test-driven-development]
requires_toolsets: [terminal]
fallback_for_toolsets: [web]
---
# My Skill Title
## Overview
## When to Use
## Procedure
## Common Pitfalls
## Verification Checklist
模块化目录结构:
~/.hermes/skills/
└── my-category/
└── my-skill/
├── SKILL.md # 主文件(核心步骤,建议 ≤500 行)
├── references/
│ ├── api-docs.md
│ └── examples.md
├── templates/
│ └── config.yaml
└── scripts/
└── setup.sh
4.2 Progressive Disclosure 三级加载(Token 控制核心)
| 加载层级 | 内容 | 触发时机 | Token 成本 |
|---|---|---|---|
| Level 0 | name + description | 每次会话开始,所有技能 | ~3K(全部技能合计) |
| Level 1 | 完整 SKILL.md 正文 | 用户 /skill-name 或 LLM 判断需要 | 取决于文件长度 |
| Level 2 | references/ scripts/ 文件 | LLM 在执行时判断需要 | 按需,单文件 |
写作建议:description 字段是 Level 0 的全部信息,LLM 靠它决定是否加载完整技能。写清「什么时候用」比「是什么」更重要。
5. Skill Bundles 工作流
Skill Bundles 是 Hermes 2026 新增的强力特性:轻量 YAML 把多个相关技能打包成一个斜杠命令。执行 /bundle-name 时,所有列出的技能同时加载,无需逐个触发。文件位置:~/.hermes/skill-bundles/<slug>.yaml
name: backend-dev description: | Full backend feature workflow — code review, TDD, and PR management. skills: - github-code-review - test-driven-development - github-pr-workflow instruction: | Always write failing tests first before implementation. Never push directly to main.
research-session 示例:arxiv、deep-research、plan、excalidraw 一键加载。mlops-deploy 示例:vllm、llama-cpp、github-pr-workflow、systematic-debugging 组成部署流水线。
优先级规则:Bundle 与单个 Skill 同名时 Bundle 优先;Bundle 中未安装的 Skill 跳过而不报错;Bundle 不修改系统提示,不会导致 Prompt Cache 失效。
hermes bundles create backend-dev \ --skills github-code-review,test-driven-development,github-pr-workflow \ --instruction "Always write failing tests first"
6. 条件激活(Conditional Activation)
技能可根据当前会话中工具的可用性,自动显示或隐藏。在 SKILL.md 的 metadata.hermes 下配置四种规则:
| 字段 | 行为逻辑 |
|---|---|
requires_toolsets | 列出的工具集不存在时,隐藏此技能 |
requires_tools | 列出的工具不存在时,隐藏此技能 |
fallback_for_toolsets | 列出的工具集存在时,隐藏此技能(作为备选方案) |
fallback_for_tools | 列出的工具存在时,隐藏此技能 |
DuckDuckGo 示例:配置 fallback_for_tools: [web_search],当用户配置了 FIRECRAWL_KEY / BRAVE_SEARCH_KEY 时付费 web_search 激活,DuckDuckGo 技能自动从提示词中消失以节省 Token;API 不可用时备选方案自动浮现。
平台感知技能:通过 requires_toolsets: [messaging] 与 platforms: [telegram, discord] 白名单,配合 hermes skills TUI 为 CLI、Telegram、Discord 独立开关技能。
7. Skills Hub 与开源生态
hermes skills install official/research/arxiv hermes skills install https://example.com/SKILL.md --name my-skill hermes skills install github:openai/skills/k8s hermes skills tap add github:my-org/my-skills
| 仓库 | 描述 | Stars / 规模 | 亮点 |
|---|---|---|---|
| ChuckSRQ/awesome-hermes-skills | 精选生产级技能合集 | 67 Stars | Deep Research、MLOps、Apple 集成;gh-copilot 插件 |
| amanning3390/hermeshub | 社区技能注册中心 | 166 Stars | API 与市场;提示注入安全扫描 |
| kevinnft/ai-agent-skills | 跨 Agent 通用技能库 | 191 个技能,28 分类 | 一键安装 Hermes/Claude Code/Cursor |
| NousResearch/hermes-agent | 官方主仓库 | 160k+ Stars | 权威来源,含 Skill 编写规范 |
agentskills.io 开放标准意味着 Skills 可在 Hermes、Claude Code、Cursor、OpenCode 之间跨平台使用;可用 skills-ref validate ./my-skill 验证格式合规性。
8. 发布 Skill Tap
通过 GitHub 仓库作为 Tap,让整个团队甚至社区订阅你的技能集。
my-skills-tap/ ├── skills.sh.json # 分类配置(可选) ├── mlops/ │ ├── vllm-deploy/SKILL.md │ └── model-benchmark/SKILL.md ├── research/ │ ├── paper-summarizer/SKILL.md │ └── citation-finder/SKILL.md └── README.md
skills.sh.json 控制 Hub 分类展示;团队部署:
hermes skills tap add github:your-org/your-skills-tap hermes skills tap add github:your-org/private-skills --token $GH_TOKEN hermes skills tap update hermes skills tap list
版本控制建议:将 ~/.hermes/skills/ 纳入 Git——cd ~/.hermes/skills && git init,跨设备 git pull && hermes skills reset 同步后重建内置技能。
9. GEPA + DSPy 自进化
GEPA(Genetic-Pareto Prompt Evolution) 是 2026 年 ICLR Oral 论文成果,Nous Research 集成到 hermes-agent-self-evolution。核心思路:不微调模型权重,只通过分析执行轨迹、生成变体、多目标帕累托优化来改进 SKILL.md 文本本身。成本:每次优化运行约 $2–10(纯 API 调用,无需 GPU)。
五阶段进化流程:Stage 1 执行轨迹收集(SQLite)→ Stage 2 反思式失败分析 → Stage 3 靶向变异(10–20 个 SKILL.md 变体)→ Stage 4 多目标帕累托评估(成功率 × Token 效率 × 速度)→ Stage 5 人工审查 PR。
git clone https://github.com/NousResearch/hermes-agent-self-evolution
cd hermes-agent-self-evolution && pip install -r requirements.txt
export HERMES_AGENT_PATH=~/.hermes
python -m evolution.skills.evolve_skill \
--skill github-code-review --iterations 10 --eval-source synthetic
python -m evolution.skills.evolve_skill \
--skill github-code-review --iterations 10 --eval-source sessiondb
四大安全护栏(Guardrails):
- 全量测试套件:
pytest tests/ -q必须 100% 通过 - 大小限制:Skills ≤ 15KB,工具描述 ≤ 500 字符
- Prompt 缓存兼容性:不能在会话中途修改导致缓存失效
- 语义保留检查:不能偏离技能的原始核心目的
| 阶段 | 优化目标 | 使用引擎 | 状态 |
|---|---|---|---|
| Phase 1 | Skill 文件(SKILL.md) | DSPy + GEPA | ✅ 已实现 |
| Phase 2 | 工具描述 | DSPy + GEPA | 🔲 计划中 |
| Phase 3 | 系统提示片段 | DSPy + GEPA | 🔲 计划中 |
| Phase 4 | 工具实现代码 | Darwinian Evolver | 🔲 计划中 |
| Phase 5 | 持续改进循环(全自动) | 自动化流水线 | 🔲 计划中 |
混合轨迹来源(实验性):agentskills.io 标准使 Claude Code / Gemini CLI 轨迹也可喂给 GEPA:
python -m evolution.skills.evolve_skill \
--skill github-code-review --iterations 10 --eval-source mixed \
--trace-dirs ~/.claude/traces,~/.hermes/sessions
10. Plugin 技能
插件将技能打包成命名空间形式(plugin:skill),实现:技能不出现在默认 skills_list(减少系统提示噪声);只在用户明确调用时激活(Opt-in);插件内技能可相互引用。
skill_view("superpowers:writing-plans")
# 加载时会自动展示同插件下的兄弟技能
在插件 plugin.yaml 中声明:
name: my-hermes-plugin
skills:
- name: writing-plans
path: skills/writing-plans/SKILL.md
- name: editing
path: skills/editing/SKILL.md
11. 进阶编写技巧
11.1 description 决定激活精度
❌ 太模糊:Helps with code. ✅ 明确触发条件:「Use when reviewing a pull request… Do NOT use for writing new code.」
11.2 Pitfalls 是质量分水岭
高质量 Pitfalls 应包含具体失败模式、根因分析与可操作修复步骤——例如 CSS selector 脆弱性、GitHub API 限流、大 diff Token 溢出及对应 chunking 策略。
11.3 脚本化与大小控制
| 技能大小 | 建议 |
|---|---|
| < 500 行 | 全部放在 SKILL.md |
| 500–1000 行 | 详细参考资料移至 references/ |
| > 1000 行 | 强烈建议拆分;考虑是否是两个技能 |
| > 15KB | 超过 GEPA 进化限制,必须拆分 |
11.4 skill_manage 与 Approval Gate
skill_manage(action='patch', name='github-code-review',
old_string='Check for obvious bugs',
new_string='Check for: null pointer, SQL injection, XSS...')
# config.yaml 开启人工审批
skills:
agent_writes_require_approval: true
12. 博客工作流实战案例
构建 blog-workflow Bundle(~/.hermes/skill-bundles/blog-workflow.yaml):
name: blog-workflow description: Full tech blog writing workflow. skills: - seo-keyword-research - outline-generator - code-example-validator - bilingual-checker - publish-to-platform instruction: | Always research SEO keywords before writing. Ensure all code examples are tested and runnable. Generate both Chinese and English title options.
核心自定义技能 seo-keyword-research:在博客写作会话开始时触发,检索中英文长尾词(「X 怎么用」「X tutorial」「X vs Y」),交叉参考掘金热榜与 Dev.to trending,输出 3–5 主关键词 + 10–15 长尾词矩阵。配置 requires_toolsets: [web] 确保仅在 web 工具可用时激活。
13. 五步 Runbook:从安装到 GEPA 进化
步骤 1 — 安装 Hermes Agent:在 macOS 节点(推荐 Mac Mini M4 16GB/32GB)执行 curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash,运行 hermes setup 并完成 OpenRouter 或本地 Ollama 配置。
步骤 2 — 安装 Skills:从官方与社区 Tap 拉取技能——hermes skills install official/research/arxiv;hermes skills tap add github:ChuckSRQ/awesome-hermes-skills;用 hermes skills TUI 验收 Level 0 索引是否正常。
步骤 3 — 创建 Skill Bundle:编写 ~/.hermes/skill-bundles/blog-workflow.yaml(或 CLI:hermes bundles create blog-workflow --skills seo-keyword-research,outline-generator ...),Telegram/CLI 执行 /blog-workflow 冒烟。
步骤 4 — 发布 Skill Tap:在 GitHub 建 my-skills-tap 仓库,添加 skills.sh.json 与 SKILL.md 目录树;团队成员 hermes skills tap add github:your-org/your-skills-tap;将 ~/.hermes/skills/ 纳入 Git 做个人定制版本控制。
步骤 5 — 运行 GEPA 进化:克隆 hermes-agent-self-evolution,设置 HERMES_AGENT_PATH=~/.hermes,先用 --eval-source synthetic 入门,积累 sessiondb 后切换 --eval-source sessiondb 或 mixed;审查 PR diff 后合并最优变体。
14. FAQ
Skills 和 MCP 有什么区别? Skills 是程序性知识文档(教 Agent 怎么做某事),MCP 是工具接口(给 Agent 额外的工具调用能力)。两者互补:MCP 提供数据库访问,Skill 教 Agent 如何正确执行数据库迁移。
为什么 Skill 改了但 Agent 还在用旧版? Skill 修改在当前会话不生效,需要 /reset 开启新会话,或安装时加 --now 参数强制刷新(会导致 Prompt Cache 失效,消耗更多 Token)。
GEPA 进化出的技能安全吗? 通过四大护栏(全量测试、15KB 大小限制、语义保留、人工 PR 审查),语义漂移检测确保技能不会偏离原始目的。但仍建议人工 review 每个 PR diff。
如何在 Claude Code 中复用 Hermes Skills? 复制 SKILL.md 到 ~/.claude/skills/,或使用 kevinnft/ai-agent-skills 一键安装脚本,一次安装多端可用。
Skill 的中文内容会影响 Token 效率吗? 中文字符在大多数 tokenizer 中每字约 1–1.5 token,与英文相近。但 description 字段建议保留英文或中英双语,因为底层 LLM 对英文 description 的理解和匹配更精确。
15. 延伸阅读与资源
官方文档:
开源仓库: hermes-agent · hermes-agent-self-evolution · awesome-hermes-skills · hermeshub · ai-agent-skills · gepa-ai/gepa · stanfordnlp/dspy
社区内容: SegmentFault 中文开发者实战指南 · Hermes Agent 中文站 · Dev.to: Self-Improving AI Agent
16. 结论:Skill 复利需要 7×24 的 Mac 节点
Windows WSL2、廉价 Linux Docker VPS 都能「跑起来」Hermes,但各有短板:WSL2 休眠打断 sessiondb 轨迹采集;x86 VPS 无原生 macOS,Apple 工具链 Skill 需套娃;Docker 抽象层增加排障成本且影响 launchd 常驻。自购 Mac Mini 则被 M 系迭代折旧锁死。要让 Skills 程序性记忆与 GEPA 进化真正复利——Level 0 索引稳定、Bundle 工作流随时可触发、Tap 团队同步不中断——Gateway 必须7×24 在线,且宿主最好是原生 macOS。
对于更稳定、更高性能、对 Apple 工具链与 AI Agent 更友好的生产环境,租赁 VPSMAC 的 Mac 云主机通常是更优解:固定月费、SSH 运维、launchd 常驻模板、Skill 备份与退租擦除,把精力花在 SKILL.md 编写与 GEPA 进化,而非硬件换代与 Docker 套娃。