Agent skill

Unyo Domain Data Layer

by K3vinb5 in K3vinb5/unyo-app

How to create domain entities, data models, and repositories in the Unyo Flutter app.

BSD-3-ClauseAuto-check passedDevelopment

Install Unyo Domain Data Layer

skills CLI
$ npx skills add K3vinb5/unyo-app --skill unyo-domain-data-layer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install K3vinb5/unyo-app unyo-domain-data-layer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/K3vinb5/unyo-app.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/unyo-domain-data-layer .claude/skills/unyo-domain-data-layer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unyo-domain-data-layer
GitHub stars
664
Token cost
~2.9k tokens
SKILL.md length
715 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

How to create domain entities, data models, and repositories in the Unyo Flutter app.

  • Works in 3 steps: Define the repository interface → Implement with RepositoryMixin → Add to barrel export
  • Adding new data types
  • SKILL.md covers Architecture Overview, Pattern: Entity Definition, Pattern: Data Model with API… and Pattern: Repository Interface…, plus 5 more sections
  • Calls flutter

What it does

Unyo Domain Data Layer is an agent skill from K3vinb5/unyo-app. How to create domain entities, data models, and repositories in the Unyo Flutter app. Use this skill whenever adding new data types, creating repository interfaces or implementations, defining Freezed models, setting up Hive adapters, or mapping API responses to domain objects in the Unyo codebase. Also use when modifying existing entities, models, or data fetching logic.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Flutter. The repository describes itself as: 🐙 Anime streaming and Manga reader desktop app without ads. The licence is BSD-3-Clause.

When your agent uses it

  • Adding new data types
  • Creating repository interfaces
  • Implementations
  • Defining Freezed models

Example prompts

  • “/unyo-domain-data-layer”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Define the repository interface
  2. Implement with RepositoryMixin
  3. Add to barrel export

What it can do on your machine

Read from SKILL.md and the folder at commit 0a44722. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • flutter

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unyo Domain Data Layer loads about 2.9k tokens when it runs. Until then it costs about 99 tokens; SKILL.md has 715 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from K3vinb5/unyo-app at commit 0a44722, republished under its BSD-3-Clause licence (© K3vinb5). 715 words, ~2,871 tokens.

