macos-menubar-applisted
Install: claude install-skill oleg-koval/agent-skills
> 🤖 *Auto-generated by **weekly-pattern-learner** · SwiftUI macOS menubar app pattern observed in FocusNotch session, Jun 2026 (364 user turns, ~48 MB transcript covering idea → spec → impl → critique cycles → App Store)*
# macOS Menubar / Notch App (SwiftUI)
## Overview
Build a macOS app that lives in the menu bar or notch using SwiftUI's `MenuBarExtra`. Covers the full lifecycle: project setup, window management, entitlements, user interaction (keyboard shortcuts, sound), and App Store preparation.
## When to Use
- User asks to build an app for the macOS menubar, status bar, or notch
- Adding a menubar presence to an existing macOS app
- Debugging sandbox rejections or entitlement errors in a SwiftUI app
## Workflow
### 1. Project Setup
Create a new macOS App target in Xcode:
- **Interface**: SwiftUI
- **App Sandbox**: Enabled (required for App Store)
- **Bundle ID**: `com.yourname.AppName`
- **Deployment target**: macOS 13+ (for `MenuBarExtra`)
In `Info.plist`, set:
```xml
<key>LSUIElement</key>
<true/>
```
This hides the app from the Dock — the menu bar becomes the only entry point.
### 2. MenuBarExtra (SwiftUI native)
```swift
@main
struct FocusApp: App {
var body: some Scene {
MenuBarExtra {
ContentView()
.frame(width: 320, height: 480)
} label: {
Label("Focus", systemImage: "timer")
}
.menuBarExtraStyle(.window)
}
}
```
Use `.menuBarExtraStyle(.window)` for a popover-style p