hermes - 💡(How to fix) Fix feat: fuzzy substring matching for /skill autocomplete [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

# hermes_cli/commands.py, get_completions() ~line 1655
if cmd_name.startswith(word):  # ← pure prefix match

---

# First pass: prefix matches (existing behavior, keep priority)
prefix_matches = []
substring_matches = []

for cmd, info in self._iter_skill_commands().items():
    cmd_name = cmd[1:]
    if cmd_name.startswith(word):
        prefix_matches.append((cmd, info))
    elif word in cmd_name:  # substring fallback
        substring_matches.append((cmd, info))

for cmd, info in prefix_matches + substring_matches:
    # yield completions...
RAW_BUFFERClick to expand / collapse

Problem

The /skill slash command autocomplete only matches by prefix (startswith). This means typing /skill pdf will NOT match nano-pdf, /skill xlsx will NOT match docx, etc.

# hermes_cli/commands.py, get_completions() ~line 1655
if cmd_name.startswith(word):  # ← pure prefix match

This is frustrating when you remember what a skill does but not its exact name prefix. The @ file completion already has fuzzy matching (_fuzzy_file_completions), so the pattern exists in the codebase.

Proposed Fix

Add substring matching as a fallback when no prefix matches are found:

# First pass: prefix matches (existing behavior, keep priority)
prefix_matches = []
substring_matches = []

for cmd, info in self._iter_skill_commands().items():
    cmd_name = cmd[1:]
    if cmd_name.startswith(word):
        prefix_matches.append((cmd, info))
    elif word in cmd_name:  # substring fallback
        substring_matches.append((cmd, info))

for cmd, info in prefix_matches + substring_matches:
    # yield completions...

Same pattern should apply to skill bundles and plugin commands.

Example

User typesCurrentExpected
/skill pdfno matchnano-pdf
/skill ocrno matchocr-and-documents
/skill xlsxno matchxlsx
/skill docdocxdocx

Environment

  • Hermes Agent: latest (main branch)
  • CLI autocomplete via prompt_toolkit

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING