architecture
Skill17 starsChanged 9 months agoMITView on GitHub
Android application architecture standards using Clean Architecture, MVVM/MVI patterns, Hilt dependency injection, and modularization. Use when: designing app structure, creating ViewModel/Repository/UseCase classes, setting up Hilt DI modules, planning module boundaries, reviewing layer dependencies, implementing offline-first data patterns, defining error handling strategy, or starting a new Android feature module.
136 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- lklimek/claudiustheir own version, first seen Nov 8, 2026
- nisarth/claude-skills-storetheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- denormans/claude-code-workflowtheir own version, first seen Nov 8, 2026
- xiaoyangtx996/Searching-skilltheir own version, first seen Nov 8, 2026
Used with
Projects with it also use intelligent-routing, bash-linux and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 6 projects that use this
xenitV1Skillbash-linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
Also in 8 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 8 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
- +8 more from xenitV1
Other versions136 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 136
- anthropics/knowledge-work-plugins★ 35ksame name
- iOfficeAI/AionUi★ 34ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- nativewind/nativewind★ 8.1ksame name
- PaulWoitaschek/Voice★ 3.3ksame name
- wellwelwel/poku★ 1.2ksame name
- Alwurts/simple-ai★ 755same name
- patrickjaja/claude-desktop-extra★ 734same name
- ktnyt/cclsp★ 673same name
126 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- compose-uiSkill
- kotlin-qualitySkill
- performanceSkill
- play-storeSkill
- privacy-auditSkill
- security-auditSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 118 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 123
Use Result<T> for operations that can fail.
- Very specific: line 133
Use @Binds for interface→implementation bindings (more efficient than @Provides).
- Very specific: line 134
Use correct @InstallIn scope (SingletonComponent, ViewModelComponent, ActivityComponent).
- Very specific: line 135
NEVER inject Activity or Fragment into non-UI classes.
- Very specific: line 136
Use @ApplicationContext when Context is needed in singletons.
- Very specific: line 145
Use Result<T> for all fallible operations in domain/data layers.
- Distinctive: line 148
NEVER silently swallow exceptions — always log or report.
- Distinctive: line 149
Use sealed class hierarchy for typed error handling.
“Common” is measured: kept by at least 6 in 10 of the 118 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Android Architecture Standards
Enforce Clean Architecture patterns with MVVM/MVI for Android Kotlin applications.
Architecture Review Process
Evaluate code against ALL layers. Output findings as:
[ARCH-XXXXX] severity: CRITICAL | HIGH | MEDIUM | LOW
Finding: <architecture violation or improvement>
Location: <file:line>
Fix: <concrete refactoring guidance>1. Layer Architecture
Three Layers (Mandatory)
┌─────────────────────────────────┐
│ Presentation Layer │ UI, ViewModel, UiState
│ (app / feature) │
├─────────────────────────────────┤
│ Domain Layer │ UseCase, Domain Model, Repository Interface
│ (optional) │
├─────────────────────────────────┤
│ Data Layer │ Repository Impl, DataSource, DTO, API, DB
│ (data / network) │
└─────────────────────────────────┘Dependency Rule
Dependencies flow INWARD only:
- Presentation → Domain → Data (allowed)
- Data → Domain (NEVER)
- Presentation → Data directly (AVOID, use Domain)
Package Structure
com.example.app/
├── di/ # Hilt modules
│ ├── AppModule.kt
│ ├── NetworkModule.kt
│ └── DatabaseModule.kt
├── data/
│ ├── local/
│ │ ├── dao/ # Room DAOs
│ │ ├── entity/ # Room entities
│ │ └── AppDatabase.kt
│ ├── remote/
│ │ ├── api/ # Retrofit interfaces
│ │ ├── dto/ # Data Transfer Objects
│ │ └── interceptor/
│ ├── mapper/ # DTO ↔ Domain mappers
│ └── repository/ # Repository implementations
├── domain/
│ ├── model/ # Domain models (pure Kotlin)
│ ├── repository/ # Repository interfaces
│ └── usecase/ # Use cases
└── ui/ # Presentation
├── navigation/
├── theme/
├── component/ # Reusable composables
└── screen/
├── login/
│ ├── LoginScreen.kt
│ ├── LoginViewModel.kt
│ └── LoginUiState.kt
└── home/
├── HomeScreen.kt
├── HomeViewModel.kt
└── HomeUiState.ktReference Guide — Load on Demand
Each reference file contains full code examples, patterns, and detailed checklists. Read the relevant file when reviewing that layer.
| # | Reference File | Content | When to Load |
| 1 | references/presentation.md | ViewModel, UiState, Actions, Events, Screen Composable | Reviewing presentation layer or ViewModel patterns |
| 2 | references/domain.md | UseCase pattern, Domain Model, Repository Interface | Reviewing domain layer or use case design |
| 3 | references/data.md | Repository Impl, Mapper, Offline-First pattern | Reviewing data layer or repository implementation |
| 4 | references/di.md | Hilt Module Structure, scope rules | Setting up or reviewing dependency injection |
| 5 | references/modularization.md | Module types, dependency graph, when to modularize | Planning module boundaries |
| 6 | references/error-handling.md | Error pattern, exception hierarchy | Designing error handling strategy |
Rules Summary
Presentation Layer
- ViewModel NEVER references
Context,Activity, orView. - ViewModel exposes
StateFlow(NOTLiveDatafor new code). - UI state is a single immutable data class per screen.
- Actions from UI → ViewModel via sealed interface.
- One-time events via
Channel.receiveAsFlow(). - Screen composable splits into: wired (with ViewModel) + stateless content.
Domain Layer
- Domain layer has ZERO Android dependencies (pure Kotlin).
- UseCase has single
invokeoperator (one operation per UseCase). - Repository interfaces defined in domain, implemented in data.
- Domain models are independent of DTO/Entity (separate mapping).
- Use
Result<T>for operations that can fail.
Data Layer
- Repository is the single source of truth.
- DTO (API response) ≠ Entity (Room) ≠ Domain Model. Map between them.
- Offline-first: Room as source of truth, network refreshes in background.
- API calls wrapped in
runCatching— NEVER throw unhandled exceptions. - DataSource abstraction:
LocalDataSource+RemoteDataSource→Repository.
Dependency Injection (Hilt)
- Use
@Bindsfor interface→implementation bindings (more efficient than@Provides). - Use correct
@InstallInscope (SingletonComponent,ViewModelComponent,ActivityComponent). - NEVER inject
ActivityorFragmentinto non-UI classes. - Use
@ApplicationContextwhen Context is needed in singletons.
Modularization
- Feature modules NEVER depend on other feature modules.
- Feature modules depend on
:core:domainand:core:uionly. :core:domainhas ZERO Android dependencies.:appmodule is thin — only navigation and DI wiring.
Error Handling
- Use
Result<T>for all fallible operations in domain/data layers. - Map network exceptions to domain exceptions in Repository.
- Present user-friendly messages in ViewModel (NEVER raw exception messages).
- NEVER silently swallow exceptions — always log or report.
- Use sealed class hierarchy for typed error handling.
Checklists
Presentation
- One ViewModel per screen
- UiState is immutable data class
- Actions modeled as sealed interface
- Events via Channel (not StateFlow)
- collectAsStateWithLifecycle used
- No Android framework imports in ViewModel (except SavedStateHandle)
- Screen split: wired container + stateless content
Domain
- Domain models have no framework annotations
- UseCase is single-purpose with invoke operator
- Repository interface in domain package
- No Android imports in domain layer
- Result type for fallible operations
Data
- DTO, Entity, Domain Model are separate classes
- Mappers exist between all data types
- Repository wraps API calls in runCatching
- Room as single source of truth (offline-first)
- No API/Room types leak to domain/presentation
Dependency Injection
- @HiltAndroidApp on Application class
- @AndroidEntryPoint on Activities/Fragments
- @HiltViewModel on ViewModels
- Interfaces bound with @Binds (not @Provides)
- Correct scope for each dependency
- No manual dependency creation outside DI
Modularization
- No circular dependencies between modules
- Feature modules don't depend on each other
- Domain module has no Android dependencies
- Build times acceptable (<2 min for incremental)
- API boundaries defined between modules
Error Handling
- Result type used for fallible operations
- Exceptions mapped to domain types in Repository
- User-friendly error messages in ViewModel
- No raw exception messages shown to user
- Global error handler for uncaught exceptions
For Compose UI patterns, see the compose-ui skill. For OWASP security audit, see the security-audit skill.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

