# Hermes Extension

> Extend Hermes Agent by adding new tools (sync + async patterns), authoring in-repo skills, upgrading Hermes, and understanding s6 container supervision. Class-level umbrella for Hermes development workflows.

- Skill: `bog5d/hermes-extension` (Agent Skill, multi-file: 8 files)
- Install (CLI): `npx skillmds@latest add bog5d/hermes-extension`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bog5d/hermes-extension/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: MIT
- Author: bog5d (https://skillmd.com/u/bog5d)
- Updated: 2026-08-19
- Page: https://skillmd.com/skills/bog5d/hermes-extension

---


# Extending Hermes Agent

Class-level umbrella for developing and extending Hermes Agent — adding tools, authoring skills, upgrading, and container supervision.

## When to Load

- Adding a new tool module to Hermes (sync or async)
- Authoring or editing SKILL.md files (in-repo or user-local)
- Integrating an external async Python library as Hermes tools
- Upgrading Hermes to the latest GitHub version
- Modifying the s6-overlay Docker supervision tree
- Debugging profile gateways in the Docker container

## Sub-Skill Map

| Workflow | Reference |
|----------|-----------|
| Adding a sync tool module | `references/hermes-add-toolset.md` |
| Adding an async tool module | `references/hermes-integrate-external-async-library.md` |
| Authoring in-repo SKILL.md | `references/hermes-agent-skill-authoring.md` |
| Upgrading Hermes from GitHub | `references/hermes-upgrade.md` |
| S6 container supervision | `references/hermes-s6-container-supervision.md` |

## Quick Path Selection

1. **New tool module (sync, standard Python)** → `references/hermes-add-toolset.md`
2. **New tool module (async, external SDK)** → `references/hermes-integrate-external-async-library.md`
3. **Writing a skill for the repo** → `references/hermes-agent-skill-authoring.md`
4. **Upgrading Hermes** → `references/hermes-upgrade.md`
5. **Docker/s6 supervision issues** → `references/hermes-s6-container-supervision.md`

## Common Pitfalls (Cross-Cutting)

- **Cross-environment file paths**: When a session spans multiple environments or the agent was previously running under a different username, verify the current `$HOME` and `$USER` before writing files. Paths like `/Users/wepon/...` won't exist when the active user is `mac`. Always check `whoami` and `echo $HOME` before creating project directories. Use `~` for home-relative paths (`~/codebuddy/cheshire/`) — they survive user switches.
- **Credential protection**: Hermes gateway locks `.env` and `config.yaml` at runtime. Use `terminal` to bypass write_file/patch restrictions, or stop the gateway before editing.
- **Config file read-before-patch**: When a config.yaml is protected by the gateway, `patch` may fail with "last read with offset/limit pagination". **Always read the full file first** (`read_file` with no offset/limit, or `cat` via terminal) before attempting `patch`. Alternatively use `sed -i` via terminal.
- **Multi-profile sync**: New tools with API keys need env vars in ALL active profile `.env` files.
- **Gateway restart required**: New tools, providers, and env vars take effect only after gateway restart (`launchctl kickstart` or `/restart` in chat).
- **Registry discovery**: Tools are auto-discovered from `tools/*.py` via `registry.register()` calls. Must be in `_HERMES_CORE_TOOLS` list.
- **Handler return type**: All tool handlers must return JSON strings, not dicts.

## 2026-06-17: Local Model Profile Setup (Holo-Local)

**场景**: 用户在 Mac 上跑了本地 llama-server（Holo-3.1-4B），想让 Telegram bot 也能跟它对话。

**标准流程**：
1. 确认 llama-server 在跑：`curl http://127.0.0.1:8080/v1/chat/completions -d '{"model":"xxx","messages":[{"role":"user","content":"hi"}]}'`
2. 给 holo-local profile 加 Telegram bot token + 绑定 bot
3. 重启 gateway

**注意**：holo-local profile 不会自动出现在 Telegram gateway 的 bot 列表中，需要手动添加。

**参考**：`references/holo-local-setup.md`

