Macos swiftui architect
Skill Xopoko/build-swift-apps/skills/macos-swiftui-architect
Swift-focused AI agent skills for iOS and macOS: build, debug, simulator, SwiftUI, Xcode, App Store workflows. Part of Plug'n Skills.
npx -y skills add Xopoko/build-swift-apps --skill macos-swiftui-architectAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Build or refactor native macOS SwiftUI scenes and components: windows, commands, toolbars, settings, split views, inspectors, menu bar extras, keyboard workflows, and desktop layouts.
SKILL.md
3.8 KB, 815 tokens by cl100k_base, as published. Nobody here has run it
macOS SwiftUI Architect
Use for macOS SwiftUI scene/component choices. Use macos-runtime-debugger for build/run, macos-view-architect for large-file extraction, and macos-appkit-bridge for AppKit-only behavior.
Start
- Existing project: read nearest scene/root view, identify interaction model, then open the relevant file from
references/components-index.md. - New app: choose scene model first:
WindowGroup,Window,Settings,MenuBarExtra, orDocumentGroup. - For menu-bar apps that should also show normal windows, use
@NSApplicationDelegateAdaptor,.regularactivation policy, and activate on launch. - Use
WindowGroup(..., id:)for a primary launched window;Window(...)for auxiliary/on-demand singleton windows. - Decide state ownership before writing views: app-wide, scene/window scoped, or local.
Desktop Rules
- Design for pointer, keyboard, menus, multiple windows, toolbars, sidebars, inspectors, context menus, and search.
- Keep scenes explicit; do not hide settings, utility windows, or menu-bar flows inside one giant
ContentView. - Prefer system colors/materials and semantic foreground styles; avoid hardcoded white roots and opaque custom sidebars unless requested.
- Use
@SceneStoragefor per-window ephemeral state and@AppStoragefor preferences. - Prefer stable sidebar selection and
NavigationSplitViewover iOS-style push navigation when persistent structure helps. - Keep primary actions available through UI chrome and keyboard/menu paths.
- Use SwiftUI-native APIs first; switch to
macos-appkit-bridgefor responder chain, panels, low-level windows, or text system control.
Sidebar Pattern
Native source-list rows: one leading icon, one title, and optional secondary detail line. Put dense metadata/cards in detail or inspector panes, not every sidebar row.
List(selection: $selection) {
ForEach(items) { item in
HStack(spacing: 10) {
Image(systemName: item.systemImage).frame(width: 16).foregroundStyle(.secondary)
VStack(alignment: .leading, spacing: 2) {
Text(item.title).lineLimit(1)
if let detail = item.detail {
Text(detail).font(.caption).foregroundStyle(.secondary).lineLimit(1)
}
}
}
.tag(item.id)
}
}
.listStyle(.sidebar)
Let NavigationSplitView sidebars use native materials. Apply custom surfaces only to detail cards or inspector sections.
State Ownership
| Scenario | Pattern |
|---|---|
| Local control state | @State |
| Child mutates parent value | @Binding |
Root-owned @Observable | @State |
| Injected observable/service | property or @Environment(Type.self) |
| Window selection/expansion | @SceneStorage when practical |
| Durable preference | @AppStorage |
| Legacy observable | @StateObject owner, @ObservedObject injected |
Avoid
One app-sized ContentView; touch-first flows without desktop affordances; actions only behind gestures; menu bar labels over 30 characters; settings as a main-window destination; card sidebars inside .sidebar lists unless requested; opaque split-pane backgrounds by default; AppKit bridges before SwiftUI scenes/commands/windows have been tried.
New Scene
Pick scene type/state ownership, place actions in content/toolbar/commands/inspector/settings, choose layout, split files by responsibility, add keyboard/menu/toolbar exposure, then build/run and check multiwindow behavior, settings entry points, and selection stability.
References
references/components-index.mdreferences/windowing.mdreferences/settings.mdreferences/commands-menus.mdreferences/split-inspectors.mdreferences/menu-bar-extra.md
What ships with it: 7 files
9.9 KB alongside SKILL.md
agents/
- openai.yaml322 B
references/
- commands-menus.md1.1 KB
- components-index.md998 B
- menu-bar-extra.md3.0 KB
- settings.md1.4 KB
- split-inspectors.md1.2 KB
- windowing.md1.9 KB