Skip to main content
skill CX Codex GP ChatGPT official · OpenAI

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.

Install into Codex · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openai/plugins --skill appkit-interop -a codex
Open on GitHub

What 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 codex

2Manually: put the files in place

.agents/skills/appkit-interop/SKILL.md

For all projects use ~/.agents/skills/

From the same set201

The whole set →
supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs remotion-render official Remotion Exports videos and static stills from Remotion projects using CLI commands. CX Codex GP ChatGPT 3installs figma-create-new-file official Figma Creates blank Figma, FigJam, or Slides files inside draft folders. It resolves planKey and editor types before invoking Figma MCP tools. CX Codex GP ChatGPT 6installs swiftui-performance-audit official OpenAI Pinpoints SwiftUI runtime issues like frame drops, unresponsive taps, and excessive view body computations. Works code-first and guides Instruments profiling. CX Codex GP ChatGPT 109installs swiftui-liquid-glass official OpenAI This skill helps build and review SwiftUI Liquid Glass interfaces for iOS 26+. Use it when adopting the API or checking fallbacks, interaction, and design fit. CX Codex GP ChatGPT 121installs swiftui-ui-patterns official OpenAI This skill helps build and refactor SwiftUI interfaces, from navigation and state to layouts and controls. Use it for new screens or changes to an existing project. CX Codex GP ChatGPT 114installs swiftui-view-refactor official OpenAI Refactors SwiftUI view files into clean, testable structures with dedicated subview types and proper Observation ownership. CX Codex GP ChatGPT 113installs ios-memgraph-leaks official OpenAI Captures and inspects iOS leaks from a simulator process or .memgraph. Useful for tracing retained objects and checking a fix with before-and-after evidence. CX Codex GP ChatGPT 1,054installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor