Skip to content
Skills Library
Programming · Planning

android-architecture

/android-architecture

Defines project structure, package layout, layer boundaries, naming conventions, and dependency injection setup for Android projects. Use this skill whenever creating a new Android project, adding a new feature module, scaffolding a new screen or flow, setting up DI bindings, naming any class or file, or deciding which layer a piece of code belongs in. Also use it when reviewing or refactoring existing code to ensure it follows the established architecture.

Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Defines project structure, package layout, layer boundaries, naming conventions, and dependency injection setup for Android projects. Use this skill whenever creating a new Android project, adding a new feature module, scaffolding a new screen or flow, setting up DI bindings, naming any class or file, or deciding which layer a piece of code belongs in. Also use it when reviewing or refactoring existing code to ensure it follows the established architecture.

Original author description

Defines project structure, package layout, layer boundaries, naming conventions, and dependency injection setup for Android projects. Use this skill whenever creating a new Android project, adding a new feature module, scaffolding a new screen or flow, setting up DI bindings, naming any class or file, or deciding which layer a piece of code belongs in. Also use it when reviewing or refactoring existing code to ensure it follows the established architecture.

How it works

  1. 1. Core architecture rules
  2. 2. Recommended project structure
  3. 3. Layer responsibilities
  4. 4. Naming conventions
  5. 5. Visibility rules
  6. 6. Dependency injection
  7. 7. Android entry points
  8. 8. Module and package boundaries
  9. 9. Code review checklist
  10. 10. Practical decision rules
Original SKILL.md headings · 287 lines, 1,009 words
SKILL.md preview
---
name: android-architecture
description: "Defines project structure, package layout, layer boundaries, naming conventions, and dependency injection setup for Android projects. Use this skill whenever creating a new Android project, adding a new feature module, scaffolding a new screen or flow, setting up DI bindings, naming any class or file, or deciding which layer a piece of code belongs in. Also use it when reviewing or refactoring existing code to ensure it follows the established architecture."
license: MIT
---

# Android Architecture

Use this skill to keep Android projects consistent, scalable, and easy to navigate.

## 1. Core architecture rules

Follow Clean Architecture inspired layering:

- `domain` is the business core.
- `data` handles remote, local, and other external data sources.
- `presentation` coordinates state and mapping for the UI.
- `ui` contains Compose screens, reusable components, and theme.
- `di` contains dependency injection modules.

Dependency flow always points inward:

`ui -> presentation -> domain <- data`

Rules:

- `domain` must not depend on Android, Compose, Retrofit, database, or DI APIs.
- `presentation` must not depend on Retrofit, Room, or DTOs.
- `data` may depend on `domain`, not the other way around.
- `ui` must stay focused on rendering and user interaction.
- Keep business rules out of UI and Android framework classes.

## 2. Recommended project structure

Prefer a feature-first layout with shared infrastructure only where it truly belongs.

```text
com.company.app/
├── AppApplication.kt
├── MainActivity.kt
│
├── di/
│   ├── NetworkModule.kt
│   ├── DatabaseModule.kt
│   ├── RepositoryModule.kt
│   └── DispatcherModule.kt
│
├── domain/
│   ├── model/
│   ├── repository/
│   └── usecase/
│
├── data/
│   ├── api/
│   │   └── model/
│   ├── datasource/
│   ├── mapper/
│   └── repository/
│
├── presentation/
│   ├── <feature>/
│   │   ├── <Feature>ViewModel.kt
│   │   ├── model/
│   │   ├── mapper/
│
└── ui/
    ├── <feature>/
    │   ├── <Feature>Screen.kt
    │   ├── components/
    └── theme/
```

Rules:

- Keep each feature self-contained.
- Place shared abstractions in the lowest common layer possible.
- Avoid large folders full of unrelated classes.
- Avoid creating `utils` or `helpers` folders as a dumping ground.

## 3. Layer responsibilities

### domain

Contains only pure Kotlin code.

Typical contents:

- entities and value objects
- repository interfaces
- use cases
- domain errors
- domain calculators when the logic is reusable and not UI-specific

### data

Handles anything outside the app process or outside the pure domain model.

Typical contents:

- Retrofit APIs
- DTOs and network models
- local datasource implementations
- mappers between external models and domain models
- repository implementations
- caching, persistence, synchronization logic

### presentation

Owns screen behavior and state orchestration.

Typical contents:

- ViewModels
- screen UiState, UiAction, UiEvent
- input state and internal state models
- pure calculators, parsers, and mappers used only by the screen flow

### ui

Owns rendering.

Typical contents:

- Screen composables
- stateless content composables
- reusable UI components
- theme, typography, colors, shapes, previews

### di

Owns object graph wiring only.

Typical contents:

- bindings
- providers
- qualifiers
- module objects and abstract modules

## 4. Naming conventions

Use explicit and consistent names.

### Common patterns

