skills/capacitor-app-creation/SKILL.md
Guides the agent through creating a new Capacitor app from scratch. Covers project scaffolding with the Capacitor CLI, configuring the app (appId, appName, webDir), adding native platforms (iOS, Android), and syncing. Includes decision points for Ionic Framework integration, live updates, and CI/CD setup. Do not use for upgrading existing Capacitor apps, migrating from other frameworks, or plugin installation.
npx skillsauth add capawesome-team/skills capacitor-app-creationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a new Capacitor app from scratch, including project scaffolding, platform setup, and optional integrations.
node --version.xcode-select --install.Before creating the app, ask the user:
Do you want to use the Ionic Framework for UI components and theming? (yes/no)
If the user answers yes, stop this skill and switch to the ionic-app-creation skill instead. If no, continue with Step 2.
Ask the user which web framework they want to use. Present these options:
Based on the selection, scaffold the web project:
npm install -g @angular/cli
ng new my-app
cd my-app
The default web asset directory for Angular is dist/my-app/browser. Adjust the directory name based on the actual project name.
npm create vite@latest my-app -- --template react-ts
cd my-app
npm install
The default web asset directory for React (Vite) is dist.
npm create vite@latest my-app -- --template vue-ts
cd my-app
npm install
The default web asset directory for Vue (Vite) is dist.
If the user has an existing web app, confirm it meets these requirements:
package.json file exists at the project root.dist, www, build).index.html file exists at the root of the build output directory.index.html file contains a <head> tag (required for Capacitor plugins to work).If the user wants a vanilla project:
mkdir my-app && cd my-app
npm init -y
mkdir www
Then create www/index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My App</title>
</head>
<body>
<h1>My App</h1>
</body>
</html>
The web asset directory is www.
Navigate to the project root directory and install the Capacitor core packages:
npm install @capacitor/core
npm install -D @capacitor/cli
Run the Capacitor init command with the app name, app ID, and web asset directory:
npx cap init <appName> <appID> --web-dir <webDir>
<appName>: Ask the user for the display name of the app (e.g., "My App").<appID>: Ask the user for the app ID in reverse-domain format (e.g., com.example.myapp).<webDir>: Use the web asset directory determined in Step 2 (e.g., dist, www, dist/my-app/browser).This creates a capacitor.config.ts file in the project root.
Before adding native platforms, build the web app so the output directory exists:
ng build
npm run build
No build step needed if using a static www/ directory.
Ask the user which platforms to add:
Which platforms do you want to add? (android/ios/both)
npm install @capacitor/android
npx cap add android
This creates the android/ directory with a native Android project.
npm install @capacitor/ios
npx cap add ios
This creates the ios/ directory with a native iOS project. By default, Capacitor 8 uses Swift Package Manager (SPM) for iOS dependency management.
Sync the web assets and native dependencies:
npx cap sync
This copies the built web assets into each native platform project and installs native dependencies (Gradle for Android, SPM for iOS).
Run the app on a connected device or emulator/simulator:
npx cap run android
This prompts for a target device (emulator or physical device).
npx cap run ios
This prompts for a target simulator or physical device.
After the app is running, ask the user:
Do you want to set up Live Updates for over-the-air updates? (yes/no)
If yes, refer the user to the capawesome-cloud skill for live update setup.
Then ask:
Do you want to set up CI/CD for native builds and app store publishing? (yes/no)
If yes, refer the user to the capawesome-cloud skill for CI/CD setup.
npx cap init fails with "already initialized": A capacitor.config.ts or capacitor.config.json file already exists. The project is already a Capacitor project. Delete the existing config file if re-initialization is intended.npx cap add fails with "platform already exists": The android/ or ios/ directory already exists. Remove the directory first: rm -rf android or rm -rf ios, then re-run npx cap add.npx cap sync fails with "could not find the web assets directory": The web app has not been built yet, or the webDir in capacitor.config.ts points to a non-existent directory. Run the web app build command first (e.g., npm run build, ng build).npx cap sync ios to ensure SPM dependencies are resolved.ANDROID_HOME or ANDROID_SDK_ROOT environment variable is set. Open Android Studio SDK Manager to install missing SDK versions.index.html missing <head> tag: Capacitor plugins inject scripts into the <head> tag. Ensure the index.html in the web asset directory contains a <head> element.ionic-app-creation — Create a new Ionic app with UI components and theming instead of a plain Capacitor app.capacitor-app-development — General Capacitor app development guidance after app creation.capacitor-angular — Angular-specific patterns and best practices for Capacitor apps.capacitor-react — React-specific patterns and best practices for Capacitor apps.capacitor-vue — Vue-specific patterns and best practices for Capacitor apps.capacitor-plugins — Install and configure Capacitor plugins after app creation.capawesome-cloud — Set up live updates, native builds, and CI/CD for the app.tools
A comprehensive starting point for AI agents to work with the Ionic Framework. Covers core concepts, components, CLI, theming, layout, lifecycle, navigation, and framework-specific patterns for Angular, React, and Vue. Pair with the other Ionic skills in this collection for deeper topic-specific guidance like app creation, framework integration, and upgrades.
tools
Guides the agent through setting up and using Capawesome Cloud for Capacitor and Cordova apps. Covers three core workflows: (1) Native Builds — cloud builds for iOS and Android (Capacitor, Cordova, or native projects), signing certificates, environments, Trapeze configuration, and build artifacts; (2) Live Updates — OTA updates via the @capawesome/capacitor-live-update or @capawesome/cordova-live-update plugin, channels, versioning, rollbacks, and code signing; (3) App Store Publishing — automated submissions to Apple App Store (TestFlight) and Google Play Store. Includes CI/CD integration for all workflows. Do not use for non-Capacitor, non-Cordova mobile frameworks such as React Native or Flutter.
tools
Guides the agent through installing, authenticating, configuring, and using the Capawesome CLI (@capawesome/cli). Covers installation, interactive and token-based authentication, project linking via capawesome.config.json, the full command reference (app management, native builds, live updates, certificates, environments, channels, deployments, destinations, devices), CI/CD integration with token auth and JSON output, and diagnostics via the doctor command. Do not use for Capawesome Cloud feature setup (native builds workflow, live updates workflow, app store publishing) — use the capawesome-cloud skill instead.
tools
A comprehensive starting point for AI agents to work with Capacitor. Covers core concepts, CLI, app creation, plugins, framework integration, best practices, storage, security, testing, troubleshooting, upgrading, and Capawesome Cloud (live updates, native builds, app store publishing). Pair with the other Capacitor skills in this collection for deeper topic-specific guidance.