Refactor macOS SwiftUI views and scenes into stable structure. Use when splitting large views, tightening scene state, or narrowing AppKit escapes.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Refactor macOS views toward small, explicit, stable scene and view types. Default to native SwiftUI for layout, selection, commands, and settings. Reach for AppKit only at the narrow edges where desktop behavior truly requires it.
private/public let@State / other stored propertiesvar (non-view)initbodyApp/<AppName>App.swift for the @main app and AppDelegate only.Views/ContentView.swift focused on root layout and composition; move feature UI into files such as Views/SidebarView.swift, Views/DetailView.swift, and Views/ComposerView.swift.Models/*.swift, stores into Stores/*.swift, app-server/network/process clients into Services/*.swift, and small formatters/resolvers/extensions into Support/*.swift.some View fragmentssome View helpers small and rare.bodybody readable as UI, not as a desktop view controller.@SceneStorage for per-window ephemeral state when it truly helps restore the scene.@AppStorage for durable preferences, not transient UI toggles that only matter in one window.NSWindow bridge exists, isolate it behind a small wrapper or helper.@Observable reference types on modern macOS targets, store them as @State in the owning view.@StateObject and @ObservedObject where needed.Process, URLSession, app-server, and platform client code out of SwiftUI views into Services/.AppDelegate and the @main app entrypoint minimal.swiftui-patterns.appkit-interop.11c74d6
Also appears in
since Jul 27, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.