Add or edit LobeHub keyboard shortcuts. Use for HotkeyEnum, HOTKEYS_REGISTRATION, combineKeys, useHotkeyById, tooltip hotkeys, shortcut scope, conflicts, or Cmd/Ctrl key combos.
This skill is a repository-specific developer guide for adding or editing keyboard shortcuts in the LobeHub application. It solves the problem of hotkeys being wired through several coordinated files: without a clear recipe, a developer can easily register a shortcut that does not appear in settings, fails to trigger, or conflicts with system and browser shortcuts. The skill documents the exact sequence and file locations LobeHub uses so shortcuts are added consistently.
It walks through five steps with concrete TypeScript and TSX snippets: add the shortcut to the HotkeyEnum constant, register a default key combination in HOTKEYS_REGISTRATION using combineKeys with a group and scope, add i18n translations (title and description), create and register a hook with useHotkeyById wired to a store action, and optionally attach the hotkey to a Tooltip on a button. It also gives best practices (choosing global versus chat scope, grouping into System/Layout/Conversation, checking for conflicts, using the platform-agnostic Key.Mod instead of hardcoding Ctrl or Cmd, and writing clear descriptions) and a troubleshooting list for shortcuts that do not work, do not appear in settings, or conflict.
It targets contributors and maintainers working inside the LobeHub codebase who need to extend its keyboard-shortcut system. It is marked non-user-invocable and is essentially a code-convention reference tied to specific internal paths; it contains no shell execution, network calls, or risky behavior.
Adding or editing keyboard shortcuts in the LobeHub codebase, covering HotkeyEnum, HOTKEYS_REGISTRATION, combineKeys, useHotkeyById, tooltip hotkeys, scopes, and conflict handling.
Add it to the HotkeyEnum constant, register a default key combination in HOTKEYS_REGISTRATION with a group and scope, add i18n title and description translations, create and register a hook using useHotkeyById, and optionally attach it to a Tooltip.
Use Key.Mod instead of hardcoding Ctrl or Cmd so the combination maps correctly on macOS and other platforms, and check for conflicts with system and browser shortcuts.
Verify the scope and that the RegisterHotkeys hook is called, confirm the entry exists in HOTKEYS_REGISTRATION so it shows in settings, watch for conflicts flagged by the HotkeyInput component, and ensure the correct scope is activated for page-specific shortcuts.
No. It is specific to the LobeHub project's internal file layout and is marked non-user-invocable, serving as a contributor reference rather than an end-user tool.
Quick Setup:
.claude/skills/Repository
lobehub/lobehub