audit-swiftui-scenes-windows

Audits macOS SwiftUI scene graphs and window code for stale APIs and silent runtime failures.

2|1|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/yigitkonur/plugin-swiftui --skill audit-swiftui-scenes-windows-yigitkonur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-swiftui-scenes-windows
Source: https://github.com/yigitkonur/plugin-swiftui/tree/main/plugins/swiftui/skills/audit-swiftui-scenes-windows
Command: npx skills add https://github.com/yigitkonur/plugin-swiftui --skill audit-swiftui-scenes-windows-yigitkonur

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ast-grep, and includes scripts (resource) and references (resource) components.

What problem does it solve? AI-generated macOS SwiftUI code often misuses the scene graph at App.body level: Preferences crammed into the main window instead of a Settings scene, menu-bar apps faked with NSStatusItem, openWindow calls that silently no-op, and the macOS 26 MenuBarExtra activation trap where windows open invisibly. This Skill systematically detects those defects in an existing project. ## Core Features & Use Cases - 13-rule defect index (sw-01 to sw-13): Covers stale or invented scene APIs, missing Settings scenes, modal Save/Cancel settings windows, sheet-faked auxiliary windows, NSStatusItem misuse, the MenuBarExtra activation trap, unmatched openWindow ids, missing dismissWindow paths, absent lifecycle bridges, and wrong window chrome. - Hybrid lint engine: Runs tier-1 ripgrep tells plus tier-2 ast-grep structural rules (containment checks grep cannot express), emitting unified JSON and SARIF with a per-file parse probe and CI exit codes. - Evidence-grounded fixes: Every finding is verified against a corpus of 1,857 real macOS apps via the swiftui-ctx CLI and Apple docs fetched through Sosumi, with permalinked real-code examples backing each recommended fix. - Use Case: Point it at a macOS SwiftUI project whose menu-bar app's Settings button does nothing on macOS 26; it locates the openSettings call inside the MenuBarExtra closure, flags the activation trap, and reports the hidden-Window workaround with citations. ## Quick Start Audit the SwiftUI sources in this macOS project for scene and window defects and write findings under swiftui-audits/scenes-windows.

Frequently Asked Questions about audit-swiftui-scenes-windows

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

FAQPage Schema
How do I audit a macOS SwiftUI app for scene and window bugs?

Run the shared lint runner with --skill audit-swiftui-scenes-windows against your sources, then read every located file in full. The skill applies a 13-rule defect index and writes one structured finding per confirmed issue under swiftui-audits/scenes-windows.

Why does openSettings do nothing inside a MenuBarExtra on macOS 26?

Menu-bar apps with .accessory activation policy have no front window, so openSettings or openWindow can open behind everything or fail silently. Even NSApp.activate() plus openSettings() fails on macOS 26; the current workaround uses a hidden Window scene and toggling the activation policy.

What is the difference between Window, WindowGroup, and UtilityWindow in SwiftUI?

WindowGroup creates user-duplicable windows with Command-N, Window creates a single unique window, and UtilityWindow creates a floating inspector panel on macOS 15+. Settings and MenuBarExtra are macOS-only scenes for preferences and menu-bar apps.

Does this skill automatically fix the SwiftUI defects it finds?

No. Every rule in this domain is flag-only because the correct fix depends on the app type, such as menu-bar-only versus document apps. Findings stay open with a recommended correct shape backed by a real permalinked code example.

Can this audit run in CI for a SwiftUI project?

Yes. The lint runner emits unified JSON and SARIF output and exits with code 2 on any hard-fail rule such as stale scene APIs or the activation trap, making it usable as a CI gate. It degrades to grep-only with a notice if ast-grep is unavailable.