fix(skills): skill_manage create respects skills.external_dirs - #22236
Closed
wesleysimplicio wants to merge 1 commit into
Closed
fix(skills): skill_manage create respects skills.external_dirs#22236wesleysimplicio wants to merge 1 commit into
wesleysimplicio wants to merge 1 commit into
Conversation
Closes NousResearch#21810 skill_manage(action='create') previously hardcoded SKILLS_DIR (~/.hermes/skills/), dropping new skills into the user-local store even when an external dir was configured as the canonical authoring location. Add _default_creation_dir() helper that prefers the first entry of skills.external_dirs when configured, falling back to SKILLS_DIR. Route _resolve_skill_dir through it, and compute the result 'path' relative to the actual containing root (not always SKILLS_DIR).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes skill_manage(action="create") so newly created skills are written to the configured authoring location when skills.external_dirs is set, aligning create behavior with existing read/lookup behavior that already honors external skill roots.
Changes:
- Add
_default_creation_dir()to prefer the first validatedskills.external_dirsentry (fallback: localSKILLS_DIR). - Route
_resolve_skill_dir()through_default_creation_dir()so creates land under the correct root (including category nesting). - Make
_create_skillreturn apathrelative to the actual containing skills root (instead of alwaysSKILLS_DIR), preventingValueErrorfor external-root creates.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/skill_manager_tool.py | Default create destination now respects skills.external_dirs, and returned path is relativized to the real containing skills root. |
| tests/tools/test_skill_manager_tool.py | Adds unit tests ensuring create targets the first external dir when configured and preserves category-relative paths. |
| .gitignore | Ignores .claude/scheduled_tasks.lock. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
13 tasks
This was referenced May 27, 2026
Contributor
Author
|
Closing — competing PR already merged or cleaner alternative exists. |
This was referenced Jul 31, 2026
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.
What does this PR do?
Closes #21810.
Root cause
The detailed rationale from the original PR body is preserved below. This template update keeps the review structure consistent with #29640.
Fix
_default_creation_dir()returns the first entry ofskills.external_dirswhen configured, falling back toSKILLS_DIR._resolve_skill_dir(name, category)now routes through_default_creation_dir()instead of hardcodingSKILLS_DIR._create_skillcomputes the returnedpathrelative to the actual containing root (via the existing_containing_skills_roothelper) instead of always relativizing toSKILLS_DIR, which would have raisedValueErroronce the skill landed outside of it.Public API of
_resolve_skill_diris unchanged.Why this shape
This shape mirrors #29640 so reviewers can quickly compare scope, root cause, fix, tests, and related context without having to decode a custom PR description.
Tests
Original body
Related PRs / issues
Original body
Summary
Closes #21810.
What Changed
Fluxo
A mudança continua seguindo o fluxo original descrito na seção preservada abaixo, sem ampliar o escopo funcional deste PR.
Visão
A padronização melhora a revisão, reduz ruído e evita deriva de formatação entre PRs abertos.
Test Plan
Original body
Summary
Closes #21810.
skill_manage(action='create')previously hardcodedSKILLS_DIR(~/.hermes/skills/), dropping new skills into the user-local store even whenskills.external_dirswas configured as the canonical authoring location (e.g. a checked-out skills monorepo). Other reads (_find_skill, etc.) already honor external dirs via_containing_skills_root/get_all_skills_dirs, so creates were the odd one out.Changes
_default_creation_dir()returns the first entry ofskills.external_dirswhen configured, falling back toSKILLS_DIR._resolve_skill_dir(name, category)now routes through_default_creation_dir()instead of hardcodingSKILLS_DIR._create_skillcomputes the returnedpathrelative to the actual containing root (via the existing_containing_skills_roothelper) instead of always relativizing toSKILLS_DIR, which would have raisedValueErroronce the skill landed outside of it.Public API of
_resolve_skill_diris unchanged.Test plan
TestCreateSkillRespectsExternalDirsclass with 4 cases:SKILLS_DIR(regression guard, unchanged behavior)category=→ category nesting still applies under external root, returnedpathis relativetests/tools/test_skill_manager_tool.pytests still pass.skill_manager_tool(test_registry,test_skill_improvements,test_skill_size_limits,test_skill_manager_tool) still pass.Generated by Hermes Turbo
Generated by Hermes Turbo