implementing-command-palettes

implementing-command-palettes is a skill for Claude Code from AgentWorkforce/relay. It costs 48 tokens per session (2,244 once invoked), scanned A, original, Apache-2.0.

A guide for building Cmd+K or Ctrl+K command palettes in React, where users search and choose commands from a keyboard-friendly menu.

In plain words
What is it for?
Use it to add keyboard navigation, keep the selected command visible while scrolling, match commands by labels and shortcuts, and keep icons and handlers stable.
Why use it?
It helps avoid broken arrow-key navigation, hidden selections, incomplete shortcut searches, and infinite re-render loops.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to add keyboard navigation, keep the selected command visible while scrolling, match commands by labels and shortcuts, and keep icons and handlers stable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentworkforce/relay/implementing-command-palettes
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AgentWorkforce/relay --skill implementing-command-palettes
Clone the repo
git clone --depth 1 https://github.com/AgentWorkforce/relay

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for implementing-command-palettes

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentworkforce/relay/implementing-command-palettes/github.svg)](https://agentmods.dev/skills/agentworkforce/relay/implementing-command-palettes)
Your own site
<a href="https://agentmods.dev/skills/agentworkforce/relay/implementing-command-palettes"><img src="https://agentmods.dev/badge/skills/agentworkforce/relay/implementing-command-palettes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for implementing-command-palettes

Your own site · 80×15
<a href="https://agentmods.dev/skills/agentworkforce/relay/implementing-command-palettes"><img src="https://agentmods.dev/badge/skills/agentworkforce/relay/implementing-command-palettes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,244 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 343
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 347
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 349
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 350
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.02244
Opus 5.5 $0.00019 $0.00898
Sonnet 5.5 $0.00010 $0.00449
Haiku 4.5 $0.00005 $0.00224

Measured 27d ago against content hash 5f00cbb64688, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

implementing-command-palettes scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 27d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/implementing-command-palettes/SKILL.md · 321 lines

How it starts

The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Implementing Command Palettes

Overview

Command palettes (Cmd+K / Ctrl+K) need precise keyboard navigation, scroll behavior, and stable references to avoid re-render loops. This skill covers the mechanical patterns that make command palettes feel responsive.

When to Use

  • Building a Cmd+K command palette in React
  • Implementing arrow key navigation with visual selection
  • Keeping selected items visible during keyboard navigation
  • Filtering commands by label text AND keyboard shortcuts
  • Experiencing infinite re-renders when commands update

Quick Reference

Feature Implementation
Arrow navigation Track selectedIndex, clamp with Math.min/max
Keep in view scrollIntoView({ block: 'nearest', behavior: 'smooth' })
Shortcut matching Strip spaces from shortcuts, match against query
Stable icons Define icon elements outside component
Stable handlers useCallback + noop constant for disabled states

Keyboard Navigation

Index Management

const [selectedIndex, setSelectedIndex] = useState(0);

useEffect(() => {
  if (!isOpen) return;

  const handleKeyDown = (e: KeyboardEvent) => {
    switch (e.key) {
      case 'ArrowDown':
        e.preventDefault();
        // Clamp to last item
        setSelectedIndex((prev) => Math.min(prev + 1, filteredItems.length - 1));
        break;
      case 'ArrowUp':
        e.preventDefault();
        // Clamp to first item
        setSelectedIndex((prev) => Math.max(prev - 1, 0));
        break;
      case 'Enter':
        e.preventDefault();
        if (filteredItems[selectedIndex]) {
          executeCommand(filteredItems[selectedIndex]);
          close();
        }
        break;
      case 'Escape':
        e.preventDefault();
        close();
        break;
    }
  };

  window.addEventListener('keydown', handleKeyDown);
  return () => window.removeEventListener('keydown', handleKeyDown);
}, [isOpen, filteredItems, selectedIndex, close]);

Read the full file on GitHub · 321 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 27d ago Changed · -48 lines 5f00cbb64688
  2. 1mo ago First seen · 369 lines · 48 tokens per session scan A ebf8d5788af8

Subscribe to this mod's changes

implementing-command-palettes is a skill published in the GitHub repository AgentWorkforce/relay (885 stars, last pushed yesterday), licensed Apache-2.0. It adds 48 tokens to every session and 2,244 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rn-best-practices

This skill should be used when writing or reviewing React Native / Expo code — before writing list rendering, animations, data fetching, component APIs, navigation, or image/media UI — and when asked to "review best practices", "check performance", "optimize renders", "review list rendering", "check animation…

Lykhoyda/rn-dev-agent · 98 tokens

rn-feature-dev

Explicit Codex workflow: Guided feature development for React Native — explore codebase, design architecture, implement, verify live on device, and review quality.

Lykhoyda/rn-dev-agent · 34 tokens

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

Lykhoyda/rn-dev-agent · 58 tokens

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…

Lykhoyda/rn-dev-agent · 67 tokens

kirocrew-app-dev

Build, package, and publish Kiro Crew external apps. Covers app.json manifests, UI components, crons, skills, lifecycle hooks, development mode, registry publishing, and common pitfalls.

kirodotdev/KiroCrew · 44 tokens

goal-conductor

Own a goal too large for one session ('clear the flaky-test backlog', 'push N PRs green') end to end via the work ledger — decompose into items, one session per item, read worker status as data, verify claims with the acceptance evaluator, decide each round until done. Use when handed such a goal.

kirodotdev/KiroCrew · 70 tokens