跳到主要内容

使用技能

技能(Skills)是按需加载的知识文档,教 Hermes 如何处理特定任务——从生成 ASCII 艺术到管理 GitHub PR。本指南带你了解日常使用方法。

完整的技术参考请参阅技能系统


查找技能

每个 Hermes 安装都附带了内置技能。查看可用内容:

# In any chat session:
/skills

# Or from the CLI:
hermes skills list

这会显示一个包含名称和描述的简洁列表:

ascii-art Generate ASCII art using pyfiglet, cowsay, boxes...
arxiv Search and retrieve academic papers from arXiv...
github-pr-workflow Full PR lifecycle — create branches, commit...
plan Plan mode — inspect context, write a markdown...
excalidraw Create hand-drawn style diagrams using Excalidraw...

搜索技能

# Search by keyword
/skills search docker
/skills search music

技能中心

官方可选技能(默认未激活的较重或小众技能)可通过中心获取:

# Browse official optional skills
/skills browse

# Search the hub
/skills search blockchain

使用技能

每个已安装的技能都自动成为一个斜杠命令。直接输入其名称:

# Load a skill and give it a task
/ascii-art Make a banner that says "HELLO WORLD"
/plan Design a REST API for a todo app
/github-pr-workflow Create a PR for the auth refactor

# Just the skill name (no task) loads it and lets you describe what you need
/excalidraw

你也可以通过自然对话触发技能——告诉 Hermes 使用某个特定技能,它会通过 skill_view 工具加载它。

渐进式披露

技能使用节省 token 的加载模式。Agent 不会一次性加载所有内容:

  1. skills_list() — 所有技能的简洁列表(约 3k token)。会话开始时加载。
  2. skill_view(name) — 单个技能的完整 SKILL.md 内容。当 Agent 决定需要该技能时加载。
  3. skill_view(name, file_path) — 技能内的特定参考文件。仅在需要时加载。

这意味着技能在真正被使用之前不会消耗 token。


从中心安装

官方可选技能随 Hermes 一起发布,但默认未激活。需要显式安装:

# Install an official optional skill
hermes skills install official/research/arxiv

# Install from the hub in a chat session
/skills install official/creative/songwriting-and-ai-music

# Install a single-file SKILL.md directly from any HTTP(S) URL
hermes skills install https://sharethis.chat/SKILL.md
/skills install https://example.com/SKILL.md --name my-skill

发生的事情:

  1. 技能目录被复制到 ~/.hermes/skills/
  2. 它出现在你的 skills_list 输出中
  3. 它成为可用的斜杠命令
提示

已安装的技能在新会话中生效。如果你希望它在当前会话中可用,使用 /reset 重新开始,或添加 --now 立即使提示词缓存失效(下一轮会消耗更多 token)。

验证安装

# Check it's there
hermes skills list | grep arxiv

# Or in chat
/skills search arxiv

插件提供的技能

插件可以使用命名空间名称(plugin:skill)捆绑自己的技能。这可以防止与内置技能的名称冲突。

# Load a plugin skill by its qualified name
skill_view("superpowers:writing-plans")

# Built-in skill with the same base name is unaffected
skill_view("writing-plans")

插件技能在系统提示词中列出,也不出现在 skills_list 中。它们是按需加载的——当你知道某个插件提供了某项技能时,显式加载它。加载后,Agent 会看到列出同一插件兄弟技能的横幅。

关于如何在你自己的插件中发布技能,请参阅构建 Hermes 插件 → 捆绑技能


配置技能设置

某些技能在其前置声明中声明了所需配置:

metadata:
hermes:
config:
- key: tenor.api_key
description: "Tenor API key for GIF search"
prompt: "Enter your Tenor API key"
url: "https://developers.google.com/tenor/guides/quickstart"

当有配置的技能首次加载时,Hermes 会提示你输入这些值。它们存储在 config.yamlskills.config.* 下。

从 CLI 管理技能配置:

# Interactive config for a specific skill
hermes skills config gif-search

# View all skill config
hermes config get skills.config

创建你自己的技能

技能只是带有 YAML 前置声明的 Markdown 文件。创建一个只需不到五分钟。

1. 创建目录

mkdir -p ~/.hermes/skills/my-category/my-skill

2. 编写 SKILL.md

~/.hermes/skills/my-category/my-skill/SKILL.md
---
name: my-skill
description: Brief description of what this skill does
version: 1.0.0
metadata:
hermes:
tags: [my-tag, automation]
category: my-category
---

# My Skill

## When to Use
Use this skill when the user asks about [specific topic] or needs to [specific task].

## Procedure
1. First, check if [prerequisite] is available
2. Run `command --with-flags`
3. Parse the output and present results

## Pitfalls
- Common failure: [description]. Fix: [solution]
- Watch out for [edge case]

## Verification
Run `check-command` to confirm the result is correct.

3. 添加参考文件(可选)

技能可以包含 Agent 按需加载的支持文件:

my-skill/
├── SKILL.md # Main skill document
├── references/
│ ├── api-docs.md # API reference the agent can consult
│ └── examples.md # Example inputs/outputs
├── templates/
│ └── config.yaml # Template files the agent can use
└── scripts/
└── setup.sh # Scripts the agent can execute

在你的 SKILL.md 中引用这些文件:

For API details, load the reference: `skill_view("my-skill", "references/api-docs.md")`

4. 测试

开始一个新会话并尝试你的技能:

hermes chat -q "/my-skill help me with the thing"

技能会自动出现——无需注册。把它放到 ~/.hermes/skills/ 中,它就生效了。

信息

Agent 也可以使用 skill_manage 自己创建和更新技能。在解决复杂问题后,Hermes 可能会提议将该方法保存为技能以供下次使用。


每平台技能管理

控制哪些技能在哪些平台上可用:

hermes skills

这会打开一个交互式 TUI,你可以在其中按平台(CLI、Telegram、Discord 等)启用或禁用技能。当你希望某些技能仅在特定上下文中可用时非常有用——例如,将开发技能从 Telegram 中移除。


技能与记忆的对比

两者在会话间持久存在,但用途不同:

技能记忆
内容程序性知识——如何做事事实性知识——事物是什么
时机按需加载,仅在相关时自动注入每个会话
大小可以很大(数百行)应该简洁(仅关键事实)
成本加载前零 token小但持续的 token 成本
示例"如何部署到 Kubernetes""用户偏好深色模式,住在 PST 时区"
创建者你、Agent 或从中心安装Agent,基于对话

经验法则: 如果你会把它放在参考文档中,那就是技能。如果你会把它写在便利贴上,那就是记忆。


技巧

保持技能专注。 试图涵盖"所有 DevOps"的技能会太长太模糊。涵盖"将 Python 应用部署到 Fly.io"的技能则足够具体,能真正发挥作用。

让 Agent 创建技能。 在完成复杂的多步骤任务后,Hermes 通常会提议将该方法保存为技能。说是吧——这些 Agent 编写的技能捕获了包括沿途发现的陷阱在内的精确工作流。

使用分类。 将技能组织到子目录中(~/.hermes/skills/devops/~/.hermes/skills/research/ 等)。这使列表保持可管理,并帮助 Agent 更快地找到相关技能。

当技能过时时更新它。 如果你使用某个技能时遇到了它未涵盖的问题,告诉 Hermes 用你学到的内容更新技能。未维护的技能会变成负担。


完整的技能参考——前置声明字段、条件激活、外部目录等——请参阅技能系统