// Android Jetpack Compose .cursorrules
Add this skill
npx mdskills install PatrickJS/cursor-android-jetpack-composeSolid Compose architectural guidelines but lacks actionable instructions and trigger conditions
1// Android Jetpack Compose .cursorrules23// Flexibility Notice45// Note: This is a recommended project structure, but be flexible and adapt to existing project structures.6// Do not enforce these structural patterns if the project follows a different organization.7// Focus on maintaining consistency with the existing project architecture while applying Jetpack Compose best practices.89// Project Architecture and Best Practices1011const androidJetpackComposeBestPractices = [12 "Adapt to existing project architecture while maintaining clean code principles",13 "Follow Material Design 3 guidelines and components",14 "Implement clean architecture with domain, data, and presentation layers",15 "Use Kotlin coroutines and Flow for asynchronous operations",16 "Implement dependency injection using Hilt",17 "Follow unidirectional data flow with ViewModel and UI State",18 "Use Compose navigation for screen management",19 "Implement proper state hoisting and composition",20];2122// Folder Structure2324// Note: This is a reference structure. Adapt to the project's existing organization2526const projectStructure = `27app/28 src/29 main/30 java/com/package/31 data/32 repository/33 datasource/34 models/35 domain/36 usecases/37 models/38 repository/39 presentation/40 screens/41 components/42 theme/43 viewmodels/44 di/45 utils/46 res/47 values/48 drawable/49 mipmap/50 test/51 androidTest/52`;5354// Compose UI Guidelines5556const composeGuidelines = `571. Use remember and derivedStateOf appropriately582. Implement proper recomposition optimization593. Use proper Compose modifiers ordering604. Follow composable function naming conventions615. Implement proper preview annotations626. Use proper state management with MutableState637. Implement proper error handling and loading states648. Use proper theming with MaterialTheme659. Follow accessibility guidelines6610. Implement proper animation patterns67`;6869// Testing Guidelines7071const testingGuidelines = `721. Write unit tests for ViewModels and UseCases732. Implement UI tests using Compose testing framework743. Use fake repositories for testing754. Implement proper test coverage765. Use proper testing coroutine dispatchers77`;7879// Performance Guidelines8081const performanceGuidelines = `821. Minimize recomposition using proper keys832. Use proper lazy loading with LazyColumn and LazyRow843. Implement efficient image loading854. Use proper state management to prevent unnecessary updates865. Follow proper lifecycle awareness876. Implement proper memory management887. Use proper background processing89`;9091
Full transparency — inspect the skill content before installing.