audit-swiftui-appkit-interop

Audits macOS SwiftUI AppKit bridge code for correctness defects and API misuse.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? SwiftUI-to-AppKit bridges in macOS apps often compile but silently misbehave: representables missing updateNSView go stale, bindings without Coordinators never receive edits, and first-responder or scene-chrome behavior breaks under NSHostingView. This Skill systematically detects those wiring defects in existing macOS SwiftUI projects. ## Core Features & Use Cases - Ten-rule defect index: Detects missing updateNSView, dead Coordinator bindings, wrong bridge protocols, missing dismantleNSView cleanup, Swift 6 concurrency races at the Coordinator boundary, and ungated newer bridge APIs. - Hybrid lint engine: Combines tier-1 grep tells with tier-2 ast-grep structural rules that prove the absence of required members across a type, emitting unified JSON and SARIF reports. - Corpus-grounded fixes: Every finding's correct shape is backed by real code from 1,857 shipping macOS apps via the swiftui-ctx CLI, plus Apple documentation verified through Sosumi. - Use Case: Point the audit at a macOS SwiftUI project containing NSViewRepresentable wrappers; it locates a representable missing updateNSView, confirms it by reading the full type, and writes a flagged finding with the canonical corrected pattern and a GitHub permalink. ## Quick Start Audit my macOS SwiftUI project for AppKit interop defects and write the findings to the swiftui-audits/appkit-interop folder.

Frequently Asked Questions about audit-swiftui-appkit-interop

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

FAQPage Schema
How do I audit SwiftUI AppKit interop code in a macOS project?

Run the shared lint runner with the audit-swiftui-appkit-interop skill against your source directory to locate candidates via grep and ast-grep rules. Then read each flagged file in full, confirm defects at 100% certainty, and write findings to the swiftui-audits/appkit-interop folder.

What defects does a SwiftUI NSViewRepresentable audit detect?

It detects ten defect classes: missing updateNSView, missing makeCoordinator with a Binding, first-responder misuse, controllers flattened to bare views, missing NSHostingController hosting, Sendable closure races, in-window material faking vibrancy, unbridged scene chrome, missing dismantleNSView cleanup, and ungated newer bridge APIs.

Does the audit fix the AppKit bridge defects it finds?

No, every finding uses flag-only mode because bridge fixes require human context. The audit reports each defect with the canonical correct shape backed by a real permalinked example from shipping macOS apps, and the developer applies the fix.

Why does my SwiftUI view not update the wrapped AppKit view?

The representable likely lacks updateNSView, which SwiftUI calls on every state change while makeNSView runs only once. Implement updateNSView with a guarded write, such as checking the value differs before assigning, so state changes propagate without resetting the cursor.

Can searchable or toolbar modifiers work inside NSHostingView on macOS?

Toolbar and navigationTitle bridge on macOS 14+ via sceneBridgingOptions when the hosting view is the window contentView. The searchable modifier has no scene bridge and never renders under a bare NSWindow with NSHostingView on any macOS version.

When does the Swift 6 concurrency check fire at the Coordinator boundary?

It fires under the Swift 6 language mode when a Sendable closure reads main-actor state at the Coordinator boundary and default Main Actor isolation is off. The audit reads SWIFT_STRICT_CONCURRENCY and isolation build settings before flagging this defect.