Native Module Skill
Config plugin and TurboModule scaffolding reviews - an Agent Skill for safely adding native surface area on Expo SDK 57 / React Native 0.86 with CNG and the New Architecture.
Search across all documentation pages
Config plugin and TurboModule scaffolding reviews - an Agent Skill for safely adding native surface area on Expo SDK 57 / React Native 0.86 with CNG and the New Architecture.
Reviews or scaffolds:
app.config.ts + plugins/with-*.ts)create-expo-module layoutexpo-doctor verificationplugins/with-custom-feature.tsprebuild --clean?"ios/ or android/ manually| Input | Why |
|---|---|
app.config.ts | Current plugins array and order |
| Native requirement | Permissions, entitlements, Gradle flags |
| Package name | npm module or local ./modules/foo |
| Architecture mode | New Architecture default on RN 0.86 |
| CNG policy | Generated vs checked-in native dirs |
package.json / autolinking notesnpx expo prebuild --clean + git diff ios/ android/ stepsnpx expo-doctor gateInfo.plist or AndroidManifest.xml.prebuild --clean twice yields empty git diff.create-expo-module - TurboModules for RN-first libraries (Writing a TurboModule).eas build - skill rejects OTA-only release plans.Quick-reference recipe card - copy-paste ready.
// app.config.ts
import type { ExpoConfig } from "expo/config";
export default ({ config }: { config: ExpoConfig }): ExpoConfig => ({
...config,
plugins: [
[
"expo-build-properties",
{
ios: { deploymentTarget: "15.1" },
android: { minSdkVersion: 24, compileSdkVersion: 35 },
},
],
"./plugins/with-analytics-sdk",
],
});// plugins/with-analytics-sdk.ts
import {
ConfigPlugin,
withInfoPlist,
withAndroidManifest,
createRunOncePlugin,
} from "expo/config-plugins";
const withAnalyticsSdk: ConfigPlugin = (config) => {
config = withInfoPlist(config, (cfg) => {
cfg.modResults.MyAnalyticsEnabled = true;
return cfg;
});
config = withAndroidManifest(config, (cfg) => {
// add manifest entries - keep idempotent
return cfg;
});
return config;
};
export default createRunOncePlugin(
withAnalyticsSdk,
"with-analytics-sdk",
"1.0.0"
);npx expo prebuild --clean
git diff ios/ android/
npx expo-doctor
eas build --profile preview --platform all # never OTA-only for this changeWhen to reach for this skill:
AndroidManifest.xml" - skill converts to pluginios/Podfile edit - skill redirects to CNG-safe pathReview checklist the skill emits:
## Config plugin review
- [ ] Uses createRunOncePlugin with name + version
- [ ] No absolute paths; reads from config props
- [ ] Info.plist / manifest changes are merge-safe
- [ ] Documented plugin order relative to expo-build-properties
- [ ] prebuild --clean → review diff → second prebuild → empty diff
- [ ] expo-doctor passes
- [ ] eas build planned (OTA insufficient)See Patching Native Projects when upstream lacks a plugin.
npx create-expo-module@latest expo-secure-counter
# Wire in app:
npx expo install ./modules/expo-secure-counter// modules/my-turbo-lib/src/NativeMyTurboLib.ts
import type { TurboModule } from "react-native";
import { TurboModuleRegistry } from "react-native";
export interface Spec extends TurboModule {
getConstants(): { value: string };
process(input: string): string;
}
export default TurboModuleRegistry.getEnforcing<Spec>("MyTurboLib");// package.json codegenConfig excerpt
{
"codegenConfig": {
"name": "MyTurboLibSpec",
"type": "modules",
"jsSrcsDir": "src"
}
}Use Native Module skill. SDK 57, CNG (no checked-in ios/android).
Vendor requires NSCameraUsageDescription + Android CAMERA permission for barcode SDK.
Produce config plugin skeleton and app.config.ts plugins array entry.
Include prebuild --clean verification and eas build note.Use Native Module skill - PR review mode.
Attached: plugins/with-payments.ts
Check idempotency, plugin ordering with expo-build-properties, and guardrails.
Do not rewrite vendor code - checklist only.Use Native Module skill.
Need bi-directional native bridge for host app token refresh.
Recommend Expo Module vs TurboModule with RN 0.86 NA default. Scaffold chosen path only.| Criterion | Expo Module | TurboModule |
|---|---|---|
| Owner | App team, single app | RN library, multi-consumer |
| Setup | create-expo-module | Codegen + codegenConfig |
| Config plugin | Often bundled | Usually react-native.config.js |
| Expo CNG fit | Excellent | Good with prebuild |
| Skill default | Yes for app bridges | When publishing RN package |
Only as emergency hotfix with follow-up plugin ticket. CNG prebuild --clean will erase hand edits - skill must flag debt.
Built-in config plugins often suffice. Invoke skill when combining multiple permission plugins or custom Gradle flags.
Never for users on old binaries without the module. Skill output always includes eas build and runtimeVersion review.
Stack versions: This page was written for React 19.2.3, React Native 0.86.0, and Expo SDK 57 (
expo~57.0.4).
Reviewed by Chris St. John·Last updated Jul 16, 2026