feat: auto-discover project-local skills from working directory - #4668
Closed
leighton-tidwell wants to merge 1 commit into
Closed
feat: auto-discover project-local skills from working directory#4668leighton-tidwell wants to merge 1 commit into
leighton-tidwell wants to merge 1 commit into
Conversation
Implements NousResearch#4667: When working in a project that has skills in well-known directories, Hermes now auto-discovers them without any config needed. Discovery paths (checked in order from git root / cwd): 1. <project_root>/.hermes/skills/ — Hermes-native, project-scoped 2. <project_root>/.agents/skills/ — Agent-agnostic convention 3. <project_root>/.claude/skills/ — Interop with npx skills / Claude Code Key behaviors: - Zero config — just works when skill dirs exist in the project - Read-only — skill_manage still writes to ~/.hermes/skills/ - Precedence: local > project > external (first seen name wins) - Source tagging: skills_list() now includes a 'source' field ('local', 'project', or 'external') for each skill - Project skills appear as slash commands via scan_skill_commands() - skill_view() searches project dirs alongside local/external Changes: - agent/skill_utils.py: Add get_project_skills_dirs(), _find_project_root(), update get_all_skills_dirs() to include project dirs - tools/skills_tool.py: Update _find_all_skills() with source tagging and project dir scanning; update skill_view() to search project dirs - agent/skill_commands.py: Include project dirs in scan_skill_commands() - tests/agent/test_project_local_skills.py: 17 tests covering discovery, precedence, source tagging, skill_view, and slash commands Closes NousResearch#4667
Collaborator
Collaborator
Author
|
Closing in favor of #17328 implementation. I don't have the time to update this branch unfortunately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #4667: Auto-discover skills from the working directory (project root) at session start, enabling zero-config project-scoped skill loading.
Problem
When working in a project with skills installed via
npx skills experimental_install(or manually placed in.claude/skills/), those skills are only discoverable through the globalexternal_dirsconfig — which pollutes every other project's context. There's no project-scoped skill discovery.Solution
Auto-discover skills from well-known project directories, checked in order from the git root (or cwd if not in a repo):
<project_root>/.hermes/skills/— Hermes-native, project-scoped<project_root>/.agents/skills/— Agent-agnostic convention (forward-looking)<project_root>/.claude/skills/— Interop withnpx skills/ Claude Code / 41+ agentsKey behaviors
skill_managestill writes to~/.hermes/skills/skills_list()now includes asourcefield ("local","project", or"external") for each skillskill_view(), and show in the system prompt skill indexChanges
agent/skill_utils.pyget_project_skills_dirs(),_find_project_root(), updateget_all_skills_dirs()tools/skills_tool.py_find_all_skills()with source tagging + project dir scanning; updateskill_view()agent/skill_commands.pyscan_skill_commands()tests/agent/test_project_local_skills.pyTesting
Closes #4667