binayshaw7777/Leaflekt-Maps / .agents/skills
material-3
VerifiedImplement Google's Material Design 3 (Material You) UI system. Primary: Jetpack Compose Material3 (MaterialTheme, components, adaptive layout). Also Flutter and limited web (@material/web, maintenance mode). Covers tokens, 30+ components, layout, theming, M3 Expressive (platform matrix), and accessibility. Use when: "material design", "MD3", "material you", "Jetpack Compose", "MaterialTheme", "material component", "md3 button".
Android modern architecture and modularization.md
View on GitHub---
name: android-architecture
description: Expert guidance on setting up and maintaining a modern Android application architecture using Clean Architecture and Hilt. Use this when asked about project structure, module setup, or dependency injection.
---
# Android Modern Architecture & Modularization
## Instructions
When designing or refactoring an Android application, adhere to the **Guide to App Architecture** and **Clean Architecture** principles.
### 1. High-Level Layers
Structure the application into three primary layers. Dependencies must strictly flow **inwards** (or downwards) to the core logic.
* **UI Layer (Presentation)**:
* **Responsibility**: Displaying data and handling user interactions.
* **Components**: Activities, Fragments, Composables, ViewModels.
* **Dependencies**: Depends on the Domain Layer (or Data Layer if simple). **Never** depends on the Data Layer implementation details directly.
* **Domain Layer (Business Logic) [Optional but Recommended]**:
* **Responsibility**: Encapsulating complex business rules and reuse.
* **Components**: Use Cases (e.g., `GetLatestNewsUseCase`), Domain Models (pure Kotlin data classes).
* **Pure Kotlin**: Must NOT contain any Android framework dependencies (no `android.*` imports).
* **Dependencies**: Depends on Repository Interfaces.
* **Data Layer**:
* **Responsibility**: Managing application data (fetching, caching, saving).
* **Components**: Repositories (implementations), Data Sources (Retrofit APIs, Room DAOs).
* **Dependencies**: Depends only on external sources and libraries.
### 2. Dependency Injection with Hilt
Use **Hilt** for all dependency injection.
* **@HiltAndroidApp**: Annotate the `Application` class.
* **@AndroidEntryPoint**: Annotate Activities and Fragments.
* **@HiltViewModel**: Annotate ViewModels; use standard `constructor` injection.
* **Modules**:
* Use `@Module` and `@InstallIn(SingletonComponent::class)` for app-wide singletons (e.g., Network, Database).
* Use `@Binds` in an abstract class to bind interface implementations (cleaner than `@Provides`).
### 3. Modularization Strategy
For production apps, use a multi-module strategy to improve build times and separation of concerns.
* **:app**: The main entry point, connects features.
* **:core:model**: Shared domain models (Pure Kotlin).
* **:core:data**: Repositories, Data Sources, Database, Network.
* **:core:domain**: Use Cases and Repository Interfaces.
* **:core:ui**: Shared Composables, Theme, Resources.
* **:feature:[name]**: Standalone feature modules containing their own UI and ViewModels. Depends on `:core:domain` and `:core:ui`.
### 4. Checklist for implementation
- [ ] Ensure `Domain` layer has no Android dependencies.
- [ ] Repositories should default to main-safe suspend functions (use `Dispatchers.IO` internally if needed).
- [ ] ViewModels should interact with the UI layer via `StateFlow` (see `android-viewmodel` skill).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |