Token导航 LogoToken导航

Agent Skill · 研究检索

cordova-to-capacitor(科尔多瓦 至 电容器)

cordova-to-capacitor 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cordova-to-capacitor 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 45,958。

总安装 816周安装 34GitHub Stars 30下载 272核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cordova-to-capacitor(科尔多瓦 至 电容器)
来源仓库:https://github.com/cap-go/capacitor-skills
仓库路径:skills/cordova-to-capacitor
安装命令:
npx skills add https://github.com/cap-go/capacitor-skills --skill cordova-to-capacitor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

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

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

提供从 Apache Cordova 迁移到 Capacitor 的完整步骤指南。适用于需要将旧版 PhoneGap 项目现代化为 Capacitor 架构的开发者。包含插件替换建议、依赖检查与迁移后验证流程。

安装方式:GitHub,命令为 npx skills add https://github.com/cap-go/capacitor-skills --skill cordova-to-capacitor。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/cordova-to-capacitor

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/cap-go/capacitor-skills --skill cordova-to-cap…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cordova-to-capacitor 怎么安装?

在终端执行 npx skills add https://github.com/cap-go/capacitor-skills --skill cordova-to-capacitor。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cordova-to-capacitor 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cordova-to-capacitor 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

cordova-to-capacitor 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

cordova-to-capacitor 用的人多吗?

公开数据是累计安装 816 次,近一周安装 34 次,下载 272 次,GitHub 30 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cordova-to-capacitor 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
cordova-to-capacitor

科尔多瓦 至 电容器 · 本页

81630操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Cordova to Capacitor Migration

Step-by-step guide for migrating from Apache Cordova/PhoneGap to Capacitor.

When to Use This Skill

  • Migrating an existing Cordova app to Capacitor
  • Converting PhoneGap projects to Capacitor
  • Understanding Cordova vs Capacitor differences
  • Finding Capacitor equivalents for Cordova plugins
  • Modernizing hybrid mobile apps

Live Project Snapshot

Current migration-related packages:!node -e "const fs=require('fs');if(!fs.existsSync('package.json'))process.exit(0);const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));const out=[];for(const section of ['dependencies','devDependencies']){for(const [name,version] of Object.entries(pkg[section]||{})){if(name.includes('cordova')||name.startsWith('@capacitor/')||name.startsWith('@ionic-enterprise/'))out.push(section+'.'+name+'='+version)}}console.log(out.sort().join('\n'))"

Relevant config and platform paths:!find. -maxdepth 3 \(-name 'config.xml' -o -name 'capacitor.config.json' -o -name 'capacitor.config.ts' -o -name 'capacitor.config.js' -o -path './ios' -o -path './android' \)

Why Migrate from Cordova?

AspectCordovaCapacitor
Native IDEBuilds via CLIFirst-class Xcode/Android Studio
Plugin ManagementSeparate ecosystemnpm packages
UpdatesFull app store reviewLive updates with Capgo
Web App PlatformAnyAny (React, Vue, Angular, etc.)
MaintenanceSlowing downActive development
TypeScriptLimitedFull support
Modern APIsOlder patternsModern Promise-based APIs

Migration Process Overview

Step 1: Assess Your Current App

Start from the injected snapshot above before falling back to manual inspection.

Check Cordova version:

cordova --version
cordova platform version

List installed plugins:

cordova plugin list

Review config.xml:

cat config.xml

Step 2: Install Capacitor

In your existing Cordova project:

# Install Capacitor
npm install @capacitor/core @capacitor/cli

# Initialize Capacitor
npx cap init

When prompted:

  • App name: Your app's display name
  • App ID: Use the same ID from config.xml (e.g., com.company.app)
  • Web directory: Usually www for Cordova projects

Step 3: Add Platforms

Capacitor doesn't modify web assets. Add platforms separately:

# Add iOS platform
npm install @capacitor/ios
npx cap add ios

# Add Android platform
npm install @capacitor/android
npx cap add android

This creates:

  • ios/ directory with Xcode project
  • android/ directory with Android Studio project

Step 4: Migrate Plugins

CRITICAL: Check plugin compatibility first.

Core Cordova Plugins → Capacitor Equivalents
Cordova PluginCapacitor EquivalentInstall Command
cordova-plugin-camera@capacitor/cameranpm install @capacitor/camera
cordova-plugin-geolocation@capacitor/geolocationnpm install @capacitor/geolocation
cordova-plugin-device@capacitor/devicenpm install @capacitor/device
cordova-plugin-network-information@capacitor/networknpm install @capacitor/network
cordova-plugin-statusbar@capacitor/status-barnpm install @capacitor/status-bar
cordova-plugin-splashscreen@capacitor/splash-screennpm install @capacitor/splash-screen
cordova-plugin-keyboard@capacitor/keyboardnpm install @capacitor/keyboard
cordova-plugin-dialogs@capacitor/dialognpm install @capacitor/dialog
cordova-plugin-file@capacitor/filesystemnpm install @capacitor/filesystem
cordova-plugin-inappbrowser@capacitor/browsernpm install @capacitor/browser
cordova-plugin-media@capacitor/mediaCustom or use @capgo plugins
cordova-plugin-vibration@capacitor/hapticsnpm install @capacitor/haptics
cordova-plugin-local-notifications@capacitor/local-notificationsnpm install @capacitor/local-notifications
cordova-plugin-push@capacitor/push-notificationsnpm install @capacitor/push-notifications
Third-Party Cordova Plugins → Capgo Equivalents

For biometrics:

# Cordova
cordova plugin add cordova-plugin-fingerprint-aio

# Capacitor
npm install @capgo/capacitor-native-biometric

For payments:

# Cordova
cordova plugin add cordova-plugin-purchase

# Capacitor
npm install @capgo/capacitor-purchases

For social login:

# Facebook
npm install @capgo/capacitor-social-login

# Google
npm install @codetrix-studio/capacitor-google-auth

Check the full plugin catalog: https://github.com/Cap-go/awesome-capacitor

Step 5: Update Code

Import Changes

Cordova (old):

document.addEventListener('deviceready', () => {
  navigator.camera.getPicture(success, error, options);
});

Capacitor (new):

import { Camera } from '@capacitor/camera';

// No deviceready event needed
const image = await Camera.getPhoto({
  quality: 90,
  allowEditing: true,
  resultType: CameraResultType.Uri
});
Common Pattern Changes

Device Information:

// Cordova
const uuid = device.uuid;
const platform = device.platform;

// Capacitor
import { Device } from '@capacitor/device';
const info = await Device.getId();
const platform = await Device.getInfo();

Network Status:

// Cordova
const networkState = navigator.connection.type;

// Capacitor
import { Network } from '@capacitor/network';
const status = await Network.getStatus();
console.log('Connected:', status.connected);

Geolocation:

// Cordova
navigator.geolocation.getCurrentPosition(success, error);

// Capacitor
import { Geolocation } from '@capacitor/geolocation';
const position = await Geolocation.getCurrentPosition();
Remove deviceready Event

Capacitor doesn't need deviceready. Plugins work immediately.

// Cordova (remove this)
document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
  // Your code
}

// Capacitor (just use directly)
import { Camera } from '@capacitor/camera';

async function takePicture() {
  const photo = await Camera.getPhoto();
}

Step 6: Update Configuration

Cordova uses config.xml. Capacitor uses capacitor.config.ts

Create capacitor.config.ts
import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: 'com.company.app', // From config.xml widget id
  appName: 'My App',         // From config.xml name
  webDir: 'www',             // From Cordova build output
  server: {
    androidScheme: 'https'
  },
  plugins: {
    SplashScreen: {
      launchShowDuration: 3000,
      backgroundColor: '#ffffff',
      androidScaleType: 'CENTER_CROP',
      showSpinner: false
    }
  }
};

export default config;
Migrate config.xml Settings

Preferences:

<!-- Cordova config.xml -->
<preference name="Orientation" value="portrait" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />

Capacitor equivalent:

  • Orientation: Set in Xcode/Android Studio per platform
  • StatusBar: Use @capacitor/status-bar plugin

Platform-specific config:

<!-- Cordova config.xml -->
<platform name="ios">
  <allow-intent href="itms:*" />
</platform>

Capacitor equivalent:

// capacitor.config.ts
const config: CapacitorConfig = {
  ios: {
    contentInset: 'always',
  },
  android: {
    allowMixedContent: true,
  }
};

Step 7: Handle Permissions

Capacitor requires explicit permission configuration.

iOS: Info.plist

Add to ios/App/App/Info.plist:

<key>NSCameraUsageDescription</key>
<string>We need camera access to take photos</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>We need photo library access to select images</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>We need location to show nearby places</string>

<key>NSMicrophoneUsageDescription</key>
<string>We need microphone access for audio recording</string>
Android: AndroidManifest.xml

Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

Step 8: Sync and Build

Sync web code with native projects:

npx cap sync

This copies:

  • Web assets from www/ to native projects
  • Installs native dependencies
  • Updates plugin configurations

Build for iOS:

npx cap open ios
# Then build in Xcode (Cmd+R)

Build for Android:

npx cap open android
# Then build in Android Studio (Run)

