svelte-hotkeys
Skill by TanStack
Adds keyboard shortcut handling to Svelte 5 apps with @tanstack/svelte-hotkeys. It covers hotkeys on the document or an element, scopes, app hotkeys, recorders, and held-key and hint getters.
Install svelte-hotkeys
Built from the published package, never by AI.
git clone --depth 1 https://github.com/TanStack/hotkeys /tmp/hotkeys && mkdir -p ~/.claude/skills && cp -r /tmp/hotkeys/packages/svelte-hotkeys/skills/svelte-hotkeys ~/.claude/skills/svelte-hotkeysRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/TanStack/hotkeys /tmp/hotkeys && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/hotkeys/packages/svelte-hotkeys/skills/svelte-hotkeys ~/.gemini/antigravity-cli/skills/svelte-hotkeysAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides an AI assistant through adding or fixing keyboard shortcuts in a Svelte 5 app that uses @tanstack/svelte-hotkeys. It describes functions such as createHotkey, createHotkeys, and createHotkeyAttachment, which register shortcuts while a component is mounted. It also covers HotkeysProvider and setHotkeysContext for default options and scopes, and getters for app hotkeys, recorders, held keys, and hint visibility.
The skill lists Svelte-specific mistakes to avoid. Options such as enabled should be passed as getters so they follow state. Returned objects should not be destructured, because that copies the value once. It also explains how to format labels in server-rendered apps. It is aimed at Svelte developers who want to replace svelte:window keydown handlers with the TanStack library.
Written from the project's SKILL.md and checked against it.
What it can do
- createHotkeyRegisters one chord, sequence, or app hotkey on the document while the component is mounted.
- createHotkeysRegisters several hotkeys at once, or a getter of a list built from data.
- createHotkeyAttachmentCreates an attachment for {@attach} that listens for a hotkey on one element.
- HotkeysProviderSets default options, a scope such as exclusive for dialogs, enabled, and app hotkeys.
- createHotkeyRecorderRecords a chord or sequence the user presses, for a settings screen.
- getAppHotkeysReads the declared app hotkeys with the user's custom hotkeys applied.
- getHotkeyHintReports whether held modifiers should reveal a shortcut's hint.
- getHeldKeysReads every key that is held right now.
- getFormatForDisplayReturns formatForDisplay with the provider's platform set, for server-rendered labels.
What you need
- Svelte 5
- @tanstack/svelte-hotkeys package
- @tanstack/hotkeys#hotkeys-core skill loaded first
Try asking
- Add a Mod+S shortcut that saves only when the form is dirty.
- Replace my svelte:window keydown handler with a TanStack hotkey.
- Build a settings screen that records a new shortcut for the user.
Good to know
- The target option of createHotkey takes only document or window.
- Element hotkeys should use attachments instead.
- setHotkeysContext reads its options once, so changing enabled or exclusive needs a HotkeysProvider.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: packages/svelte-hotkeys/skills/svelte-hotkeys/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to svelte-hotkeys
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
svelte-hotkeys: common questions
Do I need a provider to use svelte-hotkeys?
No. The source says no provider is required, and the functions can be called at the top level of a component's script.
Why do my shortcut labels differ between server and browser?
On the server formatForDisplay cannot see the user's OS, so labels can change after hydration. The source suggests setting the provider's defaultOptions.platform from the User-Agent header and using getFormatForDisplay.
How do I make a hotkey follow a changing value?
Pass the options as a getter, such as () => ({ enabled: isDirty }). A plain object is read only once during initialization.
How do I install svelte-hotkeys?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is svelte-hotkeys free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is svelte-hotkeys safe to use?
It scores 75 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to svelte-hotkeys?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
