appkit-interop — Codex skill: what it does, how to install
Builds narrow bridges between macOS SwiftUI and AppKit. Useful when you need NSWindow access, custom panels, responder chain handling, or menu validation.
npx skills add openai/plugins --skill appkit-interop -a codexWhat appkit-interop does
This skill guides the integration between SwiftUI and AppKit when SwiftUI alone cannot achieve native macOS behavior. It identifies the exact capability gap and recommends the narrowest bridge, such as NSViewRepresentable for simple views or NSViewControllerRepresentable for controller lifecycles.
SwiftUI stays the single source of truth for value state and models. AppKit objects remain isolated inside representables and coordinators. The skill discourages turning coordinators into dumping grounds and warns against storing long-lived NSView or NSWindow instances globally.
Use this skill if you want native desktop capabilities without rewriting entire SwiftUI screens in imperative AppKit.
What it helps with
- wrap AppKit controls with NSViewRepresentable
- integrate NSWindow hooks and system open or save panels
- handle responder chain commands and validate native menus
- pass bindings between SwiftUI and AppKit coordinators safely
Example prompts for the agent
- Bridge an AppKit text view into SwiftUI using NSViewRepresentable
- How do I access the current NSWindow to configure utility panels?
- Set up menu validation through the responder chain without moving state out of SwiftUI
How to install appkit-interop
1Skills CLI (Vercel)
npx skills add openai/plugins --skill appkit-interop -a codex2Manually: put the files in place
.agents/skills/appkit-interop/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openai/plugins --skill appkit-interop -a claude-code2Manually: put the files in place
~/.claude/skills/appkit-interop/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/appkit-interop/
Manually: put the files in place
.cursor/skills/appkit-interop/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openai/plugins appkit-interop2Manually: put the files in place
.github/skills/appkit-interop/SKILL.mdPlatform CLI
gemini skills install https://github.com/openai/plugins --path plugins/build-macos-apps/skills/appkit-interopManually: put the files in place
.devin/skills/appkit-interop/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set201
The whole set →Similar
Questions about appkit-interop
How do I install appkit-interop in Codex?
Run npx skills add openai/plugins --skill appkit-interop -a codex in your project terminal. This places the skill in .agents/skills/appkit-interop/SKILL.md.
What does the appkit-interop skill do?
It helps define the smallest boundary needed to connect SwiftUI with AppKit on macOS. It sets data-flow boundaries and checks lifecycle risks so SwiftUI retains state ownership.
When should you use NSViewControllerRepresentable over NSViewRepresentable?
Choose NSViewControllerRepresentable when you need controller lifecycle management, delegation, or presentation coordination. For isolated views, NSViewRepresentable is sufficient.
Source text
SKILL.md · MIT
--- name: appkit-interop description: Bridge macOS SwiftUI into AppKit narrowly. Use when implementing representables, reaching NSWindow or panels, handling menus, or using the responder chain. --- # AppKit Interop ## Quick Start Use this skill when SwiftUI is close but not quite enough for native macOS behavior. Keep the bridge as small and explicit as possible. SwiftUI should usually remain the source of truth, while AppKit handles the imperative edge. ## Choose The Smallest Bridge - Use pure SwiftUI when the required behavior already exists in scenes, toolbars, commands, inspectors, or standard controls. - Use `NSViewRepresentable` when you need a specific AppKit view with lightweight lifecycle needs. - Use `NSViewControllerRepresentable` when you need controller lifecycle, delegation, or presentation coordination. - Use direct AppKit window or app hooks when you need `NSWindow`, responder-chain, menu validation, panels, or app-level behavior. ## Workflow 1. Name the capability gap precisely. - Window behavior - Text system behavior - Menu validation - Drag and drop - File open/save panels - First responder control 2. Pick the smallest boundary that solves it. - Avoid porting a whole screen to AppKit when one wrapped control or coordinator would do. 3. Keep ownership explicit. - SwiftUI owns value state, selection, and observable models. - AppKit objects stay inside the representable, coordinator, or bridge object. 4. Expose a narrow interface back to SwiftUI. - Bindings for editable state - Small callbacks for events - Focused bridge services only when necessary 5. Validate lifecycle assumptions. - SwiftUI may recreate representables. - Coordinators exist to hold delegate and target-action glue, not as a second app architecture. ## References - `references/representables.md`: choosing between view and view-controller wrappers, plus coordinator patterns. - `references/window-panels.md`: window access, utility windows, and open/save panels. - `references/responder-menus.md`: first responder, command routing, and menu validation. - `references/drag-drop-pasteboard.md`: pasteboard, file URLs, and desktop drag/drop edges. ## Guardrails - Do not duplicate the source of truth between SwiftUI and AppKit. - Do not let `Coordinator` become an unstructured dumping ground. - Do not store long-lived `NSView` or `NSWindow` instances globally without a strong ownership reason. - Prefer a tiny tested bridge over rewriting the feature in raw AppKit. - If a pattern can remain entirely in `swiftui-patterns`, keep it there. ## Output Expectations Provide: - the exact SwiftUI limitation being crossed - the smallest recommended bridge type - the data-flow boundary between SwiftUI and AppKit - the lifecycle or validation risks to watch
© OpenAI · MIT · openai/plugins