capacitor-plugin-generator

Generates Capacitor plugin scaffolds and first-pass implementations from conversational requirements or YAML contracts.

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/involvex/ionic-everywhere --skill capacitor-plugin-generator-involvex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: capacitor-plugin-generator
Source: https://github.com/involvex/ionic-everywhere/tree/main/.agents/skills/capacitor-plugin-generator
Command: npx skills add https://github.com/involvex/ionic-everywhere --skill capacitor-plugin-generator-involvex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing a Capacitor plugin from scratch requires coordinating TypeScript contracts, web fallbacks, Swift iOS code, Kotlin/Java Android code, permissions, events, docs, and publishing checks. This Skill automates that multi-platform scaffolding so you get a reviewable plugin candidate instead of a blank directory. ## Core Features & Use Cases - Dual input modes: Accepts conversational requirements or a structured YAML contract (including handoff from the cordova-capacitor-plugin-migration skill) and skips unnecessary questions in structured mode. - Contract-first generation: Designs src/definitions.ts first, then implements web, iOS (Swift), and Android (Kotlin/Java) layers with name parity across registerPlugin, jsName, and @CapacitorPlugin. - Verification and publish checks: Runs docgen, platform verify commands, and npm publish dry-run only, keeping humans in the review loop. - Use Case: Ask for a biometric-auth plugin for iOS and Android; the Skill scaffolds the package, defines the TypeScript API with permission methods, implements both native bridges, and generates a sample app exercising the full API. ## Quick Start Ask the assistant to generate a Capacitor plugin for your desired native capability, describing the methods, platforms, and permissions you need.

Frequently Asked Questions about capacitor-plugin-generator

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

FAQPage Schema
How do I generate a Capacitor plugin for iOS and Android?

Describe the plugin's methods, platforms, events, and permissions conversationally, or provide a structured YAML contract. The Skill runs the official npm init @capacitor/plugin scaffolder non-interactively, then implements the TypeScript contract, web layer, Swift bridge, and Kotlin/Java bridge.

What is the input contract for structured Capacitor plugin generation?

The structured mode uses a YAML document with plugin, platforms, and api fields defined in references/input-contract.md. When valid YAML is provided, the generator skips elicitation entirely and halts if the optional migration block contains blockers or tier 3 hooks.

Can this Skill migrate a Cordova plugin to Capacitor?

No, it does not analyze Cordova source. The sibling cordova-capacitor-plugin-migration skill performs that analysis and produces the YAML contract this generator consumes as structured input.

Why does my generated Capacitor plugin fail to load silently?

Silent load failures almost always come from name drift: the registerPlugin() JavaScript name must exactly match the iOS jsName and the Android @CapacitorPlugin(name) annotation. The generator enforces this parity during scaffolding.

Does the generated Capacitor plugin get published to npm automatically?

No. The Skill only runs pre-publish checks and npm publish --access public --dry-run. Generated output is a reviewable candidate, and real publishing requires explicit human review outside the Skill.

What error codes should a Capacitor plugin use?

The Skill applies a canonical four-code taxonomy: UNAVAILABLE, PERMISSION_DENIED, INVALID_PARAMETER, and OPERATION_FAILED, with rare subtypes like TIMEOUT or CANCELLED. Codes are centralized as a Swift enum and Java constants so they stay consistent across platforms.