architecture_skill

This skill helps implement MVVM, Clean Architecture, and SOLID principles in Android apps using repository and dependency injection for robust, testable code.
  • Python

1

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill pluginagentmarketplace/custom-plugin-android --skill architecture

  • SKILL.md2.5 KB

Overview

This skill provides concise guidance and examples for building Android apps using MVVM, Clean Architecture, the Repository pattern, dependency injection, and SOLID principles. It focuses on practical code patterns, module boundaries, and testable abstractions to help teams scale and maintain projects. The content is oriented toward Android developers integrating these patterns with Kotlin and DI frameworks like Hilt.

How this skill works

The skill inspects typical architectural layers and shows how to organize responsibilities across domain, application, presentation, and infrastructure. It demonstrates wiring repositories to ViewModels, defining interfaces for data sources, and providing DI modules to assemble implementations. Example snippets illustrate coroutine usage in ViewModelScope, repository fallbacks between local DAO and remote API, and Hilt provider modules.

When to use it

  • Starting a new Android app to establish a maintainable architecture
  • Refactoring a monolithic codebase into clear layers and testable units
  • Implementing dependency injection to manage lifetime and replaceable implementations
  • Designing offline-first apps that combine local DAO and remote API access
  • Enforcing SOLID principles across teams for clearer ownership and easier testing

Best practices

  • Define clear layer boundaries: domain, application/use-cases, presentation, infrastructure
  • Program to interfaces: expose repositories and use-cases as abstractions
  • Use dependency injection for wiring and to enable easy replacement in tests
  • Keep ViewModels free of heavy logic; delegate business rules to use-cases or domain services
  • Write small, single-responsibility classes and keep side effects at the infrastructure layer
  • Prefer suspend functions and structured concurrency (viewModelScope) for async work

Example use cases

  • User profile flow: ViewModel calls UserRepository which queries local DAO then falls back to remote API
  • Onboarding: orchestrate use-cases for registration, persistence, and navigation in presentation layer
  • Caching strategy: implement repository that merges API responses and local cache with TTL
  • Feature toggle rollout: swap repository implementation via DI for different backend behavior
  • Unit testing: provide fake repositories or DAOs via DI to validate ViewModel and use-case logic

FAQ

Keep pure business rules and entities in domain; put orchestration and app-specific use-cases in the application layer that call domain logic and coordinate repositories.

When should I create a repository interface?

Create an interface when you need to decouple data access from callers, support multiple data sources, or enable test doubles. If data access is trivial and unlikely to change, a direct DAO may suffice.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational