Macos window architect

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

Macos window architect is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. macOS 15+ SwiftUI windows: customize toolbar/title chrome, drag regions, materials, minimize/restoration, placement, launch behavior, and borderless styles; prefer SwiftUI before NSWindow.

How to use this skill

Skill file

macOS Window Architect

Use SwiftUI scene/window modifiers first; switch to macos-appkit-bridge only when SwiftUI cannot express the behavior.

Workflow

  1. Classify the window role: main navigation, inspector/detail, About/support, media, welcome, or borderless custom surface.
  2. Adjust toolbar/title/background for that role.
  3. If toolbar chrome is hidden, add a reliable drag region.
  4. Set minimize, restoration, resize, launch, default placement, and ideal zoom behavior.
  5. Build/launch with macos-runtime-debugger.

Patterns

```swift

WindowGroup("Destination Video") {

CatalogView()

.toolbar(removing: .title)

.toolbarBackgroundVisibility(.hidden, for: .windowToolbar)

}

```

```swift

Window("About", id: "about") {

AboutView()

.toolbar(removing: .title)

.toolbarBackgroundVisibility(.hidden, for: .windowToolbar)

.containerBackground(.thickMaterial, for: .window)

}

.windowMinimizeBehavior(.disabled)

.restorationBehavior(.disabled)

```

```swift

WindowGroup("Player", for: Video.self) { $video in

PlayerView(video: video)

}

.defaultWindowPlacement { content, context in

WindowPlacement(size: clampToDisplay(content.sizeThatFits(.unspecified),

displayBounds: context.defaultDisplay.visibleRect))

}

.windowIdealPlacement { content, context in

let size = zoomToFit(content.sizeThatFits(.unspecified),

displayBounds: context.defaultDisplay.visibleRect)

return WindowPlacement(centeredPosition(for: size, in: context.defaultDisplay.visibleRect), size: size)

}

```

```swift

Color.clear

.frame(height: 48)

.contentShape(Rectangle())

.gesture(WindowDragGesture())

.allowsWindowActivationEvents(true)

```

```swift

Window("Welcome", id: "welcome") { WelcomeView() }

.windowStyle(.plain)

.defaultLaunchBehavior(.presented)

```

Rules

Guardrails

Use macos-swiftui-architect for broader scene architecture, macos-liquid-glass-designer for visual material adoption, and macos-appkit-bridge for true NSWindow/NSPanel needs.

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.