- ViewModel: `[Feature]ViewModel`
- Screen: `[Feature]Screen`
- Screen state: `[Feature]ScreenUiState`
- Content state: `[Feature]UiState`
- Actions: `[Feature]UiAction`
- Events: `[Feature]UiEvent`
- Repository interface: `[Feature]Repository`
- Repository implementation: `[Feature]RepositoryImpl`
- Use case: `[Verb][Subject]UseCase`
- Mapper: `[Source]Mapper` or `[Target]Mapper`
- Parser: `[Type]Parser`
- Provider: `[Name]Provider`
- DTO: `[Entity]Dto`

Examples:

- `ObserveRateForCurrenciesUseCase`
- `ExchangeViewModel`
- `ExchangeScreenUiState`
- `ExchangeRepositoryImpl`
- `CurrencyMapper`
- `AmountParser`

Rules:

- Prefer names that reveal responsibility immediately.
- Do not use vague names such as `Manager`, `Helper`, `Processor`, or `Utils`.
- Use `internal` by default for implementation classes.
- Keep file names aligned with class names.

## 5. Visibility rules

Use the narrowest visibility that still works.

Default rules:

- `internal` for most app implementation classes
- package-private or public only when needed for module boundaries
- `public` only for intended shared APIs
- `private` for local helpers and implementation details

Practical guidance:

- ViewModels should usually be `internal`.
- Use cases should usually be `internal`.
- repository implementations should usually be `internal`.
- Compose screen and content functions should usually be `internal` or `private` if only used locally.
- Expose only the minimum needed surface area.

## 6. Dependency injection

Use Hilt with constructor injection.

Preferred pattern:

```kotlin
@HiltViewModel
internal class ExampleViewModel @Inject constructor(
    private val repository: ExampleRepository,
) : ViewModel()
```

Rules:

- Prefer constructor injection everywhere.
- Use `@Binds` for interface to implementation bindings.
- Use `@Provides` for objects that need construction logic.
- Keep all modules in `di/`.
- Separate modules by concern.
- Use `javax.inject.Inject`.

Common module types:

- repository bindings
- network setup
- database setup
- dispatcher providers
- feature specific object providers

Do not use:

- service locators
- manual singleton containers
- global mutable dependency access
- `jakarta.inject.Inject`

## 7. Android entry points

Recommended app entry points:

- `Application` annotated with `@HiltAndroidApp`
- single `MainActivity` annotated with `@AndroidEntryPoint`

Prefer:

- one activity architecture
- Compose Navigation for routing
- no fragments for new work unless a specific legacy constraint requires them

## 8. Module and package boundaries

When adding a new feature:

1. Define the feature boundary first.
2. Create domain contracts.
3. Add data implementations.
4. Add presentation state and logic.
5. Add UI composables.
6. Wire everything in `di`.

When moving code:

- move pure business rules down to `domain`
- move external data handling to `data`
- move screen orchestration to `presentation`
- keep rendering in `ui`

## 9. Code review checklist

A piece of code belongs in the correct place only if:

- its dependencies point in the right direction
- its responsibility is clear
- the layer contains only concerns allowed by that layer
- its name matches its role
- the code can be tested in isolation
- the implementation does not leak framework details into lower layers

Refactor when:

- a ViewModel contains parsing or formatting logic that belongs elsewhere
- a repository returns DTOs instead of domain models
- UI code performs business calculations
- a module mixes unrelated responsibilities
- naming does not make the feature easy to understand

## 10. Practical decision rules

Use this skill when deciding where code belongs.

- Business rule with no UI dependency: `domain`
- Network or persistence logic: `data`
- Screen orchestration or state transformation: `presentation`
- Compose rendering: `ui`
- Dependency wiring: `di`

When uncertain, choose the lowest layer that can own the logic without leaking framework concerns upward.

Versions

RepositoryScoreLicence
This page · lennonpetrick/android-engineering-skills100MIT
HoangNguyen0403/agent-skills-standard100MIT
TheBushidoCollective/han95Apache-2.0
new-silvermoon/awesome-android-agent-skills90Apache-2.0

Database snapshot: 13.11.2026 · package version 7be6a1db8696 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100go-project-layout
    Scaffold new Go projects and services: directory structure, cmd/ and internal/ conventions, when to use a flat layout, module naming, and main package wiring. Use when: "new Go project", "scaffold a service", "create project structure", "start a Go module", "how do I organize a…
  • 100project-conventions
    Defines project structure, naming conventions, and way of working for all projects; other skills link here for the canonical specs. Use when the user mentions "project setup", "project structure", "conventions", "init", "initialize project", "directory structure", or starts a new project.
  • 100android-clean-architecture
    Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.
  • 100architecture-review
    Analyze Java project architecture at macro level - package structure, module boundaries, dependency direction, and layering. Use when user asks "review architecture", "check structure", "package organization", or when evaluating if a codebase follows clean architecture principles.
  • 100go-architecture-review
    Review Go project architecture: package structure, dependency direction, layering, separation of concerns, domain modeling, and module boundaries. Use when reviewing architecture, designing package layout, evaluating dependency graphs, or refactoring monoliths into modules.…
  • 100naming-and-structure-cleanup
    Use when naming conventions or file structure drift across a project and need to be made consistent without changing business logic.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.