monorepo-native-deps-in-app — Claude Code rule: setup guide
monorepo-native-deps-in-app is a Claude Code rule that enforces adding native packages directly to the mobile app manifest. It prevents build failures caused by missed autolinking in monorepos.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/monorepo-native-deps-in-app.mdWhat monorepo-native-deps-in-app does
React Native autolinking only inspects the app's own node_modules folder. When a package containing platform-specific code sits solely inside a shared workspace module, the build pipeline overlooks it and skips compilation.
This rule directs coding agents to declare every native library inside the target app's package.json. Even if shared UI packages consume the dependency, the root mobile package must declare it too.
What it helps with
- prevent autolinking failures for native libraries across workspace packages
- add native dependencies like
react-native-reanimatedto the application manifest - synchronize platform-specific packages between shared modules and the host app
Example prompts for the agent
- Add
react-native-reanimatedtopackages/uiand configure the mobile app dependencies - Audit workspace
package.jsonfiles for unlinked native libraries - Set up a native module inside the shared package and link it into the mobile client
How to install monorepo-native-deps-in-app
Manually: put the files in place
.claude/rules/monorepo-native-deps-in-app.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/monorepo-native-deps-in-app.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/monorepo-native-deps-in-app.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/monorepo-native-deps-in-app.mdManually: put the files in place
.clinerules/monorepo-native-deps-in-app.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about monorepo-native-deps-in-app
How to install monorepo-native-deps-in-app in Claude Code?
Place the rule markdown file at .claude/rules/monorepo-native-deps-in-app.md. Claude Code reads project rules from this folder automatically.
What does monorepo-native-deps-in-app do?
It instructs the AI assistant to list native dependencies in the application package manifest even if they are only imported by shared monorepo packages.
Why does autolinking miss dependencies in shared packages?
Autolinking discovery routines only search the host application's node_modules directory, ignoring native code nestled inside separate workspace folders.