H繁中版
<!-- Source: https://hermesbible.com/docs/guides/work-with-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 的載入模式。代理人不會一次載入所有內容:

  1. skills_list() — 所有技能的簡潔列表(約 3k Token)。在會話開始時載入。
  2. skill_view(name) — 某個技能的完整 SKILL.md 內容。在代理人判斷需要該技能時載入。
  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 中。它們是選擇性載入的——當你知道某個外掛提供了某個技能時,請明確載入。載入後,代理人會看到一個列出來自同一外掛的兄弟技能的橫幅。

有關如何在你自己的外掛中發佈技能,請見建立 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 show | grep '^skills\.config'

建立你自己的技能

技能只是帶有 YAML 前置資訊的 Markdown 檔案。建立一個只需不到五分鐘。

1. 建立目錄

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

2. 撰寫 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. 加入參考檔案(可選)

技能可以包含代理人按需載入的輔助檔案:

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/ 就能使用。

資訊

代理人也可以使用 skill_manage 來建立和更新技能。在解決一個複雜問題後,Hermes 可能會提議將該方法儲存為技能以供下次使用。


按平台管理技能

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

hermes skills

這會開啟一個互動式終端使用者介面(TUI),你可以在其中按平台(CLI、Telegram、Discord 等)啟用或停用技能。當你想要某些技能僅在特定情境中可用時很有用——例如,不讓開發技能出現在 Telegram 上。


技能 vs 記憶

兩者都能跨會話持久化,但它們的用途不同:

技能記憶
什麼程序性知識——如何做事事實性知識——事物是什麼
何時按需載入,僅在相關時自動注入每個會話
大小可以很大(數百行)應該精簡(僅關鍵事實)
成本載入前零 Token少量但持續的 Token 消耗
範例「如何部署到 Kubernetes」「使用者偏好深色模式,居住在太平洋時區」
誰建立你、代理人或從技能中心安裝代理人根據對話建立

經驗法則: 如果你會把它放在參考文件中,那就是技能。如果你會把它寫在便利貼上,那就是記憶。


小技巧

保持技能專注。 一個試圖涵蓋「所有 DevOps」的技能會太長且太模糊。一個涵蓋「將 Python 應用部署到 Fly.io」的技能足夠具體,才能真正有用。

讓代理人建立技能。 在完成一個複雜的多步驟任務後,Hermes 通常會提議將該方法儲存為技能。答應它——這些由代理人建立的技能會精確捕捉整個工作流程,包括過程中發現的陷阱。

使用分類。 將技能組織到子目錄中(~/.hermes/skills/devops/~/.hermes/skills/research/ 等)。這能保持列表易於管理,並幫助代理人更快找到相關技能。

技能過時時要更新。 如果你使用某個技能時遇到它未涵蓋的問題,告訴 Hermes 用你學到的東西更新該技能。未維護的技能會變成負擔。


完整的技能參考——前置資訊欄位、條件式啟用、外部目錄等——請見技能系統



委派與並行工作