数据与研究

cordova-to-capacitor

cap-go/capgo-skills

Migrates an Apache Cordova, PhoneGap, or Ionic-Cordova app to Capacitor. Use when the project has config.xml, a platforms/ or plugins/ folder, cordova-* or phonegap-* dependencies, @awesome-cordova-plugins or @ionic-native wrappers, deviceready listeners, or cordova.plugins.* calls, and the user wants Capacitor native projects, Capacitor/Capgo plugin replacements, config.xml preference migration, and preserved localStorage/IndexedDB data (iosScheme/androidScheme). Covers keeping Cordova plugins temporarily, Capacitor 9 making the Cordova runtime optional (CapacitorCordova only bundled when a Cordova plugin is installed), skipped incompatible plugins, and removing Cordova afterwards. Do not use for porting a single Cordova plugin's native source into a Capacitor plugin, Capacitor major upgrades (capacitor-app-upgrades), Appflow/cordova-plugin-ionic live updates (ionic-appflow-migration), or non-Cordova web apps (webapp-to-capacitor, framework-to-capacitor).

  • 778 次安装
  • 74 星标
  • 收录于

安装命令

npx skills add https://github.com/cap-go/capgo-skills --skill cordova-to-capacitor

SKILL.md

Cordova to Capacitor Migration

Move a Cordova app onto Capacitor incrementally: Capacitor first, plugins one by one, Cordova removed last.

When to Use

TRIGGER when:

  • config.xml, platforms/, plugins/, cordova-android/cordova-ios, or cordova-plugin-* are present and the user wants Capacitor.
  • Code waits on deviceready or calls navigator.camera, window.plugins.*, cordova.plugins.*, @awesome-cordova-plugins/*, @ionic-native/*.
  • After migration: data loss on first launch, missing Cordova plugin behaviour, or Capacitor 9 build errors referencing Cordova symbols.

Do not use for:

  • Rewriting a Cordova plugin's Java/Objective-C as a Capacitor plugin (plugin-level port) -> follow Capacitor plugin docs; capacitor-plugins for existing replacements.
  • Upgrading Capacitor majors -> capacitor-app-upgrades.
  • Replacing Appflow Live Updates (cordova-plugin-ionic) -> ionic-appflow-migration + capgo-live-updates.
  • Framework build config (Angular output path, Vite) -> framework-to-capacitor.

Live Project Snapshot