Macos swiftui architect

From Xopoko/build-swift-apps · View interactive version

Macos swiftui architect is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. macOS SwiftUI scenes: build or refactor windows, commands, toolbars, settings, split views, inspectors, menu bar extras, keyboard flows, and desktop layouts; not AppKit-only behavior.

How to use this skill

Skill file

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

Desktop Rules

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.