Skip to content

fix(skills): resolve skills.create_dir in skill_view, skills_list and slash commands - #108160

Closed
neo-wanderer wants to merge 1 commit into
NousResearch:mainfrom
neo-wanderer:fix/skill-view-create-dir
Closed

neo-wanderer wants to merge 1 commit into
NousResearch:mainfrom
neo-wanderer:fix/skill-view-create-dir

Conversation

@neo-wanderer

@neo-wanderer neo-wanderer commented Sep 11, 2026 •

Copy link
Copy Markdown

What does this PR do?

Skills in skills.create_dir (#100377) show up in the system-prompt skill index, because build_skills_system_prompt uses get_all_skills_dirs()[1:]. But skill_view returns "not found" for them, skills_list leaves them out, and they get no /slash command or Telegram/Discord menu entry. Those read paths each build their directory list by hand as local + get_external_skills_dirs(), which skips create_dir.

This PR moves those call sites to get_all_skills_dirs()[1:], the form prompt_builder and skill_usage already use. Every discovery surface then scans the same directories the index advertises.

get_all_skills_dirs() already removes duplicates between create_dir and external_dirs, and _collect_skill_candidates removes duplicates by resolved path. So a directory listed under both keys stays unambiguous, and a regression test covers that.

Related Issue

Fixes #108157

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • tools/skills_tool.py: _skill_search_dirs (backs skill_view + skills_list) and _get_category_from_path (so create_dir skills get their category in skills_list)
  • agent/skill_commands.py: scan_skill_commands, so /skill-name registers for create_dir skills; the precedence comment now reads project > local > create_dir > external
  • hermes_cli/commands_platforms.py: _iter_gateway_skills roots (Telegram menu, Discord /skill groups, inline picker)
  • tests/tools/test_skill_create_dir.py: new TestReadPathDiscovery class with 6 tests: skill_view, skill_manage create → skill_view end to end, skills_list with category, create_dir also listed in external_dirs (no ambiguity), slash-command registration, and the gateway menu

Deliberately not touched:

This PR shares no files with the open #108040.

How to Test

  1. Show the bug on origin/main with the new tests only: scripts/run_tests.sh tests/tools/test_skill_create_dir.py -q -k TestReadPathDiscovery gives 5 failed, 1 passed. The one that passes is the dedup guard, which holds both before and after the fix. Each failure is the reported symptom, e.g. {'success': False, 'error': "Skill 'brain-skill' not found.", ...}.
  2. With this patch, scripts/run_tests.sh tests/tools/test_skill_create_dir.py -q gives 22 passed.
  3. Neighbouring suites all pass: 386 passed across test_skill_create_dir, test_skill_commands, test_commands, test_discord_skill_clamp_warning, test_skills_tool, test_skill_utils, test_external_skills, test_project_skills, test_prompt_builder, test_skill_manager_tool, test_skill_usage and test_web_server_skills_profiles. The gateway consumers also pass: 53 passed across test_telegram_inline_picker, test_discord_slash_commands, test_reload_skills_discord_resync, test_telegram_forum_commands and test_discord_slash_auth.
  4. Run the standalone repro from skills.create_dir skills are advertised in the prompt but skill_view / skills_list / slash commands can't find them #108157 on a fresh synthetic HERMES_HOME:
# origin/main
in prompt index     : True
skills_list names   : []
skill_view          : Skill 'demo-skill' not found.

# this branch
in prompt index     : True
skills_list names   : ['demo-skill']
skill_view          : ok
  1. Full suite (scripts/run_tests.sh, Linux, Python 3.12, .[dev] extras only): 4033 files, 48,349 passed, 151 failed, 441 skipped. None of the failures come from this PR. I re-ran every failing file on unpatched origin/main and compared test IDs, and no test fails on this branch that doesn't also fail on main. main fails 169 IDs to this branch's 167. The two extra ones are a flaky subagent-handoff test and an FTS5 test in a file that timed out here under full parallel load. The failures come from missing optional extras (ACP, platform SDKs), provider/credential tests, gateway adapters and wisdom setup; none of them touch skills. Two files did not run in the full pass because of per-file timeouts, tests/test_hermes_state.py and tests/wisdom/test_installed_setup.py. Run on their own, both give identical results on this branch and on main.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run the full suite: it introduces no new failures, and every failure on this runner also happens on unpatched origin/main (see How to Test §5)
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Ubuntu (Linux 6.8), Python 3.12.3

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — docstrings/comments only
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — N/A, no new path handling (the same get_all_skills_dirs() values already used by the prompt builder)
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

🤖 Generated with Claude Code

https://claude.ai/code/session_015jsCfn6VnuphwzZTrqcfwM

… slash commands

The system-prompt skill index is built from get_all_skills_dirs(), which
folds skills.create_dir in after the local dir. The read paths that then
resolve an advertised name each hand-assembled their own list as
local + get_external_skills_dirs() and never saw create_dir. A skill the
agent created there (or an operator placed there) was listed in the
prompt, but skill_view returned "not found", skills_list omitted it, and
no /slash command or gateway menu entry was registered for it.

Switch those call sites to get_all_skills_dirs()[1:] - the form
prompt_builder and skill_usage already use - so every discovery surface
scans the same dirs the index advertises:

- tools/skills_tool.py: _skill_search_dirs (skill_view, skills_list)
  and _get_category_from_path
- agent/skill_commands.py: scan_skill_commands
- hermes_cli/commands_platforms.py: _iter_gateway_skills

get_all_skills_dirs() already dedups create_dir against external_dirs and
_collect_skill_candidates dedups by resolved path, so listing one
directory under both keys stays unambiguous (covered by a test).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015jsCfn6VnuphwzZTrqcfwM
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard labels Sep 11, 2026
@neo-wanderer

Copy link
Copy Markdown
Author

Closing — this is fixed on main by #132464, which landed the same behaviour through the shared skill catalog rather than this patch's get_all_skills_dirs()[1:] switch:

  • f525ecd (skill_view applies cross-directory precedence) — skill_view and skills_list now resolve skills in skills.create_dir.
  • 340be37 (slash commands register only names that resolve uniquely) — /<skill> commands are now built from the same catalog, so create_dir skills get one.

Verified with the repro from #108157 (plus a hand-placed create_dir skill in a category subdirectory): every check fails on the parent of f525ecd, skill_view/skills_list pass from f525ecd, and slash commands pass from 340be37 onward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skills.create_dir skills are advertised in the prompt but skill_view / skills_list / slash commands can't find them

2 participants