macos-scenes

Structure macOS SwiftUI apps with multiple window scene types.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/productengineered/parsely --skill macos-scenes-productengineered
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: macos-scenes
Source: https://github.com/productengineered/parsely/tree/main/.claude/skills/tooling/macos-scenes
Command: npx skills add https://github.com/productengineered/parsely --skill macos-scenes-productengineered

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

macOS app architecture often requires disciplined patterns to manage multiple windows, scene lifecycles, and cross-window coordination. This guide presents a catalog of SwiftUI scene types (WindowGroup, Window, UtilityWindow, Settings, MenuBarExtra, DocumentGroup) and how to apply them to build scalable, predictable macOS apps.

Core Features & Use Cases

  • WindowGroup patterns for multi-window apps with state restoration and data binding.
  • Dedicated windows (Window, UtilityWindow) and menus (MenuBarExtra) for auxiliary tools and status UIs.
  • Document-based workflows with DocumentGroup and predictable open/close semantics.
  • State management tips, including window sizing, persistence, and pitfall avoidance.

Quick Start

Create a minimal macOS app that uses WindowGroup for the main window and opens a secondary Window to demonstrate multi-window lifecycle.

Frequently Asked Questions about macos-scenes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a SwiftUI macOS app with multiple windows?

Structure a SwiftUI macOS app with multiple windows by applying scene types like WindowGroup for the main interface and Window for secondary views. This separates lifecycles and manages cross-window coordination predictably.

When should I use DocumentGroup versus WindowGroup in macOS?

Use DocumentGroup in macOS for document-based workflows requiring predictable open and close semantics. Use WindowGroup for standard multi-window apps where state restoration and data binding are the primary architectural concerns.

Can I add a MenuBarExtra or UtilityWindow to an existing macOS SwiftUI app?

Yes, you can add MenuBarExtra for status UIs and UtilityWindow for auxiliary tools directly within your SwiftUI scene declarations. These provide dedicated interfaces without disrupting the main WindowGroup lifecycle.

What is the best way to handle state restoration across multiple macOS scenes?

Handle state restoration across macOS scenes by binding data within your WindowGroup patterns. This ensures window sizing, persistence, and cross-window state remain synchronized and avoids common architectural pitfalls during scene transitions.

Why does my macOS SwiftUI window fail to persist its size and position?

macOS SwiftUI windows fail to persist sizing when scene state is not properly bound or restored. Applying correct WindowGroup state management patterns ensures window dimensions and positions save reliably across app launches.