К основному содержанию
скилл CX Codex

capacitor-platforms — скилл для Claude Code: Capacitor на десктоп

Проведёт агента через добавление и настройку десктопных платформ Capawesome для Capacitor — Electron и Tauri. Пригодится, когда веб-приложение пора собрать под macOS, Windows и Linux.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add capawesome-team/skills --skill capacitor-platforms -a claude-code
Открыть на GitHub

Что делает capacitor-platforms

Скилл помогает агенту выбрать между @capawesome/capacitor-electron и @capawesome/capacitor-tauri, поставить платформу и настроить её. Обе работают через обычный цикл Capacitor: cap add, cap sync, cap run. Выбор чаще всего решают плагины: Electron тянет нативные реализации под Node, а Tauri собирает веб-ассеты прямо в бинарник.

Внутри — пошаговые процедуры: определение уже установленных платформ и плагинов по package.json, установка и скаффолдинг, синхронизация и запуск, live reload, deep links, упаковка и обновления приложения. Для Tauri синхронизация дополнительно сканирует зависимости плагинов и генерирует capability-файл с запретом по умолчанию, набор крейтов tauri-plugin-* и регистрации плагинов на Rust.

Нужен Node.js 18+ и npm. Для Tauri придётся поставить тулчейн Rust и системные зависимости — без них шаг установки не пройдёт, и скилл советует сначала проверить rustc --version. Ещё нюанс: на Capacitor 6 и 7 CLI игнорирует код выхода хуков платформы, поэтому упавший npx cap sync отчитается об успехе. Ищите в логе строки с [capacitor-electron].

Какие задачи решает

  • выбрать между Electron и Tauri под требования проекта
  • добавить десктопную платформу в существующее Capacitor-приложение
  • настроить live reload и deep links на десктопе
  • проверить, какие Capacitor-плагины переживут переезд на Tauri
  • собрать подписанный бинарник для macOS, Windows и Linux

Примеры запросов агенту

  • Добавь @capawesome/capacitor-electron в проект и настрой окно и deep links
  • Проверь, все ли Capacitor-плагины приложения покрыты веб-реализациями для Tauri
  • Настрой live reload для десктопной платформы через server.url

Как установить capacitor-platforms

1Через Skills CLI (Vercel)

npx skills add capawesome-team/skills --skill capacitor-platforms -a claude-code

2Вручную: положить файлы

~/.claude/skills/capacitor-platforms/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/capacitor-platforms/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о capacitor-platforms

Как установить capacitor-platforms в Claude?

Выполните npx skills add capawesome-team/skills --skill capacitor-platforms -a claude-code. Скилл появится в ~/.claude/skills/capacitor-platforms/SKILL.md.

Что делает capacitor-platforms?

Ведёт агента через добавление, настройку и использование десктопных платформ Capawesome для Capacitor. Закрывает выбор между Electron и Tauri, установку, sync/run, live reload, deep links, совместимость плагинов, упаковку и обновления.

Что нужно для работы скилла?

Node.js 18+ и npm. Для Tauri дополнительно нужен тулчейн Rust с системными зависимостями, а сам скилл советует сначала проверить rustc --version.

Исходный текст

SKILL.md · MIT
---
name: capacitor-platforms
description: "Guides the agent through adding, configuring, and using the Capawesome desktop platforms for Capacitor — @capawesome/capacitor-electron and @capawesome/capacitor-tauri. Covers choosing between Electron and Tauri, installation and scaffolding, sync/run workflows, live reload, deep links, plugin compatibility (Electron plugin implementations and web fallback; Tauri plugin tiers), packaging, and app updates. Do not use for the Android or iOS platforms, installing individual Capacitor plugins, migrating Capacitor apps or plugins to newer versions, or non-Capacitor desktop frameworks."
license: MIT
compatibility: "Requires Node.js 18+ and npm. Tauri additionally requires the Rust toolchain and its system dependencies."
metadata:
  author: capawesome-team
  source: https://github.com/capawesome-team/skills/tree/main/skills/capacitor-platforms
---

# Capacitor Platforms (Desktop)

