macOS应用

macOS应用 is a skill for Claude Code, Codex from nongjun/awesome-harness-engineering. It costs 44 tokens per session (470 once invoked), scanned A, a copy of macOS应用, MIT.

A set of guidelines for building macOS desktop apps with Swift and SwiftUI, Apple's tools for creating native user interfaces. It covers app permissions, windows, data storage, networking, and distribution.

In plain words
What is it for?
Use it when building, storing data in, networking from, or distributing a macOS app. It also covers menus, shortcuts, drag-and-drop, multiple windows, and SwiftUI state.
Why use it?
It helps developers account for macOS conventions, sandbox permissions, background behavior, and the different ways apps are distributed.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nongjun/awesome-harness-engineering/macos
Any agent
npx skills add nongjun/awesome-harness-engineering --skill macos
Clone the repo
git clone --depth 1 https://github.com/nongjun/awesome-harness-engineering

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for macOS应用

README.md
[![agentmods](https://agentmods.dev/badge/skills/nongjun/awesome-harness-engineering/macos.svg)](https://agentmods.dev/skills/nongjun/awesome-harness-engineering/macos)
Your own site
<a href="https://agentmods.dev/skills/nongjun/awesome-harness-engineering/macos"><img src="https://agentmods.dev/badge/skills/nongjun/awesome-harness-engineering/macos.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 470 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00044 $0.00470
Opus 5 $0.00022 $0.00235
Sonnet 5 $0.00009 $0.00094
Haiku 4.5 $0.00004 $0.00047

Measured 5d ago against content hash de57ae4f6470, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

macOS应用 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to macOS应用 — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/macOS应用/SKILL.md · 50 lines

What it actually says

macOS 应用开发模式

适用场景

使用 Swift/SwiftUI 开发 macOS 桌面应用时。

核心原则

  • 沙箱优先——App Store 要求沙箱化,提前规划权限需求
  • 原生体验——遵循 macOS 人机界面指南,菜单栏、快捷键、拖拽都要支持
  • 后台能力——macOS 应用可以后台运行,注意内存和 CPU 占用
  • 多窗口——macOS 用户期望多窗口支持,不要做成单窗口

SwiftUI 模式

  • 用 @State、@Binding、@ObservedObject 管理状态
  • 复杂状态用 @EnvironmentObject 跨视图共享
  • 列表用 LazyVStack/LazyHStack 做懒加载
  • 导航用 NavigationSplitView(macOS 三栏布局)

数据持久化

  • 简单配置用 UserDefaults 或 @AppStorage
  • 结构化数据用 SwiftData 或 Core Data
  • 文件操作需申请沙箱权限,用 NSOpenPanel/NSSavePanel
  • 敏感数据(密码、Token)存 Keychain

网络通信

  • 用 URLSession 或 Alamofire 做 HTTP 请求
  • 异步操作用 async/await(Swift Concurrency)
  • 处理网络不可用的情况,给用户明确提示

分发方式

  • App Store:需要沙箱、签名、审核
  • Developer ID:签名 + 公证(Notarization),可直接分发
  • 企业内部:可以用 .app 或 .dmg 直接分发(需关闭 Gatekeeper 或签名)

常见坑点

  • macOS 权限系统比 iOS 复杂(辅助功能、屏幕录制、完全磁盘访问等)
  • 菜单栏应用(MenuBarExtra)的生命周期与窗口应用不同
  • 进程间通信用 XPC 或 DistributedNotificationCenter
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 50 lines · 44 tokens per session scan A de57ae4f6470

Subscribe to this mod's changes

macOS应用 is a skill published in the GitHub repository nongjun/awesome-harness-engineering (2 stars, last pushed 5mo ago), licensed MIT. It adds 44 tokens to every session and 470 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to macOS应用, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

kotlin-specialist

Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…

Jeffallan/claude-skills · 86 tokens

gradle-expert

Build optimization, dependency resolution, and multi-module KMP troubleshooting for AmethystMultiplatform. Use when working with: (1) Gradle build files (build.gradle.kts, settings.gradle), (2) Version catalog (libs.versions.toml), (3) Build errors and dependency conflicts, (4) Module dependencies and source sets, (5)…

vitorpamplona/amethyst · 0 tokens

swiftui-dev

Use this skill for SwiftUI development, architecture, structure, performance, and Apple native app profiling. It combines.

Orkas-AI/Orkas · 3 tokens

macos-swiftpm

Build, run, and test SwiftPM macOS packages and executables. Use when the repo is package-first or has no Xcode project.

robinebers/openusage · 35 tokens

developing-genkit-dart

Generates code and provides documentation for the Genkit Dart SDK. Use when the user asks to build AI agents in Dart, use Genkit flows, or integrate LLMs into Dart/Flutter applications.

google/skills · 48 tokens

wax

Swift framework guidance for Wax on-device memory/RAG. Use when writing Swift code with the public Memory facade, experimental PhotoMemory / VideoMemory, BuiltInMultimodalEmbeddings, embedding providers, retrieval modes, or hybrid search. For agent operators using the Wax MCP server tools, use the separate wax-mcp…

christopherkarani/Wax · 68 tokens