跳到主要内容

技能系统

技能是按需加载的知识文档,代理在需要时可将其载入。它们遵循 渐进披露 模式,以最小化 token 使用量,并与 agentskills.io 开放标准兼容。

所有技能均位于 ~/.hermes/skills/ —— 主目录及数据源。在全新安装时,捆绑的技能会从代码仓库复制过来。通过 Hub 安装或代理创建的技能也存放于此。代理可以修改或删除任意技能。

你也可以让 Hermes 指向 外部技能目录 —— 与本地目录一同被扫描的额外文件夹。详见下文的 外部技能目录

另请参阅:

使用技能

每个已安装的技能都会自动作为斜杠命令可用:

# In the CLI or any messaging platform:
/gif-search funny cats
/axolotl help me fine-tune Llama 3 on my dataset
/github-pr-workflow create a PR for the auth refactor
/plan design a rollout for migrating our auth provider

# Just the skill name loads it and lets the agent ask what you need:
/excalidraw

捆绑的 plan 技能是技能驱动的斜杠命令的优秀示例,具有自定义行为。运行 /plan [request] 会指示 Hermes 检查上下文(如需要),生成 Markdown 格式的实施计划而非直接执行任务,并将结果保存在活动工作区/后端工作目录下的 .hermes/plans/ 目录中。

你也可以通过自然语言对话与技能交互:

hermes chat --toolsets skills -q "What skills do you have?"
hermes chat --toolsets skills -q "Show me the axolotl skill"

渐进披露

技能采用高效的 token 加载模式:

Level 0: skills_list()           → [{name, description, category}, ...]   (~3k tokens)
Level 1: skill_view(name) → Full content + metadata (varies)
Level 2: skill_view(name, path) → Specific reference file (varies)

代理仅在真正需要时才加载完整的技能内容。

SKILL.md 格式

---
name: my-skill
description: Brief description of what this skill does
version: 1.0.0
platforms: [macos, linux] # Optional — restrict to specific OS platforms
metadata:
hermes:
tags: [python, automation]
category: devops
fallback_for_toolsets: [web] # Optional — conditional activation (see below)
requires_toolsets: [terminal] # Optional — conditional activation (see below)
config: # Optional — config.yaml settings
- key: my.setting
description: "What this controls"
default: "value"
prompt: "Prompt for setup"
---

# Skill Title

## When to Use
Trigger conditions for this skill.

## Procedure
1. Step one
2. Step two

## Pitfalls
- Known failure modes and fixes

## Verification
How to confirm it worked.

平台特定技能

技能可通过 platforms 字段限制自身仅在特定操作系统上运行:

匹配
macosmacOS (Darwin)
linuxLinux
windowsWindows
platforms: [macos]            # macOS only (e.g., iMessage, Apple Reminders, FindMy)
platforms: [macos, linux] # macOS and Linux

设置后,该技能在不兼容的平台上将自动从系统提示、skills_list() 和斜杠命令中隐藏。若省略此字段,技能将在所有平台上加载。

条件激活(备用技能)

技能可根据当前会话中可用的工具自动显示或隐藏自身。这在 备用技能 中最为有用——即免费或本地替代方案,仅在高级工具不可用时才出现。

metadata:
hermes:
fallback_for_toolsets: [web] # Show ONLY when these toolsets are unavailable
requires_toolsets: [terminal] # Show ONLY when these toolsets are available
fallback_for_tools: [web_search] # Show ONLY when these specific tools are unavailable
requires_tools: [terminal] # Show ONLY when these specific tools are available
字段行为
fallback_for_toolsets当列出的工具集可用时,该技能被 隐藏;缺失时显示。
fallback_for_tools同上,但检查的是单个工具而非工具集。
requires_toolsets当列出的工具集不可用时,该技能被 隐藏;存在时显示。
requires_tools同上,但检查的是单个工具。

示例: 内置的 duckduckgo-search 技能使用 fallback_for_toolsets: [web]。当你设置了 FIRECRAWL_API_KEY 时,网络工具集可用,代理将使用 web_search —— DuckDuckGo 技能保持隐藏。若 API 密钥缺失,网络工具集不可用,DuckDuckGo 技能将自动作为备用出现。

未设置任何条件字段的技能行为与之前完全相同——始终显示。

加载时的安全设置

技能可以声明所需的环境变量,而不会从发现列表中消失:

required_environment_variables:
- name: TENOR_API_KEY
prompt: Tenor API key
help: Get a key from https://developers.google.com/tenor
required_for: full functionality

当检测到缺失值时,Hermes 仅在本地 CLI 中实际加载该技能时安全地询问你。你可以跳过设置并继续使用该技能。消息界面从不在聊天中请求密钥——而是提示你使用 hermes setup 或本地 ~/.hermes/.env

