Back to Mobile Development

macos-spm-app-packaging

macOSSwiftPMapp packagingbuild automationnotarizationsigningCI/CDshell scripting
⭐ 3.7kπŸ“„ MITπŸ•’ 2026-03-29Source β†—

Install this skill

npx skills add dimillian/skills

Works 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

  1. Initialize the directory structure using the bootstrap template
  2. Update the version.env file with current app metadata
  3. Execute the packaging script to generate the .app bundle
  4. Sign the application bundle using local developer certificates
  5. Run the notarization and stapling script for distribution
  6. 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

Does this support iOS development?
No, this skill is strictly for macOS application packaging and signing workflows.
Can I use this without a paid Apple Developer account?
You can build and run locally without an account, but you cannot notarize or distribute signed apps to other users.
Why does the app require an Info.plist if I am not using Xcode?
macOS requires an Info.plist inside the app bundle to identify the binary as an application; the provided scripts generate this automatically.

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.

Source & trust

⭐ 3.7k starsπŸ“„ MITπŸ•’ Updated 2026-03-29
πŸ“„ Full skill instructions β€” original source: dimillian/skills
# 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
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)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/macos-spm-app-packaging/
  3. Save the file as SKILL.md
  4. 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

Read the Master Guide: Mastering Agent Skills β†’

Recommended Rules

View more rules β†’

Recommended Workflows

View more workflows β†’

Recommended MCP Servers

View more MCP servers β†’

Take It Further

Maximize your productivity with these powerful resources

πŸ“‹

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
πŸ“–

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid mobile development issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Mobile Development and is published by Thomas Ricouard, maintained in dimillian/skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.