Master native modules - Turbo Modules, JSI, Fabric, and platform bridging
Build native modules for iOS and Android using Turbo Modules, JSI, and the new architecture. Use when bridging platform APIs, third-party SDKs, or implementing performance-critical features.
/plugin marketplace add pluginagentmarketplace/custom-plugin-react-native/plugin install react-native-assistant@pluginagentmarketplace-react-nativeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyLearn to build native modules for iOS and Android using Turbo Modules, JSI, and the new architecture.
After completing this skill, you will be able to:
// specs/NativeCalculator.ts
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
add(a: number, b: number): number; // Sync
multiply(a: number, b: number): Promise<number>; // Async
}
export default TurboModuleRegistry.getEnforcing<Spec>('Calculator');
@objc(Calculator)
class Calculator: NSObject {
@objc static func requiresMainQueueSetup() -> Bool { false }
@objc func add(_ a: Double, b: Double) -> Double {
return a + b
}
@objc func multiply(_ a: Double, b: Double,
resolve: @escaping RCTPromiseResolveBlock,
reject: @escaping RCTPromiseRejectBlock) {
resolve(a * b)
}
}
@ReactModule(name = "Calculator")
class CalculatorModule(reactContext: ReactApplicationContext) :
ReactContextBaseJavaModule(reactContext) {
override fun getName() = "Calculator"
@ReactMethod(isBlockingSynchronousMethod = true)
fun add(a: Double, b: Double): Double = a + b
@ReactMethod
fun multiply(a: Double, b: Double, promise: Promise) {
promise.resolve(a * b)
}
}
import { NativeEventEmitter, NativeModules } from 'react-native';
const { MyModule } = NativeModules;
const emitter = new NativeEventEmitter(MyModule);
// Subscribe
const subscription = emitter.addListener('onProgress', (data) => {
console.log('Progress:', data.percent);
});
// Cleanup
subscription.remove();
| Scenario | Solution |
|---|---|
| Access native APIs | Native module |
| Performance-critical | JSI/Turbo Module |
| Third-party SDK | Bridge wrapper |
| UI component | Fabric component |
// JavaScript usage
import NativeCalculator from './specs/NativeCalculator';
// Sync call (blocks JS thread briefly)
const sum = NativeCalculator.add(5, 3);
console.log('Sum:', sum); // 8
// Async call (non-blocking)
const product = await NativeCalculator.multiply(5, 3);
console.log('Product:', product); // 15
| Error | Cause | Solution |
|---|---|---|
| "Module not found" | Not linked | Run pod install |
| Crash on sync | Main thread | Use async or background |
| Type mismatch | Codegen issue | Regenerate specs |
Skill("react-native-native-modules")
Bonded Agent: 04-react-native-native
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.