appkit-interop

โดย openai

ตัดสินใจว่าเมื่อใดและอย่างไรในการเชื่อมต่อแอป macOS จาก SwiftUI เข้าสู่ AppKit ใช้เมื่อนำ NSViewRepresentable หรือ NSViewControllerRepresentable มาใช้งาน การเข้าถึง…

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

Skills เพิ่มเติมจาก openai

release
openai
สร้าง Symphony release โดยการ bump เวอร์ชันที่ commit ไว้ นำไป merge แท็ก commit ที่รวมแล้ว และตรวจสอบ Burrito release workflow ใช้เมื่อถูกขอให้…
signing-entitlements
openai
ตรวจสอบปัญหาเกี่ยวกับการลงนาม การอนุญาต รันไทม์ที่แข็งแกร่ง และ Gatekeeper สำหรับแอป macOS ใช้เมื่อถูกขอให้วินิจฉัยความล้มเหลวในการลงนามโค้ด การอนุญาตที่ขาดหายไป…
building-ai-agent-on-cloudflare
openai
สร้าง AI agents บน Cloudflare โดยใช้ Agents SDK พร้อมการจัดการสถานะ, WebSockets แบบเรียลไทม์, งานตามกำหนดเวลา, การรวมเครื่องมือ และแชท…
epigraphdb-skill
openai
ส่งคำขอ API EpiGraphDB แบบกระชับสำหรับ ontology, วรรณกรรม, MR, ยีน-ยา และหลักฐานเส้นทางสนับสนุน ใช้เมื่อผู้ใช้ต้องการสรุป EpiGraphDB แบบสั้น
runtime-behavior-probe
openai
วางแผนและดำเนินการตรวจสอบพฤติกรรมขณะรันไทม์ด้วยสคริปต์ตรวจสอบชั่วคราว เมทริกซ์การตรวจสอบ การควบคุมสถานะ และรายงานที่เน้นผลลัพธ์เป็นหลัก ใช้เฉพาะเมื่อ…
deep-security-scan
openai
ใช้เมื่อผู้ใช้ขอการสแกนความปลอดภัยของ Codex แบบเจาะลึก ละเอียดถี่ถ้วน หลายรอบ หรือลดความแปรปรวน ครอบคลุมทั้ง repository หรือเฉพาะเส้นทางที่กำหนด โดยให้รันซ้ำแบบอิสระ…
define-security-policy
openai
กำหนด ทบทวน หรือปรับปรุงแนวทาง SECURITY.md สำหรับ repository หรือ component ใช้เมื่อผู้ใช้ต้องการชี้แจงว่า Codex Security ควรตรวจสอบอะไร สิ่งใดอยู่นอก
validation
openai
ใช้เมื่อ Codex อยู่ในขั้นตอนการตรวจสอบความปลอดภัยแล้ว หรือผู้ใช้ขออย่างชัดเจนให้ระบุว่าข้อค้นพบด้านความปลอดภัยที่อาจเป็นไปได้หนึ่งรายการหรือมากกว่านั้น…