Bring a Capacitor app to macOS, Windows, and Linux with the Capawesome desktop platforms: [`@capawesome/capacitor-electron`](https://github.com/capawesome-team/capacitor-electron) and [`@capawesome/capacitor-tauri`](https://github.com/capawesome-team/capacitor-tauri). Both use the standard Capacitor workflow (`cap add` / `cap sync` / `cap run`), report `Capacitor.isNativePlatform()` as `true`, and deliver deep links through the standard `@capacitor/app` events.

## Prerequisites

| Requirement | Electron | Tauri |
| --- | --- | --- |
| Node.js | LTS (18+) | LTS (18+) |
| Capacitor | 6+ | 8+ |
| Electron | >= 28 (installed by the scaffold) | — |
| Rust toolchain + system dependencies | — | Required — see the [Tauri prerequisites guide](https://v2.tauri.app/start/prerequisites/) |

On Capacitor 6 and 7, the Capacitor CLI ignores the exit code of platform hooks — a failing `npx cap sync` still reports success. Check the log output for `[capacitor-electron]` errors. Capacitor 8 fails the command properly.

## Agent Behavior

- **Auto-detect before asking.** Read `package.json` and the Capacitor config to determine installed platforms and plugins before prompting the user.
- **Help choose the platform first.** If the user has not committed to Electron or Tauri, apply Step 1 — plugin requirements usually decide it.
- **Always use the full package name** with Capacitor CLI commands (e.g. `npx cap sync @capawesome/capacitor-electron`). A bare `npx cap sync electron` or `npx cap sync tauri` silently does nothing.
- **Check plugin compatibility early.** On Tauri, list the app's Capacitor plugins and verify each is covered by a web implementation or a curated shim (see `references/tauri.md`) before recommending it.

## MCP Servers

Two hosted MCP servers serve the current documentation, so both are always ahead of the guidance bundled with this skill:

- **[Capawesome MCP server](https://capawesome.io/docs/ai/mcp/capawesome/)** — the Capawesome plugins, the Capawesome CLI, and Capawesome Cloud.
- **[Capacitor MCP server](https://capawesome.io/docs/ai/mcp/capacitor/)** (unofficial) — Capacitor itself: the CLI, the `capacitor.config` file, the native Android and iOS projects, and the official plugin APIs.

Both expose `search_docs` and `get_doc_page`, so pick the server by topic before calling either.

- **If the MCP tools are available**, call `search_docs` on the server that owns the topic and read the matching page with `get_doc_page` before applying the guidance below. Where the two disagree, follow the documentation.
- **If they are not available**, mention once that the servers can be added with the commands below, then continue with this skill. Never block on it.

```bash
claude mcp add --transport http capawesome "https://mcp.capawesome.io/mcp"
claude mcp add --transport http capacitor "https://capacitor-mcp.capawesome.io/mcp"
```

Neither server needs an account or a token for documentation. See the `capawesome-mcp` and `capacitor-mcp` skills for full setup, including the Capawesome Cloud tools.

## Procedures

### Step 1: Choose a Platform

| The app needs… | Choose |
| --- | --- |
| Reuse of Capacitor plugins with native (Node) desktop implementations | **Electron** |
| Web-bundle over-the-air updates | **Electron** (Capawesome Cloud Live Updates via `@capawesome/capacitor-live-update` >= 8.5.0, requires Capacitor 8 — see `references/electron.md`; Tauri compiles web assets into the binary — only full signed binary updates) |
| A single, predictable bundled Chromium across all OSes | **Electron** |
| Smallest binaries (~3–10 MB vs ~85–120 MB) and lowest memory use | **Tauri** |
| A deny-by-default security model with a Rust core | **Tauri** |
| No Rust toolchain in dev/CI | **Electron** |

Tauri's trade-offs are inherent, not bugs: no Node runtime (so no arbitrary Capacitor plugin reuse), three different system webviews (WKWebView/WebView2/WebKitGTK), no web-bundle OTA, and a required Rust toolchain. If in doubt, read the Honest Limitations section of the [Tauri platform README](https://github.com/capawesome-team/capacitor-tauri).

### Step 2: Install and Add the Platform

Electron:

```bash
npm install @capawesome/capacitor-electron
npx cap add @capawesome/capacitor-electron
cd electron && npm install && cd ..
```

Then add a `postinstall` script to the app's root `package.json` so the Electron dependencies are always installed together with the main app dependencies:

```json
{
  "scripts": {
    "postinstall": "cd electron && npm ci && cd .."
  }
}
```

Tauri (verify `rustc --version` works first; if not, stop and walk the user through the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/)):

```bash
npm install @capawesome/capacitor-tauri
npx cap add @capawesome/capacitor-tauri
```

Both scaffolds contain only files the user owns (config, icons, a few-line entry point); all runtime logic lives in the versioned package/crate and updates via `npm update` / `cargo update`.

### Step 3: Sync and Run

```bash
npx cap sync @capawesome/capacitor-electron   # or @capawesome/capacitor-tauri
npx cap run @capawesome/capacitor-electron    # or @capawesome/capacitor-tauri
```

Electron sync copies web assets and regenerates the plugin manifest. Tauri sync additionally scans the app's Capacitor plugin dependencies and generates a deny-by-default capability file, the curated `tauri-plugin-*` crate dependencies, and the Rust plugin registrations.

For live reload on either platform, set `server.url` in the Capacitor config to the local dev server and run the platform — see the platform reference for details.

### Step 4: Configure

- Electron: typed options in `electron/capacitor.electron.config.ts` (window, CSP, deep links, hooks) — see `references/electron.md`.
- Tauri: `src-tauri/tauri.conf.json` (window, CSP, deep links via `plugins.deep-link.desktop.schemes`, bundle) — see `references/tauri.md`.

### Step 5: Package for Distribution

- Electron: `cd electron && npm run pack` (electron-builder; vendors the runtime and plugin implementations automatically) — see `references/electron.md`.
- Tauri: `npx cap sync @capawesome/capacitor-tauri && npx tauri build` (native installers per OS) — see `references/tauri.md`.

## References

- `references/electron.md` — scaffold layout, configuration, live reload, deep links, plugin support and plugin development contract, packaging and vendoring, app updates (binary updates and Live Updates), migration from `@capacitor-community/electron`.
- `references/tauri.md` — Rust prerequisites, scaffold layout, sync-time codegen, the plugin tier model (built-in / curated / web fallback), configuration, live reload, deep links, packaging, honest limitations.

## Related Skills

- **`capacitor-app-creation`** — Create a new Capacitor app before adding a desktop platform.
- **`capacitor-app-development`** — General Capacitor development topics, configuration, and troubleshooting.
- **`capacitor-plugins`** — Install and configure Capacitor plugins, including checking desktop platform support.
- **`capawesome-cloud`** — Set up Capawesome Cloud Live Updates for the Electron platform (same app and config as Android/iOS).
- **`capawesome-mcp`** — Connect an MCP client to the hosted Capawesome MCP server for always-current documentation and Capawesome Cloud management.

© capawesome-team · MIT · capawesome-team/skills

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

Всё по теме «Мобильная разработка» →
native-feel-cross-platform-desktop yetone Скилл для проектирования кросс-платформенных десктопных приложений, которые ощущаются нативными: окна, хоткеи, материалы, запуск. CX Codex +1 608установок tauri-v2 nodnarbnitram Подсказывает агенту, как писать команды на Rust, настраивать IPC и capabilities в Tauri v2, и не даёт наступить на типовые грабли сборки. CX Codex +1 8 000установок framework-to-capacitor Cap-go Настраивает статическую сборку Next.js, Nuxt, Angular, SvelteKit или Vite так, чтобы Capacitor упаковал её в приложение для iOS и Android. CX Codex +1 870установок capacitor-splash-screen Cap-go Скилл разбирается, почему в приложении Capacitor мелькает белый экран или сплэш не исчезает, и правит конфиг, тему Android 12+ и iOS storyboard. CX Codex +1 1 100установок electron-development Mindrally Скилл задаёт агенту правила разработки десктопных приложений на Electron: разделение процессов, IPC, безопасность окон. CX Codex +1 1 300установок electron-pro VoltAgent Community Субагент для создания приложений на Electron 27+. Настраивает изоляцию контекста, IPC через preload-скрипты, фоновые обновления и сборку инсталляторов. 376установок

Из того же набора20

ionic-app-upgrades Ведёт агента через мажорный апгрейд Ionic: пошаговые миграции для Angular, React и Vue, ломающие изменения компонентов и CSS-переменных. CX Codex +1 740установок capacitor-in-app-purchases Скилл ведёт агента по шагам: настройка товаров в App Store Connect и Google Play Console, выбор плагина, покупки, валидация чеков и тесты в песочнице. CX Codex +1 728установок ionic-appflow-migration Проводит агента через переезд проекта с Ionic Appflow на Capawesome Cloud: импорт организации одной командой и замена Live Update SDK в приложении. CX Codex +1 663установок ionic-enterprise-sdk-migration Ведёт агента через перенос Capacitor-приложения с закрытых плагинов Ionic Enterprise SDK на альтернативы Capawesome: OAuth, Vault, Biometrics, Secure Preferences, SQLite. CX Codex +1 630установок ionic-react Ведёт агента по разработке приложений на Ionic Framework с React: структура проекта, IonReactRouter, хуки жизненного цикла и работа с состоянием. CX Codex +1 622установок ionic-vue Ведёт агента по разработке Ionic-приложений на Vue: структура проекта, навигация, хуки жизненного цикла и композаблы. Пригодится, когда страницы не обновляют данные при повторном заходе. CX Codex +1 603установок capacitor-app-spm-migration Скилл ведёт агента через перенос iOS-зависимостей Capacitor-приложения с CocoaPods на Swift Package Manager. Пригодится, когда ios/ уже оброс кастомными файлами. CX Codex +1 593установок capgo-cloud-migration Ведёт агента через перенос Capacitor-проекта с Capgo на Capawesome Cloud: находит следы Capgo и меняет плагин, конфиг, каналы и CI/CD. CX Codex +1 409установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой