domain-layer

Guide Android domain layer implementation with stateless, main-safe use cases.

3|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/tajemniktv/TajsOS --skill domain-layer-tajemniktv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-layer
Source: https://github.com/tajemniktv/TajsOS/tree/main/.agent/skills/domain-layer
Command: npx skills add https://github.com/tajemniktv/TajsOS --skill domain-layer-tajemniktv

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the common issue of bloated, hard-to-test ViewModels in Android apps by providing clear guidance for implementing a proper domain layer that separates business logic from UI and data layers.

Core Features & Use Cases

  • Architecture Guidance: Clear rules for when to add a domain layer, including reuse, complexity, and testability requirements
  • Use Case Design Standards: Naming conventions, operator fun invoke implementation rules, and statelessness requirements for consistent use case creation
  • Review & Validation Tools: PR checklists and anti-pattern references to ensure business logic is correctly placed and implemented
  • Use Case Example: For a multi-step user login flow that combines repository calls and input validation, use this Skill to structure the logic into a reusable, testable use case instead of cluttering the ViewModel.

Quick Start

Use the domain-layer skill to review your existing Android ViewModel and extract its complex business logic into a compliant, testable use case following Google's official guidelines.

Frequently Asked Questions about domain-layer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract business logic from a bloated Android ViewModel?

To extract business logic from a bloated Android ViewModel, implement a domain layer with stateless use cases. This separates complex logic from UI components, ensuring your ViewModels remain lean, main-safe, and highly testable.

When do I need a domain layer in my Android Kotlin app?

You need a domain layer in your Android Kotlin app when handling complex, multi-step business logic, requiring code reuse across ViewModels, or enforcing strict testability requirements that exceed simple UI or data layer operations.

What are the naming conventions for Android use cases?

Android use cases should follow standard naming conventions and implement the operator fun invoke() rule. This allows use case classes to be executed like functions, maintaining statelessness, main-safety, and consistency across your domain layer.

What are common anti-patterns when implementing use cases in Kotlin?

Common anti-patterns when implementing use cases in Kotlin include creating redundant proxy use cases that add no logic, and introducing Android framework dependencies into the domain layer, which breaks testability, main-safety, and architecture compliance.

Does the Android domain layer require dependency injection for use cases?

Yes, the Android domain layer requires proper dependency injection for use cases. Injecting repositories into use cases ensures they remain main-safe, stateless, and fully testable without direct Android framework dependencies.

How do I validate architecture compliance for Android domain layer PRs?

To validate architecture compliance for Android domain layer PRs, use a review checklist to verify business logic placement, statelessness, and proper dependency injection, ensuring no Android framework dependencies leak into the domain layer.