mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-30 23:04:59 +08:00
add .mdc file
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
---
|
||||
description: Recommends a flexible project structure for Android applications, adapting to existing project organization.
|
||||
globs: app/**/*
|
||||
---
|
||||
- Note: This is a reference structure. Adapt to the project's existing organization
|
||||
|
||||
- Project Structure:
|
||||
|
||||
app/
|
||||
src/
|
||||
main/
|
||||
java/com/package/
|
||||
data/
|
||||
repository/
|
||||
datasource/
|
||||
models/
|
||||
domain/
|
||||
usecases/
|
||||
models/
|
||||
repository/
|
||||
presentation/
|
||||
screens/
|
||||
components/
|
||||
theme/
|
||||
viewmodels/
|
||||
di/
|
||||
utils/
|
||||
res/
|
||||
values/
|
||||
drawable/
|
||||
mipmap/
|
||||
test/
|
||||
androidTest/
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
---
|
||||
description: Applies general best practices for Android Jetpack Compose development within the main application code.
|
||||
globs: app/src/main/java/com/package/**/*.kt
|
||||
---
|
||||
- Adapt to existing project architecture while maintaining clean code principles.
|
||||
- Follow Material Design 3 guidelines and components.
|
||||
- Implement clean architecture with domain, data, and presentation layers.
|
||||
- Use Kotlin coroutines and Flow for asynchronous operations.
|
||||
- Implement dependency injection using Hilt.
|
||||
- Follow unidirectional data flow with ViewModel and UI State.
|
||||
- Use Compose navigation for screen management.
|
||||
- Implement proper state hoisting and composition.
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: Outlines performance optimization guidelines for Android Jetpack Compose applications.
|
||||
globs: app/src/main/java/com/package/**/*.kt
|
||||
---
|
||||
- Minimize recomposition using proper keys.
|
||||
- Use proper lazy loading with LazyColumn and LazyRow.
|
||||
- Implement efficient image loading.
|
||||
- Use proper state management to prevent unnecessary updates.
|
||||
- Follow proper lifecycle awareness.
|
||||
- Implement proper memory management.
|
||||
- Use proper background processing.
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Defines testing guidelines for Android Jetpack Compose components, ViewModels, and UseCases.
|
||||
globs: app/src/test/java/com/package/**/*.kt
|
||||
---
|
||||
- Write unit tests for ViewModels and UseCases.
|
||||
- Implement UI tests using Compose testing framework.
|
||||
- Use fake repositories for testing.
|
||||
- Implement proper test coverage.
|
||||
- Use proper testing coroutine dispatchers.
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: Enforces specific UI-related guidelines for Jetpack Compose within the presentation layer.
|
||||
globs: app/src/main/java/com/package/presentation/**/*.kt
|
||||
---
|
||||
- Use remember and derivedStateOf appropriately.
|
||||
- Implement proper recomposition optimization.
|
||||
- Use proper Compose modifiers ordering.
|
||||
- Follow composable function naming conventions.
|
||||
- Implement proper preview annotations.
|
||||
- Use proper state management with MutableState.
|
||||
- Implement proper error handling and loading states.
|
||||
- Use proper theming with MaterialTheme.
|
||||
- Follow accessibility guidelines.
|
||||
- Implement proper animation patterns.
|
||||
Reference in New Issue
Block a user