Download SKILL.mdSave it as .claude/skills/unyo-domain-data-layer/SKILL.md (or your agent's skills folder).
name
unyo-domain-data-layer
description
How to create domain entities, data models, and repositories in the Unyo Flutter app. Use this skill whenever adding new data types, creating repository interfaces or implementations, defining Freezed models, setting up Hive adapters, or mapping API responses to domain objects in the Unyo codebase. Also use when modifying existing entities, models, or data fetching logic.

Unyo Domain & Data Layer

This skill covers the domain/data architecture in Unyo: entities, models, and repositories. Everything starts here — before you add a cubit, screen, or notifier, you need the domain and data layer in place.

Architecture Overview

lib/
├── domain/
│   ├── entities/          # Abstract business objects
│   │   ├── anime.dart     # Abstract class + Freezed implementation
│   │   └── entities.dart  # Barrel export
│   └── repositories/      # Abstract repository contracts
│       ├── anime_repository.dart
│       └── repositories.dart  # Barrel export
├── data/
│   ├── models/            # Concrete Freezed models with JSON mapping
│   │   ├── anilist_anime_model.dart
│   │   └── models.dart    # Barrel export
│   ├── repositories/      # Repository implementations
│   │   ├── anime_repository_anilist.dart
│   │   ├── repository_mixin.dart
│   │   └── repositories.dart  # Barrel export
│   └── adapters/          # Hive type adapters
├── generated/json/        # Generated JSON serialization code
└── core/services/api/     # API services and DTOs
    ├── graphql/            # GraphQL service, queries, responses
    ├── http/               # HTTP service, responses, exceptions
    └── dto/                # Data Transfer Objects (API response models)

Pattern: Entity Definition

Domain entities live in lib/domain/entities/. They use a dual-class pattern: an abstract base class defining the contract, and a Freezed-generated implementation class.

Why two classes? The abstract class lets repositories return a stable domain type while data models can vary by provider (AniList, MAL, etc.). The Freezed class gets copyWith, equality, and JSON serialization for free.

Creating a new entity
  1. Create the abstract class and Freezed model in one file:
dart
// lib/domain/entities/anime.dart
import 'package:freezed_annotation/freezed_annotation.dart';
import 'airing_episode.dart';
import 'title.dart';

part 'anime.freezed.dart';
part 'anime.g.dart';

// Abstract base — the domain contract
abstract class Anime {
  final int id;
  final String coverImage;
  // ... all fields as final

  const Anime({
    required this.id,
    required this.coverImage,
    // ... all required parameters
  });
}

// Freezed implementation — adds copyWith, equality, JSON
@freezed
abstract class AnimeModel with _$AnimeModel implements Anime {
  const factory AnimeModel({
    required int id,
    @TitleConverter() required Title title,
    required String coverImage,
    // ... all fields matching the abstract class
  }) = _AnimeModel;

  // Factory for empty/default instances (used in initial state)
  factory AnimeModel.empty() => AnimeModel(
        id: -1,
        title: TitleModel.empty(),
        coverImage: '',
      );

  // JSON serialization
  factory AnimeModel.fromJson(Map<String, dynamic> json) =>
      _$AnimeModelFromJson(json);

  // Required for toJson on the abstract type
  @override
  Map<String, dynamic> toJson() =>
      _$AnimeModelToJson(this as _AnimeModel);
}

// Converter for use in other Freezed classes that reference this type
class AnimeConverter
    implements JsonConverter<Anime, Map<String, dynamic>> {
  const AnimeConverter();

  @override
  Anime fromJson(Map<String, dynamic> json) =>
      AnimeModel.fromJson(json);

  @override
  Map<String, dynamic> toJson(Anime object) =>
      (object as AnimeModel).toJson();
}
  1. Always pair abstract + Freezed — never use Freezed alone for a domain entity that other code references. Other code should depend on the abstract class, not the model.

  2. Custom JSON converters are needed when a Freezed class references another abstract entity type. The converter delegates to the concrete model's fromJson/toJson. Name them <EntityName>Converter.

  3. Empty factories are essential — cubit initial states need default values. Every entity should have an .empty() factory.

  4. Add the entity to the barrel export in lib/domain/entities/entities.dart.

  5. Run code generation after creating or modifying any entity:

sh
flutter pub run build_runner build --delete-conflicting-outputs

Pattern: Data Model with API Mapping

Data models in lib/data/models/ extend domain entities by adding factory constructors that map from API response DTOs.

Key conventions
  • Models use Freezed implements Anime (the abstract class), NOT extends Anime
  • Named factories like fromScheduleEntry(), fromPopularOrTrendingMediaEntry() map specific API responses
  • The model file has part 'model_name.freezed.dart' and part 'model_name.g.dart'
  • Models must match all fields from the abstract class exactly (same names, same types)
Creating a model for a new data source
dart
// lib/data/models/anilist_anime_model.dart
@freezed
abstract class AnilistAnimeModel with _$AnilistAnimeModel implements Anime {
  const AnilistAnimeModel._();  // Private constructor for custom methods

  const factory AnilistAnimeModel({
    required int id,
    required String coverImage,
    // ... all fields from Anime abstract class
  }) = _AnilistAnimeModel;

  // Map from AniList API DTO
  factory AnilistAnimeModel.fromScheduleEntry(
      MediaCollectionRecentlyReleasedDto schedule) {
    return AnilistAnimeModel(
      id: schedule.media.id,
      coverImage: schedule.media.coverImage.large,
      // ... map all fields
    );
  }

  factory AnilistAnimeModel.fromJson(Map<String, dynamic> json) =>
      _$AnilistAnimeModelFromJson(json);
}

Important: When there are multiple API sources (AniList, MAL, etc.), each source gets its own model file (e.g., mal_anime_model.dart) but they all implement the same Anime abstract class.

Pattern: Repository Interface & Implementation

Repositories follow a strict interface-implementation separation:

1. Define the repository interface
dart
// lib/domain/repositories/anime_repository.dart
abstract class AnimeRepository {
  Future<(bool, List<Anime>)> getTrendingAnimes(int page, User loggedUser);
  Future<(bool, AnimeDetails)> getAnimeDetails(Anime selectedAnime, User loggedUser);
  // ... all methods as abstract
}

Convention: Methods return Dart records (bool, List<Anime>) where the bool indicates if there's a next page. Methods take User typed parameters (the abstract User, not AnilistUserModel).

2. Implement with RepositoryMixin
dart
// lib/data/repositories/anime_repository_anilist.dart
class AnimeRepositoryAnilist with RepositoryMixin implements AnimeRepository {
  final GraphQLService _anilistGraphQLService = sl<GraphQLService>(
    instanceName: config.anilistGraphQlService,
  );
  final Logger _logger = sl<Logger>();

  @override
  Future<(bool, List<Anime>)> getTrendingAnimes(int page, User loggedUser) async {
    // 1. Call the API service
    final response = await _anilistGraphQLService.query(
      query: anilist_queries.mediaTrendingOrPopularQuery,
      fromJson: MediaCollectionTrendingOrPopularGraphqlEntity.fromJson,
      variables: {"sort": "TRENDING_DESC", "page": page, "perPage": 30, "type": "ANIME"},
    );
    // 2. Use RepositoryMixin to check for errors
    throwIfGraphQlError(response);
    // 3. Map DTOs to domain models
    final animes = response.data.page.media
        .map((entry) => AnilistAnimeModel.fromPopularOrTrendingMediaEntry(entry))
        .toList();
    return (true, animes);
  }
}

Key patterns:

  • Use RepositoryMixin.throwIfGraphQlError() to check for API errors — this throws a GraphQLException that cubits catch
  • Name implementations after their data source: AnimeRepositoryAnilist, AnimeRepositoryMal, etc.
  • Inject services via sl<T>() (service locator), not constructor params (repositories are singletons)
3. Add to barrel export
dart
// lib/domain/repositories/repositories.dart
export 'anime_repository.dart';
// lib/data/repositories/repositories.dart
export 'anime_repository_anilist.dart';

Pattern: API DTOs (Data Transfer Objects)

API response DTOs live in lib/core/services/api/dto/. They are generated from JSON using json_serializable:

dart
// lib/core/services/api/dto/anilist/media_collection_trendingOrPopular_graphql_entity.dart
// These are typically auto-generated or manually created from the API schema
// They use json_annotation and have corresponding .g.dart files

Convention: DTO class names describe the API response structure (e.g., MediaCollectionTrendingOrPopularGraphqlEntity). They are internal to the data layer and never leak into domain or application code.

Show full SKILL.md (275 more words)Show less

Pattern: Hive Type Adapters

For entities that need local persistence via Hive:

  1. The entity file must use @HiveType(typeId: N) annotations
  2. An adapter file in lib/data/adapters/ handles serialization
  3. Register adapters in main.dart via Hive.registerAdapter() or Hive.registerAdapters() (auto-generated)

Workflow: Adding a New Feature's Data Layer

When adding a completely new feature (e.g., "Studio browsing"):

  1. Entity: Create lib/domain/entities/studio.dart with abstract class + Freezed model + converter
  2. Barrel: Add export to lib/domain/entities/entities.dart
  3. Model (if mapping from API): Create lib/data/models/anilist_studio_model.dart with mapping factories
  4. Repository interface: Create lib/domain/repositories/studio_repository.dart
  5. Repository impl: Create lib/data/repositories/studio_repository_anilist.dart using RepositoryMixin
  6. API DTOs (if needed): Create in lib/core/services/api/dto/anilist/
  7. GraphQL queries (if using GraphQL): Add to lib/core/services/api/graphql/queries/anilist_queries.dart
  8. Register in DI: Add to lib/core/di/locator.dart (see unyo-dependency-injection skill)
  9. Run code gen: flutter pub run build_runner build --delete-conflicting-outputs
  10. Run analysis: flutter analyze

Common Pitfalls

  • Missing part directives: Every entity/model file needs part 'filename.freezed.dart' and part 'filename.g.dart' (if using JSON).
  • Field mismatches: The Freezed factory must match the abstract class fields exactly. Missing or extra fields cause compile errors.
  • Converter forgetfulness: If entity A references entity B via the abstract type in a Freezed class, you need a BConverter. Without it, Freezed generates code that tries to serialize the abstract type directly.
  • Forget to run build_runner: After any change to @freezed, @JsonSerializable, or @HiveType annotated files, you must regenerate.
  • Leaking DTOs: Never import DTO types in domain or presentation layers. The repository methods should return domain entities, and internal mapping from DTO to entity happens inside the repository implementation.

Cross-references

  • Registering repositories in DI: See unyo-dependency-injection skill
  • Using repositories in cubits: See unyo-bloc-state-management skill
  • Sharing entity state across cubits: See unyo-reactive-notifiers skill

© K3vinb5, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/unyo-domain-data-layer of K3vinb5/unyo-app.

Open the folder on GitHubat commit 0a44722

Compare with similar skills

Unyo Domain Data Layer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unyo Domain Data Layer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unyo Domain Data Layer this skillK3vinb5/unyo-app664—~2.9kAutomated safety check: PassBSD-3-Clause
Code Reviewflutter/flutter179k—~1.4kAutomated safety check: PassBSD-3-Clause
Senior Architect Toolkitmaslennikov-ig/claude-code-orchestrator-kit2608 repos~1.2kAutomated safety check: NotesCustom licence
Code Review Skillawesome-skills/code-review-skill2.1k—~2.8kAutomated safety check: NotesMIT
Adding Release Notesflutter/devtools1.7k—~1kAutomated safety check: PassBSD-3-Clause
Code Guidelinesgetsentry/sentry-dart873—~2.2kAutomated safety check: PassMIT

Similar skills

  • Code Review

    flutter/flutter

    Performs a comprehensive, multi-step code review of pull requests or local code changes, using iterative refinement (generation, critique, synthesis) to ensure high-quality, actionable feedback.

    179k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Senior Architect Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin…

    260 GitHub starsUsed in 8 repos~1.2k tokens
    DevelopmentAuto-check: notes
  • Code Review Skill

    awesome-skills/code-review-skill

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, Java 8, PHP, Ruby, Rails, Python, Django, FastAPI, Go, C/.NET, Kotlin, Swift, Dart…

    2.1k GitHub stars~2.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Adding Release Notes

    flutter/devtools

    Adds user-facing change descriptions to DevTools release notes.

    1.7k GitHub stars~1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Code Guidelines

    getsentry/sentry-dart

    Official

    Enforce Sentry Dart/Flutter SDK code guidelines for implementation, refactoring, and review.

    873 GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Automate git worktree creation and copy private files (not tracked in git) to new workdirs.

    155 GitHub stars~930 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed

More from K3vinb5/unyo-app

  • Generate Dart bean classes from JSON and regenerate serialization helpers using the fjson CLI.

    664 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • How to create cubits, define states, use the EffectMixin pattern, and handle side effects in the Unyo Flutter app.

    664 GitHub stars~3.2k tokensUpdated 3 mo ago
    Auto-check passed
  • How to register and resolve dependencies using GetIt in the Unyo Flutter app.

    664 GitHub stars~2.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Unyo Reactive Notifiers

    K3vinb5/unyo-app

    How to create and use RxDart BehaviorSubject notifiers for cross-cubit communication in the Unyo Flutter app.

    664 GitHub stars~2.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Unyo Routing Navigation

    K3vinb5/unyo-app

    How to add routes, configure navigation, and use AutoRoute in the Unyo Flutter app.

    664 GitHub stars~2.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Unyo UI Presentation

    K3vinb5/unyo-app

    How to build screens, widgets, and handle effects in the Unyo Flutter app's presentation layer.

    664 GitHub stars~3k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Unyo Domain Data Layer

What does Unyo Domain Data Layer do?

How to create domain entities, data models, and repositories in the Unyo Flutter app. Unyo Domain Data Layer is an agent skill from K3vinb5/unyo-app. How to create domain entities, data models, and repositories in the Unyo Flutter app.

When should I use Unyo Domain Data Layer?

Unyo Domain Data Layer fits situations like: adding new data types; creating repository interfaces; implementations; defining Freezed models.

How do I install Unyo Domain Data Layer in Claude Code?

Run `npx skills add K3vinb5/unyo-app --skill unyo-domain-data-layer -a claude-code`. Or copy the skill folder (.agents/skills/unyo-domain-data-layer in K3vinb5/unyo-app) into .claude/skills/unyo-domain-data-layer in your project. Claude Code loads it when a task matches its description.

How do I install Unyo Domain Data Layer in Codex?

Run `npx skills add K3vinb5/unyo-app --skill unyo-domain-data-layer -a codex`. Or copy the skill folder (.agents/skills/unyo-domain-data-layer in K3vinb5/unyo-app) into .agents/skills/unyo-domain-data-layer in your project. Codex loads it when a task matches its description.

Can I use Unyo Domain Data Layer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add K3vinb5/unyo-app --skill unyo-domain-data-layer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unyo-domain-data-layer, .gemini/skills/unyo-domain-data-layer, .github/skills/unyo-domain-data-layer and .opencode/skills/unyo-domain-data-layer in your project.

What does Unyo Domain Data Layer need to run?

Going by SKILL.md and its folder, Unyo Domain Data Layer needs the command-line tools its instructions call (flutter).

Does Unyo Domain Data Layer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Unyo Domain Data Layer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unyo Domain Data Layer use?

Unyo Domain Data Layer is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unyo Domain Data Layer use?

About 2.9k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Unyo Domain Data Layer?

Skills that share tags, products or a category with Unyo Domain Data Layer: Code Review (flutter/flutter, 179k stars), Senior Architect Toolkit (maslennikov-ig/claude-code-orchestrator-kit, 260 stars), Code Review Skill (awesome-skills/code-review-skill, 2.1k stars) and Adding Release Notes (flutter/devtools, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unyo Domain Data Layer?

K3vinb5 (a GitHub user) maintains it in K3vinb5/unyo-app, which has 664 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on June 12, 2026.

Source: K3vinb5/unyo-app on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.