rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Command Menu

Notion-style ⌘K palette + search modal. Consumer supplies groups; slice owns dialog + MRU.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
command-menu.prompt.mdmarkdown
# Install `command-menu` — Command Menu

> Notion-style ⌘K palette + search modal. Consumer supplies groups; slice owns dialog + MRU.

📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail   : https://resource.rahmanef.com/slices/command-menu
🧠 JSON catalog   : https://resource.rahmanef.com/api/knowledge?slice=command-menu
🔗 Source         : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/command-menu

## 1. Install

```bash
npm i cmdk
# alias: npx rr add command-menu
```

The CLI copies `frontend/slices/command-menu/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.

## 2. What it ships

- npm: `cmdk`
- shadcn primitives: `command`, `dialog`

## 3. Wire it up

Run `npx rr add command-menu`. Wire <CommandPalette groups={...} onHistorySelect={...} labels={...} /> at the dashboard shell. Build groups from your feature registry; each item.onSelect handles navigation. Use <SearchModal bindings={{ pages, databases, recents, isLoading, onQueryChange, onSelectPage, onSelectDatabase }} /> for the search dialog — see slice README.md for adapter shapes.

## Rules of engagement

- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice

The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.