data-state-pattern

Official

Standardize DataState/UiState flows end-to-end.

AuthorAniTrend
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill solves inconsistent and fragile data-flow behavior by providing a clear pattern for how repositories, data sources, interactors, and UI should coordinate loading, error, refresh, and retry using DataState and UiState contracts.

Core Features & Use Cases

  • Defines a DataState/UiState workflow: pairs model streams with loading/error status and standardizes refresh/retry behavior across layers.
  • Guides repository and layering contracts: keeps contracts in the domain layer and concrete implementations in the data layer, including how to structure Types.kt and use-case bridges.
  • Provides offline-first read patterns: explains Room-first non-paged reads and Room-backed paged reads (including relationship collection variants) so UI stays responsive while network refreshes opportunistically.
  • Establishes mutation-specific rules: separates mutation-only flows (toggle/save/delete/rate) from offline-first read guidance to avoid conflating responsibilities.
  • Lists practical implementation red flags and dispatching rules: helps prevent common anti-patterns like raw repository returns, incorrect threading, and improper cache merging.

Quick Start

Implement or review your repository and data-source orchestration using DataState to wrap model Flow(s) with loading/error state, and apply the offline-first non-paged or paged read pattern appropriate to your screen.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: data-state-pattern
Download link: https://github.com/AniTrend/anitrend-v2/archive/main.zip#data-state-pattern

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.