swift-api-design-macos

Design Swift APIs for macOS AppKit and Objective-C runtime interoperability.

1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/LaughingJackalope/macos-skills --skill swift-api-design-macos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-api-design-macos
Source: https://github.com/LaughingJackalope/macos-skills/tree/main/swift-api-design-macos
Command: npx skills add https://github.com/LaughingJackalope/macos-skills --skill swift-api-design-macos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of designing Swift APIs that work seamlessly with macOS-specific AppKit conventions, Objective-C interoperability, and system frameworks, eliminating common pitfalls like incorrect delegate naming, ObjC incompatibility, and improper error handling that lead to fragile, hard-to-maintain code.

Core Features & Use Cases

  • AppKit Delegate Naming: Follows strict AppKit delegate and data source naming conventions for clarity and consistency with system frameworks.
  • @objc Protocol Design: Guides proper @objc protocol setup, optional method handling, and ObjC representability for cross-language interoperability.
  • Error Type Design: Covers POSIXError, CocoaError, and custom LocalizedError implementation for reliable error handling across Swift and ObjC boundaries.
  • Swift Package Structure: Provides best practices for modular macOS library packaging with separated core, platform-specific, and umbrella targets.
  • Use Case: Ideal for developers building macOS frameworks, libraries, or large apps that need to expose clean, idiomatic Swift APIs that work with both Swift and Objective-C code, or distribute via Swift Package Manager.

Quick Start

Use the swift-api-design-macos skill to audit your macOS framework's public API surface for compliance with Swift API Design Guidelines and AppKit interoperability best practices.

Frequently Asked Questions about swift-api-design-macos

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

FAQPage Schema
How do I design Swift APIs that integrate correctly with AppKit and the Objective-C runtime?

Designing Swift APIs for macOS integration requires following AppKit delegate naming conventions, setting up @objc protocols for optional method handling, and ensuring proper ObjC representability for cross-language interoperability.

How do I structure a modular Swift Package for macOS framework development?

Structuring a modular macOS Swift package involves separating core logic, platform-specific targets, and umbrella targets to create a clean, distributable library architecture for macOS 26+.

Does this approach support auditing an existing macOS framework's public API surface?

Auditing an existing macOS framework's public API surface supports checking compliance with Swift API Design Guidelines and verifying AppKit interoperability best practices to eliminate fragile, hard-to-maintain code.

Why are my @objc protocol optional methods causing ObjC incompatibility issues in my macOS library?

ObjC incompatibility issues in macOS libraries often stem from incorrect @objc protocol setup and improper optional method handling, which requires strict adherence to ObjC representability and AppKit conventions.

When do I need to use @objc protocol compatibility for macOS AppKit delegate design?

You need @objc protocol compatibility for macOS AppKit delegate design when building frameworks that expose clean, idiomatic Swift APIs working seamlessly with both Swift and Objective-C system code.