Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
feat(cli): install managed skills into Hermes' .hermes/skills family
AkitaOnRailsb1046ca83ef6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 11150555..7282ac8b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [Unreleased]### Added+- `install-skills --agent hermes` (and the `hermes` entry in+ `memory_install_self_routing`'s `target_hints`) installs the managed routing+ skills into Hermes Agent's `.hermes/skills` (project) or `~/.hermes/skills`+ (global) family, completing Hermes routing support alongside its lifecycle+ hooks (#933). (#942)- `docs/jev-reranker-adapter.md` gains a choice-contrastive variant of theJev reranker adapter(`docs/examples/jev-reranker-adapter/jev_rerank_shim_choice.py`): onediff --git a/crates/ai-memory-cli/src/cli.rs b/crates/ai-memory-cli/src/cli.rsindex cc9758cf..deeb8486 100644--- a/crates/ai-memory-cli/src/cli.rs+++ b/crates/ai-memory-cli/src/cli.rs@@ -1423,6 +1423,8 @@ pub enum InstallSkillsAgent {Devin,/// Grok Build CLI's `.grok/skills` directory.Grok,+ /// Hermes Agent's `.hermes/skills` directory.+ Hermes,/// Install into both Claude Code and `.agents` skill directories.Both,}diff --git a/crates/ai-memory-cli/src/commands/install_skills.rs b/crates/ai-memory-cli/src/commands/install_skills.rsindex 4a4ca260..d3a7a33a 100644--- a/crates/ai-memory-cli/src/commands/install_skills.rs+++ b/crates/ai-memory-cli/src/commands/install_skills.rs@@ -4,8 +4,8 @@ use std::fs;use std::path::{Path, PathBuf};use ai_memory_core::routing_skills::{- AGENTS_SKILL_DIR, CLAUDE_SKILL_DIR, DEVIN_SKILL_DIR, GROK_SKILL_DIR, MANAGED_MARKER,- MANAGED_SKILLS, ManagedSkill, SKILLS_DIR,+ AGENTS_SKILL_DIR, CLAUDE_SKILL_DIR, DEVIN_SKILL_DIR, GROK_SKILL_DIR, HERMES_SKILL_DIR,+ MANAGED_MARKER, MANAGED_SKILLS, ManagedSkill, SKILLS_DIR,};use anyhow::{Context, Result, bail};@@ -176,6 +176,18 @@ fn resolve_target_roots_for_platform(platform,)?]}+ InstallSkillsAgent::Hermes => {+ vec![agent_root(+ args.scope,+ SkillRootKind::Hermes,+ cwd,+ home,+ appdata,+ grok_home,+ claude_config_dir,+ platform,+ )?]+ }InstallSkillsAgent::Both => vec![agent_root(args.scope,@@ -225,6 +237,7 @@ enum SkillRootKind {Agents,Devin,Grok,+ Hermes,}#[allow(clippy::too_many_arguments)]@@ -275,6 +288,7 @@ fn agent_root(SkillRootKind::Agents => AGENTS_SKILL_DIR,SkillRootKind::Devin => DEVIN_SKILL_DIR,SkillRootKind::Grok => GROK_SKILL_DIR,+ SkillRootKind::Hermes => HERMES_SKILL_DIR,};Ok(base.join(agent_dir).join(SKILLS_DIR))}@@ -420,6 +434,22 @@ mod tests {.unwrap();assert_eq!(root_names(&project_grok), ["/repo/.grok/skills"]);+ let project_hermes = resolve_target_roots(+ &args(InstallSkillsScope::Project, InstallSkillsAgent::Hermes),+ cwd,+ Some(home),+ )+ .unwrap();+ assert_eq!(root_names(&project_hermes), ["/repo/.hermes/skills"]);++ let global_hermes = resolve_target_roots(+ &args(InstallSkillsScope::Global, InstallSkillsAgent::Hermes),+ cwd,+ Some(home),+ )+ .unwrap();+ assert_eq!(root_names(&global_hermes), ["/home/alice/.hermes/skills"]);+let project_both = resolve_target_roots(&args(InstallSkillsScope::Project, InstallSkillsAgent::Both),cwd,diff --git a/crates/ai-memory-core/src/routing_skills.rs b/crates/ai-memory-core/src/routing_skills.rsindex 4138021f..f8bad2ba 100644--- a/crates/ai-memory-core/src/routing_skills.rs+++ b/crates/ai-memory-core/src/routing_skills.rs@@ -14,6 +14,8 @@ pub const AGENTS_SKILL_DIR: &str = ".agents";pub const DEVIN_SKILL_DIR: &str = ".devin";/// Grok Build CLI Agent Skill directory below a project or home root.pub const GROK_SKILL_DIR: &str = ".grok";+/// Hermes Agent Skill directory below a project or home root.+pub const HERMES_SKILL_DIR: &str = ".hermes";/// Leaf directory that contains individual Agent Skill directories.pub const SKILLS_DIR: &str = "skills";diff --git a/crates/ai-memory-mcp/src/server.rs b/crates/ai-memory-mcp/src/server.rsindex 746fc05c..ea89cf1e 100644--- a/crates/ai-memory-mcp/src/server.rs+++ b/crates/ai-memory-mcp/src/server.rs@@ -372,7 +372,7 @@ should be proposed from a completed session, or at explicit wrap-up \CLAUDE.md / AGENTS.md'. Returns the managed routing package: the \slim markered snippet (`markered_block`), filename hints, \`managed_skills` payloads, `target_hints` for `.claude/skills`, \- `.agents/skills`, `.devin/skills`, `.grok/skills`, and Devin's Windows global \+ `.agents/skills`, `.devin/skills`, `.grok/skills`, `.hermes/skills`, and Devin's Windows global \`%APPDATA%\\devin\\skills` root, and overwrite guidance. Use your own Write/Edit \tool to replace only the ai-memory marker block in the rules file, \then write each managed skill under the selected skill root. Only \@@ -5199,7 +5199,7 @@ impl AiMemoryServer {`agent_filenames` for rules-file targets, `managed_skills` for \Agent Skill files, and `target_hints` for project/global \`.claude/skills`, `.agents/skills`, `.devin/skills`, `.grok/skills`, \- `$GROK_HOME/skills` (default `~/.grok/skills`), and Devin Windows global roots. \+ `.hermes/skills`, `$GROK_HOME/skills` (default `~/.grok/skills`), and Devin Windows global roots. \Use when the user asks to install or refresh ai-memory routing in this project. \Pass `compact: true` to return the compact routing block that delegates \to installed Agent Skills, or when refreshing a file that already uses the compact snippet. \@@ -5260,7 +5260,8 @@ impl AiMemoryServer {"claude_code": ".claude/skills","agents": ".agents/skills","devin": ".devin/skills",- "grok": ".grok/skills"+ "grok": ".grok/skills",+ "hermes": ".hermes/skills"},"global": {"claude_code": "~/.claude/skills",@@ -5269,7 +5270,8 @@ impl AiMemoryServer {"windows": "%APPDATA%\\devin\\skills","non_windows": "~/.devin/skills"},- "grok": "$GROK_HOME/skills (default: ~/.grok/skills)"+ "grok": "$GROK_HOME/skills (default: ~/.grok/skills)",+ "hermes": "~/.hermes/skills"}},"overwrite_guidance": {@@ -7599,6 +7601,18 @@ mod tests {.unwrap(),".grok/skills");+ assert_eq!(+ response["target_hints"]["project"]["hermes"]+ .as_str()+ .unwrap(),+ ".hermes/skills"+ );+ assert_eq!(+ response["target_hints"]["global"]["hermes"]+ .as_str()+ .unwrap(),+ "~/.hermes/skills"+ );assert_eq!(response["target_hints"]["global"]["claude_code"].as_str()diff --git a/docs/usage.md b/docs/usage.mdindex 2463f5be..6abf5a90 100644--- a/docs/usage.md+++ b/docs/usage.md@@ -234,7 +234,8 @@ exists, both when both exist, or creates `CLAUDE.md` when neither exists. Useinstruction target unless you override it: `CLAUDE.md` implies`.claude/skills`, `AGENTS.md` implies `.agents/skills`, and both files implyboth skill roots. For Grok Build CLI, select `--skills-agent grok` so skills-install under its `.grok/skills` root.+install under its `.grok/skills` root; for Hermes Agent, `--skills-agent hermes`+installs under `.hermes/skills` (project) or `~/.hermes/skills` (global).When a project keeps `AGENTS.md` as its canonical instruction file, give it a`CLAUDE.md` whose first line is a bare `@AGENTS.md` import. Claude Code loads@@ -252,6 +253,7 @@ ai-memory install-skillsai-memory install-skills --scope global --agent agentsai-memory install-skills --scope global --agent devinai-memory install-skills --scope global --agent grok+ai-memory install-skills --scope global --agent hermesai-memory install-skills --agent both --printai-memory install-skills --target-dir .custom/skills --force```