macos-spm-app-packaging
Install this skill
npx skills add dimillian/skillsWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
This skill facilitates the creation and distribution of macOS applications entirely through Swift Package Manager without requiring an Xcode project file. It provides a structured template system to handle the manual requirements of app bundling, which include creating directory structures, managing Info.plist entries, and handling code signing. By employing provided bash scripts, developers can manage the lifecycle of an application from initial scaffolding to final notarization and Sparkle-ready appcast generation. The workflow relies on environment variables defined in a version file to maintain consistency across build steps. This approach is suited for developers who prefer command-line build processes, CI/CD automation, or lightweight environments where generating full Xcode projects creates unnecessary overhead or configuration drift.
When to Use This Skill
- β’Building command-line driven macOS utilities with a GUI interface
- β’Automating the release pipeline for cross-platform Swift tools
- β’Maintaining lightweight project files that avoid Xcode project merge conflicts
- β’Developing menu bar apps in headless CI environments
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- βBootstrap a new SwiftPM macOS app without Xcode
- βPackage my Swift package into a signed .app bundle
- βAutomate notarization for my SwiftPM macOS application
- βSet up a CLI-based build pipeline for a macOS app
- βCreate a Sparkle-ready appcast for my macOS SwiftPM build
Pro Tips
- π‘Integrate `version.env` with your CI/CD system to automatically increment build numbers for each release.
- π‘Utilize environment variables within your packaging scripts to easily switch between development and production signing identities.
- π‘Consider wrapping the packaging and notarization scripts in a single Makefile or Fastlane lane for a more cohesive release workflow.
What this skill does
- β’Scaffold folder structures for SwiftPM-based macOS applications
- β’Automate bundle creation, signing, and notarization via shell scripts
- β’Generate .icns assets from standard image files
- β’Integrate Sparkle framework updates through automated appcast creation
- β’Toggle between standard application and background menu bar modes via build flags
When not to use it
- βComplex projects requiring Interface Builder or storyboard visual editors
- βApps that depend heavily on proprietary Xcode build settings or specific plugins
- βTeams that lack experience with bash scripting and manual code signing
Example workflow
- Initialize the directory structure using the bootstrap template
- Update the version.env file with current app metadata
- Execute the packaging script to generate the .app bundle
- Sign the application bundle using local developer certificates
- Run the notarization and stapling script for distribution
- Generate the appcast file to enable Sparkle auto-updates
Prerequisites
- βmacOS environment
- βApple Developer Program membership for signing
- βInstalled Swift toolchain
Pitfalls & limitations
- !Manual maintenance of entitlements is required if app needs specific sandboxing
- !Missing Xcode might prevent certain build-related tasks like icon generation if local tools are absent
- !Incorrectly incrementing the version.env file breaks Sparkle update logic
FAQ
How it compares
Unlike manual packaging where developers risk human error during folder structure creation and signing, this skill enforces a repeatable script-based standard that integrates directly with CI/CD tools.
π Full skill instructions β original source: dimillian/skills
## 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.## 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.
## 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.How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/macos-spm-app-packaging/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/dimillian/skills/macos-spm-app-packaging/SKILL.md - Cursor:
~/.cursor/skills/dimillian/skills/macos-spm-app-packaging/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/dimillian/skills/macos-spm-app-packaging/SKILL.md
π Install with CLI:npx skills add dimillian/skills