From flutter-ddd-builder
This skill should be used when creating "Freezed models", "Riverpod services", "API clients", "domain models", "AsyncNotifier", or working with Flutter DDD architecture. Provides patterns for Freezed 3.x, Riverpod 3.x, and API client integration following project conventions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flutter-ddd-builder:flutter-ddd-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
examples/auth_service_example.dartexamples/form_with_validation_example.dartexamples/paginated_list_example.dartexamples/post_create_page_example.dartexamples/user_model_example.dartreferences/anti-patterns.mdreferences/api-client-patterns.mdreferences/common-utilities.mdreferences/freezed-3x-guide.mdreferences/pagination-patterns.mdreferences/riverpod-3x-guide.mdreferences/theme-dual-mode.mdlib/apps/
├── domain/{domain}/
│ ├── models/ # {entity}_model.dart (Freezed 3.x)
│ ├── services/ # {domain}_service.dart (Riverpod 3.x AsyncNotifier)
│ ├── pages/{page}/
│ │ ├── {page}_page.dart
│ │ └── providers/ # {feature}_provider.dart
│ └── components/
├── infra/ # Dio client, interceptors, exception
├── application/ # Cross-feature (storage, auth)
├── ui/ # theme, router, common components
├── generated/api/ # swagger_parser output (수동 편집 금지)
└── global/ # constants, utils, hooks, types
Core Rules:
_model.dart + Model suffix@freezed abstract class + const factory@riverpod + Ref (not FooRef)package:app/... imports (no relative)@freezed annotationabstract class {Entity}Model with _${Entity}Modelconst {Entity}Model._(); (custom methods가 있을 때)const factory constructor (const 필수)fromJson factory.freezed.dart + .g.dart{entity}_model.dart, 절대 _dto.dart 아님@riverpod annotation (lowercase)extends _${Name} | Function: Ref ref parameterbuild() 안에서만 ref.watch — helper/action 메서드에서는 ref.readAsyncValue.guard for error handlingbuild()에서 ref.listen 사용/posts/new)를 동적 경로(/posts/:id) 앞에 등록static const path, static const name, go(), push()abstract final class with const instancesauthProvider 로그인 실패 시 AsyncData(unauthenticated()) 복귀 (절대 AsyncError 아님)Error.throwWithStackTrace(e, st) (rethrow 대신 — 상태 설정 후 전파)emailLoginProvider가 에러 메시지 담당 (역할 분리)ref.listen(authProvider) → 성공 네비게이션, ref.listen(emailLoginProvider) → 에러 표시AppException → ExceptionHandler.getUserMessage(), 그 외 → generic 메시지authValue == null → 미인증 취급 (defense-in-depth)ResponseInterceptor + ErrorInterceptor 포함AuthInterceptor는 retry Dio에서 제외 (무한루프 방지)refreshToken 저장 확인PaginatedResponse<T> model in lib/global/types/paginated_response.dartPaginationMeta with offset/pageSize/totalItemCount/isFirst/isLast_page counter + _hasMore flagloadMore() appends to existing listNotificationListener<ScrollNotification> or ScrollControllerAsyncValueWidget instead of .when(data:, error:, loading:) inlinelib/apps/ui/common/async_value_widget.dartemptyCheck and emptyMessage for empty statesloading and error builders optionalValidators from lib/global/utils/validators.dartValidators.compose([...]) for multiple rulesrequired, email, minLength, maxLength, phone, passwordwithLoaderOverlay(context, () async { ... }) for button actionsLoaderOverlay widget in tree (wrap Scaffold or MaterialApp)AppTheme.fromTokens() — Figma token-based (AppColors → ColorScheme)AppTheme.fromSeed(seedColor: Colors.blue) — Material 3 auto-generatedTheme.of(context).colorScheme.primary works identicallyAppSpacing, AppRadius usable in both modes| Type | File | Class |
|---|---|---|
| Model | {entity}_model.dart | {Entity}Model |
| Service | {domain}_service.dart | {Domain}Service |
| Provider | {feature}_provider.dart | {Feature}Provider |
| Page | {page}_page.dart | {Page}Page |
| Route | domains/{domain}.dart | {Page}Route |
import 'dart:async'; // 1. Dart
import 'package:freezed_annotation/freezed_annotation.dart'; // 2. Package
import 'package:app/apps/domain/.../model.dart'; // 3. Project (absolute)
part 'file.g.dart'; // 4. Part
dart run swagger_parser # API clients
dart run build_runner build --delete-conflicting-outputs # Freezed + Riverpod
npx claudepluginhub ureca-corp/claude --plugin flutter-ddd-builderProvides expert Flutter/Dart patterns for cross-platform mobile apps including feature-first project structure, const widget best practices, and Riverpod/Bloc state management.
Provides production-ready Dart/Flutter patterns for null safety, state management (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and testing.
Provides production-ready Dart and Flutter code patterns for null safety, sealed classes, async composition, widget architecture, state management (BLoC, Riverpod, Provider), GoRouter navigation, Dio HTTP, Freezed codegen, and clean architecture.