Refactor macOS SwiftUI views and scenes with strong defaults for small dedicated subviews, stable sidebar and selection structure, explicit command and toolbar ownership, scene-aware state, and narrow AppKit escape hatches. Use when cleaning up a macOS view file, splitting oversized scene roots, removing iOS-centric patterns, or tightening mixed SwiftUI/AppKit architecture.
75
92%
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
The canonical home for this skill is view-refactor in openai/plugins
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.9d2bf09
Canonical home
since Jul 24, 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.