你已经装好了 Hermes,写了几段 Prompt,却发现 Agent 每次新会话都「失忆」——问题不在系统提示词不够长,而在缺少 Skills:跨会话持久、激活前零 Token 消耗的程序性记忆。本文面向已运行 Hermes(或在 Cursor / Claude Code 中使用 SKILL.md)的开发者,交付生产级模式:① 厘清 Skills / Memory / Prompts 边界;② 掌握 agentskills.io 格式与三级 Progressive Disclosure;③ 部署 Bundles、Conditional Activation 与团队 Tap;④ 用 GEPA 对真实轨迹做自我进化;⑤ 在 NUKCLOUD 云端 Mac 上稳定运行技能实验室。若尚未搭好主机,请先读 Hermes 安装教程 与 Cursor Agent Skills 指南;长期运行可参考 30 天 VPS / Mac mini 租赁实战。
00引言:为什么 Hermes 技能系统值得单独深入研究?
2026 年初,Nous Research 发布 Hermes Agent,两个月内 GitHub Star 突破 16 万,成为 AI Agent 领域增速最快的开源项目之一。它的 headline 不是更大的模型,而是一种哲学:"the agent that grows with you"——Agent 会随着使用越来越懂你。
这一切的底层实现,就是 Skills 技能系统。与传统「一次性 Prompt」不同,Hermes 技能体系是一套有标准、可进化、跨会话持久的程序性记忆。本文不聊基础入门,直接进入进阶区域:
- Skills 内部的 Progressive Disclosure 渐进加载如何控制 Token 成本?
- Conditional Activation 条件激活怎么用?
- Skill Bundles 如何让复杂工作流一键触发?
- 如何用 DSPy + GEPA 让 Skills 自动进化、越跑越好?
- 开源社区里有哪些优质 Skills 仓库可以直接 Tap 订阅?
痛点把 Skills 当长 Prompt 用,会踩哪些坑?
- Token 泄漏:把完整 SOP 塞进每次会话,上下文还没开工就满了。Skills 的设计是按需加载,当成长驻 Prompt 用等于自废武功。
- description 太模糊:写「helps with code」会在无关任务里误激活。Level 0 全靠
description做匹配,写清「什么时候用」比「是什么」更重要。 - 没有工作流打包:团队每次开 session 手动敲五个斜杠命令——Code Review、TDD、PR、调试、部署——而不是一个 Bundle 搞定。
- 改了 SKILL.md 不生效:当前会话内修改无效,需
/reset或--now重装;后者会让 Prompt Cache 失效、Token 飙升。 - Skills 与 MCP 混淆:MCP 给工具,Skills 教怎么用。只有数据库 MCP、没有迁移 Skill,Agent 照样乱操作。
01核心概念:Skills ≠ Prompts,Skills ≠ Memory
三层上下文看起来相似,行为却截然不同。写第一个 SKILL.md 前,先对照这张表 📊
| 维度 | 普通 Prompt | Memory(记忆) | Skills(技能) |
|---|---|---|---|
| 持久性 | 当前对话 | 跨会话,永久 | 跨会话,永久 |
| 加载时机 | 每次都在上下文中 | 每次会话自动注入 | 按需加载(关键差异) |
| Token 成本 | 每次消耗 | 小而稳定 | 激活前零消耗 |
| 内容类型 | 任意意图描述 | 用户偏好 / 事实 | 程序性步骤(如何做某事) |
| 维护者 | 用户手动 | Agent 自动 | 用户 + Agent 均可 |
| 可共享性 | 不方便 | 私有 | 可发布为社区 Tap |
核心记忆口诀 💡
- Prompt = 便利贴(当次有效)
- Memory = 便签本(永久笔记,随时在手边)
- Skill = SOP 手册(步骤化流程,需要时翻阅)
02SKILL.md 格式深度解析与 Progressive Disclosure
所有 Hermes Skills 遵循 agentskills.io 开放标准,确保跨 Agent 可移植(Hermes、Claude Code、Cursor、OpenCode 均可使用)。发布前可用 skills-ref validate ./my-skill 校验格式。
---
name: my-skill
description: |
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
1-2 段:做什么、为什么存在。
## When to Use
- Use for: [具体场景]
- Don't use for: [明确排除场景]
## Procedure
1. 步骤一(包含精确命令)
2. 步骤二
3. 步骤三
## Common Pitfalls
1. 常见问题及修复方案
2. 边界情况处理
## Verification Checklist
- [ ] 验证点 1
- [ ] 验证点 2
技能目录结构(模块化设计):
├── SKILL.md # 主文件(核心步骤,建议 ≤500 行)
├── references/
│ ├── api-docs.md # API 参考(按需加载)
│ └── examples.md # 示例输入输出
├── templates/
│ └── config.yaml # 可复用模板
└── scripts/
└── setup.sh # Agent 可直接执行的脚本
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 靠它决定是否加载完整技能。写清「什么时候用」比「是什么」更重要。
03Skill Bundles:一条命令触发完整工作流
Skill Bundles 是 Hermes 2026 新增的强力特性,也是目前最被低估的功能之一。Bundle 是轻量 YAML 文件,把多个相关技能打包成一个斜杠命令;执行 /bundle-name 时,所有列出的技能同时加载,无需逐个触发。
文件位置: ~/.hermes/skill-bundles/<slug>.yaml
name: backend-dev
description: |
Full backend feature workflow — code review, TDD, and PR management.
Use at the start of any new backend feature session.
skills:
- github-code-review
- test-driven-development
- github-pr-workflow
instruction: |
Always write failing tests first before implementation.
Open PRs with co-author tags for pair-programming sessions.
Never push directly to main.
场景 1:AI 研究员工作流
name: research-session
description: Load all research tools at once for deep-dive sessions.
skills:
- arxiv
- deep-research
- plan
- excalidraw
instruction: |
Start every session by checking recent papers on the topic.
Create an Excalidraw diagram for any architecture discussed.
场景 2:MLOps 部署流水线
name: mlops-deploy
description: Model deployment pipeline with monitoring setup.
skills:
- vllm
- llama-cpp
- github-pr-workflow
- systematic-debugging
instruction: |
Always run inference benchmarks before and after deployment.
Document model quantization settings in PR description.
Bundle 优先级规则:
- Bundle 与单个 Skill 同名时,Bundle 优先
- Bundle 中列出的 Skill 未安装时,跳过而不报错,并在加载时提示缺失
- Bundle 不修改系统提示,不会导致 Prompt Cache 失效(Token 友好)
hermes bundles create backend-dev \
--skills github-code-review,test-driven-development,github-pr-workflow \
--instruction "Always write failing tests first"
04Conditional Activation:智能感知环境
这是让 Hermes 技能真正「聪明」的机制。技能可根据当前会话中工具的可用性,自动显示或隐藏。在 SKILL.md 的 metadata.hermes 下配置:
metadata:
hermes:
requires_toolsets: [web]
requires_tools: [web_search]
fallback_for_toolsets: [browser]
fallback_for_tools: [browser_navigate]
| 字段 | 行为逻辑 |
|---|---|
requires_toolsets | 列出的工具集不存在时,隐藏此技能 |
requires_tools | 列出的工具不存在时,隐藏此技能 |
fallback_for_toolsets | 列出的工具集存在时,隐藏此技能(作为备选方案) |
fallback_for_tools | 列出的工具存在时,隐藏此技能 |
经典场景:免费 / 付费搜索智能切换 🦆
name: duckduckgo-search
description: Search the web using DuckDuckGo. Use when web_search is unavailable.
metadata:
hermes:
fallback_for_tools: [web_search]
当用户配置了 FIRECRAWL_KEY / BRAVE_SEARCH_KEY 时,付费的 web_search 工具激活,DuckDuckGo 技能自动从提示词中消失,节省 Token;当 API 不可用时,备选方案自动浮现。
高级场景:平台感知技能
metadata:
hermes:
requires_toolsets: [messaging]
platforms: [telegram, discord]
通过 hermes skills TUI,还可以为不同平台(CLI、Telegram、Discord)独立开关某个技能。
05Skills 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 | 亮点 |
|---|---|---|---|
| awesome-hermes-skills | 精选生产级技能合集 | 67 | Deep Research、MLOps、Apple 集成;gh-copilot 插件,23 个技能集成 GitHub Copilot |
| hermeshub | 社区技能注册中心,安全扫描认证 | 166 | API 与市场功能;每个技能经过提示注入检测 |
| ai-agent-skills | 191 个技能,28 个分类 | 10 | 一键安装;Hermes / Claude Code / Cursor 跨 Agent 通用 |
| hermes-agent | 官方仓库,含所有内置 Skills | — | 权威来源,含 Skill 编写规范 |
agentskills.io 开放标准意味着:Skills 可在 Hermes、Claude Code、Cursor、OpenCode 之间跨平台使用;社区共建,技能资产不绑定单一平台。
06发布你自己的 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
{
"groupings": [
{
"title": "MLOps & Model Deployment",
"skills": ["vllm-deploy", "model-benchmark"]
},
{
"title": "AI Research Workflows",
"skills": ["paper-summarizer", "citation-finder"]
}
]
}
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
Git 版本管理建议:将 ~/.hermes/skills/ 纳入版本控制,跨设备同步:
cd ~/.hermes/skills && git init
git remote add origin https://github.com/your-org/personal-skills
git push -u origin main
git pull && hermes skills reset
07Self-Evolving Skills:GEPA + DSPy 让技能自动进化
GEPA(Genetic-Pareto Prompt Evolution) 是 2026 年 ICLR Oral 论文成果,Nous Research 将其集成到 hermes-agent-self-evolution 项目。核心思路:不微调模型权重,只通过分析执行轨迹、生成变体、多目标帕累托优化来改进技能文本本身。
成本:每次优化运行约 $2–10(纯 API 调用,无需 GPU)。
GEPA 五阶段进化流程 🧬
- Stage 1 — 执行轨迹收集:从 SQLite 读取全量推理轨迹(工具调用、分支、错误)。
- Stage 2 — 反思式失败分析:LLM 生成「可操作侧信息」——不是「失败了」,而是「为什么失败」。
- Stage 3 — 靶向变异:针对失败原因,生成 10–20 个
SKILL.md变体。 - Stage 4 — 多目标帕累托评估:同时优化成功率 × Token 效率 × 速度。
- Stage 5 — 人工审查 PR:最优变体 → 生成 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)——进化变体必须通过全部四项约束才能生成 PR:
- 全量测试套件:
pytest tests/ -q必须 100% 通过 - 大小限制:Skills ≤ 15KB,工具描述 ≤ 500 字符(防止 Token 膨胀)
- Prompt 缓存兼容性:不能在会话中途修改导致缓存失效
- 语义保留检查:不能偏离技能的原始核心目的
| 阶段 | 优化目标 | 使用引擎 | 状态 |
|---|---|---|---|
| Phase 1 | Skill 文件(SKILL.md) | DSPy + GEPA | ✅ 已实现 |
| Phase 2 | 工具描述 | DSPy + GEPA | 🔲 计划中 |
| Phase 3 | 系统提示片段 | DSPy + GEPA | 🔲 计划中 |
| Phase 4 | 工具实现代码 | Darwinian Evolver | 🔲 计划中 |
| Phase 5 | 持续改进循环(全自动) | 自动化流水线 | 🔲 计划中 |
多来源轨迹联合进化(实验性):Skills 遵循 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
08Plugin 技能:plugin:skill 命名空间
插件可以将技能打包成命名空间形式(plugin:skill),实现:
- 技能不出现在默认
skills_list(减少系统提示噪声) - 只在用户明确调用时激活(Opt-in)
- 插件内技能可相互引用(横向感知)
skill_view("superpowers:writing-plans")
加载时会自动展示同插件下的兄弟技能——Agent 提示:「This plugin also includes: superpowers:editing, superpowers:research」。
name: my-hermes-plugin
skills:
- name: writing-plans
path: skills/writing-plans/SKILL.md
- name: editing
path: skills/editing/SKILL.md
09技能编写进阶技巧(工程师视角)
description 字段的写法决定激活精度 ✍️
description: Helps with code.
description: |
Use when reviewing a pull request, checking for code quality issues,
security vulnerabilities, or style violations. Handles GitHub PR URLs
and local git diff output. Do NOT use for writing new code.
Pitfalls 部分是技能质量的分水岭——高质量 Pitfalls 应包含:具体的失败模式(而非泛泛而谈)、每个失败的根因分析、可操作的修复步骤。
1. CSS selector brittleness: Dynamic class names like css-abc123
change on rebuild. Fix: Use data-testid or ARIA roles instead.
2. Rate limiting on GitHub API: Burst of >5000 requests/hour returns 403.
Fix: Add --rate-limit 100; check X-RateLimit-Remaining header.
3. Token overflow on large diffs: PRs with >500 files may hit context limits.
Fix: skill_view("github-code-review", "references/chunking.md")
脚本化:让技能具备真正的执行能力
3. Run the extraction script:
The agent will execute: scripts/extract_schema.py --input $FILE
If the script fails, load: references/manual-extract.md
| 技能大小 | 建议 |
|---|---|
| < 500 行 | 全部放在 SKILL.md |
| 500–1000 行 | 将详细参考资料移至 references/ |
| > 1000 行 | 强烈建议拆分;考虑是否是两个技能 |
| > 15KB | 超过 GEPA 进化的大小限制,必须拆分 |
skill_manage 让 Agent 动态维护技能:
skill_manage(
action='patch',
name='github-code-review',
old_string='Check for obvious bugs',
new_string='Check for: null pointer, SQL injection, XSS, logic errors'
)
skill_manage(
action='create',
name='my-new-skill',
content="""---
name: my-new-skill
description: Use when [...].
---
# My New Skill
...""",
category='automation'
)
在 config.yaml 中开启人工审批门:skills.agent_writes_require_approval: true——Agent 写入技能前必须人工确认。
10实战案例:技术博客工作流 Skills
目标:构建一套完整的博客写作辅助技能体系,让 Hermes 成为你的专属博客助理 📝
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.
---
name: seo-keyword-research
description: |
Use when planning a technical blog post. Researches search volume,
competition, and related queries for Chinese and English audiences.
metadata:
hermes:
requires_toolsets: [web]
tags: [seo, blogging, content]
---
## When to Use
Use at the start of any blog writing session, before creating the outline.
## Procedure
1. Identify primary topic from user or context
2. Chinese long-tail: "X 怎么用", "X 教程", "X 最佳实践"
3. English long-tail: "X tutorial", "how to X", "X vs Y"
4. Cross-reference platform trends (掘金, Dev.to, HN)
5. Output keyword matrix: 3-5 primary + 10-15 long-tail per language
## Common Pitfalls
- Chinese and English audiences search differently
- "Agent" vs "智能体" vs "代理" — check platform dominance
Session 开始时执行 /blog-workflow,Agent 会先调研关键词、生成大纲、校验代码示例、准备中英双语标题,再动笔写正文。
11六步 Runbook:在云端 Mac 上搭建 Skills 实验室
-
01
安装 Hermes 与基线技能:按 安装教程 完成部署。添加官方 Tap 与至少一个社区仓库(
hermes skills tap add github:ChuckSRQ/awesome-hermes-skills)。用hermes skills list确认 Level 0 目录合计约 3K Token 以内。 -
02
开通专用云端 Mac:打开 NUKCLOUD 控制台,选择 16 GB+ 规格(若 GEPA 进化与活跃会话并行,建议 32 GB)。技能编写试点可按小时计费,见 定价页。
-
03
编写并校验 SKILL.md:在
~/.hermes/skills/按 agentskills.io 规范创建技能。运行skills-ref validate ./my-skill。写精确description,超过 500 行拆到references/。 -
04
打包 Bundles 与 Conditional Activation:为 recurring 工作流写 YAML Bundle。为免费/付费工具切换设置
fallback_for_tools。用/bundle-name冒烟测试,确认缺失技能仅警告不崩溃。 -
05
发布团队 Tap 并运行 GEPA 进化:将技能推送到 GitHub Tap;队友执行
hermes skills tap add。克隆hermes-agent-self-evolution,设置HERMES_AGENT_PATH,用--eval-source sessiondb进化一个技能(预算 $2–10/次)。合并前人工审查 PR diff。 -
06
常驻化并锁定容量:将
~/.hermes/skills/纳入 Git;用launchd跑 24/7 Hermes 网关或 Telegram Bot。在 订购页 锁定规格。若团队 IDE 与终端 Agent 分工,可交叉阅读 Cursor Skills 模式。
在笔记本上跑 Hermes Skills,常见痛点是合盖休眠杀死 Telegram 会话、共享 VPS 带宽抖动打断长 Agent 循环、会话中途改 Skill 导致 Prompt Cache 失效。GEPA 进化与 overnight Agent 运行需要一台始终在线、网络稳定的机器。生产级技能实验室与团队 Tap,NUKCLOUD 多区域裸金属 Mac / 云端 Mac 节点提供租户隔离与规格弹性——先在 定价页 按小时试点,技能目录稳定后再转固定月租容量。
12常见问题 FAQ
/reset 开启新会话,或安装时加 --now 参数强制刷新(会导致 Prompt Cache 失效,消耗更多 Token)。优先使用 /reset。SKILL.md 文件到 ~/.claude/skills/ 目录,或使用 kevinnft/ai-agent-skills 等支持多 Agent 的安装脚本,一次安装多端可用。agentskills.io 格式本身即为跨平台标准。description 字段建议保留英文(或中英双语),因为底层 LLM 对英文 description 的理解和匹配更精确;正文内容可用任意语言。13延伸阅读与资源链接
官方资源:
- Hermes Agent 官方文档 — 权威参考
- Hermes Agent 中文文档 — 官方中文版
- Skills System 文档 — 技能系统完整参考
- Creating Skills 开发者指南 — 技能编写规范
- agentskills.io 开放标准 — 跨平台技能标准
开源仓库:
- NousResearch/hermes-agent — 官方主仓库
- hermes-agent-self-evolution — GEPA 自进化工具
- awesome-hermes-skills — 精选技能合集(Deep Research、MLOps)
- hermeshub — 社区技能注册中心
- ai-agent-skills — 191 个跨平台技能
- gepa-ai/gepa — GEPA 算法实现(MIT)
- stanfordnlp/dspy — DSPy 框架
社区内容: