Skip to content

feat(skills): support external skill directories via config#3678

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-ea354159
Mar 29, 2026
Merged

feat(skills): support external skill directories via config#3678
teknium1 merged 1 commit intomainfrom
hermes/hermes-ea354159

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

What this PR does

Adds a skills.external_dirs config option that lets users point Hermes at additional skill directories outside ~/.hermes/skills/. Skills in external dirs are discovered alongside local skills — they show up in the system prompt index, skills_list, skill_view, and /skill slash commands.

Requested by community member primco who maintains a shared ~/.agents/skills/ directory across multiple AI tools and didn't want skills locked into Hermes.

Config

skills:
  external_dirs:
    - ~/.agents/skills
    - /home/shared/team-skills

Paths support ~ expansion and ${VAR} substitution (existing config feature). Non-existent dirs are silently skipped.

Design decisions

  • Read-only: External dirs are only scanned for discovery. skill_manage (create/edit/delete) always writes to ~/.hermes/skills/
  • Local precedence: If the same skill name exists in both local and external dirs, local wins (first match by name)
  • Security: Configured external dirs are recognized as trusted in the security check (no warning). Only skills from truly unknown paths trigger the warning
  • Snapshot cache: The disk snapshot covers only the local dir (unchanged). External dirs are scanned directly on cache miss. The in-process LRU cache covers everything

Files changed (7 files, +446/-93)

File Change
agent/skill_utils.py get_external_skills_dirs() and get_all_skills_dirs() helpers
agent/prompt_builder.py Scan external dirs in build_skills_system_prompt()
tools/skills_tool.py _find_all_skills(), skill_view(), security check updated
agent/skill_commands.py /skill slash commands discover external skills
hermes_cli/config.py skills.external_dirs in DEFAULT_CONFIG
cli-config.yaml.example Document the option
tests/agent/test_external_skills.py 11 new tests

Tests

  • 11 new tests covering: config parsing, path validation, dedup, local precedence, skill_view resolution
  • 590 existing tests pass (1 pre-existing failure unrelated to this change)
@github-actions
Copy link
Copy Markdown

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

Add skills.external_dirs config option — a list of additional directories
to scan for skills alongside ~/.hermes/skills/. External dirs are read-only:
skill creation/editing always writes to the local dir. Local skills take
precedence when names collide.

This lets users share skills across tools/agents without copying them into
Hermes's own directory (e.g. ~/.agents/skills, /shared/team-skills).

Changes:
- agent/skill_utils.py: add get_external_skills_dirs() and get_all_skills_dirs()
- agent/prompt_builder.py: scan external dirs in build_skills_system_prompt()
- tools/skills_tool.py: _find_all_skills() and skill_view() search external dirs;
  security check recognizes configured external dirs as trusted
- agent/skill_commands.py: /skill slash commands discover external skills
- hermes_cli/config.py: add skills.external_dirs to DEFAULT_CONFIG
- cli-config.yaml.example: document the option
- tests/agent/test_external_skills.py: 11 tests covering discovery, precedence,
  deduplication, and skill_view for external skills

Requested by community member primco.
@teknium1 teknium1 force-pushed the hermes/hermes-ea354159 branch from db346b4 to e18a2cd Compare March 29, 2026 07:18
@github-actions
Copy link
Copy Markdown

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1 teknium1 merged commit fcd1645 into main Mar 29, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant