.claude/skills/ts-capacitor/SKILL.md
Turn web apps into native mobile apps with Capacitor — access native device APIs from JavaScript. Use when someone asks to "convert my website to a mobile app", "Capacitor", "web to native app", "access camera from JavaScript", "deploy web app to App Store", "hybrid mobile app", or "Ionic Capacitor". Covers native API access, plugin system, web-to-native bridge, and app store deployment.
npx skillsauth add eliferjunior/Claude capacitorInstall 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.
Capacitor wraps your web app in a native container and gives it access to native device APIs — camera, file system, push notifications, biometrics, geolocation, and more. Your existing React/Vue/Angular/Svelte app becomes an iOS and Android app without rewriting in Swift or Kotlin. Built by the Ionic team, it's the modern replacement for Cordova/PhoneGap.
npm install @capacitor/core @capacitor/cli
npx cap init "My App" com.mycompany.myapp
# Add platforms
npm install @capacitor/ios @capacitor/android
npx cap add ios
npx cap add android
# Build your web app first
npm run build
# Copy web assets to native projects
npx cap sync
# Open in native IDE
npx cap open ios # Opens Xcode
npx cap open android # Opens Android Studio
# Or run directly
npx cap run ios --target "iPhone 15"
npx cap run android
# Install plugins
npm install @capacitor/camera @capacitor/filesystem @capacitor/push-notifications
npm install @capacitor/haptics @capacitor/share @capacitor/browser
npx cap sync
// src/native/camera.ts — Access the device camera
import { Camera, CameraResultType, CameraSource } from "@capacitor/camera";
async function takePhoto(): Promise<string> {
const photo = await Camera.getPhoto({
quality: 80,
allowEditing: false,
resultType: CameraResultType.Uri,
source: CameraSource.Camera,
});
return photo.webPath!; // File URI to display in <img>
}
async function pickFromGallery(): Promise<string[]> {
const photos = await Camera.pickImages({
quality: 80,
limit: 5,
});
return photos.photos.map((p) => p.webPath!);
}
// src/native/notifications.ts — Push notifications
import { PushNotifications } from "@capacitor/push-notifications";
async function registerPush() {
const permission = await PushNotifications.requestPermissions();
if (permission.receive === "granted") {
await PushNotifications.register();
}
PushNotifications.addListener("registration", (token) => {
console.log("FCM Token:", token.value);
// Send token to your server
});
PushNotifications.addListener("pushNotificationReceived", (notification) => {
console.log("Received:", notification.title, notification.body);
});
}
// src/native/filesystem.ts — File system access
import { Filesystem, Directory } from "@capacitor/filesystem";
async function saveFile(data: string, filename: string) {
await Filesystem.writeFile({
path: filename,
data: data,
directory: Directory.Documents,
});
}
async function readFile(filename: string): Promise<string> {
const result = await Filesystem.readFile({
path: filename,
directory: Directory.Documents,
});
return result.data as string;
}
// src/utils/platform.ts — Adapt behavior per platform
import { Capacitor } from "@capacitor/core";
export const isNative = Capacitor.isNativePlatform();
export const platform = Capacitor.getPlatform(); // 'ios' | 'android' | 'web'
// Use native features when available, fallback to web
async function share(text: string) {
if (isNative) {
const { Share } = await import("@capacitor/share");
await Share.share({ text });
} else {
navigator.share?.({ text }) ?? navigator.clipboard.writeText(text);
}
}
User prompt: "I have a React web app. Make it available on iOS and Android."
The agent will add Capacitor, configure native projects, add platform detection for native features, and prepare for App Store/Play Store submission.
User prompt: "Add photo capture and file upload to my mobile web app."
The agent will install Capacitor camera and filesystem plugins, create a photo capture component with gallery fallback, and implement file upload.
npx cap sync after every web build — copies assets to native projectsnpx cap run for testing — faster than opening IDE each timeCapacitor.isNativePlatform() for conditional native featuresnpx cap run ios --livereloadcapacitor.config.ts — configure server URL, plugins, app infodevelopment
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.