Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

xcode-project-setup — Codex skill: what it does, install

This skill adds Swift Packages and links files in Xcode projects. Use it when an iOS app needs dependencies such as Firebase or Alamofire.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add firebase/agent-skills --skill xcode-project-setup -a claude-code
Open on GitHub

What xcode-project-setup does

The skill configures Swift Package Manager in an .xcodeproj: it adds the package repository, selects products, and links them to the main target. It can also add configuration files such as GoogleService-Info.plist to the resources build phase.

A bundled Swift package, scripts/xcode_spm_setup, performs the changes through swift run. Re-running it skips packages and files that are already linked. The environment needs macOS, Swift, and an existing Xcode project. Create the .xcodeproj in Xcode before using the skill.

For Firebase products, the script adds -ObjC to OTHER_LDFLAGS. Check that build setting if the app crashes at launch after Firebase is linked.

What it helps with

  • add a Swift Package to an Xcode project
  • link package products to the main target
  • add GoogleService-Info.plist to resources
  • configure Firebase through Swift Package Manager
  • rerun setup without duplicate links

Example prompts for the agent

  • Set up `MyApp.xcodeproj` with Alamofire through `xcode_spm_setup` and link the `Alamofire` product.
  • Configure Firebase in `MyApp.xcodeproj` and link `FirebaseCore`, `FirebaseAuth`, and `FirebaseFirestore`.
  • Add `MyApp/GoogleService-Info.plist` to the project resources and check the Firebase linker settings.

How to install xcode-project-setup

1Skills CLI (Vercel)

npx skills add firebase/agent-skills --skill xcode-project-setup -a claude-code

2Manually: put the files in place

~/.claude/skills/xcode-project-setup/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/xcode-project-setup/

From the same set8

The whole set →
firebase-hosting-basics Google LLC Deploys static sites and SPAs to Firebase Hosting CDN with SSL, preview channels, and custom domains. Claude Code CX Codex Cursor +1 169,800installs firebase-app-hosting-basics Google LLC Deploy and manage SSR web apps built with Next.js or Angular on Firebase App Hosting. Use it for configuration, secrets, and deployment workflows. Claude Code CX Codex Cursor +1 169,200installs firebase-data-connect Google LLC Builds and configures Firebase SQL Connect backends on PostgreSQL with GraphQL schemas and generated SDKs. Useful when adding relational data to Firebase projects. Claude Code CX Codex Cursor +1 168,300installs firebase-security-rules-auditor Google LLC Audits Firebase rules for data leaks, privilege escalation, and validation gaps. Use it when reviewing Firestore or Cloud Storage access. Claude Code CX Codex Cursor +1 138,200installs firebase-ai-logic-basics Google LLC Integrates Firebase AI Logic into Android, iOS, Web, and Flutter client apps. Helps configure direct Gemini API calls, streaming, and multimodal inputs. Claude Code CX Codex Cursor +1 135,300installs firebase-crashlytics Google LLC A skill for Firebase Crashlytics in Claude Code, Cursor, and other AI coding platforms. Collects crash reports from Android and iOS apps, lets you read data through the Firebase CLI MCP server. Claude Code CX Codex Cursor +1 131,200installs firebase-remote-config-basics Google LLC Manages Firebase Remote Config templates, loading strategies, and feature flags for Android and iOS. Helps tweak app behavior without pushing a release to app stores. Claude Code CX Codex Cursor +1 120,800installs

Similar

react-native-design Seth Hobson This skill guides React Native styling, navigation, and Reanimated animations. Use it when building cross-platform mobile apps or platform-specific screens. Claude Code CX Codex Cursor 15,522installs react-native-architecture Seth Hobson A skill for Claude Code, Codex and Cursor that hands your agent project layout, navigation, native modules and offline sync patterns for React Native on Expo. Claude Code CX Codex Cursor 15,087installs accessibility-compliance Seth Hobson This skill guides accessibility audits and interface work involving keyboard navigation, screen readers, and forms. Use it when building against WCAG 2.2. Claude Code CX Codex Cursor 14,596installs developer-device-platform-basics official google This skill guides agents through managing remote Android devices on Developer Device Platform, from checking availability to connecting over ADB. Claude Code Gemini CLI CX Codex 4,500installs vercel-react-native-skills vercel A rules pack for React Native and Expo work: lists, animations, navigation, native modules. Load it so your agent makes mobile changes the same way every time. Claude Code CX Codex Cursor +1 253,900installs animate-expo emilkowalski Builds React Native and Expo animations using Reanimated and Gesture Handler. Helps keep motion on the UI thread and avoid dropped frames on physical devices. Claude Code CX Codex Cursor +1 135,900installs mobile-native emilkowalski Strips the tells that give a web app away on a phone: sticky hover, tap highlight flash, the 100vh bug. Claude Code CX Codex Cursor +1 84,500installs aso coreyhaines31 Audits App Store and Google Play listings against store optimization standards. Helps uncover gaps in metadata, visual assets, and conversion. Claude Code CX Codex Cursor +1 74,900installs

Questions about xcode-project-setup

How do I install xcode-project-setup in Codex?

Run npx skills add firebase/agent-skills --skill xcode-project-setup -a codex, then open .agents/skills/xcode-project-setup/SKILL.md.

What does xcode-project-setup do?

It adds Swift Packages to an Xcode project, links selected products to the main target, and adds configuration files to the resource phase.

What does xcode-project-setup require?

It requires macOS, Swift installed locally, and an existing Xcode project. The setup checks swift --version before changing dependencies.

Source text

SKILL.md · Apache-2.0
---
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.*

© Google LLC · Apache-2.0 · firebase/agent-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor