macos-menus-commands

Implement native macOS menu bar, keyboard shortcuts, and AppKit interop for SwiftUI apps.

1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/LaughingJackalope/macos-skills --skill macos-menus-commands
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: macos-menus-commands
Source: https://github.com/LaughingJackalope/macos-skills/tree/main/macos-menus-commands
Command: npx skills add https://github.com/LaughingJackalope/macos-skills --skill macos-menus-commands

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the difficulty of implementing native, production-quality macOS menu systems in SwiftUI apps, where built-in menu APIs are limited and AppKit interop is often required for advanced features.

Core Features & Use Cases

  • SwiftUI Menu Bar Customization: Build custom top-level menus, reorder built-in menu groups, and assign conflict-free keyboard shortcuts using .commands, CommandMenu, and CommandGroup.
  • Context & System Menus: Implement right-click context menus, dynamic dock menus, and system Services menu integration for seamless macOS user experience.
  • AppKit Interop Patterns: Use the NSMenu escape hatch for advanced dynamic menu items, menu validation, and first-responder routing when SwiftUI's APIs are insufficient.
  • Use Case: A macOS note-taking app can use this Skill to add a custom "Notes" top-level menu, assign keyboard shortcuts for quick note creation, implement a context menu for note actions, and add a dock menu that shows recent notes when right-clicking the app icon.

Quick Start

Use the macos-menus-commands skill to add a custom top-level menu with a keyboard shortcut to your macOS SwiftUI app's menu bar.

Frequently Asked Questions about macos-menus-commands

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom menus and keyboard shortcuts to a SwiftUI macOS app?

You add custom menus and keyboard shortcuts in SwiftUI using .commands, CommandMenu, and CommandGroup modifiers to build top-level menus and assign conflict-free shortcuts within the native menu bar.

How do I implement right-click context menus and dock menus in macOS SwiftUI?

You implement right-click context menus and dynamic dock menus in macOS SwiftUI by applying the Skill's system menu integration patterns. This enables seamless right-click actions and dock icon interactions for recent items.

When do I need AppKit interop for SwiftUI menu bar customization?

You need AppKit interop for SwiftUI menu bar customization when requiring advanced dynamic menu items, menu validation, first-responder routing, or per-window menu scoping that SwiftUI's built-in APIs cannot handle. The NSMenu escape hatch provides these advanced capabilities.

Can I scope macOS menu bar items to specific windows using SwiftUI?

Yes, you can scope macOS menu bar items to specific windows using SwiftUI. The Skill satisfies functional requirements for per-window menu scoping, allowing menu visibility and actions to target individual windows.

What is the best way to resolve keyboard shortcut conflicts in macOS SwiftUI menus?

The best way to resolve keyboard shortcut conflicts in macOS SwiftUI menus is using CommandGroup and .commands to assign conflict-free shortcuts. This ensures custom keyboard combinations do not override built-in system behaviors.

Does this macOS menu integration approach work with the system Services menu?

Yes, this macOS menu integration approach works with the system Services menu. The Skill implements system Services menu integration alongside context menus and dock menus to provide a seamless macOS user experience.