一旦设置,声明的环境变量将 自动传递execute_codeterminal 沙箱——技能脚本可直接使用 $TENOR_API_KEY。对于非技能相关的环境变量,请使用 terminal.env_passthrough 配置选项。详情请见 环境变量透传

技能配置设置

技能还可以声明非敏感的配置设置(路径、偏好),这些设置存储在 config.yaml 中:

metadata:
hermes:
config:
- key: wiki.path
description: Path to the wiki directory
default: "~/wiki"
prompt: Wiki directory path

配置项存储在 skills.config 下的 config.yaml 中。hermes config migrate 会提示你配置未设置的项,hermes config show 会显示它们。当技能加载时,其解析后的配置值会被注入上下文,使代理能自动知晓已配置的值。

详情请见 技能设置创建技能 —— 配置设置

技能目录结构

~/.hermes/skills/                  # Single source of truth
├── mlops/ # Category directory
│ ├── axolotl/
│ │ ├── SKILL.md # Main instructions (required)
│ │ ├── references/ # Additional docs
│ │ ├── templates/ # Output formats
│ │ ├── scripts/ # Helper scripts callable from the skill
│ │ └── assets/ # Supplementary files
│ └── vllm/
│ └── SKILL.md
├── devops/
│ └── deploy-k8s/ # Agent-created skill
│ ├── SKILL.md
│ └── references/
├── .hub/ # Skills Hub state
│ ├── lock.json
│ ├── quarantine/
│ └── audit.log
└── .bundled_manifest # Tracks seeded bundled skills

外部技能目录

如果你在 Hermes 之外维护技能——例如,一个由多个 AI 工具共享的 ~/.agents/skills/ 目录——你可以告诉 Hermes 也扫描这些目录。

~/.hermes/config.yamlskills 部分添加 external_dirs

skills:
external_dirs:
- ~/.agents/skills
- /home/shared/team-skills
- ${SKILLS_REPO}/skills

路径支持 ~ 展开和 ${VAR} 环境变量替换。

工作原理

  • 只读模式:外部目录仅用于技能发现。当代理创建或编辑技能时,始终写入 ~/.hermes/skills/ 目录。
  • 本地优先:如果同一技能名称同时存在于本地目录和外部目录中,本地版本具有优先权。
  • 完全集成:外部技能会出现在系统提示索引、skills_listskill_view 以及作为 /skill-name 的斜杠命令中——与本地技能无异。
  • 不存在的路径将静默跳过:如果配置的目录不存在,Hermes 会忽略它而不会报错。这对于可能在每台机器上都不存在的可选共享目录非常有用。

示例

~/.hermes/skills/               # Local (primary, read-write)
├── devops/deploy-k8s/
│ └── SKILL.md
└── mlops/axolotl/
└── SKILL.md

~/.agents/skills/ # External (read-only, shared)
├── my-custom-workflow/
│ └── SKILL.md
└── team-conventions/
└── SKILL.md

所有四个技能均出现在你的技能索引中。如果你在本地创建一个名为 my-custom-workflow 的新技能,它将覆盖外部版本。

代理管理的技能(skill_manage 工具)

代理可通过 skill_manage 工具自行创建、更新和删除技能。这是代理的程序性记忆——当它发现一个非平凡的工作流时,会将其方法保存为技能以供未来复用。

代理创建技能的时机

  • 成功完成一个复杂任务(5+ 工具调用)后
  • 在遭遇错误或死胡同后找到可行路径时
  • 用户纠正其方法时
  • 发现非平凡工作流时

操作

操作使用场景关键参数
create从零开始创建新技能namecontent(完整的 SKILL.md),可选 category
patch针对性修复(推荐)nameold_stringnew_string
edit重大结构重写namecontent(完整 SKILL.md 替换)
delete完全删除一个技能name
write_file添加或更新支持文件namefile_pathfile_content
remove_file删除支持文件namefile_path
提示

更新时推荐使用 patch 操作——相比 edit,它更节省 token,因为只有变更的文本会出现在工具调用中。

技能中心

从在线注册表、skills.sh、知名技能端点以及官方可选技能中浏览、搜索、安装和管理技能。

常用命令

hermes skills browse                              # Browse all hub skills (official first)
hermes skills browse --source official # Browse only official optional skills
hermes skills search kubernetes # Search all sources
hermes skills search react --source skills-sh # Search the skills.sh directory
hermes skills search https://mintlify.com/docs --source well-known
hermes skills inspect openai/skills/k8s # Preview before installing
hermes skills install openai/skills/k8s # Install with security scan
hermes skills install official/security/1password
hermes skills install skills-sh/vercel-labs/json-render/json-render-react --force
hermes skills install well-known:https://mintlify.com/docs/.well-known/skills/mintlify
hermes skills list --source hub # List hub-installed skills
hermes skills check # Check installed hub skills for upstream updates
hermes skills update # Reinstall hub skills with upstream changes when needed
hermes skills audit # Re-scan all hub skills for security
hermes skills uninstall k8s # Remove a hub skill
hermes skills publish skills/my-skill --to github --repo owner/repo
hermes skills snapshot export setup.json # Export skill config
hermes skills tap add myorg/skills-repo # Add a custom GitHub source

