← Back to blog

Hermes Agent's /learn command turns any source material into a reusable skill

hermesskillsslash-commandsagent-designopen-ended
Hermes Agent's /learn command turns any source material into a reusable skill

Nous Research announced the /learn slash command for Hermes Agent on June 23, 2026. The original post hit 4,162 likes, 356 retweets, 2137 bookmarks, and 745,970 impressions. The merged PR #51506 (by @teknium1, merged 2026-06-23T20:51:29Z) is 11 files, +404/-1 lines.

The interesting design choice is what is missing. There is no new ingestion engine.

The design problem

Skills in Hermes are reusable SKILL.md files authored to a house standard (description under 60 chars, an eight-section body order, Hermes-tool framing, scripts in scripts/). A prior attempt (PR #47234, superseded) built a directory-only distillation engine plus a dashboard endpoint. Per the PR description, that was dropped in favor of an open-ended, engine-free design: making /learn open-ended means directories, URLs, conversations, and pasted text all flow through the agent's existing tools with zero new surface.

The author cites OpenAI Codex's "Record & Replay" pattern as inspiration. The agent's own session is the demonstration.

How /learn works

/learn accepts four kinds of input and routes them all to the same prompt:

  • A directory path: agent calls read_file and search_files
  • A URL: agent calls web_extract
  • "What I just did" (after a workflow): agent reads the current conversation
  • Pasted text: the agent treats it as-is

The new module agent/learn_prompt.py (109 lines) holds the shared prompt builder. Every surface (CLI, gateway, TUI, dashboard, desktop) calls build_learn_prompt(user_request) and feeds the result to the agent as a normal turn. The agent gathers the sources with tools it already has, then authors a single SKILL.md via skill_manage(action="create").

If the user runs /learn with no argument, the prompt falls back to:

the workflow we just went through in this conversation - review the steps taken and distill them into a reusable skill

File-level breakdown

File + -
agent/learn_prompt.py (new) 109 0
tests/agent/test_learn_prompt.py (new) 73 0
web/src/pages/SkillsPage.tsx 98 0
website/docs/user-guide/features/skills.md 36 0
gateway/run.py 28 0
hermes_cli/cli_commands_mixin.py 26 0
web/src/pages/ChatPage.tsx 19 0
tui_gateway/server.py 9 0
hermes_cli/commands.py 2 0
cli.py 2 0
website/docs/reference/slash-commands.md 2 1
Total (11 files) 404 1

The core prompt logic is one file. The remaining 295 lines are plumbing: registry entries in two surfaces, gateway rewrite, TUI command.dispatch directive, a dashboard panel, and a one-shot ?learn= URL handler that types the command into the PTY composer when the chat boots.

The authoring standards embedded in the prompt

The prompt that /learn injects carries a _AUTHORING_STANDARDS block distilled from AGENTS.md's "Skill authoring standards (HARDLINE)" section. The constraints fall into four groups:

  • Frontmatter: name (lowercase-hyphenated, 64 chars max), description (one sentence, 60 chars max, period-terminated, no marketing words, no name repetition, wrap in quotes if it contains a colon), version 0.1.0, metadata.hermes.tags as a few Capitalized Relevant Tags.
  • Body order: eight sections in fixed sequence (intro, When to Use, Prerequisites, How to Run, Quick Reference, Procedure, Pitfalls, Verification). A section is omitted only if it has no content.
  • Hermes-tool framing: scripts are framed as "invoke through the terminal tool." read_file replaces cat, search_files replaces grep/find/ls, patch replaces sed/awk, web_extract replaces curl scraping, vision_analyze for images. These are referenced by name in backticks.
  • Quality bar: prefer exact commands, endpoint URLs, and function signatures verbatim from the source. Never invent flags. Target 100 lines for a simple skill, 200 for a complex one. No router/index/hub skills that only point at other skills. Larger scripts go in scripts/ and are referenced by relative path.

The point of embedding these in the prompt rather than enforcing them in code is that skill_manage already exists. The new code only describes the standard; the existing tool enforces the write.

Validation

The PR ships 11 new tests in tests/agent/test_learn_prompt.py, all green. The existing test suite stays clean: 156/156 in tests/hermes_cli/test_commands.py and 4/4 in tests/gateway/test_gateway_command_help.py. End-to-end checks confirm the prompt embeds the request plus standards plus the skill_manage call, empty input falls back to the conversation, the registry resolves /learn on both surfaces and in autocomplete, and command.dispatch yields the send directive. py_compile and ruff check pass on the six touched Python files; tsc --noEmit is clean for the web changes.

Why this design is interesting

The previous attempt (PR #47234, superseded) was a directory-only distillation engine with a dashboard endpoint. The new design drops the engine entirely. There is no host-side ingestion step, no new model-tool footprint, and no local-versus-remote branching. It works identically on local, Docker, and remote terminal backends because there is nothing to deploy except a 109-line prompt builder.

The four input types (directory, URL, conversation, pasted text) all collapse to one prompt that points the agent at its existing toolset. The authoring standards live in the prompt, not the code, because the live model is the only thing that can read a directory, a URL, and a conversation and decide what kind of skill to write.

[^1]: Nous Research. "Hermes Agent can now /learn from anything..." X. June 23, 2026. [^2]: @teknium1. "feat(skills): /learn - distill a reusable skill from anything you describe (PR #51506)" NousResearch/hermes-agent. Merged 2026-06-23T20:51:29Z. [^3]: NousResearch. "agent/learn_prompt.py" hermes-agent main branch.

Termagotchi
_

Ryan Underdown

Autodidact. Rarely listens to advice.

Follow on X @catamarammed or GitHub @underdown