macos-spm-app-packaging
Automates the process of converting SwiftPM packages into signed and notarized macOS application bundles using templates.
Install
mkdir -p .claude/skills/macos-spm-app-packaging && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3348" && unzip -o skill.zip -d .claude/skills/macos-spm-app-packaging && rm skill.zipInstalls to .claude/skills/macos-spm-app-packaging
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, a custom .app bundle assembly script, or signing/notarization/appcast steps outside Xcode.Key capabilities
- →Bootstrap SwiftPM directory skeleton
- →Inject custom build and release scripts
- →Automate code signing and notarization
- →Generate Sparkle appcast files
- →Validate bundle structure and binary integrity
How it works
Executes shell scripts that manipulate folder structures and trigger Apple's signing/notarization tools.
Inputs & outputs
When to use macos-spm-app-packaging
- →Bootstrap a new SwiftPM macOS project
- →Package a Swift app for distribution
- →Automate code signing and notarization
- →Generate an appcast for Sparkle updates
About this skill
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.
Two-Step Workflow
-
Bootstrap the project folder
- Copy
assets/templates/bootstrap/into a new repo. - Rename
MyAppinPackage.swift,Sources/MyApp/, andversion.env. - Customize
APP_NAME,BUNDLE_ID, and versions.
- Copy
-
Build, package, and run the bootstrapped app
- Copy scripts from
assets/templates/into your repo (for example,Scripts/). - Build/tests:
swift buildandswift test. - Package:
Scripts/package_app.sh. - Run:
Scripts/compile_and_run.sh(preferred) orScripts/launch.sh. - Release (optional):
Scripts/sign-and-notarize.shandScripts/make_appcast.sh. - Tag + GitHub release (optional): create a git tag, upload the zip/appcast to the GitHub release, and publish.
- Copy scripts from
Minimum End-to-End Example
Shortest path from bootstrap to a running app:
# 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):
# 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):
# 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:
# 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), soBUILD_NUMBERinversion.envmust increase for each update. - For menu bar apps, set
MENU_BAR_APP=1when packaging to emitLSUIElementin Info.plist.
When not to use it
- →When the project requires complex Xcode-only build phases
- →When building iOS-only apps
Prerequisites
Limitations
- →Requires manual template modification for each new project
- →Doesn't handle Apple's UI-based provisioning profile selection
How it compares
It bypasses the Xcode GUI, enabling headless, script-driven builds and deployments.
Compared to similar skills
macos-spm-app-packaging side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| macos-spm-app-packaging (this skill) | 1 | 5mo | Review | Intermediate |
| agent-release-manager | 0 | 6mo | Review | Intermediate |
| dev-release | 0 | 4mo | No flags | Intermediate |
| chroma-release | 0 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Dimillian
View all by Dimillian →You might also like
agent-release-manager
ruvnet
Agent skill for release-manager - invoke with $agent-release-manager
dev-release
evolution-foundation
Release preparation — changelog generation, version bump, tag creation. Generic version (not project-specific). For EvoNexus releases, use custom-release instead.
chroma-release
onevcat
Chroma 的发布一体化流程(SemVer 决策、生成 changelog、同步 CLI 版本、打 git tag、发布 GitHub Release)。当被要求进行新版本发布、更新 CHANGELOG.md、升级 `ca` CLI 版本号、创建 tag 或发布 GitHub Release 时使用。
proof-of-work
MadAppGang
Proof artifact generation patterns for task validation. Covers screenshots, test results, deployments, and confidence scoring.
release
mantaskazlauskas
Release workflow for ChattyLittleNpc addon. Bumps the .toc version, commits and pushes to GitHub, then runs release.py to create a GitHub release. Activates for: release, bump version, publish, ship, tag, new version, deploy addon, push release.
wa:deploy-release
jeremy-newhouse
Create release: git tag, changelog generation, and release notes.