Skip to main content
Reuse existing public package APIs before copying helpers, schemas, components, or provider code. Reuse should preserve ownership rather than turn one feature into a dependency hub.

Reuse by responsibility

Import from a package’s public entry point when the symbol is part of its supported API. Avoid deep imports into another package’s internal files.

Keep adapters replaceable

Provider SDKs belong in packages/<domain>/src/adapters. Domain consumers should depend on the package contract or registry, not directly on Firebase, RevenueCat, OneSignal, or another vendor SDK. When adding an adapter:
The generated object is only a scaffold. Implement the owning package’s adapter contract and export only the intended public API.

Do not over-share

Keep code local when it is used by one screen and has no stable cross-feature contract. Promote it only when reuse is real and the owner is clear. Avoid these patterns:
  • copying a Zod schema instead of keeping the shared shape in its owning package
  • rebuilding a button or token that exists in @amisi-mobile-starter/ui or @amisi-mobile-starter/theme
  • importing provider SDKs in route files
  • reading environment variables directly outside the approved configuration layer
  • creating circular dependencies between domain packages
  • exposing package internals only to shorten an import

Review the boundary

Before adding a shared export, check who owns the behavior, whether callers need a contract, and whether a provider can still be replaced. Run bun run verify after updating package exports or dependencies.