capacitor-plugin-spm-support

Generate a Package.swift and migrate Objective-C bridge code to CAPBridgedPlugin.

2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/involvex/happy-vibecode --skill capacitor-plugin-spm-support-involvex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: capacitor-plugin-spm-support
Source: https://github.com/involvex/happy-vibecode/tree/main/.agents/skills/capacitor-plugin-spm-support
Command: npx skills add https://github.com/involvex/happy-vibecode --skill capacitor-plugin-spm-support-involvex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the complex, error-prone process of adding Swift Package Manager (SPM) support to an existing Capacitor plugin by creating a Package.swift manifest, migrating Objective-C bridge integrations to the CAPBridgedPlugin Swift protocol, and cleaning up Xcode and package configuration so the plugin can be consumed via SPM.

Core Features & Use Cases

  • Automated Manifest Creation: Generates a Package.swift using the podspec and package.json metadata, including platform targets, products, dependencies, and targets.
  • Bridge Migration: Replaces Objective-C bridge files by updating the Swift plugin class to conform to CAPBridgedPlugin and injecting identifier, jsName, and pluginMethods metadata.
  • Project Cleanup & Validation: Removes ObjC files, prunes references from the Xcode project, updates .gitignore and package.json, and provides guidance for resolving CocoaPods-to-SPM dependency mappings.
  • Use Case: Convert an existing Capacitor plugin that currently distributes via CocoaPods into an SPM-compatible package so it can be integrated into Swift Package Manager workflows.

Quick Start

Use the capacitor-plugin-spm-support skill to add SPM support to the plugin in the current repository by creating Package.swift, migrating the Objective-C bridge to CAPBridgedPlugin, removing bridge files, updating the Xcode project, and adjusting package.json and .gitignore.

Frequently Asked Questions about capacitor-plugin-spm-support

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Swift Package Manager support to an existing Capacitor plugin?

To add Swift Package Manager support to a Capacitor plugin, generate a Package.swift manifest from existing podspec and package.json metadata, migrate Objective-C bridge files to the CAPBridgedPlugin Swift protocol, and clean up Xcode project references.

Why do I need to migrate Objective-C bridge files when converting a Capacitor plugin to SPM?

Migrating Objective-C bridge files to the CAPBridgedPlugin Swift protocol is required for SPM compatibility because Swift Package Manager needs native Swift class conformance to inject plugin metadata like identifier, jsName, and pluginMethods directly into the target.

What versions of Capacitor, Swift, and Xcode are required for plugin SPM migration?

Migrating a Capacitor plugin to Swift Package Manager requires Capacitor 6 or higher, Swift 5.9 or higher, and Xcode 15 or above, along with an existing iOS plugin repository containing Swift source and Objective-C bridge files.

How are CocoaPods dependencies handled when migrating a Capacitor plugin to Swift Package Manager?

When migrating to Swift Package Manager, CocoaPods dependencies require resolution by mapping podspec references to SPM package URLs and version constraints, or by replacing them with equivalent SPM packages within the generated Package.swift manifest.

What project cleanup is needed after switching a Capacitor plugin from CocoaPods to SPM?

After switching to SPM, project cleanup involves removing Objective-C bridge files, pruning references from the Xcode .pbxproj file, and updating package.json and .gitignore to reflect the new Swift Package Manager distribution configuration.