add-native
π Shared instructions: shared-instructions.md β read first.
Add Native Capability
Generate a one-file typed wrapper under src/native/ for a native device capability that the upstream template already ships. Screens import the wrapper instead of touching Expo modules directly, so the discriminated-union result contract stays consistent across the app.
Hard rules β do NOT cross these lines
- Never run
npx expo install,npm install, oryarn addfor a native module. The set of native modules inpackage.jsonis fixed by the upstream template. Adding a new one breaks the rewrap pipeline (the customer's binary is built from a pre-built base, not from theirpackage.json). - Never edit
app.config.jsβ plugins,ios.infoPlist,android.permissions, or anything else. All native config the template ships is intentional and signed off; arbitrary additions cannot be honored at rewrap time. - Never edit
package.jsondependenciesfor native modules (anything starting withexpo-,react-native-, or that ships an iOS/Android folder). Generic JS-only libraries (e.g.,date-fns,zod,@tanstack/react-query) are not native modules and remain fine to install vianpx expo install <pkg>from other skills β this rule scopes only to packages with a config plugin or native code. - If the requested module isn't actually present in
package.jsonβ STOP. That means the upstream template hasn't shipped it yet; do not work around by installing it.
Routing β /add-native is the public entry point
Some capabilities have a dedicated implementation helper that does more than a plain wrapper (camera writes scanner/upload helpers; PDF report/viewer helpers enforce local-vs-HTTPS boundaries; pen has native-control-specific validation). Users should still call /add-native <capability> for native controls. When a dedicated implementation exists, run it internally and do not ask the user to run that helper directly.
Lookup convention: after normalizing the capability, first check the internal-helper map below. For camera, image-picker, barcode-scanner, and qr-scanner, read and execute ${CLAUDE_SKILL_DIR}/add-camera/SKILL.md inside this /add-native invocation. For pdf-report, read and execute ${CLAUDE_SKILL_DIR}/add-pdf-report/SKILL.md. For pdf-viewer, read and execute ${CLAUDE_SKILL_DIR}/add-pdf-viewer/SKILL.md. For pen-input, read and execute ${CLAUDE_SKILL_DIR}/add-pen-input/SKILL.md. For geolocation, read and execute ${CLAUDE_SKILL_DIR}/add-geolocation/SKILL.md. If no helper exists, fall through to this skill's inline wrapper flow.