xcode-project-setup
Skill506 starsChanged 5 months agoApache-2.0View on GitHub
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
3 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- renansouza12/mixtape-edited, first seen Oct 13, 2026
- baliadventours/Tripbone-SaaS-Productionedited, first seen Aug 5, 2026
- VolantTyler/Cognitive-Bridge-Antigravityedited, first seen Jun 5, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- VolantTyler/Cognitive-Bridge-Antigravity★ 198% same
- baliadventours/Tripbone-SaaS-Production★ 0100% same
- renansouza12/mixtape-★ 098% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- extension-to-functions-codebaseSkill
- firebase-ai-logic-basicsSkill
- firebase-analyticsSkill
- firebase-app-hosting-basicsSkill
- firebase-auth-basicsSkill
- firebase-basicsSkill
- firebase-crashlyticsSkill
- firebase-data-connectSkill
- firebase-firestoreSkill
- firebase-hosting-basicsSkill
- firebase-remote-config-basicsSkill
- firebase-security-rules-auditorSkill
- firestore-rules-creationSkill
The file
We split this skill into the rules it gives an agent
12 rules. 1 is common, 1 is distinctive, and 10 are very specific to this project.
1
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before performing any Xcode setup or file manipulation, you MUST adhere to the following rules.
- Very specific: line 32
If you absolutely must write a script to manipulate the project environment (e.g., configuring SPM packages beyond what the provided …
- Very specific: line 42
Run swift --version before proceeding.
- Very specific: line 43
If the Swift command is not found, you must stop and recommend the user install the Swift toolchain (e.g., via xcode-select --install on …
- Very specific: line 50
When setting up SPM dependencies that heavily rely on internal Objective-C categories and +load methods (such as the Firebase iOS SDK …
- Very specific: line 68
If you are asked to build an iOS app or configure Xcode dependencies but no .xcodeproj or .xcworkspace exists, you MUST ask the user to …
- Very specific: line 75
Wait for the user to confirm they have created the .xcodeproj via Xcode, then proceed with the Standard Xcode Workflow below.
- Very specific: line 82
Do not use raw text parsing, sed, or Ruby scripts to modify .pbxproj files directly.
- Very specific: line 85
Instead, execute the Swift configuration package bundled with this skill (scripts/xcode_spm_setup) to securely install SPM packages and …
- Very specific: line 95
Use the most recent version number (e.g., 11.x.y) in your commands instead of hardcoded placeholders.
- Common: line 100
When adding a Swift Package to an Xcode project, two distinct steps must occur:
- Very specific: line 117
Execute: Run the native swift run command using the signature below:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Xcode Project Setup
⛔️ CRITICAL RULES & ENVIRONMENT CHECKS
Before performing any Xcode setup or file manipulation, you MUST adhere to the following rules. A hefty fee will be applied if you violate them.
1. The Anti-Ruby Mandate
You are strictly forbidden from using Ruby, Rails, or any Ruby gems
(including the xcodeproj gem). Under no circumstances may you write or execute
Ruby scripts.
2. Modern Xcode Folder Synchronization
Modern Xcode projects support folder synchronization. When adding new source
code (.swift) or resource files, simply write them to the correct directory on
disk. They will be automatically included in the Xcode project. Never manually
modify the .pbxproj file to add files.
3. Allowed Scripting Languages
If you absolutely must write a script to manipulate the project environment
(e.g., configuring SPM packages beyond what the provided xcode_spm_setup
script does), you must use Swift. Only as an absolute last resort, if Swift
is completely unviable, may you use Node.js or TypeScript.
4. Toolchain Verification
Because this skill relies entirely on a native Swift script, you must verify the environment:
- Run
swift --versionbefore proceeding. - If the Swift command is not found, you must stop and recommend the user
install the Swift toolchain (e.g., via
xcode-select --installon macOS), or ask if you can attempt to install it for them. Do not attempt to proceed without Swift.
5. Mandatory Linker Flags for Static Frameworks (Firebase)
When setting up SPM dependencies that heavily rely on internal Objective-C
categories and +load methods (such as the Firebase iOS SDK suite), the Apple
linker will aggressively strip these methods out if they are linked statically.
This causes fatal runtime crashes (e.g.,
FirebaseAuth/Auth.swift:167: Fatal error: Unexpectedly found nil).
The provided xcode_spm_setup Swift script automatically injects the -ObjC
flag to OTHER_LDFLAGS when adding Firebase products. However, you should
still verify it is present in the build settings if you encounter issues.
- Failing to include this flag when adding Firebase dependencies is a critical error.
Empty Directory Workflow
If you are asked to build an iOS app or configure Xcode dependencies but no
.xcodeproj or .xcworkspace exists, you MUST ask the user to create the
project first:
"No Xcode project found in this directory. Please create an empty Xcode project manually and let me know when you are ready to proceed."
Wait for the user to confirm they have created the .xcodeproj via Xcode, then
proceed with the Standard Xcode Workflow below.
Standard Xcode Workflow
Do not use raw text parsing, sed, or Ruby scripts to modify .pbxproj files
directly.
Instead, execute the Swift configuration package bundled with this skill
(scripts/xcode_spm_setup) to securely install SPM packages and link optional
config files (like GoogleService-Info.plist).
CRITICAL: Always Use Latest SDK Version
To ensure access to the latest features and security fixes, always use the most recent version of the Firebase iOS SDK. Check for the latest release version at https://github.com/firebase/firebase-ios-sdk/releases.
- Use the most recent version number (e.g.,
11.x.y) in your commands instead of hardcoded placeholders.
Understanding the Script's Actions
When adding a Swift Package to an Xcode project, two distinct steps must occur:
- Adding the package repository dependency (e.g.,
https://github.com/Alamofire/Alamofire). - Selecting the target (e.g.,
MyApp), navigating to General > Frameworks, Libraries, and Embedded Content, and hitting the+button to explicitly link the specific product modules (e.g.,Alamofire).
The provided xcode_spm_setup Swift script automatically handles BOTH of
these steps for you. By passing the list of modules as arguments, it safely
injects the package dependency and automatically wires those modules to the main
target's Frameworks build phase. You do not need to do any manual linking.
Usage
- Locate the package path: Find the absolute path to this skill's
scripts/xcode_spm_setupdirectory on disk. - Execute: Run the native
swift runcommand using the signature below:
swift run --package-path <PATH_TO_SKILL>/scripts/xcode_spm_setup xcode_spm_setup <ProjectPath.xcodeproj> <RepoURL> <VersionRequirement> [--plist <Optional/Path/To/Config.plist>] <Product1> [Product2 ...]Example 1: Generic Package (e.g., Alamofire)
Adding Alamofire to a standard Xcode project. Notice there is no --plist flag.
swift run --package-path /Users/foo/.agents/skills/xcode-project-setup/scripts/xcode_spm_setup xcode_spm_setup MyApp.xcodeproj https://github.com/Alamofire/Alamofire 5.8.1 AlamofireExample 2: Firebase (Requires Plist)
Adding Firebase and linking the GoogleService-Info.plist to the resources
build phase automatically. Note: Replace 11.0.0 with the actual latest
version from
the releases page.
swift run --package-path /Users/foo/.agents/skills/xcode-project-setup/scripts/xcode_spm_setup xcode_spm_setup MyApp.xcodeproj https://github.com/firebase/firebase-ios-sdk 11.0.0 --plist MyApp/GoogleService-Info.plist FirebaseCore FirebaseAuth FirebaseFirestoreNote: The script is idempotent. It will automatically skip linking files or packages that are already present in the project.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

