react-hotkeys-hook
AGENTS.md3.5k starsChanged 19 months agoMITView on GitHub
This file provides guidelines for agentic coding agents working in this repository. This repo is hosted on Github. Use the gh CLI to fetch issues, create PRs, etc.
Trending
Less talk lately.about the whole repository
Who's talking about JohannesKlauss/react-hotkeys-hook
- greena13/react-hotkeys“Plans for a useHotkeys hook?”GitHub · Jul 18, 2019 · 4 reactions
- signadot/browser-extension“Bump react-hotkeys-hook from 4.6.2 to 5.3.3”GitHub · Oct 16, 2026 · 1 reactions
- lrnselfreliance/wrolpi“Bump the npm-dependencies group across 1 directory with 9 updates”GitHub · May 16, 2026 · 1 reactions
- lrnselfreliance/wrolpi“Bump the npm-dependencies group in /app with 8 updates”GitHub · May 3, 2026 · 1 reactions
- dimagi/open-chat-studio“Bump react-hotkeys-hook from 5.1.0 to 5.2.1”GitHub · Dec 1, 2025 · 1 reactions
The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 52
Talked about on GitHub, Bluesky and Stack Overflow (52 times).
On GitHub · 50
- Jul 18, 2019Plans for a useHotkeys hook? — greena13/react-hotkeys4 reactions · 6 comments
- Oct 16, 2026Bump react-hotkeys-hook from 4.6.2 to 5.3.3 — signadot/browser-extension1 reaction
- May 16, 2026Bump the npm-dependencies group across 1 directory with 9 updates — lrnselfreliance/wrolpi1 reaction · 3 comments
- May 3, 2026Bump the npm-dependencies group in /app with 8 updates — lrnselfreliance/wrolpi1 reaction · 3 comments
- Dec 1, 2025Bump react-hotkeys-hook from 5.1.0 to 5.2.1 — dimagi/open-chat-studio1 reaction · 1 comment
45 more on GitHub
- Nov 10, 2023🐛 fix: hotkey disabled in form tags — lobehub/lobehub1 reaction · 4 comments
- Nov 7, 2026Update dependency react-hotkeys-hook to v5.3.3 — code0-tech/sculptor0 reactions · 1 comment
- Oct 9, 2026build(deps): bump react-hotkeys-hook from 5.2.4 to 5.3.3 in /frontend — Sfayson1/Luma0 reactions · 2 comments
- Oct 5, 2026chore(deps): bump react-hotkeys-hook from 3.4.6 to 5.3.3 — or-test-general/sentry0 reactions · 1 comment
- Oct 1, 2026build(deps): bump react-hotkeys-hook from 3.4.7 to 5.3.3 — Asvarox/allkaraoke0 reactions · 2 comments
- Aug 28, 2026chore(deps-dev): bump react-hotkeys-hook from 4.6.2 to 5.3.3 — LTY750/AIbox0 reactions
- Aug 27, 2026chore(deps): bump react-hotkeys-hook from 4.6.2 to 5.3.3 in /apps/web — campennydarden-cpu/documenso0 reactions · 1 comment
- Aug 16, 2026deps: bump react-hotkeys-hook from 5.2.4 to 5.3.3 — lw9335/AI-Wind-Comic0 reactions
- Aug 11, 2026chore(frontend): bump react-hotkeys-hook from 4.5.1 to 5.3.3 in /frontend — queentiffany1111-cloud/MerchFunds0 reactions · 1 comment
- Aug 3, 2026chore(deps): bump react-hotkeys-hook from 5.2.1 to 5.3.3 — Labrys-Group-IO/social0 reactions
- Jul 27, 2026Bump react-hotkeys-hook from 4.6.1 to 5.3.3 in /graylog2-web-interface — Graylog2/graylog2-server0 reactions
- Jul 23, 2026FE-39: Add keyboard shortcuts for power users — Chrisland58/SorobanPay0 reactions · 8 comments
- Jul 14, 2026Bump react-hotkeys-hook from 4.5.0 to 5.3.3 — Ellentat/chia-blockchain-gui--0220 reactions · 2 comments
- Jul 14, 2026Bump react-hotkeys-hook from 4.5.0 to 5.3.3 — hirayap/chia-blockchain-gui--0130 reactions · 2 comments
- Jul 14, 2026Bump react-hotkeys-hook from 4.5.0 to 5.3.3 — Jortegata/chia-blockchain-gui--0100 reactions · 2 comments
- Jul 13, 2026Bump react-hotkeys-hook from 4.5.0 to 5.3.3 — Camomtat/chia-blockchain-gui--0060 reactions · 2 comments
- Jul 4, 2026build(deps): bump react-hotkeys-hook from 5.3.2 to 5.3.3 — aniflix227/Koharu-Remote0 reactions · 1 comment
- Jul 3, 2026Bump react-hotkeys-hook from 5.3.2 to 5.3.3 — rubenvitt/bluelight-hub0 reactions · 2 comments
- Jul 3, 2026Bump react-hotkeys-hook from 4.6.2 to 5.3.3 in /qwerty-learner — Rosatus/qwerty-learner-desktop0 reactions
- Jun 29, 2026Bump react-hotkeys-hook from 5.2.4 to 5.3.3 — zxcvcvm/tersa0 reactions · 2 comments
- Jun 2, 2026chore(deps): bump react-hotkeys-hook from 5.2.4 to 5.3.2 — sonnv1912/sticky-clip0 reactions · 1 comment
- May 30, 2026chore(deps): bump react-hotkeys-hook from 5.2.4 to 5.3.2 — the7thfreedom/superwin0 reactions
- May 22, 2026Hotkeys support — awinogradov/symbiot0 reactions
- May 12, 2026Bump react-hotkeys-hook from 5.2.4 to 5.3.2 — godedit-prog/aliceprompterai0 reactions · 2 comments
- May 9, 2026Bump react-hotkeys-hook from 5.2.4 to 5.3.2 — WebToUI/tersa-ai-workflow-canvas0 reactions · 2 comments
- Apr 15, 2026Update dependency react-hotkeys-hook to v5.3.3 — h3poteto/whalebird-desktop0 reactions
- Mar 24, 2026@claude please create this feature and add and merge it to one of the branches that is most recent that has most recent commit, but do not deploy feature yet — totallyjohnny7/nousai-app0 reactions
- Mar 23, 2026Update dependency react-hotkeys-hook to v5 — X-oss-byte/Integration-commercetools0 reactions · 2 comments
- Feb 12, 2026chore(deps): bump react-hotkeys-hook from 4.6.1 to 5.2.4 — snoopywasright/chatbox0 reactions
- Feb 10, 2026Bump react-hotkeys-hook from 4.6.1 to 5.3.3 in /graylog2-web-interface — Graylog2/graylog2-server0 reactions · 2 comments
- Jan 17, 2026Bump react-hotkeys-hook from 5.2.1 to 5.2.3 — Usuf-1/postiz-app0 reactions · 1 comment
- Dec 20, 2025[all components] stopPropagation() logic doesn't truly stop — mui/base-ui0 reactions · 1 comment
- Oct 30, 2025global keyboard handler for key navigation — laszloekovacs/dima-remix0 reactions
- Oct 27, 2025chore(deps): bump react-hotkeys-hook from 4.6.2 to 5.2.1 in /frontend — kevinmastascusa/GemCheck0 reactions · 1 comment
- Oct 20, 2025chore(deps): bump react-hotkeys-hook from 4.6.2 to 5.2.1 — Brownster/agent-desktop0 reactions · 1 comment
- Oct 20, 2025deps(deps): bump react-hotkeys-hook from 4.6.2 to 5.2.1 — affx08/snipsearch0 reactions · 1 comment
- Jun 12, 2025Allow users to change keyboard shortcuts with keyboard only — vedmakk/doppelpunkt0 reactions · 2 comments
- Jun 10, 2025Support hotkeys — h5radar/web0 reactions
- May 28, 2025Keyboard shortcuts — willy0483/Tavern0 reactions
- Apr 26, 2025Update dependency react-hotkeys-hook to v5 — alindt/netbird-dashboard0 reactions
- Apr 19, 2025fix(deps): update dependency react-hotkeys-hook to v5 — GraphQL-Portal/graphql-portal-dashboard0 reactions · 1 comment
- Apr 16, 2025chore: update dependency react-hotkeys-hook to v5 — scaffdog/scaffdog0 reactions
- Apr 9, 2025fix(deps): update dependency react-hotkeys-hook to v5 — syx-413/onedrive-vercel-index0 reactions · 1 comment
- Nov 22, 2024Bump react-hotkeys-hook from 4.5.1 to 4.6.1 — technomango/Video-Web-Editor0 reactions · 1 comment
- Oct 28, 2024[Snyk] Upgrade react-hotkeys-hook from 4.5.0 to 4.5.1 — hohner2008/InvokeAI0 reactions
On Bluesky · 1
- Dec 12, 2024🔗 GitHub: github.com/JohannesKla... — @bmstefanski.bsky.social1 likes and repost
On Stack Overflow · 1
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
41 rules. About 0 are common, 13 are distinctive, and 28 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
28
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Use packages/lab to reproduce bugs
- Distinctive: line 12
Verify behavior with the playwright mcp
- Very specific: line 46
Use import type for type-only imports: import type { Hotkey } from './types'
- Distinctive: line 48
Keep imports at top of file, grouped by purpose
- Distinctive: line 51
Use explicit type annotations for function parameters and returns
- Very specific: line 52
Prefer readonly for arrays that shouldn't be modified: readonly FormTags[]
- Very specific: line 53
Use type over interface for object types (this codebase uses type)
- Very specific: line 54
Use generic type parameters with constraints: function foo<T extends HTMLElement>()
- Very specific: line 55
Use as const for literal types where appropriate
- Very specific: line 56
Use @ts-expect-error for intentional type errors with explanation
- Distinctive: line 66
Use functional components with hooks
- Very specific: line 67
Use useCallback for event handlers and functions passed to children
- Very specific: line 68
Use useRef for mutable refs and DOM elements
- Very specific: line 69
Use useState for component state
- Very specific: line 70
Use useEffect or useLayoutEffect for side effects
- Very specific: line 71
Prefer useLayoutEffect over useEffect for DOM mutations
- Very specific: line 72
Use TypeScript generics for refs: useRef<T>(null)
- Distinctive: line 76
Use conditional checks instead of try-catch where possible
- Very specific: line 78
Use type guards: isReadonlyArray(enabledOnTags)
- Distinctive: line 79
Check for undefined/null before accessing properties
- Very specific: line 80
Use optional chaining: e.target?.isContentEditable
- Very specific: line 83
Use TODO comments for future improvements: // TODO: Make modifiers work with sequences
- Very specific: line 84
Use biome-ignore comments for intentional lint violations: // biome-ignore lint/correctness/useExhaustiveDependencies
- Distinctive: line 85
Avoid inline comments for obvious code
- Distinctive: line 86
Add comments for complex logic or non-obvious behavior
- Distinctive: line 87
Use console.warn for developer-facing warnings in production code
- Very specific: line 90
Test files use .test.tsx extension in src/test/ directory
- Very specific: line 91
Use test() from vitest (not it())
- Very specific: line 92
Use expect() for assertions
- Very specific: line 94
Use vi.useFakeTimers() for timer-related tests
- Very specific: line 95
Use userEvent.setup() for user interactions
- Very specific: line 96
Test files in src/test/, source in src/lib/
- Very specific: line 97
Use renderHook() for testing hooks
- Very specific: line 98
Use render() for testing components
- Very specific: line 99
Use beforeEach() for setup
- Very specific: line 100
Use .only() sparingly for debugging only (remove before commit)
- Very specific: line 111
Use type imports for type-only imports to reduce bundle size
- Distinctive: line 112
Avoid parameter reassignment (Biome rule)
- Distinctive: line 113
Use single variable declarators (Biome rule)
- Distinctive: line 114
Avoid unnecessary else statements (Biome rule)
- Distinctive: line 116
Use as const assertions for literal types (Biome rule)
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidelines for agentic coding agents working in this repository.
Github
This repo is hosted on Github. Use the gh CLI to fetch issues, create PRs, etc.
Development Workflow
- Use
packages/labto reproduce bugs - Verify behavior with the playwright mcp
Development Commands
Build and Development
npm run build- Build the main library package (runs in packages/react-hotkeys-hook)npm run build:documentation- Build documentation sitenpm run -w packages/react-hotkeys-hook dev- Start development server for librarynpm run -w packages/react-hotkeys-hook build- Build library only (TypeScript + Vite)
Linting and Formatting
npm run lint- Run Biome linter with auto-fix (applies to all packages)npm run format- Run Biome formatter (applies to all packages)npx @biomejs/biome lint --write packages- Lint with write directlynpx @biomejs/biome format --write packages- Format with write directly
Testing
npm run test- Run all tests (Vitest in packages/react-hotkeys-hook)npm run -w packages/react-hotkeys-hook test- Run tests in library packagenpm run -w packages/react-hotkeys-hook vitest run- Run tests once (no watch mode)npx vitest run --testNamePattern "test name"- Run single test matching patternnpx vitest run src/test/useHotkeys.test.tsx- Run specific test filenpx vitest run -t "should listen to key presses"- Run tests matching name
Code Style Guidelines
Formatting (Biome)
- Line width: 120 characters
- Indentation: Spaces (2 spaces)
- Quotes: Single quotes
- Semicolons: As needed (optional)
- Biome auto-organizes imports on save
Imports
- Use
import typefor type-only imports:import type { Hotkey } from './types' - Group imports: external React hooks first, then local modules
- Keep imports at top of file, grouped by purpose
TypeScript
- Use explicit type annotations for function parameters and returns
- Prefer
readonlyfor arrays that shouldn't be modified:readonly FormTags[] - Use
typeoverinterfacefor object types (this codebase usestype) - Use generic type parameters with constraints:
function foo<T extends HTMLElement>() - Use
as constfor literal types where appropriate - Use
@ts-expect-errorfor intentional type errors with explanation
Naming Conventions
- Variables and functions: camelCase (
isHotkeyEnabled,recordedKeys) - Components: PascalCase (
HotkeysProvider,BoundHotkeysProxyProvider) - Types: PascalCase (
HotkeyCallback,Options,HotkeysContextType) - Constants: UPPER_SNAKE_CASE (
FORM_TAGS_AND_ROLES) - Private/internal variables: Prefix with underscore (
_options,_deps)
React Patterns
- Use functional components with hooks
- Use
useCallbackfor event handlers and functions passed to children - Use
useReffor mutable refs and DOM elements - Use
useStatefor component state - Use
useEffectoruseLayoutEffectfor side effects - Prefer
useLayoutEffectoveruseEffectfor DOM mutations - Use TypeScript generics for refs:
useRef<T>(null) - Export default hooks for main API:
export default function useHotkeys()
Error Handling
- Use conditional checks instead of try-catch where possible
- Return early from functions on error conditions
- Use type guards:
isReadonlyArray(enabledOnTags) - Check for undefined/null before accessing properties
- Use optional chaining:
e.target?.isContentEditable
Comments
- Use TODO comments for future improvements:
// TODO: Make modifiers work with sequences - Use biome-ignore comments for intentional lint violations:
// biome-ignore lint/correctness/useExhaustiveDependencies - Avoid inline comments for obvious code
- Add comments for complex logic or non-obvious behavior
- Use console.warn for developer-facing warnings in production code
Testing Patterns (Vitest + Testing Library)
- Test files use
.test.tsxextension insrc/test/directory - Use
test()from vitest (notit()) - Use
expect()for assertions - Mock functions with
vi.fn() - Use
vi.useFakeTimers()for timer-related tests - Use
userEvent.setup()for user interactions - Test files in
src/test/, source insrc/lib/ - Use
renderHook()for testing hooks - Use
render()for testing components - Use
beforeEach()for setup - Use
.only()sparingly for debugging only (remove before commit)
File Structure
- Main source:
packages/react-hotkeys-hook/src/lib/ - Tests:
packages/react-hotkeys-hook/src/test/ - Types: Defined in
src/lib/types.ts - Entry point:
src/lib/index.ts - Monorepo: Multiple packages in
packages/directory
Additional Notes
- This is an ES modules project (type: "module" in package.json)
- Use
typeimports for type-only imports to reduce bundle size - Avoid parameter reassignment (Biome rule)
- Use single variable declarators (Biome rule)
- Avoid unnecessary else statements (Biome rule)
- Self-closing JSX elements (Biome rule)
- Use as const assertions for literal types (Biome rule)
- This project uses Vitest, not Jest
- Build system: Vite + TypeScript
- Testing environment: jsdom
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
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.

