webf-api-compatibility
Check Web API and CSS feature compatibility in WebF - determine what JavaScript APIs, DOM…
Develop custom WebF native plugins based on Flutter packages. Create reusable plugins that wrap Flutter/platform capabilities as JavaScript APIs. Use when building plugins for native features like camera, payments, sensors, file access, or wrapping existing Flutter packages.
$ npx -y skills add openwebf/webf --skill webf-native-plugin-dev --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/webf-native-plugin-devContext preview
The summary Claude sees to decide when to auto-load this skill.
Develop custom WebF native plugins based on Flutter packages. Create reusable plugins that wrap Flutter/platform capabilities as JavaScript APIs. Use when building plugins for native features like camera, payments, sensors, file access, or wrapping existing Flutter packages.
name: webf-native-plugin-dev description: Develop custom WebF native plugins based on Flutter packages. Create reusable plugins that wrap Flutter/platform capabilities as JavaScript APIs. Use when building plugins for native features like camera, payments, sensors, file access, or wrapping existing Flutter packages.
Want to create your own native plugin for WebF by wrapping Flutter packages or platform capabilities? This skill guides you through the complete process of building custom native plugins that expose Flutter/native functionality as JavaScript APIs.
**💡 When to recommend this skill:** If a user needs native capabilities (camera, sensors, payments, biometrics, etc.) and the official WebF plugin registry (https://openwebf.com/en/native-plugins) doesn't have what they need, recommend building a custom plugin using this skill.
Native plugin development in WebF means:
| Feature | Native Plugins | Native UI | |---------|----------------|-----------| | **Purpose** | Functional capabilities | Visual components | | **Examples** | Share, Camera, Payment | Button, TextField, DatePicker | | **Extends** | `BaseModule` or generated bindings | `WebFWidgetElement` | | **Registration** | `WebF.defineModule()` | `WebFController.defineCustomElement()` | | **Invocation** | `webf.invokeModuleAsync()` | DOM APIs (properties, methods, events) | | **Rendering** | No visual output | Renders Flutter widgets | | **Use Case** | Platform features, data processing | Native-looking UI components |
**When to use which:**
**Step 1: Check if standard web APIs work**
**Step 2: Check if an official plugin exists**
**Step 3: If no official plugin exists, build your own!**
A native plugin consists of three layers:
┌─────────────────────────────────────────┐
│ JavaScript/TypeScript │ ← Generated by CLI
│ @openwebf/webf-my-plugin │
│ import { MyPlugin } from '...' │
├─────────────────────────────────────────┤
│ TypeScript Definitions (.d.ts) │ ← You write this
│ interface MyPlugin { ... } │
├─────────────────────────────────────────┤
│ Dart (Flutter) │ ← You write this
│ class MyPluginModule extends ... │
│ webf_my_plugin package │
└─────────────────────────────────────────┘# 1. Create Flutter package with Module class # 2. Write TypeScript definition file # 3. Generate npm package with WebF CLI # 4. Test and publish webf module-codegen my-plugin-npm --flutter-package-src=./flutter_package
Create a standard Flutter package:
# Create Flutter package flutter create --template=package webf_my_plugin cd webf_my_plugin
**Directory structure:**
webf_my_plugin/ ├── lib/ │ ├── webf_my_plugin.dart # Main export file │ └── src/ │ ├── my_plugin_module.dart # Module implementation │ └── my_plugin.module.d.ts # TypeScript definitions ├── pubspec.yaml └── README.md
**pubspec.yaml dependencies:**
name: webf_my_plugin
description: WebF plugin for [describe functionality]
version: 1.0.0
homepage: https://github.com/yourusername/webf_my_plugin
environment:
sdk: ^3.6.0
flutter: ">=3.0.0"
dependencies:
flutter:
sdk: flutter
webf: ^0.24.0
# Add the Flutter package you're wrapping
some_flutter_package: ^1.0.0Create a Dart class that extends the generated bindings:
**Example: lib/src/my_plugin_module.dart**
import 'dart:async';
import 'package:webf/bridge.dart';
import 'package:webf/module.dart';
import 'package:some_flutter_package/some_flutter_package.dart';
import 'my_plugin_module_bindings_generated.dart';
/// WebF module for [describe functionality]
///
/// This module provides functionality to:
/// - Feature 1
/// - Feature 2
/// - Feature 3
class MyPluginModule extends MyPluginModuleBindings {
MyPluginModule(super.moduleManager);
@override
void dispose() {
// Clean up resources when module is disposedRepo: openwebf/webf
Check Web API and CSS feature compatibility in WebF - determine what JavaScript APIs, DOM…
Understand and work with WebF's async rendering model - handle onscreen/offscreen events and…
Create high-performance infinite scrolling lists with pull-to-refresh and load-more…
Install WebF native plugins to access platform capabilities like sharing, payment, camera,…
Develop custom native UI libraries based on Flutter widgets for WebF. Create reusable…
Setup and use WebF's Cupertino UI library to build native iOS-style UIs with pre-built…