xcode-project-setup

작성자: firebase

Xcode 프로젝트(.pbxproj)를 안전하게 수정하여 Swift 패키지를 추가하고 파일을 연결합니다. iOS 프로젝트에 의존성을 설치해야 할 때 이 스킬을 사용하세요(예: ...).

npx skills add https://github.com/firebase/agent-skills --skill xcode-project-setup

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.

  • 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).
  2. 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.
  2. Execute: Run the native swift run command 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 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.

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.

firebase의 다른 스킬

developing-genkit-dart
firebase
통합 AI SDK for Dart로 코드 생성, 구조화된 출력, 도구, 플로우 및 에이전트를 지원합니다. 단일 인터페이스로 생성, 도구 정의, 플로우 오케스트레이션, 임베딩 및 스트리밍을 위한 핵심 API를 제공합니다. LLM 제공업체(Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, Chrome 브라우저 통합, Shelf를 통한 HTTP 서버 호스팅을 위한 8개 이상의 플러그인을 포함합니다. 플로우 실행, 추적, 모델 실험 등을 위한 로컬 개발 UI가 포함된 내장 CLI를 제공합니다.
official
developing-genkit-js
firebase
Genkit 플로우, 도구 및 멀티 모델 지원을 통해 AI 기반 Node.js/TypeScript 애플리케이션을 구축합니다. Genkit은 제공자에 구애받지 않으며, 플러그인을 통해 Google AI, OpenAI, Anthropic, Ollama 및 기타 LLM 제공자를 지원합니다. Zod를 사용하여 타입 안전 스키마로 플로우를 정의하고, 생성 요청을 실행하며, TypeScript로 다단계 AI 워크플로우를 구성합니다. Genkit CLI v1.29.0+가 필요하며, 최근 주요 API 변경 사항으로 인해 이전 지식이 아닌 현재 패턴을 위해 genkit docs:read 및 common-errors.md를 참조해야 합니다...
official
extension-to-functions-codebase
firebase
설치된 Firebase Extension(또는 확장 프로그램 소스)을 독립형 Cloud Functions for Firebase 코드베이스 또는 게시 가능한 npm 패키지로 변환하는 스킬,…
official
firebase-ai-logic
firebase
웹 앱을 위한 클라이언트 측 Gemini 통합으로, 멀티모달 추론, 스트리밍, 온디바이스 하이브리드 실행을 지원합니다. 텍스트 전용 및 멀티모달 입력(이미지, 오디오, 비디오, PDF)을 지원하며, 20MB를 초과하는 파일은 Cloud Storage를 통해 라우팅됩니다. 자동 기록이 포함된 채팅 세션, 실시간 디스플레이를 위한 스트리밍 응답, 구조화된 JSON 출력 적용을 제공합니다. Chrome의 Gemini Nano를 통한 온디바이스 하이브리드 추론을 지원하며, 자동으로 클라우드 실행으로 폴백됩니다. 프로덕션 환경에서는 App Check가 필요합니다...
official
firebase-ai-logic-basics
firebase
Firebase AI Logic(Gemini API)를 웹 애플리케이션에 통합하기 위한 공식 스킬입니다. 설정, 멀티모달 추론, 구조화된 출력 및 보안을 다룹니다.
official
firebase-app-hosting-basics
firebase
Firebase App Hosting을 사용하여 Next.js, Angular 및 기타 지원되는 프레임워크로 풀스택 웹 앱을 배포하고 관리합니다. Firebase 프로젝트가 Blaze 요금제에 있어야 하며, 서버사이드 렌더링(SSR) 및 증분 정적 재생성(ISR) 워크플로를 지원합니다. 백엔드 설정을 위한 선택적 apphosting.yaml과 함께 firebase.json 구성을 통해 배포하거나, GitHub 통합을 통한 자동화된 "git push to deploy"를 활성화할 수 있습니다. 민감한 키에 대한 안전한 접근을 위해 CLI 명령을 통한 비밀 관리 기능을 포함합니다...
official
firebase-auth-basics
firebase
Firebase 인증을 여러 ID 제공업체와 함께 설정하고 데이터 접근 규칙을 보호합니다. 이메일/비밀번호, 전화번호, 익명, 연합 제공업체(Google, Facebook, Twitter, GitHub, Microsoft, Apple) 및 사용자 지정 인증 통합을 지원합니다. 각 인증된 사용자는 Firebase 서비스에 접근하기 위한 고유 ID와 JWT 기반 토큰(단기 ID 토큰 및 장기 갱신 토큰)을 받습니다. Google 로그인, 익명 및 이메일/비밀번호에 대해 CLI를 통해 제공업체를 활성화하고 Firebase Console을 사용합니다...
official
firebase-basics
firebase
Firebase 프로젝트 설정 및 AI 에이전트 통합을 위한 CLI 워크플로우입니다. firebase-local-env-setup 스킬과 Firebase CLI 설치가 사전에 완료되어야 합니다. 핵심 워크플로우는 firebase login을 통한 인증, 고유 ID를 사용한 프로젝트 생성, 그리고 대화형 firebase init 명령어를 통한 서비스 초기화를 다룹니다. 설정 중 Firestore, Functions, Hosting을 포함한 기능 선택을 지원하며, 자동으로 설정 파일을 생성합니다. --help 플래그를 통한 자체 문서화 CLI 기능을 제공합니다...
official