/ios-swift-skills:macos-spm-app-packagingfrom ios-swift-skills
Scaffolds, builds, and packages SwiftPM-based macOS apps without Xcode. Covers project layout, .app bundle assembly, signing, and notarization.
Ships in ios-swift-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bootstrap a complete SwiftPM macOS app, then build, package, and run it without Xcode. This skill covers the full workflow from project scaffolding to release distribution.
MyApp/
├── Package.swift
├── Sources/
│ └── MyApp/
│ ├── MyApp.swift # @main App entry
│ └── ContentView.swift
├── Resources/
│ ├── Assets.xcassets/
│ └── Info.plist
├── Scripts/
│ ├── package_app.sh
│ ├── compile_and_run.sh
│ └── sign-and-notarize.sh
└── version.env
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "MyApp",
platforms: [.macOS(.v14)],
products: [
.executable(name: "MyApp", targets: ["MyApp"])
],
targets: [
.executableTarget(
name: "MyApp",
resources: [
.process("Resources")
]
)
]
)
APP_NAME="MyApp"
BUNDLE_ID="com.example.myapp"
VERSION="1.0.0"
BUILD_NUMBER="1"
MIN_MACOS="14.0"
# Set to 1 for menu bar apps
MENU_BAR_APP=0
# Debug build
swift build
# Release build
swift build -c release
# Run tests
swift test
Create Scripts/package_app.sh:
#!/bin/bash
set -e
source version.env
BUILD_DIR=".build/release"
APP_BUNDLE="$BUILD_DIR/$APP_NAME.app"
CONTENTS="$APP_BUNDLE/Contents"
MACOS="$CONTENTS/MacOS"
RESOURCES="$CONTENTS/Resources"
# Build release
swift build -c release
# Create bundle structure
rm -rf "$APP_BUNDLE"
mkdir -p "$MACOS" "$RESOURCES"
# Copy binary
cp "$BUILD_DIR/$APP_NAME" "$MACOS/"
# Copy resources
cp -r Resources/* "$RESOURCES/" 2>/dev/null || true
# Generate Info.plist
cat > "$CONTENTS/Info.plist" << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>$APP_NAME</string>
<key>CFBundleIdentifier</key>
<string>$BUNDLE_ID</string>
<key>CFBundleName</key>
<string>$APP_NAME</string>
<key>CFBundleVersion</key>
<string>$BUILD_NUMBER</string>
<key>CFBundleShortVersionString</key>
<string>$VERSION</string>
<key>LSMinimumSystemVersion</key>
<string>$MIN_MACOS</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
$([ "$MENU_BAR_APP" = "1" ] && echo " <key>LSUIElement</key>
<true/>")
</dict>
</plist>
EOF
echo "Created $APP_BUNDLE"
Create Scripts/compile_and_run.sh:
#!/bin/bash
set -e
source version.env
# Kill existing instance
pkill -x "$APP_NAME" 2>/dev/null || true
# Package
./Scripts/package_app.sh
# Launch
open ".build/release/$APP_NAME.app"
# Sign for local development
codesign --force --sign - ".build/release/MyApp.app"
# Or with a specific identity
codesign --force --sign "Developer ID Application: Your Name" ".build/release/MyApp.app"
# Generate self-signed certificate for consistent dev signing
security create-keychain -p "" dev-signing.keychain
security default-keychain -s dev-signing.keychain
# Follow prompts in Keychain Access to create certificate
Create Scripts/sign-and-notarize.sh:
#!/bin/bash
set -e
source version.env
APP_PATH=".build/release/$APP_NAME.app"
ZIP_PATH=".build/release/$APP_NAME-$VERSION.zip"
# Sign with Developer ID
codesign --force --options runtime --sign "Developer ID Application: Your Name" "$APP_PATH"
# Create zip for notarization
ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH"
# Submit for notarization
xcrun notarytool submit "$ZIP_PATH" \
--apple-id "[email protected]" \
--team-id "TEAM_ID" \
--password "@keychain:AC_PASSWORD" \
--wait
# Staple the ticket
xcrun stapler staple "$APP_PATH"
# Re-zip with stapled ticket
rm "$ZIP_PATH"
ditto -c -k --keepParent "$APP_PATH" "$ZIP_PATH"
echo "Release ready: $ZIP_PATH"
#!/bin/bash
source version.env
ZIP_PATH=".build/release/$APP_NAME-$VERSION.zip"
SIZE=$(stat -f%z "$ZIP_PATH")
SIGNATURE=$(./bin/sign_update "$ZIP_PATH")
DATE=$(date -R)
cat << EOF
<item>
<title>Version $VERSION</title>
<pubDate>$DATE</pubDate>
<sparkle:version>$BUILD_NUMBER</sparkle:version>
<sparkle:shortVersionString>$VERSION</sparkle:shortVersionString>
<enclosure
url="https://example.com/releases/$APP_NAME-$VERSION.zip"
length="$SIZE"
type="application/octet-stream"
sparkle:edSignature="$SIGNATURE"
/>
</item>
EOF
# Create tag
git tag -a "v$VERSION" -m "Release $VERSION"
git push origin "v$VERSION"
# Create GitHub release
gh release create "v$VERSION" \
".build/release/$APP_NAME-$VERSION.zip" \
--title "v$VERSION" \
--notes "Release notes here"
swift build succeedsswift test passesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
swiftpm, macos-app, app-packaging, xcode-alternative, notarization
10 skills in this plugin
/issue-fix-flowEnd-to-end GitHub issue fix workflow using gh CLI, local code changes, builds/tests, and git push. Use when asked to take an issue number, implement a fix, run builds/tests, commit with a closing message, and push./debugger-agentBuild, run, and debug iOS apps on a simulator. Use when asked to run an iOS app, interact with the simulator UI, capture logs, or diagnose runtime behavior./native-app-profilingProfile native macOS/iOS apps using Time Profiler via CLI (xctrace). Use when asked to identify performance hotspots, profile CPU usage, or diagnose slow code paths without opening Instruments.Generated from the plugin's indexed repository (patrickserrano/skills) — no native marketplace selected
npx claudepluginhub p/patrickserrano-ios-swift-skillsOther plugins' skills for the same job