En bref
La skill modifie en sécurité un projet Xcode (.pbxproj) pour ajouter des paquets Swift et lier des fichiers, typiquement lorsqu’une app iOS doit recevoir une dépendance (Firebase, Alamofire, etc.). Elle interdit d’éditer le .pbxproj à la main par analyse de texte, sed ou scripts Ruby. À la place, on exécute le paquet de configuration Swift fourni avec la skill. Dans un répertoire encore vide, certains fichiers déposés sur le disque sont ensuite inclus automatiquement : il ne faut pas les ajouter manuellement au projet. On utilise un numéro de version récent dans les commandes, et le lien vers la phase Frameworks du ciblé se fait sans édition manuelle. Si un prérequis d’environnement manque, on demande s’il est possible de l’installer, on ne continue pas à l’aveugle.
Ce que ça fait
- Passe exclusivement par le paquet Swift bundlé pour toucher au .pbxproj, jamais par sed ou un script de texte.
- Évite le lien manuel des frameworks lorsque le flux du skill s’en charge.
- S’applique à l’ajout de dépendances et de fichiers dans un projet iOS, y compris Firebase.
- N’est pas un guide App Hosting, ni un déploiement TestFlight générique.
Pour qui, et un exemple
Équipes iOS qui doivent ajouter un paquet Swift (souvent Firebase) sans corrompre le projet Xcode.
Exemple de demande : On ajoute le SDK Firebase à une app existante : la skill lance le configurateur Swift bundlé, pose la version récente, et n’ouvre pas le pbxproj dans un éditeur de texte.
Dès qu’un projet iOS a besoin d’installer une dépendance ou de lier des fichiers dans le .pbxproj, par exemple Firebase ou Alamofire. Exemple rédigé par iadujour.fr à partir du SKILL.md, non testé.
Installer
npx skills add firebase/skills (README ; le dépôt firebase/skills redirige vers firebase/agent-skills).
npx skills add firebase/skillsFonctionne avec
- Gemini CLI
- Claude Code
- Codex
- Kimi Code CLI
- Cursor
- Windsurf
- GitHub Copilot
Source : Procédures d’installation documentées dans le README (Cursor, Windsurf et Copilot par copie manuelle).
Niveau : Intermédiaire
Suppose de savoir lire du code et utiliser un terminal.
Extrait du SKILL.md
La description d’origine, celle que l’agent lit pour décider de charger la skill (en anglais) :
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).
Citée depuis le SKILL.md au commit 99954a3 . Le dossier contient aussi 4 fichiers annexes (scripts/).
Le SKILL.md compte 144 lignes et 4 sections principales :
- ⛔️ CRITICAL RULES & ENVIRONMENT CHECKS
- Empty Directory Workflow
- Standard Xcode Workflow
- Usage
Licence : Apache 2.0
Vérifiée le 10 novembre 2026 sur : fichier LICENSE du dépôt .
La licence autorise la reprise : le texte intégral du SKILL.md est reproduit ci-dessous, sans modification, avec sa mention de licence.
Texte intégral du SKILL.md
Reproduit sans modification depuis firebase/agent-skills (commit 99954a3) , © Firebase (Google), sous licence Apache 2.0 (fichier de licence d’origine ).
Afficher le SKILL.md original (144 lignes, en anglais)
---
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.*
Commentaires.
Un retour d’expérience, une question, une précision sur cette skill ? Les commentaires sont relus avant publication.
Commentaires publiés
Chargement des commentaires…
Laisser un commentaire
Charte de modération. Chaque commentaire est relu avant publication. Sont refusés : l’incitation à la haine, les propos injurieux ou discriminatoires, la publicité, le spam et les liens promotionnels, le hors-sujet et les données personnelles d’autrui.