{"id":"e57acf72-7010-419e-a6b3-45519bbc91cf","shortId":"pNf7rY","kind":"skill","title":"macos-spm-app-packaging","tagline":"Scaffold, build, sign, and package SwiftPM macOS apps without Xcode projects.","description":"# macOS SwiftPM App Packaging (No Xcode)\n\n## Overview\nBootstrap 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.\n\n## When to Use\n- When the user needs a SwiftPM-based macOS app without relying on an Xcode project.\n- When you need packaging, signing, notarization, or appcast guidance for a SwiftPM app.\n\n## Two-Step Workflow\n1) Bootstrap the project folder\n   - Copy `assets/templates/bootstrap/` into a new repo.\n   - Rename `MyApp` in `Package.swift`, `Sources/MyApp/`, and `version.env`.\n   - Customize `APP_NAME`, `BUNDLE_ID`, and versions.\n\n2) Build, package, and run the bootstrapped app\n   - Copy scripts from `assets/templates/` into your repo (for example, `Scripts/`).\n   - Build/tests: `swift build` and `swift test`.\n   - Package: `Scripts/package_app.sh`.\n   - Run: `Scripts/compile_and_run.sh` (preferred) or `Scripts/launch.sh`.\n   - Release (optional): `Scripts/sign-and-notarize.sh` and `Scripts/make_appcast.sh`.\n   - Tag + GitHub release (optional): create a git tag, upload the zip/appcast to the GitHub release, and publish.\n\n## Minimum End-to-End Example\nShortest path from bootstrap to a running app:\n```bash\n# 1. Copy and rename the skeleton\ncp -R assets/templates/bootstrap/ ~/Projects/MyApp\ncd ~/Projects/MyApp\nsed -i '' 's/MyApp/HelloApp/g' Package.swift version.env\n\n# 2. Copy scripts\ncp assets/templates/package_app.sh Scripts/\ncp assets/templates/compile_and_run.sh Scripts/\nchmod +x Scripts/*.sh\n\n# 3. Build and launch\nswift build\nScripts/compile_and_run.sh\n```\n\n## Validation Checkpoints\nRun these after key steps to catch failures early before proceeding to the next stage.\n\n**After packaging (`Scripts/package_app.sh`):**\n```bash\n# Confirm .app bundle structure is intact\nls -R build/HelloApp.app/Contents\n\n# Check that the binary is present and executable\nfile build/HelloApp.app/Contents/MacOS/HelloApp\n```\n\n**After signing (`Scripts/sign-and-notarize.sh` or ad-hoc dev signing):**\n```bash\n# Inspect signature and entitlements\ncodesign -dv --verbose=4 build/HelloApp.app\n\n# Verify the bundle passes Gatekeeper checks locally\nspctl --assess --type execute --verbose build/HelloApp.app\n```\n\n**After notarization and stapling:**\n```bash\n# Confirm the staple ticket is attached\nstapler validate build/HelloApp.app\n\n# Re-run Gatekeeper to confirm notarization is recognised\nspctl --assess --type execute --verbose build/HelloApp.app\n```\n\n## Common Notarization Failures\n| Symptom | Likely Cause | Recovery |\n|---|---|---|\n| `The software asset has already been uploaded` | Duplicate submission for same version | Bump `BUILD_NUMBER` in `version.env` and repackage. |\n| `Package Invalid: Invalid Code Signing Entitlements` | Entitlements in `.entitlements` file don't match provisioning | Audit entitlements against Apple's allowed set; remove unsupported keys. |\n| `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. |\n| 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. |\n| `stapler validate` fails after successful notarization | Ticket not yet propagated | Wait ~60 s, then re-run `xcrun stapler staple`. |\n\n## Templates\n- `assets/templates/package_app.sh`: Build binaries, create the .app bundle, copy resources, sign.\n- `assets/templates/compile_and_run.sh`: Dev loop to kill running app, package, launch.\n- `assets/templates/build_icon.sh`: Generate .icns from an Icon Composer file (requires Xcode install).\n- `assets/templates/sign-and-notarize.sh`: Notarize, staple, and zip a release build.\n- `assets/templates/make_appcast.sh`: Generate Sparkle appcast entries for updates.\n- `assets/templates/setup_dev_signing.sh`: Create a stable dev code-signing identity.\n- `assets/templates/launch.sh`: Simple launcher for a packaged .app.\n- `assets/templates/version.env`: Example version file consumed by packaging scripts.\n- `assets/templates/bootstrap/`: Minimal SwiftPM macOS app skeleton (Package.swift, Sources/, version.env).\n\n## Notes\n- Keep entitlements and signing configuration explicit; edit the template scripts instead of reimplementing.\n- Remove Sparkle steps if you do not use Sparkle for updates.\n- Sparkle relies on the bundle build number (`CFBundleVersion`), so `BUILD_NUMBER` in `version.env` must increase for each update.\n- For menu bar apps, set `MENU_BAR_APP=1` when packaging to emit `LSUIElement` in Info.plist.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["macos","spm","app","packaging","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents"],"capabilities":["skill","source-sickn33","skill-macos-spm-app-packaging","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/macos-spm-app-packaging","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34726 github stars · SKILL.md body (5,056 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T12:51:11.936Z","embedding":null,"createdAt":"2026-04-18T21:40:17.485Z","updatedAt":"2026-04-23T12:51:11.936Z","lastSeenAt":"2026-04-23T12:51:11.936Z","tsv":"'/projects/myapp':191,193 '1':89,182,574 '2':114,199 '3':212 '4':276 '60':435 'ad':264 'ad-hoc':263 'add':389 'allow':365 'alreadi':331 'api':420 'app':4,13,19,29,65,84,108,121,180,241,417,450,461,505,518,569,573 'appcast':79,486 'appl':363 'ask':615 'assess':286,315 'asset':329 'assets/templates':125 'assets/templates/bootstrap':40,95,190,514 'assets/templates/build_icon.sh':464 'assets/templates/compile_and_run.sh':206,455 'assets/templates/launch.sh':499 'assets/templates/make_appcast.sh':483 'assets/templates/package_app.sh':203,445 'assets/templates/setup_dev_signing.sh':490 'assets/templates/sign-and-notarize.sh':475 'assets/templates/version.env':506 'attach':301 'audit':360 'bar':568,572 'base':63 'bash':181,239,268,295 'binari':252,447 'bootstrap':24,90,120,176 'boundari':623 'build':7,32,115,134,213,217,340,446,482,553,557 'build/helloapp.app':277,290,304,319 'build/helloapp.app/contents':248 'build/helloapp.app/contents/macos/helloapp':258 'build/tests':132 'bump':339 'bundl':110,242,280,451,552 'call':395 'catch':227 'caus':325 'cd':192 'cfbundlevers':555 'check':249,283,412 'checkpoint':220 'chmod':208 'clarif':617 'clear':590 'code':349,496 'code-sign':495 'codesign':273,384,394 'common':320 'complet':26 'compos':470 'configur':528 'confirm':240,296,310 'connect':419 'consum':510 'copi':94,122,183,200,452 'cp':188,202,205 'creat':154,448,491 'credenti':405 'criteria':626 'custom':107 'describ':594 'detail':52 'dev':266,456,494 'duplic':334 'dv':274 'earli':229 'edit':386,530 'email':400 'emit':578 'enabl':378 'end':169,171 'end-to-end':168 'entitl':272,351,352,354,361,525 'entri':487 'environ':606 'environment-specif':605 'exampl':130,172,507 'execut':256,288,317,371 'expert':611 'expir':423 'explicit':529 'export':416 'fail':426 'failur':228,322 'file':257,355,471,509 'flag':382 'folder':30,93 'gatekeep':282,308 'generat':465,484 'git':156 'github':151,163 'guidanc':80 'hang':397 'harden':376 'histori':410 'hoc':265 'icn':466 'icon':469 'id':111 'ident':498 'increas':562 'info.plist':581 'input':620 'inspect':269 'instal':474 'instead':534 'intact':245 'invalid':347,348 'invoc':385 'issu':406 'keep':524 'key':224,369,421 'kill':459 'launch':215,463 'launcher':501 'layout':44 'like':324 'limit':582 'local':284 'loop':457 'ls':246 'lsuielement':579 'maco':2,12,17,28,64,517 'macos-spm-app-packag':1 'match':358,591 'menu':567,571 'minim':515 'minimum':167 'miss':379,628 'must':561 'myapp':101 'name':109 'need':59,74 'network':403 'new':98 'next':234 'notar':77,292,311,321,396,429,476 'notarytool':402,409 'note':523 'number':341,554,558 'option':146,153,380,390 'output':600 'overview':23 'packag':5,10,20,33,49,75,116,138,237,346,462,504,512,576 'package.swift':103,197,520 'pass':281 'path':174 'permiss':621 'prefer':142 'present':254 'proceed':231 'project':16,71,92 'propag':433 'provis':359 'publish':166 'r':189,247 're':306,415,439 're-export':414 're-run':305,438 'recognis':313 'recoveri':326 'references/packaging.md':46 'references/release.md':47 'reimplement':536 'releas':51,145,152,164,481 'reli':67,549 'remov':367,537 'renam':100,185 'repackag':345 'repo':99,128 'requir':472,619 'resourc':453 'review':612 'run':35,118,140,179,221,307,407,440,460 'runtim':377,381,391 's/myapp/helloapp/g':196 'safeti':622 'scaffold':6 'scope':593 'script':123,131,201,204,207,210,513,533 'scripts/compile_and_run.sh':141,218 'scripts/launch.sh':144 'scripts/make_appcast.sh':149 'scripts/package_app.sh':139,238 'scripts/sign-and-notarize.sh':147,261 'sed':194 'set':366,570 'sh':211 'shortest':173 'sign':8,76,260,267,350,454,497,527 'sign-and-notarize.sh':387 'signatur':270 'simpl':500 'skeleton':187,519 'skill':585 'skill-macos-spm-app-packaging' 'softwar':328 'sourc':521 'source-sickn33' 'sources/myapp':104 'sparkl':485,538,545,548 'spctl':285,314 'specif':607 'spm':3 'stabl':493 'stage':235 'stapl':294,298,443,477 'stapler':302,424,442 'starter':43 'status':399,413 'step':87,225,539 'stop':613 'store':418 'structur':243 'submiss':335 'substitut':603 'success':428,625 'swift':133,136,216 'swiftpm':11,18,27,62,83,516 'swiftpm-bas':61 'symptom':323 'tag':150,157 'task':589 'templat':444,532 'test':137,609 'ticket':299,430 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':598 'two':86 'two-step':85 'type':287,316 'unsupport':368 'updat':489,547,565 'upload':158,333 'use':39,55,544,583 'user':58 'valid':219,303,425,608 'verbos':275,289,318 'verifi':278 'version':113,338,508 'version.env':106,198,343,522,560 'wait':434 'without':14,37,66 'workflow':88 'x':209 'xcode':15,22,38,70,473 'xcrun':401,408,441 'yet':432 'zip':479 'zip/appcast':160","prices":[{"id":"f462fde9-3312-4b33-9a10-932446e6e4e4","listingId":"e57acf72-7010-419e-a6b3-45519bbc91cf","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:40:17.485Z"}],"sources":[{"listingId":"e57acf72-7010-419e-a6b3-45519bbc91cf","source":"github","sourceId":"sickn33/antigravity-awesome-skills/macos-spm-app-packaging","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/macos-spm-app-packaging","isPrimary":false,"firstSeenAt":"2026-04-18T21:40:17.485Z","lastSeenAt":"2026-04-23T12:51:11.936Z"}],"details":{"listingId":"e57acf72-7010-419e-a6b3-45519bbc91cf","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"macos-spm-app-packaging","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34726,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"a0f1fc8953cdbce0857ee34d2710df16dd2c7793","skill_md_path":"skills/macos-spm-app-packaging/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/macos-spm-app-packaging"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"macos-spm-app-packaging","description":"Scaffold, build, sign, and package SwiftPM macOS apps without Xcode projects."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/macos-spm-app-packaging"},"updatedAt":"2026-04-23T12:51:11.936Z"}}