支持的中心源

示例说明
officialofficial/security/1password随 Hermes 一起发布的可选技能。
skills-shskills-sh/vercel-labs/agent-skills/vercel-react-best-practices可通过 hermes skills search <query> --source skills-sh 搜索。当 skills.sh 的别名 slug 与仓库文件夹名称不同时,Hermes 会自动解析。
well-knownwell-known:https://mintlify.com/docs/.well-known/skills/mintlify从网站的 /.well-known/skills/index.json 直接提供技能。可通过站点或文档 URL 进行搜索。
githubopenai/skills/k8s直接从 GitHub 仓库/路径安装,支持自定义 tap。
clawhublobehubclaude-marketplace源特定标识符社区或市场集成。

已集成的中心与注册表

Hermes 目前集成了以下技能生态系统和发现源:

1. 官方可选技能(official

这些技能维护在 Hermes 仓库内部,安装时自带信任机制。

hermes skills browse --source official
hermes skills install official/security/1password

2. skills.sh(skills-sh

这是 Vercel 的公共技能目录。Hermes 可直接搜索、查看技能详情页、解析别名风格的 slug,并从底层源仓库安装。

hermes skills search react --source skills-sh
hermes skills inspect skills-sh/vercel-labs/json-render/json-render-react
hermes skills install skills-sh/vercel-labs/json-render/json-render-react --force

3. 知名技能端点(well-known

基于 URL 的发现机制,适用于发布 /.well-known/skills/index.json 的网站。这不是单一的中心化枢纽,而是一种网络发现约定。

hermes skills search https://mintlify.com/docs --source well-known
hermes skills inspect well-known:https://mintlify.com/docs/.well-known/skills/mintlify
hermes skills install well-known:https://mintlify.com/docs/.well-known/skills/mintlify

4. 直接 GitHub 技能(github

Hermes 可直接从 GitHub 仓库和基于 GitHub 的 tap 安装技能。当你已知仓库路径或希望添加自己的自定义源仓库时非常有用。

默认 tap(无需任何配置即可浏览):

hermes skills install openai/skills/k8s
hermes skills tap add myorg/skills-repo

5. ClawHub(clawhub

第三方技能市场,作为社区源集成。

6. Claude 市场风格仓库(claude-marketplace

Hermes 支持发布与 Claude 兼容的插件/市场清单的市场仓库。

已集成的来源包括:

Hermes 源 ID:claude-marketplace

7. LobeHub(lobehub

Hermes 可以搜索并转换 LobeHub 公共目录中的代理条目,将其转换为可安装的 Hermes 技能。

安全扫描与 --force

所有通过 hub 安装的技能都会经过一个 安全扫描,检查数据外泄、提示注入、破坏性命令、供应链信号以及其他威胁。

hermes skills inspect ... 现在还会在可用时显示上游元数据:

  • 仓库 URL
  • skills.sh 详情页面 URL
  • 安装命令
  • 每周安装量
  • 上游安全审计状态
  • 著名索引/端点 URL

当你已审查第三方技能并希望覆盖非危险性策略阻断时,请使用 --force

hermes skills install skills-sh/anthropics/skills/pdf --force

重要行为:

  • --force 可覆盖“谨慎/警告”类发现的策略阻断。
  • --force 不会覆盖“危险”扫描结论。
  • 官方可选技能(official/...)被视为内置信任,不会显示第三方警告面板。

信任等级

等级来源策略
builtin随 Hermes 一同发布始终信任
official仓库中的 optional-skills/ 目录内置信任,不显示第三方警告
trusted受信任的注册表/仓库,如 openai/skillsanthropics/skills策略比社区来源更宽松
community其他所有来源(skills.sh、知名端点、自定义 GitHub 仓库、大多数市场)非危险发现可使用 --force 覆盖;“危险”结论仍被阻止

更新生命周期

现在 hub 能够追踪足够的溯源信息,以重新检查已安装技能的上游副本:

hermes skills check          # Report which installed hub skills changed upstream
hermes skills update # Reinstall only the skills with updates available
hermes skills update react # Update one specific installed hub skill

此功能使用存储的源标识符以及当前上游捆绑包内容哈希来检测漂移。

斜杠命令(在聊天中)

所有相同的命令都支持 /skills

/skills browse
/skills search react --source skills-sh
/skills search https://mintlify.com/docs --source well-known
/skills inspect skills-sh/vercel-labs/json-render/json-render-react
/skills install openai/skills/skill-creator --force
/skills check
/skills update
/skills list

官方可选技能仍使用如 official/security/1passwordofficial/migration/openclaw-migration 这样的标识符。