Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

capacitor-app-spm-migration

БесплатноБез исполняемых скриптовНе проверен

Guides the agent through migrating an existing Capacitor app project from CocoaPods to Swift Package Manager (SPM) for iOS dependency management. Covers…

capawesome-teamот capawesome-team★ 56 звёзд на GitHub

Об этом скилле

Capacitor App: CocoaPods → SPM Migration

Migrate an existing Capacitor app project's iOS dependency management from CocoaPods to Swift Package Manager (SPM). The migration is destructive — the existing ios/ folder is deleted and re-scaffolded, then user-authored files are restored from a temporary backup.

Prerequisites

Requirement Version
Capacitor 6+
Node.js 18+
Xcode 15+
CocoaPods installed (only used for verification before deletion)

The project must be a Capacitor app (not a plugin) and must currently use CocoaPods (ios/App/Podfile exists).

Procedures

Step 1: Verify Project State

  1. Verify the project is a Capacitor app, not a plugin. Confirm package.json lists @capacitor/ios in dependencies and the project root contains a capacitor.config.* file.
  2. Verify the project currently uses CocoaPods. The file ios/App/Podfile must exist. If it does not exist and ios/App/CapApp-SPM/Package.swift exists, the project is already on SPM — abort and inform the user.
  3. Read @capacitor/core version from package.json (dependencies or devDependencies). Confirm the major version is 6 or higher. If lower, abort and direct the user to the capacitor-app-upgrades skill first.
  4. Verify the working tree is clean. Run git status --porcelain — if the output is non-empty, instruct the user to commit or stash changes before proceeding. The migration is destructive and must be reversible via git checkout.

Step 2: Inventory Installed Capacitor Plugins

Read package.json and record every installed Capacitor plugin under dependencies. Match these prefixes:

  • @capacitor/* (official plugins)
  • @capawesome/* and @capawesome-team/*
  • @capacitor-community/*
  • @capacitor-firebase/*
  • @capacitor-mlkit/*
  • @revenuecat/*
  • Any other package with "capacitor" in its package.json keywords array

Record each plugin's package name and installed version. This list is used in Step 8 to verify all plugins resolve under SPM after re-sync.

Step 3: Identify Files to Preserve

Build a checklist of files in ios/ that contain user-authored content and must survive the re-scaffold. For each path below, check whether the file exists. Record only the paths that exist.

Path (relative to project root) Purpose
ios/App/App/Info.plist App permissions, URL schemes, bundle config, custom keys
ios/App/App/AppDelegate.swift Custom app lifecycle code
ios/App/App/SceneDelegate.swift Custom scene lifecycle code (if present)
ios/App/App/Assets.xcassets/ App icon, splash assets, color sets
ios/App/App/Base.lproj/ LaunchScreen and Main storyboards
ios/App/App/App.entitlements Push, App Groups, Associated Domains, Keychain Sharing
ios/App/App/GoogleService-Info.plist Firebase configuration (if Firebase plugins are installed)
ios/App/App/*.xcconfig Build configuration overrides
ios/App/App.xcodeproj/project.pbxproj Source for extracting signing values in Step 5

Additionally, scan ios/App/App/ for any other .swift files beyond AppDelegate.swift and SceneDelegate.swift. These are user-authored Swift sources (e.g., custom Notification Service Extensions, custom view controllers) and must also be preserved.

If the project contains a Notification Service Extension or other Xcode targets under ios/App/ (e.g., ios/App/NotificationService/), record those directories as well.

Step 4: Back Up Preserved Files

  1. Create the backup directory:

    mkdir -p .spm-migration-backup
    
  2. Add .spm-migration-backup/ to .gitignore to prevent accidental commits:

     # iOS files
    +.spm-migration-backup/
    
  3. Copy each file recorded in Step 3 into .spm-migration-backup/, preserving the relative path. For example:

    mkdir -p .spm-migration-backup/ios/App/App
    cp ios/App/App/Info.plist .spm-migration-backup/ios/App/App/Info.plist
    cp ios/App/App/AppDelegate.swift .spm-migration-backup/ios/App/App/AppDelegate.swift
    cp -R ios/App/App/Assets.xcassets .spm-migration-backup/ios/App/App/Assets.xcassets
    cp -R ios/App/App/Base.lproj .spm-migration-backup/ios/App/App/Base.lproj
    

    Repeat for every file/directory identified in Step 3. Use cp -R for directories.

  4. Always copy the full ios/App/App.xcodeproj/project.pbxproj to .spm-migration-backup/ios/App/App.xcodeproj/project.pbxproj, even though the file itself will not be restored. Step 5 reads it to extract signing values, and Step 11 may reference it for capability reconfiguration.

Step 5: Extract Signing & Bundle Configuration

Read .spm-migration-backup/ios/App/App.xcodeproj/project.pbxproj and extract the values of the following build settings from the App target's XCBuildConfiguration blocks (both Debug and Release). Search for each ke

Полный SKILL.md на GitHub

Установить capacitor-app-spm-migration в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл capacitor-app-spm-migration?

Guides the agent through migrating an existing Capacitor app project from CocoaPods to Swift Package Manager (SPM) for iOS dependency management. Covers prerequisite checks, inventorying installed Capacitor plugins, backing up customized iOS project files (Info.plist, AppDelegate.swift, Assets.xcassets, Base.lproj, App.entitlements, GoogleService-Info.plist, .xcconfig files, signing configuration), deleting the existing `ios/` folder, re-scaffolding with `npx cap add ios --packagemanager SPM`, restoring preserved files, re-syncing plugins, and verifying the build. Performs all migration steps manually — does not use the interactive `npx cap spm-migration-assistant` command. Do not use for Capacitor plugin projects, app projects already on SPM, app projects without an existing `ios/` folder, or non-Capacitor mobile frameworks.

Как установить скилл capacitor-app-spm-migration?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл capacitor-app-spm-migration запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить capacitor-app-spm-migration с