appkit-interop

por openai

Decida quando e como fazer a ponte de um app macOS do SwiftUI para o AppKit. Use ao implementar NSViewRepresentable ou NSViewControllerRepresentable, acessando…

npx skills add https://github.com/openai/plugins --skill appkit-interop

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

Mais skills de openai

release
openai
Crie um release da Symphony atualizando a versão commitada, fazendo o merge, criando a tag no commit mesclado e verificando o workflow de release do Burrito. Use quando for solicitado a...
signing-entitlements
openai
Inspecione problemas de assinatura, entitlements, runtime protegido e Gatekeeper em aplicativos macOS. Use quando solicitado a diagnosticar falhas de assinatura de código, entitlements ausentes,…
building-ai-agent-on-cloudflare
openai
Constrói agentes de IA na Cloudflare usando o Agents SDK com gerenciamento de estado, WebSockets em tempo real, tarefas agendadas, integração de ferramentas e chat…
epigraphdb-skill
openai
Envie requisições compactas da API EpiGraphDB para ontologia, literatura, MR, gene-droga e evidências de suporte a caminhos. Use quando um usuário desejar resumos concisos do EpiGraphDB.
runtime-behavior-probe
openai
Planeje e execute investigações de comportamento em tempo de execução com scripts de sonda temporários, matrizes de validação, controles de estado e relatórios focados em descobertas. Use apenas quando…
deep-security-scan
openai
Use quando o usuário solicitar uma varredura de segurança Codex Security scan profunda, exaustiva, de múltiplas passagens ou com redução de variância, em todo o repositório ou em caminho específico. Execute repetidas verificações independentes…
define-security-policy
openai
Defina, revise ou atualize as orientações do SECURITY.md para um repositório ou componente. Use quando o usuário quiser esclarecer o que o Codex Security deve revisar, o que está fora…
validation
openai
Use quando o Codex já está na fase de validação de uma varredura de segurança ou quando o usuário pede explicitamente para determinar se uma ou mais descobertas de segurança candidatas…