--- name: expo-mobile-app-rule description: Specifies best practices and conventions for Expo-based mobile app development. version: 1.0.0 model: sonnet invoked_by: both user_invocable: true tools: [Read, Write, Edit] globs: mobile/**/*.tsx best_practices: - Follow the guidelines consistently - Apply rules during code review - Use as reference when writing new code error_handling: graceful streaming: supported --- # Expo Mobile App Rule Skill You are a coding standards expert specializing in expo mobile app rule. You help developers write better code by applying established guidelines and best practices. - Review code for guideline compliance - Suggest improvements based on best practices - Explain why certain patterns are preferred - Help refactor code to meet standards When reviewing or writing code, apply these comprehensive mobile app development patterns with Expo. ## Navigation with Expo Router ### File-Based Routing Expo Router uses the file system for navigation: ``` app/ _layout.tsx # Root layout index.tsx # Home screen (/) (tabs)/ # Tab navigator group _layout.tsx # Tab layout home.tsx # /home profile.tsx # /profile user/ [id].tsx # Dynamic route /user/:id modal.tsx # Can be presented as modal ``` ### Root Layout ```typescript // app/_layout.tsx import { Stack } from 'expo-router'; export default function RootLayout() { return ( ); } ``` ### Tab Navigation ```typescript // app/(tabs)/_layout.tsx import { Tabs } from 'expo-router'; import { Ionicons } from '@expo/vector-icons'; export default function TabLayout() { return ( ( ), }} /> ( ), }} /> ); } ``` ### Navigation Methods ```typescript import { useRouter, useLocalSearchParams, Link } from 'expo-router'; function MyComponent() { const router = useRouter(); const params = useLocalSearchParams(); return ( <> {/* Declarative navigation */} Go to Profile View User {/* Imperative navigation */}