agentleFS
ritengzhang77-maxritengzhang77-max/gavin_skill/skills/software-development/debugging-hermes-tui-commands/SKILL.md

debugging-hermes-tui-commands

Skill0 starsChanged 4 months agoMITView on GitHub

Debug Hermes TUI slash commands: Python, gateway, Ink UI.

6 other projects use a version of this, 6 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use popular-web-designs, sketch and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Tommy-ywSkill

    popular-web-designs

    54 production-quality design systems extracted from real websites. Load a template to generate HTML/CSS that matches the visual identity of sites like Stripe, Linear, Vercel, Notion, Airbnb, and more. Each template includes colors, typography, components, layout rules, and ready-to-use CSS values.

    Also in 3 projects that use this

  • seikaikyoSkill

    sketch

    拋棄式 HTML mockup 比稿:產出 2 到 3 個設計立場不同的變體(密度 / 版式 / 強調軸,不是換色),各附取捨說明,最後給有立場的對比結論。適用:「畫個草圖」「比較 A 版 B 版」「先看方向再做」「給我看幾種做法」。要 production 元件或設計已定案時不適用。

    Also in 3 projects that use this

  • seedprodSkill

    himalaya

    CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).

    Also in 3 projects that use this

  • HyaxiaSkill

    blogwatcher

    Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

    Also in 3 projects that use this

  • lookfreeSkill

    excalidraw

    Generate architecture diagrams as .excalidraw files from codebase analysis. Use when the user asks to create architecture diagrams, system diagrams, visualize codebase structure, or generate excalidraw files.

    Also in 3 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 4 are common, 0 are distinctive, and 8 are very specific to this project.

  • 4

    Common

    Most of the 6 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Use this skill when you encounter issues with slash commands in the Hermes TUI, particularly when commands aren't showing in autocomplete, …

    line 20
  2. Common:

    If a command exists in the TUI but doesn't show in autocomplete:

    line 72
  3. Very specific:

    Add a CommandDef entry to COMMAND_REGISTRY in hermes_cli/commands.py:

    line 74
  4. Very specific:

    Ensure subcommands matches the expected tab-completion options shown by the TUI.

    line 88
  5. Very specific:

    If the command runs server-side, add a handler in HermesCLI.process_command() in cli.py:

    line 90
  6. Common:

    When surface-level inspection doesn't reveal the bug:

    line 116
  7. Very specific:

    Python side hangs or misbehaves: use the python-debugpy skill to break inside _SlashWorker.exec or the command handler.

    line 118
  8. Very specific:

    Ink side not reacting: use the node-inspect-debugger skill to break in app.tsx's slash dispatch or the local command branch.

    line 119
  9. Very specific:

    Don't forget to set the appropriate category for the command in CommandDef (e.g., "Session", "Configuration", "Tools & Skills", "Info", …

    line 124
  10. Very specific:

    Make sure any aliases are properly registered in the aliases tuple — no other file changes are needed, everything downstream (Telegram …

    line 125
  11. Common:

    Run the TUI and test the command:

    line 140
  12. Very specific:

    If the command is also gateway-available, test it from at least one messaging platform (or run the gateway tests: scripts/run_tests.sh …

    line 152

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debugging Hermes TUI Slash Commands

Overview

Hermes slash commands span three layers — Python command registry, tui_gateway JSON-RPC bridge, and the Ink/TypeScript frontend. When a command misbehaves (missing from autocomplete, works in CLI but not TUI, config persists but UI doesn't update), the bug is almost always one layer being out of sync with another.

Use this skill when you encounter issues with slash commands in the Hermes TUI, particularly when commands aren't showing in autocomplete, aren't working properly in the TUI, or need to be added/updated.

When to Use

  • A slash command exists in one part of the codebase but doesn't work fully
  • A command needs to be added to both backend and frontend
  • Command autocomplete isn't working for specific commands
  • Command behavior is inconsistent between CLI and TUI
  • A command persists config but doesn't apply live in the TUI

Architecture Overview

Python backend (hermes_cli/commands.py)     <- canonical COMMAND_REGISTRY
       │
       ▼
TUI gateway (tui_gateway/server.py)         <- slash.exec / command.dispatch
       │
       ▼
TUI frontend (ui-tui/src/app/slash/)        <- local handlers + fallthrough

Command definitions must be registered consistently across Python and TypeScript to work properly. The Python COMMAND_REGISTRY is the source of truth for: CLI dispatch, gateway help, Telegram BotCommand menu, Slack subcommand map, and autocomplete data shipped to Ink.

Investigation Steps

  1. Check if the command exists in the TUI frontend:
    search_files --pattern "/commandname" --file_glob "*.ts" --path ui-tui/
    search_files --pattern "/commandname" --file_glob "*.tsx" --path ui-tui/
  2. Examine the TUI command definition:
    read_file ui-tui/src/app/slash/commands/core.ts
    # If not there:
    search_files --pattern "commandname" --path ui-tui/src/app/slash/commands --target files
  3. Check if the command exists in the Python backend:
    search_files --pattern "CommandDef" --file_glob "*.py" --path hermes_cli/
    search_files --pattern "commandname" --path hermes_cli/commands.py --context 3
  4. Examine the gateway implementation:
    search_files --pattern "complete.slash|slash.exec" --path tui_gateway/

Fix: Missing Command Autocomplete

If a command exists in the TUI but doesn't show in autocomplete:

  1. Add a CommandDef entry to COMMAND_REGISTRY in hermes_cli/commands.py:
    CommandDef("commandname", "Description of the command", "Session",
               cli_only=True, aliases=("alias",),
               args_hint="[arg1|arg2|arg3]",
               subcommands=("arg1", "arg2", "arg3")),
  2. Pick cli_only vs gateway availability carefully:
    • cli_only=True — only in the interactive CLI/TUI
    • gateway_only=True — only in messaging platforms
    • neither — available everywhere
    • gateway_config_gate="display.foo" — config-gated availability in the gateway
  3. Ensure subcommands matches the expected tab-completion options shown by the TUI.
  4. If the command runs server-side, add a handler in HermesCLI.process_command() in cli.py:
    elif canonical == "commandname":
        self._handle_commandname(cmd_original)
  5. For gateway-available commands, add a handler in gateway/run.py:
    if canonical == "commandname":
        return await self._handle_commandname(event)

Common Issues

  1. Command shows in TUI but not in autocomplete. The command is defined in the TUI codebase but missing from COMMAND_REGISTRY in hermes_cli/commands.py. Autocomplete data ships from Python.
  2. Command shows in autocomplete but doesn't work. Check the command handler in tui_gateway/server.py and the frontend handler in ui-tui/src/app/createSlashHandler.ts. If the command is local-only in Ink, it must be handled in app.tsx built-in branch; otherwise it falls through to slash.exec and must have a Python handler.
  3. Command behavior differs between CLI and TUI. The command might have different implementations. Check both cli.py::process_command and the TUI's local handler. Local TUI handlers take precedence over gateway dispatch.
  4. Command persists config but doesn't apply live. For TUI-local commands, updating config.set is not enough. Also patch the relevant nanostore state immediately (usually patchUiState(...)) and pass any new state through rendering components. Example: /details collapsed must update live detail visibility, not just save details_mode; in-session global /details <mode> may need a separate command-override flag so live commands can override built-in section defaults while startup/config sync preserves default-expanded thinking/tools behavior.
  5. Gateway dispatch silently ignores the command. The gateway only dispatches commands it knows about. Check GATEWAY_KNOWN_COMMANDS (derived from COMMAND_REGISTRY automatically) includes the canonical name. If the command is cli_only with a gateway_config_gate, verify the gated config value is truthy.

Debugging Tactics

When surface-level inspection doesn't reveal the bug:

  • Python side hangs or misbehaves: use the python-debugpy skill to break inside _SlashWorker.exec or the command handler. remote-pdb set at the handler entry is the fastest path.
  • Ink side not reacting: use the node-inspect-debugger skill to break in app.tsx's slash dispatch or the local command branch. sb('dist/app.js', <line>) after npm run build.
  • Registry mismatch / unclear which side is wrong: compare the canonical COMMAND_REGISTRY entry against the TUI's local command list side-by-side.

Pitfalls

  • Don't forget to set the appropriate category for the command in CommandDef (e.g., "Session", "Configuration", "Tools & Skills", "Info", "Exit")
  • Make sure any aliases are properly registered in the aliases tuple — no other file changes are needed, everything downstream (Telegram menu, Slack mapping, autocomplete, help) derives from it
  • For commands with subcommands, ensure the subcommands tuple in CommandDef matches what's in the TUI code
  • cli_only=True commands won't work in gateway/messaging platforms — unless you add a gateway_config_gate and the gate is truthy
  • After adding live UI state, search every consumer of the old prop/helper and thread the new state through all render paths, not just the active streaming path. TUI detail rendering has at least two important paths: live StreamingAssistant/ToolTrail and transcript/pending MessageLine rows. A /clean pass should explicitly check both.
  • Rebuild the TUI (npm --prefix ui-tui run build) before testing — tsx watch mode may lag on first launch

Verification

After fixing:

  1. Rebuild the TUI:
    cd /path/to/hermes-agent && npm --prefix ui-tui run build
  2. Run the TUI and test the command:
    hermes --tui
  3. Type / and verify the command appears in autocomplete suggestions with the expected description and args hint.
  4. Execute the command and confirm:
    • Expected behavior fires
    • Any persisted config updates correctly (read_file ~/.hermes/config.yaml)
    • Live UI state reflects the change immediately (not just after restart)
  5. If the command is also gateway-available, test it from at least one messaging platform (or run the gateway tests: scripts/run_tests.sh tests/gateway/).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.