Command Palette

Search for a command to run...

Назад к скиллам
скилл № 33291

desktop-appkit

Use when the user asks about AppKit, Cocoa, NSWindow, NSViewController, NSDocument, menus and the responder chain, Objective-C or Swift macOS apps, sandboxing…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить desktop-appkit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

AppKit

Purpose

Build native macOS applications using AppKit — Apple's mature, Objective-C-originated UI framework. AppKit provides deep OS integration, native look and feel, and access to macOS-specific features (menus, toolbars, sheets, drawers, NSTableView, NSCollectionView, document architecture) that SwiftUI cannot fully replace.

Agent Protocol

Trigger

Exact user phrases: "AppKit", "macOS app", "Cocoa framework", "NSView", "NSViewController", "NSTableView", "NSDocument", "native Mac app", "Mac Catalyst", "Objective-C Mac", "Swift AppKit".

Input Context

  • macOS deployment target (macOS 12 Monterey+, macOS 14 Sonoma+)
  • Language preference (Swift, Objective-C, or mixed)
  • App architecture (single window, multi-document, preferences window)
  • Existing codebase details (SwiftUI hybrid, pure AppKit, legacy)
  • Performance requirements (large data sets, real-time rendering, heavy computation)
  • Distribution method (Mac App Store, notarized DMG, enterprise MDM)

Output Artifact

AppKit architecture plan with view controller hierarchy, window management, delegation patterns, and data flow design.

Response Format

Architecture: {MVC|MVVM} with {NSViewController tree}
Windows/menus: {NSWindowController, menu items -> actions}
Components: {NSTableView/NSOutlineView/NSCollectionView usage}
Distribution: {App Store sandbox | Developer ID + notarization}
Code: {Swift files}

Completion Criteria

  • Window architecture defined (NSWindow, NSWindowController, storyboard/XIB vs programmatic)
  • View controller hierarchy established (NSViewController, NSView lifecycle)
  • Data model with bindings or delegate/dataSource patterns
  • Menu bar and toolbar designed
  • Document-based app architecture (if applicable) with NSDocument/NSDocumentController
  • Sheet, popover, and modal dialog strategy
  • Drag-and-drop support (if needed)
  • Accessibility (NSAccessibility protocol) integrated
  • Sandbox entitlements and security-scoped bookmarks configured
  • Dark mode and Dynamic Type support

Max Response Length

250 lines.

Framework/Methodology

AppKit Architecture Decision Tree

What type of macOS app?
├── Document-based (files are the primary data unit)
│   → NSDocument + NSDocumentController architecture
│   → Auto-save, versions, NSFileWrapper, UTType declaration
├── Single-window utility (calculator, preferences, toolbar)
│   → NSWindowController + single NSViewController
│   → NSWindow level behavior (floating, modal panel)
├── Multi-window browser/inspector (Xcode, Finder-like)
│   → NSWindowController per window, NSWindowController + delegate
│   → NSWindow restoration, tabs (NSWindowTabGroup)
└── Menu bar app (status item, background process)
    → NSStatusItem + NSMenu (no dock icon if LSUIElement)
    → NSApplication delegate, activateIgnoringOtherApps

MVC in AppKit (Traditional Cocoa Pattern)

Model (NSManagedObject / Codable structs)
    ↕ Bindings or KVO
Controller (NSViewController / NSWindowController)
    ↕ Outlets and Actions
View (NSView subclasses: NSTableView, NSButton, NSTextField)

View Controller Lifecycle

loadView()              // Create view hierarchy programmatically (or load from nib)
  ↓
viewDidLoad()           // Setup initial state, register observers, configure views
  ↓
viewWillAppear()        // View about to appear (update from model)
  ↓
viewDidAppear()         // View appeared (start animations, set first responder)
  ↓
viewWillDisappear()     // View about to disappear (save state)
  ↓
viewDidDisappear()      // View disappeared (stop timers, remove observers)

Workflow

Step 1: Choose Architecture Pattern

Pattern Description Best For
MVC (Traditional) Model-View-Controller, Cocoa native Simple apps, document-based apps
MVVM + Bindings NSObjectController, ArrayController, bindings in IB Form-heavy, preferences, inspector panels
Presenter NSViewController as presenter, passive views Testable logic, moderate complexity
Coordinator AppKit + child view controller coordination Multi-screen flows, wizards
Combine + AppKit Reactive pipelines with NSObject subscriptions Modern Swift, async data handling

Modern approach: Use Combine for binding-like data flow without IB bindings, which are fragile and hard to debug.

class DocumentViewController: NSViewController {
    let viewModel = DocumentViewModel()
    private var cancellables = Set<AnyCancellable>()

    override func viewDidLoad() {
        super.viewDidLoad()
        viewModel.$documentTitle
            .sink { [weak self] title in
                self?.titleLabel.stringValue = title
            }
            .store(in: &cancellables)

        viewModel.$isDirty
            .sink { [weak self] dirty in
                self?.view.window?.isDocumentEdited = dirty
            }
            .store(in: &cancellables)
    }
}

Step

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/appkit-advanced.md
  • references/appkit-architecture.md
  • references/appkit-best-practices.md
  • references/appkit-controls.md
  • references/appkit-fundamentals.md
  • references/appkit-modernization.md

FAQ

Что делает скилл desktop-appkit?

Use when the user asks about AppKit, Cocoa, NSWindow, NSViewController, NSDocument, menus and the responder chain, Objective-C or Swift macOS apps, sandboxing or notarization. Produces native macOS app architecture with AppKit. Not for SwiftUI-first Mac apps (use desktop-swiftui) or cross-platform desktop (use desktop-electron).

Как установить скилл desktop-appkit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл desktop-appkit запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить desktop-appkit с