desktop-swiftui
Use when the user asks about SwiftUI on macOS, WindowGroup, MenuBarExtra, Settings scenes, Observation (@Observable), NavigationSplitView, AppKit bridging or…
от j4flmao★ 47 звёзд на GitHub
Установить desktop-swiftui в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
SwiftUI
Purpose
Build native macOS applications using SwiftUI — Apple's declarative UI framework for all Apple platforms. SwiftUI on macOS provides automatic support for Dark Mode, Dynamic Type, Accessibility, and native window management with less code than AppKit.
Agent Protocol
Trigger
Exact user phrases: "SwiftUI macOS", "SwiftUI App", "macOS SwiftUI", "SwiftUI multiplatform", "SwiftUI scene", "NSViewRepresentable", "SwiftUI window", "SwiftUI settings", "SwiftUI commands".
Input Context
- Minimum macOS target (macOS 12+, macOS 14+ for latest APIs)
- App lifecycle (SwiftUI App vs AppKit delegate with SwiftUI views)
- Platform targets (macOS only vs multiplatform iOS + macOS)
- Architecture (MVVM, TCA, Redux, Combine)
- Core Data, SwiftData, or other persistence
- Window types (single window, multiple windows, document-based, settings, menu bar)
Output Artifact
SwiftUI macOS architecture with scene structure, view hierarchy, state management, and platform-specific patterns.
Response Format
Target: macOS {version} Scenes: {WindowGroup/Window/Settings/MenuBarExtra}
Navigation: {NavigationSplitView columns}
Data: {@Observable models | SwiftData @Model}
AppKit bridges: {NSViewRepresentable list}
Code: {files}
Completion Criteria
- App structure defined (WindowGroup, DocumentGroup, MenuBarExtra, Settings)
- Window management strategy (multiple windows, window group, custom scene)
- View hierarchy with navigation (NavigationSplitView, NavigationStack)
- State management (ObservableObject, @State, @Binding, @Environment)
- Model layer (SwiftData, Core Data, or Codable structs)
- Commands and menus (MenuBarExtra, CommandMenu, CommandGroup)
- Toolbar and sidebar configuration
- Drag and drop (NSDraggingDestination, .onDrop, .onDrag)
- Accessibility integration (VoiceOver, keyboard navigation)
- AppKit bridge (NSViewRepresentable for missing SwiftUI components)
Max Response Length
250 lines.
Framework/Methodology
SwiftUI for macOS Decision Tree
What type of macOS app?
├── Simple single-window (settings, player, quick tool)
│ → WindowGroup with NavigationStack
│ → @AppStorage for preferences
├── Multi-window MDI (editor, dashboard, browser)
│ → WindowGroup with ID-based windows
│ → WindowScene for custom window management
├── Document-based (file editor, image viewer)
│ → DocumentGroup with file types
│ → SwiftData or Codable for document model
├── Menu bar app (status bar, background)
│ → MenuBarExtra scene
│ → NSApplication activation policy: .accessory
└── Preferences window
→ Settings scene (macOS 13+)
→ TabView with form-based controls
SwiftUI macOS Scenes
@main struct MyApp: App {
var body: some Scene {
WindowGroup { ContentView() } // Main window
DocumentGroup(...) // Document-based window
MenuBarExtra(...) // Menu bar app
Settings { SettingsView() } // Preferences
Window("Name", id: "custom") { ... } // Custom window (macOS 13+)
WindowGroup("Name", id: "group") { ... }
}
}
Workflow
Step 1: Set Up macOS SwiftUI App
// MyApp.swift
import SwiftUI
@main
struct MyApp: App {
@State private var appState = AppState()
var body: some Scene {
WindowGroup {
ContentView()
.environment(appState)
.frame(minWidth: 800, minHeight: 600)
}
.windowResizability(.contentSize)
.windowToolbarStyle(.unified)
.defaultSize(width: 1000, height: 700)
Settings {
SettingsView()
.environment(appState)
}
}
}
@Observable
class AppState {
var selectedItemID: UUID?
var items: [Item] = []
var isEditing = false
}
Step 2: Build NavigationSplitView (macOS Standard)
// ContentView.swift - Three-column macOS navigation
import SwiftUI
struct ContentView: View {
@Environment(AppState.self) private var appState
var body: some View {
NavigationSplitView {
// Sidebar
List(appState.items, selection: $appState.selectedItemID) { item in
Text(item.name)
.tag(item.id)
}
.navigationSplitViewColumnWidth(min: 180, ideal: 200, max: 300)
} content: {
// Content list (middle column)
if let id = appState.selectedItemID,
let item = appState.items.first(where: { $0.id == id }) {
ItemListView(item: item)
} else {
ContentUnavailableView(
"Select an Item",
systemImage: "sidebar.left",
description: Text("Choose an item from the sidebar")
)
}
} detail: {
// Detail view (right column)
if let id = appState.selectedItemI
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/swiftui-advanced.md
- references/swiftui-architecture.md
- references/swiftui-deployment.md
- references/swiftui-fundamentals.md
- references/swiftui-macos-patterns.md
- references/swiftui-setup.md
FAQ
Что делает скилл desktop-swiftui?
Use when the user asks about SwiftUI on macOS, WindowGroup, MenuBarExtra, Settings scenes, Observation (@Observable), NavigationSplitView, AppKit bridging or multiplatform SwiftUI apps. Produces SwiftUI Mac app architecture. Not for AppKit-only apps (use desktop-appkit) or iOS apps (use ios).
Как установить скилл desktop-swiftui?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл desktop-swiftui запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…