A unified, intelligent guide for building and maintaining high-performance mobile applications within the Clawhub ecosystem.
Add this directory to your agent's skill path.
Ensure you have the following global dependencies installed:
bash
npm install -g expo-cli eas-cli react-native-clean-pattern
OR
bash
bun clawdhub install react-native-clean-pattern
bash
/provision-app
bash
/make-screen
bash
/make-component
bash
/setup-api
/setup-navigation
Follow these steps for any task in the Clawhub ecosystem:
@shared components or @hooks.getStyles using the useAppStyle() hook for RTL-compliance. Use HSL tokens from @styles/common.controller.ts, utilizing @hooks/useRedux and @services/apiClient.mountedRef is used in all async controllers to prevent Memory Leaks.npx tsc --noEmit and check RTL/LTR UI toggle.Standardized, strictly typed, and RTL-ready folder architecture. All files must be interconnected via aliases.
text
.
├── app/ # Expo Router (routes & layouts)
├── screens/ # Feature-specific implementations (MVC-Lite)
├── components/ # Distributed Atom/Molecule components
│ ├── [RegularComponent]/ # Regular/Feature components (e.g., DynamicIsland)
│ └── SharedComponent/ # Global blessed component library (@shared)
├── services/ # Infrastructure (API, Auth, Firebase, Storage)
├── store/ # State Management (Redux Power Slices)
├── hooks/ # Custom logical hooks (@hooks)
├── helpers/ # Shared pure logic & utilities (@helpers)
├── enums/ # Global Constants & Types (@enums)
├── styles/ # Design Token System (@styles)
├── i18n/ # Localization assets (@i18n)
└── assets/ # Media & Fonts (@assets)
Never use relative paths ( ../../). Always use:
@shared, @services, @hooks, @store, @helpers, @config, @styles, @enums.
@enums)#Use these enums to ensure zero string-literal errors across the app.
EnumKey ValuesAuthScreen``LOGIN, REGISTER, FORGOT_PASSWORD, OTP_VERIFY``ValidationRule``REQUIRED, EMAIL, MIN_LENGTH, MATCH``UserType``USER, VENDOR, ADMIN, DELIVERY_BOY``TokenKey``ACCESS_TOKEN, REFRESH_TOKEN, FCM_TOKEN
@hooks)#HookResponsibilityuseAppDispatch / useAppSelectorStrictly typed Redux access.useRTLManages I18nManager force-flipping and app reloads.useAppStyleDynamic UI pipe that merges base themes with remote config, resolves RTL directionality (rowDirection, textAlign), and provides centralized design tokens and localized font resolution.useAppConfigReactive access to merged Local/Remote Config.useColorSchemeReactive system theme detection (Light/Dark mode).useNotificationsOrchestrates FCM registration, Notifee channel management, and real-time state rehydration (Profile/Theme) upon receipt of push payloads.
@config)#Environment-driven, strictly typed central config:
.env variables via process.env.AppConfig interface.@services/apiClient)#Singleton wrapper with:
Accept-Language headers.JSON and FormData.@services/authService)#Orchestrator for Login, Register, OTP, and Profile management with:
EMAIL_PASSWORD, EMAIL_OTP, and PHONE_OTP.@services/firebaseService)#Platform-aware initialization for Expo Go and Development Builds.
@services/notificationService)#Management of paginated alert listing and "read" state synchronization.
@services/tokenStorage)#Encrypted or AsyncStorage persistence for tokens and user metadata.
@helpers/logger)#Sensitized logging system with:
password, token, authorization, otp).request(), response(), and error() tracing with latency tracking.addBreadcrumb and captureException.__DEV__) with terminal icons (🌐, ✅, ❌, 🔴, ℹ️, ⚠️).@i18n)#RTL-First standard with:
i18next with compatibilityJSON: 'v3' for React Native safe pluralization.AsyncStorage usage to remember language selection across reloads.initializeI18n() async boot sequence required in _layout.tsx.I18nManager force-flip with expo-updates reload (try/catch protected).store directly into the i18n instance.expo-updates for mandatory UI rehydration on direction change.setupRTL() boot helper to maintain state consistency.@store)#Strictly typed state management with:
useAppDispatch and useAppSelector for type-safe state access.ComponentPurposeKey PropsAppTextTypography with RTL font scaling.variant, weight, align``ButtonThemed touchable with loading states.title, loading, icon, variant``AppHeaderRTL-aware screen header with back/actions.title, showBackButton, rightComp``AppInputValidated text input with icons.label, error, icon, secure``PriceTagCurrency-aware formatted price display.price, originalPrice, discount``AppLoaderLottie-powered full-screen or inline loading.visible, variant, message``AppModalStandardized bottom-sheet or center popup.visible, onClose, title
Implemented as isolated folders under screens/ following MVC-Lite:
Core: expo@~55.0.5, react@19.2.0, react-native@0.83.2.
Navigation: @react-navigation/native, @react-navigation/native-stack, @react-navigation/bottom-tabs.
key remounting.State & Logic: @reduxjs/toolkit@^2.11.2, react-redux@^9.2.0.
Networking & Auth: @react-native-firebase/app, @react-native-firebase/messaging.
Persistence: @react-native-async-storage/async-storage@^2.2.0.
Internationalization: i18next@^25.8.16, react-i18next@^16.5.6, expo-localization.
UI & Visuals: lottie-react-native@~7.3.4, react-native-reanimated@4.2.1, react-native-render-html.
Maps & Location: react-native-maps, react-native-maps-directions, expo-location.
Typography: @expo-google-fonts/cairo, @expo-google-fonts/outfit, @expo-google-fonts/roboto.
Observability: @sentry/react-native@~7.11.0.
Native Features: @notifee/react-native, expo-image-picker, expo-document-picker.
Every new screen, feature, OR shared component MUST consist of exactly 4 files:
index.tsx (Skin): Pure JSX. Connects to controller.ts.controller.ts (Brain): logic hook, utilizes @hooks/useRedux.styles.ts (Nerves): Function-based styles consuming useAppStyle.types.ts (Structure): Interface definitions. Zero any.Memory Safety: Always use isMounted ref in controllers. Abort all API calls in useEffect cleanup.
Zero Duplication: Shared logic must stay in @hooks or @helpers. Don't copy-paste styles; use @styles/common. Hard Requirement: All sizes, spacing, and colors must be consumed via useAppStyle().tokens and useAppStyle().colors.
Zero Hardcoding: Using literal hex codes ( #FFFFFF) or RGBA strings in UI components is FORBIDDEN. All UI colors must be resolved from the colors object provided by the central styling hook.
Zero Inline Styles: Using the style={{ ... }} prop in JSX is FORBIDDEN for layout and presentation. All styles MUST be defined in the accompanying styles.ts file and resolve via the screen/component controller to ensure theme and RTL reactivity.
Branding Sync: Primary theme colors MUST be defined in src/config/index.ts and consumed via @constants/Colors.ts to support white-labeling and remote branding.
RTL Enforcement: Use rowDirection and textAlign from useAppStyle.
Sanitization: Never log raw bodies containing password or token.
Absolute Paths: All imports MUST use standardized aliases. Relative paths ( ../../) are forbidden.
@/, @components, @hooks, @constants, @store, @i18n, @assets, @config, @app-types, @enums, @utils, @helpers, @services, @screens, @styles.npx tsc --noEmit passes with zero errors.@styles/common.mountedRef safety.When starting a NEW application, you must follow this interactive training flow to ensure architectural integrity without merely copy-pasting old classes.
You MUST ask the user for authorization to implement:
Project Identity: Targeted app name and bundle identifier.
Localization: RTL support needs and target languages (LTR: EN, ES, FR, etc. | RTL: AR, HE, FA, etc.).
Core Screens:
app/_layout.tsx: Master orchestrator (Sentry, Redux, RTL, Hydration).app/(auth): Auth flow group (Login, Register, OTP).app/(tabs): Main application navigation.Core Auth: Login, Register, OTP, and Forgot Password recovery screens.
State Architecture: Redux Toolkit (Auth/App/Notify slices).
Native Bridges: Firebase Messaging and Notifee.
Observation Layer: Sentry integration and Custom Logger.
Persistence: Encrypted Token Storage.
Instead of copying files, generate fresh implementations based on these patterns:
Login, Register, OTP) gets its own Skin, Brain, Nerves, and Structure.apiClient.ts and authService.ts.package.json, tsconfig.json, and app.json.npm install or bun install to pull the Approved Dependency Matrix..env file from the .env.example template.npx expo start to verify the baseline.Use these commands to automate common development tasks within the Clawhub ecosystem:
CommandPurposeWhen to Use/provision-appInitialize ProjectStarting a new app from scratch./setup-apiAPI & ObservabilityAdding a production-grade apiClient.ts and logger.ts./setup-navigationRouter SetupScaffolding Root (Auth) and Main (Dynamic Tab) navigators./make-screenFeature ScaffoldingCreating a new screen using the 4-file MVC-Lite pattern./make-componentUI ScaffoldingCreating a new Shared, Regular, or Local component.