xcode-project-setup
/xcode-project-setup
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).
- Author
- firebase ↗
- Repository
- agent-skills ↗
- Licence
- Apache-2.0
- Last repository change
- 20.10.2026
Assessment and security
- Files in this package
- 5
- Scripts
- 2
- HTML comments
- 0
- URLs in SKILL.md
- 6
No signals detected. Repository changed on 20.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
- 2 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/xcode_spm_setup/Package.swift, scripts/xcode_spm_setup/Sources/main.swift
What it does and when to use it
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).
Original author description
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).
How it works
- ⛔️ CRITICAL RULES & ENVIRONMENT CHECKS
- Empty Directory Workflow
- Standard Xcode Workflow
- Usage
SKILL.md preview
--- name: xcode-project-setup description: 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). compatibility: Requires Swift to be installed locally and macOS environment. metadata: author: Google LLC category: ApplicationDevelopment --- # 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 --version` before proceeding. - 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 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](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: 1. Adding the package repository dependency (e.g., `https://github.com/Alamofire/Alamofire`). 1. 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 1. **Locate the package path:** Find the absolute path to this skill's `scripts/xcode_spm_setup` directory on disk. 1. **Execute:** Run the native `swift run` command using the signature below: ```bash 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. ```bash 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 Alamofire ``` ### Example 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](https://github.com/firebase/firebase-ios-sdk/releases).* ```bash 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 FirebaseFirestore ``` *Note: The script is idempotent. It will automatically skip linking files or packages that are already present in the project.*
Files in this package (5)
- SKILL.md 6 KB
- scripts/xcode_spm_setup/.gitignore 1 KB
- scripts/xcode_spm_setup/Package.resolved 1 KB
- scripts/xcode_spm_setup/Package.swift 1 KB
- scripts/xcode_spm_setup/Sources/main.swift 9 KB
Versions
The database has no other skills named xcode-project-setup.
Identical content appears in 4 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version a53c85a091c3 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100xcode-management
Xcode 项目管理和 iOS/macOS 开发工作流程方面的专家。专注于管理 Xcode 项目文件、理解 .pbxproj 格式,以及自动化文件添加到 Xcode 项目的过程。使用此技能管理 Xcode 项目、添加新文件到项目、配置构建设置或处理项目文件问题时使用。 - 100xcode-management
Expert in Xcode project management and iOS/macOS development workflows. Specializes in managing Xcode project files, understanding the .pbxproj format, and automating file additions to Xcode projects. Use this skill when managing Xcode projects, adding new files, configuring… - 100xcproj
Create, read, edit and validate Xcode projects from the command line with the `xcodeproj` and `xcprojformatter` tools that ship in Xcode 27.2+ — targets, build phases, build settings, groups and synchronized folders, xcconfig files, Swift packages, app extensions — plus the JSON… - 100swift-review
Reviews Swift/Xcode codebases, pull requests, local changes, or individual files against Swift best practices including Google's Swift Style Guide, Apple's API Design Guidelines, build performance, memory management, and testing standards. Use this skill whenever the user asks… - 100xcode
Expert Xcode assistance covering Swift/SwiftUI development, iOS/macOS simulators, Xcode Cloud CI/CD, Instruments profiling, and Swift Package Manager (SPM). Use when configuring Xcode projects, debugging iOS apps with LLDB, profiling with Instruments, or managing Apple Developer signing. - 95building-swift-apps
Builds, tests, and ships native Swift/SwiftUI apps for Apple platforms (macOS/iOS) reliably in CI and locally — unsigned CI builds, the hand-maintained pbxproj, SwiftPM-module vs app-target test boundaries, SourceKit false positives, gitignored base xcconfig, Keychain vs…