layered-module-patterns

Select closest layered module wiring patterns for AniTrend feature, data, domain, and task scenarios.

51|6|Updated Mar 10, 2019
One-click install
npx skills add https://github.com/AniTrend/anitrend-v2 --skill layered-module-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: layered-module-patterns
Source: https://github.com/AniTrend/anitrend-v2/tree/main/.agents/skills/layered-module-patterns
Command: npx skills add https://github.com/AniTrend/anitrend-v2 --skill layered-module-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents module-architecture drift by helping you choose consistent layered wiring patterns across feature, common, data, domain, and task modules in AniTrend.

Core Features & Use Cases

  • Pattern selection for module wiring: Match query-only, hybrid query+mutation, mutation-only, and Android/platform support scenarios to the closest reference layout.
  • Domain vs data responsibilities: Enforce that contracts and abstract use cases stay in domain while repositories, sources, mappers, and Koin bindings stay in data.
  • Types.kt interactor alias discipline: Keep Types.kt lean so feature and task layers consume interactor aliases specialized with DataState<T>.
  • Offline-first guidance: Pick correct source-of-truth approaches for non-paged and paged flows (Room-backed observable flows, mapper ownership, and paging refresh coordination).
  • Safe import boundaries: Allow interactor alias imports into feature/task, but avoid importing repositories, sources, mappers, or remote models.

Quick Start

Use the layered-module-patterns skill to choose the closest existing module recipe for your planned media/review/favourite feature and align the domain-data-task boundaries with the standard wiring rules.

Frequently Asked Questions about layered-module-patterns

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

FAQPage Schema
How do I enforce clean architecture domain and data boundaries in Android module wiring?

Clean architecture domain and data boundaries are enforced by keeping contracts and abstract use cases in domain modules, while repositories, sources, mappers, and Koin bindings stay strictly in data modules. This separation prevents module-architecture drift and ensures feature layers only consume interactor aliases.

What is the best way to structure offline-first paging with Room in a clean architecture Android app?

Offline-first paging with Room requires using Room-backed observable flows as the source-of-truth for paged and non-paged data. You must coordinate paging refresh logic correctly and ensure mapper ownership stays within the data layer to maintain data consistency.

Why should feature and task modules consume interactor aliases specialized with DataState?

Feature and task modules should consume interactor aliases specialized with DataState to keep a lean Types.kt file. This discipline allows safe import boundaries, letting features invoke use cases without directly accessing underlying repositories, sources, or remote models.

How do I select the correct layered module pattern for Android query, mutation, and platform support scenarios?

Selecting the correct layered module pattern involves matching query-only, hybrid query+mutation, mutation-only, and Android platform support scenarios to the closest reference layout. This ensures consistent wiring for feature, data, domain, and task modules across your project.

What are the limitations of importing repositories and remote models into feature layers?

Importing repositories, sources, mappers, or remote models into feature layers breaks safe import boundaries and causes module-architecture drift. Feature and task layers must only import interactor aliases from Types.kt to maintain proper domain-data separation.

Does Koin dependency injection work with operation-specific repository contracts in domain-driven design?

Koin dependency injection works with operation-specific repository contracts by binding those repository implementations within the data layer. This domain-driven design approach ensures feature layers receive dependencies through lean interactor aliases without direct repository access.