一键导入
native-module-scaffold
Guided wizard for creating Turbo Modules and Expo Modules with iOS and Android implementations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guided wizard for creating Turbo Modules and Expo Modules with iOS and Android implementations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Apple HIG design intelligence — build, review, animate, and analyze with Apple Human Interface Guidelines for React Native/Expo
Video-based visual debugging — extract key frames from screen recordings and analyze UI bugs over time. Detects animation glitches, race conditions, gesture issues, scroll jank, keyboard overlap, and navigation transitions that screenshots cannot capture.
Auto-generate skills and rules from observed React Native development patterns
ERNE — Implement animations using the ui-designer agent with Reanimated and Gesture Handler
ERNE — Diagnose and fix build failures using the expo-config-resolver agent
ERNE — Comprehensive code review combining code quality and performance analysis
| name | native-module-scaffold |
| description | Guided wizard for creating Turbo Modules and Expo Modules with iOS and Android implementations |
You are creating a native module for React Native. This skill guides you through the entire process from TypeScript API design to native implementations.
Invoke when:
Simplest approach. Uses expo-modules-core for bridging:
npx create-expo-module my-module
Generated structure:
modules/my-module/
expo-module.config.json
src/MyModuleModule.ts # TypeScript API
ios/MyModuleModule.swift # Swift implementation
android/src/.../MyModuleModule.kt # Kotlin implementation
src/__tests__/MyModule.test.ts
Lower level, more control. Uses codegen from TypeScript spec:
Step 1: Define TypeScript spec
// NativeMyModule.ts
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
multiply(a: number, b: number): Promise<number>;
getDeviceInfo(): { model: string; os: string; version: string };
}
export default TurboModuleRegistry.getEnforcing<Spec>('MyModule');
Step 2: Implement iOS (Swift)
@objc(MyModule)
class MyModule: NSObject {
@objc func multiply(_ a: Double, b: Double, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
resolve(a * b)
}
@objc func getDeviceInfo() -> [String: String] {
return [
"model": UIDevice.current.model,
"os": UIDevice.current.systemName,
"version": UIDevice.current.systemVersion
]
}
}
Step 3: Implement Android (Kotlin)
class MyModuleModule(reactContext: ReactApplicationContext) :
NativeMyModuleSpec(reactContext) {
override fun multiply(a: Double, b: Double): Promise {
return Promise.resolve(a * b)
}
override fun getDeviceInfo(): WritableMap {
return Arguments.createMap().apply {
putString("model", Build.MODEL)
putString("os", "Android")
putString("version", Build.VERSION.RELEASE)
}
}
}
For custom UI components rendered natively:
// NativeMyView.ts
import type { ViewProps } from 'react-native';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
interface NativeProps extends ViewProps {
color?: string;
radius?: number;
}
export default codegenNativeComponent<NativeProps>('MyView');