Step 9: Test the App

Test all plugin functionality:

  • Camera/photo picker
  • Geolocation
  • File operations
  • Network detection
  • Device information
  • Push notifications

Check for:

  • Missing permissions
  • API differences
  • Callback → Promise conversions
  • Removed plugins

Step 10: Remove Cordova

Once migration is complete and tested:

# Remove Cordova platforms
cordova platform remove ios
cordova platform remove android

# Remove Cordova
npm uninstall cordova
npm uninstall cordova-ios
npm uninstall cordova-android

# Remove Cordova plugins
cordova plugin list | xargs -I {} cordova plugin remove {}

# Remove config.xml (after backing up)
mv config.xml config.xml.backup

Common Issues and Solutions

Issue: Plugin Not Found

Problem:

Error: Plugin not found

Solution:

  1. Check if plugin is installed: npm list
  2. Sync native projects: npx cap sync
  3. Clean and rebuild in Xcode/Android Studio

Issue: deviceready Never Fires

Problem: Cordova's deviceready event doesn't exist in Capacitor.

Solution: Remove all deviceready event listeners. Capacitor plugins work immediately.

// Remove this
document.addEventListener('deviceready', onDeviceReady);

// Use this
import { App } from '@capacitor/app';
App.addListener('appStateChange', (state) => {
  console.log('App state changed:', state.isActive);
});

Issue: White Screen on Startup

Problem: App shows white screen or crashes.

Solution:

  1. Check webDir in capacitor.config.ts points to correct build output
  2. Rebuild web app: npm run build
  3. Sync: npx cap sync
  4. Check browser console in device for errors

Issue: Permissions Not Working

Problem: Camera/location/etc. fail silently.

Solution:

  1. Add permission strings to Info.plist (iOS)
  2. Add permission declarations to AndroidManifest.xml (Android)
  3. Request permissions explicitly in code:
import { Camera } from '@capacitor/camera';

// Capacitor handles permission prompts automatically
const photo = await Camera.getPhoto();

Issue: Plugins Using Old Cordova API

Problem: Some third-party Cordova plugins still reference Cordova global.

Solution: Use the Capacitor Cordova compatibility layer:

npm install cordova-plugin-example
npx cap sync

Capacitor includes Cordova compatibility, but:

  • It's best to migrate to native Capacitor plugins when possible
  • Not all Cordova plugins will work

Hybrid Approach: Run Both

You can run Cordova and Capacitor side-by-side during migration.

  1. Install Capacitor alongside Cordova
  2. Keep both config.xml and capacitor.config.ts
  3. Migrate plugins incrementally
  4. Test each platform independently

When ready, remove Cordova entirely.

Plugin Migration Checklist

  • List all Cordova plugins: cordova plugin list
  • Find Capacitor equivalents (use table above)
  • Install Capacitor plugins: npm install @capacitor/plugin-name
  • Update imports in code
  • Convert callbacks to async/await
  • Remove deviceready event listeners
  • Add permission strings (iOS Info.plist, Android AndroidManifest.xml)
  • Sync native projects: npx cap sync
  • Test on physical devices
  • Remove Cordova plugins after verification

Live Updates with Capgo

Capacitor enables instant updates without app store review.

After migration, add Capgo for OTA updates:

# Install Capgo plugin
npm install @capgo/capacitor-updater

# Create account at capgo.app
npm install -g @capgo/cli
capgo login

# Initialize and deploy
capgo init
npm run build
capgo upload

Users get updates instantly. See the capgo-live-updates skill for details.

Resources

Migration Timeline Estimate

App SizeEstimated Time
Small (1-3 plugins)2-4 hours
Medium (4-8 plugins)1-2 days
Large (9+ plugins)3-5 days
Enterprise (custom plugins)1-2 weeks

Post-Migration Benefits

After migrating from Cordova to Capacitor:

✅ Faster development - Direct access to Xcode/Android Studio ✅ Live updates - Deploy updates without app store review (with Capgo) ✅ Better TypeScript - Full type safety ✅ Modern APIs - Promise-based, async/await ✅ Active maintenance - Regular updates and improvements ✅ Better debugging - Native IDE debugging tools ✅ Improved performance - Optimized native bridge

Next Steps

  1. Complete the migration using steps above
  2. Test thoroughly on physical devices
  3. Set up CI/CD (see capacitor-ci-cd skill)
  4. Add live updates (see capgo-live-updates skill)
  5. Submit to app stores (see capacitor-app-store skill)

平台分布

Codex

33.77%
按下载量换算92

Claude

29.89%
按下载量换算81

Cursor

17.99%
按下载量换算49

Gemini CLI

8.87%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills