Xcode Project Setup

TopTinker Aug 13, 2026 New v1.0.0 1,640 installs Sec S+ Verified source
Claude Code Cursor
Free
Open verification
AI OverviewGenerated from SKILL.md
Core usage
This skill safely modifies Xcode projects to add Swift Package Manager dependencies and link files such as GoogleService-Info.plist. It uses a native Swift script, xcode_spm_setup, to add package repositories and automatically wire product modules to the target's Frameworks build phase. Before use, verify Swift is installed; if no .xcodeproj exists, ask the user to create one manually before proceeding.
Key advantages
It avoids dangerous manual .pbxproj text parsing or Ruby scripts, which are explicitly forbidden. The provided script handles both adding the package dependency and linking the specific product modules, including automatic injection of the -ObjC linker flag for Firebase. It is idempotent, skipping packages or files that are already present.
Limitations
It requires a macOS environment with a local Swift toolchain, and setup must stop if Swift is not available. It cannot create an Xcode project if none exists; the user must create one first. The skill is limited to SPM dependency setup and file linking rather than general Xcode project manipulation, and modern Xcode folder synchronization means new source files should not be added through scripted .pbxproj edits.
Target audience
This is for iOS developers or AI agents who need to install Swift Package dependencies in an existing Xcode project, especially packages like Firebase or Alamofire. It is also useful for those who want a safer, scripted alternative to manually editing .pbxproj files.
Risks & notes
Failing to verify the Swift environment before starting can lead to incomplete or broken setup attempts. When adding Firebase products, omitting the automatically injected -ObjC linker flag can cause fatal runtime crashes due to stripped Objective-C categories and +load methods. Always use the latest Firebase iOS SDK version for security fixes, and never manually modify .pbxproj or use Ruby scripts, as these are critical rule violations.
DescriptionWritten by the seller

# 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 /scripts/xcode_spm_setup xcode_spm_setup [--plist ] [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.*

Use caseInput → Output
Input
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.
Output
Verified guidance, commands and best practices for Xcode Project Setup, ready to paste into your agent
How it worksImport to your platform and run
Item details
Use case
AI Skills
Capability
Coding
Agents
Claude Code, Cursor
Version
1.0.0
First seen
Aug 13, 2026
Installs
1,640
License
Non-exclusive
Last update
Aug 13, 2026
InstallCompatible with agent skill ecosystem
npx skills add firebase/agent-skills --skill xcode-project-setup
Source: firebase/agent-skills
What you get
SKILL.md skill definitionCommand referenceInstallation instructionsXcode Project Setup reference
Verified sourceOriginal project page — inspect before install
Open the original source project
Check the upstream repository, license and changelog before install
Open source
Security ScanS+Score 100/100 · 0 findings · 2026-08-15 21:35:33
Static analysis100
Dynamic behavior100
Dependencies100
Network100
Privacy100
Threat intel100
✓ 未发现安全问题,六维检测全部通过。
Security scan generated by TopTinker automated engine from SKILL.md static analysis, for pre-install reference only. Third-party skills carry their own runtime risk.
WeChat
Qizhuwang Source Code Trading Platform
2021-12-28开店时间
284商品数
认证
Guarantees
Escrow paymentOn
Platform holds funds until delivery is confirmed
Install verified
Free download - install & run before you pay
Source transparency
Original GitHub repo linked & verified
No refunds after download
Digital product - disputes arbitrated on evidence only
Enhanced protection
Trusted seller - priority arbitration within 48h, backed by platform bond
Free

Report this listing

This content is locked. Buy it once and use it forever - instant delivery after purchase.

one-time
Unlock now
Escrow payment · 7-day refund support