jonluca/palate / .agents/skills/expo-module
expo-module
VerifiedFramework (OSS). Guide for creating and writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript). Covers module definition DSL, native views, shared objects, config plugins, lifecycle hooks, autolinking, and type system. Use when building or modifying native modules for Expo. Not for migrating an existing Swift module from the definition DSL to the Expo Modules API 2.0 macros; use expo-migrate-module (from the expo-experiments plugin) for that.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.4 KB |
| agents/openai.yaml | config | 367 B |
| references/config-plugin.md | markdown | 2.0 KB |
| references/create-expo-module.md | markdown | 9.8 KB |
| references/lifecycle.md | markdown | 3.7 KB |
| references/module-config.md | markdown | 1.7 KB |
| references/native-module.md | markdown | 5.7 KB |
| references/native-view.md | markdown | 3.5 KB |
references/config-plugin.md
View on GitHub# Config Plugins Reference
Config plugins customize native Android and iOS projects generated with `npx expo prebuild`. They are synchronous functions that accept an `ExpoConfig` and return a modified version.
## Plugin Structure
```
my-module/
plugin/
tsconfig.json
src/
index.ts
app.plugin.js # Entry: module.exports = require('./plugin/build');
```
## Writing a Plugin
Plugin functions follow the `with` prefix naming convention.
```typescript
import {
ConfigPlugin,
withInfoPlist,
withAndroidManifest,
AndroidConfig,
} from "expo/config-plugins";
const withMyConfig: ConfigPlugin<{ apiKey: string }> = (config, { apiKey }) => {
// iOS: modify Info.plist
config = withInfoPlist(config, (config) => {
config.modResults["MY_API_KEY"] = apiKey;
return config;
});
// Android: modify AndroidManifest.xml
config = withAndroidManifest(config, (config) => {
const mainApp =
AndroidConfig.Manifest.getMainApplicationOrThrow(config.modResults);
AndroidConfig.Manifest.addMetaDataItemToMainApplication(
mainApp,
"MY_API_KEY",
apiKey
);
return config;
});
return config;
};
export default withMyConfig;
```
## Using in app.json
```json
{
"expo": {
"plugins": [["my-module", { "apiKey": "secret_key" }]]
}
}
```
## Reading Config Values in Native Code
**Swift:**
```swift
Function("getApiKey") {
return Bundle.main.object(forInfoDictionaryKey: "MY_API_KEY") as? String
}
```
**Kotlin:**
```kotlin
Function("getApiKey") {
val appInfo = appContext?.reactContext?.packageManager?.getApplicationInfo(
appContext?.reactContext?.packageName.toString(),
PackageManager.GET_META_DATA
)
return@Function appInfo?.metaData?.getString("MY_API_KEY")
}
```
## Key Rules
- Plugins must be synchronous; return values must be serializable (except `mods`)
- `Mods` are async functions invoked during the prebuild "syncing" phase
- Use `npm run build plugin` to compile TypeScript plugins
- Test with `npx expo prebuild --clean`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |