macos-spm-app-packaging
Scaffold, build, sign, and package SwiftPM macOS apps without Xcode projects.
About this skill
This skill empowers AI agents to fully automate the lifecycle of macOS application development using Swift Package Manager (SPM), entirely bypassing traditional Xcode projects. It provides capabilities to scaffold a complete SwiftPM macOS app folder from a predefined template, then proceed to build, sign, and package the resulting application. Beyond basic compilation, it includes guidance and tools for advanced steps such as code signing, notarization, and setting up appcast feeds for updates, making it a comprehensive solution for deploying macOS apps directly from a SwiftPM foundation. It is part of the `antigravity-awesome-skills` collection, designed to extend AI agent interaction with external services and facilitate complex processing tasks.
Best use case
Developers or users who need to quickly create, build, sign, and package macOS applications based on Swift Package Manager. It is particularly useful for streamlining CI/CD pipelines or automating deployment processes without requiring manual Xcode project setup or interaction, enabling a more scriptable approach to macOS app delivery.
Scaffold, build, sign, and package SwiftPM macOS apps without Xcode projects.
A successfully scaffolded SwiftPM macOS application directory structure, or a fully built, signed, and packaged `.app` bundle, potentially notarized and ready for distribution, accompanied by guidance for appcast updates. The entire process is completed without direct Xcode project interaction, yielding a distributable macOS application artifact.
Practical example
Example input
Please scaffold a new SwiftPM macOS application project named 'MyNewApp' in the current directory. Once scaffolded, build and package it into a distributable .dmg file, ensuring it's signed with my developer ID.
Example output
```json
{
"status": "success",
"message": "SwiftPM macOS application 'MyNewApp' successfully scaffolded, built, signed, and packaged.",
"project_path": "/path/to/current/directory/MyNewApp",
"output_file": "/path/to/current/directory/MyNewApp/build/MyNewApp.dmg",
"next_steps_guidance": [
"Refer to 'references/packaging.md' for detailed notarization steps.",
"Refer to 'references/release.md' for guidance on setting up appcast for updates."
]
}
```When to use this skill
- When an AI agent needs to generate a new SwiftPM-based macOS application project without creating an Xcode project.
- When the user requires assistance with building, packaging, code signing, notarization, or setting up appcast for a SwiftPM macOS application.
- To automate the entire build-to-release workflow for macOS applications using Swift Package Manager.
- For integrating macOS app compilation and packaging into automated scripts or CI environments.
When not to use this skill
- When the application is already managed by an Xcode project and requires Xcode-specific features, configurations, or deep integration.
- For applications not targeting macOS, or applications not built primarily with Swift Package Manager.
- When the user requires advanced debugging, profiling, or UI design features that are typically integrated within the Xcode IDE.
- If the user needs to modify an existing Xcode project rather than create a new SwiftPM-based one.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/macos-spm-app-packaging/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How macos-spm-app-packaging Compares
| Feature / Agent | macos-spm-app-packaging | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
Scaffold, build, sign, and package SwiftPM macOS apps without Xcode projects.
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# macOS SwiftPM App Packaging (No Xcode) ## Overview Bootstrap a complete SwiftPM macOS app folder, then build, package, and run it without Xcode. Use `assets/templates/bootstrap/` for the starter layout and `references/packaging.md` + `references/release.md` for packaging and release details. ## When to Use - When the user needs a SwiftPM-based macOS app without relying on an Xcode project. - When you need packaging, signing, notarization, or appcast guidance for a SwiftPM app. ## Two-Step Workflow 1) Bootstrap the project folder - Copy `assets/templates/bootstrap/` into a new repo. - Rename `MyApp` in `Package.swift`, `Sources/MyApp/`, and `version.env`. - Customize `APP_NAME`, `BUNDLE_ID`, and versions. 2) Build, package, and run the bootstrapped app - Copy scripts from `assets/templates/` into your repo (for example, `Scripts/`). - Build/tests: `swift build` and `swift test`. - Package: `Scripts/package_app.sh`. - Run: `Scripts/compile_and_run.sh` (preferred) or `Scripts/launch.sh`. - Release (optional): `Scripts/sign-and-notarize.sh` and `Scripts/make_appcast.sh`. - Tag + GitHub release (optional): create a git tag, upload the zip/appcast to the GitHub release, and publish. ## Minimum End-to-End Example Shortest path from bootstrap to a running app: ```bash # 1. Copy and rename the skeleton cp -R assets/templates/bootstrap/ ~/Projects/MyApp cd ~/Projects/MyApp sed -i '' 's/MyApp/HelloApp/g' Package.swift version.env # 2. Copy scripts cp assets/templates/package_app.sh Scripts/ cp assets/templates/compile_and_run.sh Scripts/ chmod +x Scripts/*.sh # 3. Build and launch swift build Scripts/compile_and_run.sh ``` ## Validation Checkpoints Run these after key steps to catch failures early before proceeding to the next stage. **After packaging (`Scripts/package_app.sh`):** ```bash # Confirm .app bundle structure is intact ls -R build/HelloApp.app/Contents # Check that the binary is present and executable file build/HelloApp.app/Contents/MacOS/HelloApp ``` **After signing (`Scripts/sign-and-notarize.sh` or ad-hoc dev signing):** ```bash # Inspect signature and entitlements codesign -dv --verbose=4 build/HelloApp.app # Verify the bundle passes Gatekeeper checks locally spctl --assess --type execute --verbose build/HelloApp.app ``` **After notarization and stapling:** ```bash # Confirm the staple ticket is attached stapler validate build/HelloApp.app # Re-run Gatekeeper to confirm notarization is recognised spctl --assess --type execute --verbose build/HelloApp.app ``` ## Common Notarization Failures | Symptom | Likely Cause | Recovery | |---|---|---| | `The software asset has already been uploaded` | Duplicate submission for same version | Bump `BUILD_NUMBER` in `version.env` and repackage. | | `Package Invalid: Invalid Code Signing Entitlements` | Entitlements in `.entitlements` file don't match provisioning | Audit entitlements against Apple's allowed set; remove unsupported keys. | | `The executable does not have the hardened runtime enabled` | Missing `--options runtime` flag in `codesign` invocation | Edit `sign-and-notarize.sh` to add `--options runtime` to all `codesign` calls. | | Notarization hangs / no status email | `xcrun notarytool` network or credential issue | Run `xcrun notarytool history` to check status; re-export App Store Connect API key if expired. | | `stapler validate` fails after successful notarization | Ticket not yet propagated | Wait ~60 s, then re-run `xcrun stapler staple`. | ## Templates - `assets/templates/package_app.sh`: Build binaries, create the .app bundle, copy resources, sign. - `assets/templates/compile_and_run.sh`: Dev loop to kill running app, package, launch. - `assets/templates/build_icon.sh`: Generate .icns from an Icon Composer file (requires Xcode install). - `assets/templates/sign-and-notarize.sh`: Notarize, staple, and zip a release build. - `assets/templates/make_appcast.sh`: Generate Sparkle appcast entries for updates. - `assets/templates/setup_dev_signing.sh`: Create a stable dev code-signing identity. - `assets/templates/launch.sh`: Simple launcher for a packaged .app. - `assets/templates/version.env`: Example version file consumed by packaging scripts. - `assets/templates/bootstrap/`: Minimal SwiftPM macOS app skeleton (Package.swift, Sources/, version.env). ## Notes - Keep entitlements and signing configuration explicit; edit the template scripts instead of reimplementing. - Remove Sparkle steps if you do not use Sparkle for updates. - Sparkle relies on the bundle build number (`CFBundleVersion`), so `BUILD_NUMBER` in `version.env` must increase for each update. - For menu bar apps, set `MENU_BAR_APP=1` when packaging to emit `LSUIElement` in Info.plist.
Related Skills
nerdzao-elite
Senior Elite Software Engineer (15+) and Senior Product Designer. Full workflow with planning, architecture, TDD, clean code, and pixel-perfect UX validation.
nerdzao-elite-gemini-high
Modo Elite Coder + UX Pixel-Perfect otimizado especificamente para Gemini 3.1 Pro High. Workflow completo com foco em qualidade máxima e eficiência de tokens.
multi-platform-apps-multi-platform
Build and deploy the same feature consistently across web, mobile, and desktop platforms using API-first architecture and parallel implementation strategies.
monorepo-architect
Expert in monorepo architecture, build systems, and dependency management at scale. Masters Nx, Turborepo, Bazel, and Lerna for efficient multi-project development. Use PROACTIVELY for monorepo setup,
minecraft-bukkit-pro
Master Minecraft server plugin development with Bukkit, Spigot, and Paper APIs.
memory-safety-patterns
Cross-language patterns for memory-safe programming including RAII, ownership, smart pointers, and resource management.
legacy-modernizer
Refactor legacy codebases, migrate outdated frameworks, and implement gradual modernization. Handles technical debt, dependency updates, and backward compatibility.
i18n-localization
Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.
framework-migration-deps-upgrade
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
fp-refactor
Comprehensive guide for refactoring imperative TypeScript code to fp-ts functional patterns
dotnet-backend-patterns
Master C#/.NET patterns for building production-grade APIs, MCP servers, and enterprise backends with modern best practices (2024/2025).
dotnet-architect
Expert .NET backend architect specializing in C#, ASP.NET Core, Entity Framework, Dapper, and enterprise application patterns.