Agent skill
architecture
MVVM pattern, Clean Architecture, Repository pattern, dependency injection, SOLID principles.
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-android/tree/main/skills/architecture
SKILL.md
App Architecture Skill
Quick Start
MVVM Pattern
@HiltViewModel
class UserViewModel @Inject constructor(
private val repository: UserRepository
) : ViewModel() {
private val _state = MutableLiveData<UiState>()
val state: LiveData<UiState> = _state
fun loadUser(id: Int) {
viewModelScope.launch {
_state.value = repository.getUser(id)
}
}
}
Repository Pattern
interface UserRepository {
suspend fun getUser(id: Int): User
}
class UserRepositoryImpl(
private val dao: UserDao,
private val api: UserApi
) : UserRepository {
override suspend fun getUser(id: Int): User {
return dao.getUser(id) ?: api.fetchUser(id)
}
}
Dependency Injection (Hilt)
@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {
@Provides
fun provideUserRepository(dao: UserDao, api: UserApi): UserRepository {
return UserRepositoryImpl(dao, api)
}
}
Key Concepts
MVVM Benefits
- Lifecycle awareness
- Configuration change handling
- Separation of concerns
- Testability
Clean Architecture Layers
- Domain: Business rules
- Application: Use cases
- Presentation: UI
- Infrastructure: Data sources
SOLID Principles
- S: Single Responsibility
- O: Open/Closed
- L: Liskov Substitution
- I: Interface Segregation
- D: Dependency Inversion
Best Practices
✅ Dependency injection ✅ Interface-based design ✅ Layered architecture ✅ Single responsibility ✅ Testable code
Resources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
platform
Android core components lifecycle, Activities, Fragments, Services, Intent system.
ui
XML layouts, ConstraintLayout, Jetpack Compose, Material Design 3.
data
Room ORM, SQLite, SharedPreferences, DataStore, encryption.
production
Unit testing, performance optimization, security implementation, Play Store deployment.
networking
Retrofit, OkHttp, REST APIs, JSON serialization, network security.
fundamentals
Master Kotlin syntax, OOP principles, SOLID practices, functional programming, and data structures.
Didn't find tool you were looking for?