[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75Q4GPSCM8HQYR0SPC7PER1":3,"skill-same:01M75Q4GPSCM8HQYR0SPC7PER1":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M75Q4GPSCM8HQYR0SPC7PER1","flutter-apply-architecture-best-practices",null,"Architects a Flutter application using the recommended layered approach (UI, Logic, Data). Use when structuring a new project or refactoring for scalability.","mictlanix\u002Fmbe-ui","mictlanix","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F703184?v=4","01M75Q1XD9477GXRKPM6JVVC11","Mictlanix","01M75Q1XDXKYX3VS9T3CS2XEFR",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflutter-apply-architecture-best-practices\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: flutter-apply-architecture-best-practices\ndescription: Architects a Flutter application using the recommended layered approach (UI, Logic, Data). Use when structuring a new project or refactoring for scalability.\nmetadata:\n  model: models\u002Fgemini-3.1-pro-preview\n  last_modified: Tue, 21 Apr 2026 20:11:20 GMT\n---\n# Architecting Flutter Applications\n\n## Contents\n- [Architectural Layers](#architectural-layers)\n- [Project Structure](#project-structure)\n- [Workflow: Implementing a New Feature](#workflow-implementing-a-new-feature)\n- [Examples](#examples)\n\n## Architectural Layers\n\nEnforce strict Separation of Concerns by dividing the application into distinct layers. Never mix UI rendering with business logic or data fetching.\n\n### UI Layer (Presentation)\nImplement the MVVM (Model-View-ViewModel) pattern to manage UI state and logic.\n*   **Views:** Write reusable, lean widgets. Restrict logic in Views to UI-specific operations (e.g., animations, layout constraints, simple routing). Pass all required data from the ViewModel.\n*   **ViewModels:** Manage UI state and handle user interactions. Extend `ChangeNotifier` (or use `Listenable`) to expose state. Expose immutable state snapshots to the View. Inject Repositories into ViewModels via the constructor.\n\n### Data Layer\nImplement the Repository pattern to isolate data access logic and create a single source of truth.\n*   **Services:** Create stateless classes to wrap external APIs (HTTP clients, local databases, platform plugins). Return raw API models or `Result` wrappers.\n*   **Repositories:** Consume one or more Services. Transform raw API models into clean Domain Models. Handle caching, offline synchronization, and retry logic. Expose Domain Models to ViewModels.\n\n### Logic Layer (Domain - Optional)\n*   **Use Cases:** Implement this layer only if the application contains complex business logic that clutters the ViewModel, or if logic must be reused across multiple ViewModels. Extract this logic into dedicated Use Case (interactor) classes that sit between ViewModels and Repositories.\n\n## Project Structure\n\nOrganize the codebase using a hybrid approach: group UI components by feature, and group Data\u002FDomain components by type.\n\n```text\nlib\u002F\n├── data\u002F\n│   ├── models\u002F         # API models\n│   ├── repositories\u002F   # Repository implementations\n│   └── services\u002F       # API clients, local storage wrappers\n├── domain\u002F\n│   ├── models\u002F         # Clean domain models\n│   └── use_cases\u002F      # Optional business logic classes\n└── ui\u002F\n    ├── core\u002F           # Shared widgets, themes, typography\n    └── features\u002F\n        └── [feature_name]\u002F\n            ├── view_models\u002F\n            └── views\u002F\n```\n\n## Workflow: Implementing a New Feature\n\nFollow this sequential workflow when adding a new feature to the application. Copy the checklist to track progress.\n\n### Task Progress\n- [ ] **Step 1: Define Domain Models.** Create immutable data classes for the feature using `freezed` or `built_value`.\n- [ ] **Step 2: Implement Services.** Create or update Service classes to handle external API communication.\n- [ ] **Step 3: Implement Repositories.** Create the Repository to consume Services and return Domain Models.\n- [ ] **Step 4: Apply Conditional Logic (Domain Layer).**\n  - *If the feature requires complex data transformation or cross-repository logic:* Create a Use Case class.\n  - *If the feature is a simple CRUD operation:* Skip to Step 5.\n- [ ] **Step 5: Implement the ViewModel.** Create the ViewModel extending `ChangeNotifier`. Inject required Repositories\u002FUse Cases. Expose immutable state and command methods.\n- [ ] **Step 6: Implement the View.** Create the UI widget. Use `ListenableBuilder` or `AnimatedBuilder` to listen to ViewModel changes.\n- [ ] **Step 7: Inject Dependencies.** Register the new Service, Repository, and ViewModel in the dependency injection container (e.g., `provider` or `get_it`).\n- [ ] **Step 8: Run Validator.** Execute unit tests for the ViewModel and Repository.\n  - *Feedback Loop:* Run tests -> Review failures -> Fix logic -> Re-run until passing.\n\n## Examples\n\n### Data Layer: Service and Repository\n\n```dart\n\u002F\u002F 1. Service (Raw API interaction)\nclass ApiClient {\n  Future\u003CUserApiModel> fetchUser(String id) async {\n    \u002F\u002F HTTP GET implementation...\n  }\n}\n\n\u002F\u002F 2. Repository (Single source of truth, returns Domain Model)\nclass UserRepository {\n  UserRepository({required ApiClient apiClient}) : _apiClient = apiClient;\n  \n  final ApiClient _apiClient;\n  User? _cachedUser;\n\n  Future\u003CUser> getUser(String id) async {\n    if (_cachedUser != null) return _cachedUser!;\n    \n    final apiModel = await _apiClient.fetchUser(id);\n    _cachedUser = User(id: apiModel.id, name: apiModel.fullName); \u002F\u002F Transform to Domain Model\n    return _cachedUser!;\n  }\n}\n```\n\n### UI Layer: ViewModel and View\n\n```dart\n\u002F\u002F 3. ViewModel (State management and presentation logic)\nclass ProfileViewModel extends ChangeNotifier {\n  ProfileViewModel({required UserRepository userRepository}) \n      : _userRepository = userRepository;\n\n  final UserRepository _userRepository;\n\n  User? _user;\n  User? get user => _user;\n\n  bool _isLoading = false;\n  bool get isLoading => _isLoading;\n\n  Future\u003Cvoid> loadProfile(String id) async {\n    _isLoading = true;\n    notifyListeners();\n\n    try {\n      _user = await _userRepository.getUser(id);\n    } finally {\n      _isLoading = false;\n      notifyListeners();\n    }\n  }\n}\n\n\u002F\u002F 4. View (Dumb UI component)\nclass ProfileView extends StatelessWidget {\n  const ProfileView({super.key, required this.viewModel});\n\n  final ProfileViewModel viewModel;\n\n  @override\n  Widget build(BuildContext context) {\n    return ListenableBuilder(\n      listenable: viewModel,\n      builder: (context, _) {\n        if (viewModel.isLoading) {\n          return const Center(child: CircularProgressIndicator());\n        }\n        \n        final user = viewModel.user;\n        if (user == null) {\n          return const Center(child: Text('User not found'));\n        }\n\n        return Column(\n          children: [\n            Text(user.name),\n            ElevatedButton(\n              onPressed: () => viewModel.loadProfile(user.id),\n              child: const Text('Refresh'),\n            ),\n          ],\n        );\n      },\n    );\n  }\n}\n```\n","# Architecting Flutter Applications\n\n## Contents\n- [Architectural Layers](#architectural-layers)\n- [Project Structure](#project-structure)\n- [Workflow: Implementing a New Feature](#workflow-implementing-a-new-feature)\n- [Examples](#examples)\n\n## Architectural Layers\n\nEnforce strict Separation of Concerns by dividing the application into distinct layers. Never mix UI rendering with business logic or data fetching.\n\n### UI Layer (Presentation)\nImplement the MVVM (Model-View-ViewModel) pattern to manage UI state and logic.\n*   **Views:** Write reusable, lean widgets. Restrict logic in Views to UI-specific operations (e.g., animations, layout constraints, simple routing). Pass all required data from the ViewModel.\n*   **ViewModels:** Manage UI state and handle user interactions. Extend `ChangeNotifier` (or use `Listenable`) to expose state. Expose immutable state snapshots to the View. Inject Repositories into ViewModels via the constructor.\n\n### Data Layer\nImplement the Repository pattern to isolate data access logic and create a single source of truth.\n*   **Services:** Create stateless classes to wrap external APIs (HTTP clients, local databases, platform plugins). Return raw API models or `Result` wrappers.\n*   **Repositories:** Consume one or more Services. Transform raw API models into clean Domain Models. Handle caching, offline synchronization, and retry logic. Expose Domain Models to ViewModels.\n\n### Logic Layer (Domain - Optional)\n*   **Use Cases:** Implement this layer only if the application contains complex business logic that clutters the ViewModel, or if logic must be reused across multiple ViewModels. Extract this logic into dedicated Use Case (interactor) classes that sit between ViewModels and Repositories.\n\n## Project Structure\n\nOrganize the codebase using a hybrid approach: group UI components by feature, and group Data\u002FDomain components by type.\n\n```text\nlib\u002F\n├── data\u002F\n│   ├── models\u002F         # API models\n│   ├── repositories\u002F   # Repository implementations\n│   └── services\u002F       # API clients, local storage wrappers\n├── domain\u002F\n│   ├── models\u002F         # Clean domain models\n│   └── use_cases\u002F      # Optional business logic classes\n└── ui\u002F\n    ├── core\u002F           # Shared widgets, themes, typography\n    └── features\u002F\n        └── [feature_name]\u002F\n            ├── view_models\u002F\n            └── views\u002F\n```\n\n## Workflow: Implementing a New Feature\n\nFollow this sequential workflow when adding a new feature to the application. Copy the checklist to track progress.\n\n### Task Progress\n- [ ] **Step 1: Define Domain Models.** Create immutable data classes for the feature using `freezed` or `built_value`.\n- [ ] **Step 2: Implement Services.** Create or update Service classes to handle external API communication.\n- [ ] **Step 3: Implement Repositories.** Create the Repository to consume Services and return Domain Models.\n- [ ] **Step 4: Apply Conditional Logic (Domain Layer).**\n  - *If the feature requires complex data transformation or cross-repository logic:* Create a Use Case class.\n  - *If the feature is a simple CRUD operation:* Skip to Step 5.\n- [ ] **Step 5: Implement the ViewModel.** Create the ViewModel extending `ChangeNotifier`. Inject required Repositories\u002FUse Cases. Expose immutable state and command methods.\n- [ ] **Step 6: Implement the View.** Create the UI widget. Use `ListenableBuilder` or `AnimatedBuilder` to listen to ViewModel changes.\n- [ ] **Step 7: Inject Dependencies.** Register the new Service, Repository, and ViewModel in the dependency injection container (e.g., `provider` or `get_it`).\n- [ ] **Step 8: Run Validator.** Execute unit tests for the ViewModel and Repository.\n  - *Feedback Loop:* Run tests -> Review failures -> Fix logic -> Re-run until passing.\n\n## Examples\n\n### Data Layer: Service and Repository\n\n```dart\n\u002F\u002F 1. Service (Raw API interaction)\nclass ApiClient {\n  Future\u003CUserApiModel> fetchUser(String id) async {\n    \u002F\u002F HTTP GET implementation...\n  }\n}\n\n\u002F\u002F 2. Repository (Single source of truth, returns Domain Model)\nclass UserRepository {\n  UserRepository({required ApiClient apiClient}) : _apiClient = apiClient;\n  \n  final ApiClient _apiClient;\n  User? _cachedUser;\n\n  Future\u003CUser> getUser(String id) async {\n    if (_cachedUser != null) return _cachedUser!;\n    \n    final apiModel = await _apiClient.fetchUser(id);\n    _cachedUser = User(id: apiModel.id, name: apiModel.fullName); \u002F\u002F Transform to Domain Model\n    return _cachedUser!;\n  }\n}\n```\n\n### UI Layer: ViewModel and View\n\n```dart\n\u002F\u002F 3. ViewModel (State management and presentation logic)\nclass ProfileViewModel extends ChangeNotifier {\n  ProfileViewModel({required UserRepository userRepository}) \n      : _userRepository = userRepository;\n\n  final UserRepository _userRepository;\n\n  User? _user;\n  User? get user => _user;\n\n  bool _isLoading = false;\n  bool get isLoading => _isLoading;\n\n  Future\u003Cvoid> loadProfile(String id) async {\n    _isLoading = true;\n    notifyListeners();\n\n    try {\n      _user = await _userRepository.getUser(id);\n    } finally {\n      _isLoading = false;\n      notifyListeners();\n    }\n  }\n}\n\n\u002F\u002F 4. View (Dumb UI component)\nclass ProfileView extends StatelessWidget {\n  const ProfileView({super.key, required this.viewModel});\n\n  final ProfileViewModel viewModel;\n\n  @override\n  Widget build(BuildContext context) {\n    return ListenableBuilder(\n      listenable: viewModel,\n      builder: (context, _) {\n        if (viewModel.isLoading) {\n          return const Center(child: CircularProgressIndicator());\n        }\n        \n        final user = viewModel.user;\n        if (user == null) {\n          return const Center(child: Text('User not found'));\n        }\n\n        return Column(\n          children: [\n            Text(user.name),\n            ElevatedButton(\n              onPressed: () => viewModel.loadProfile(user.id),\n              child: const Text('Refresh'),\n            ),\n          ],\n        );\n      },\n    );\n  }\n}\n```\n",{"name":5,"metadata":24,"description":7},{"model":25,"last_modified":26},"models\u002Fgemini-3.1-pro-preview","Tue, 21 Apr 2026 20:11:20 GMT","main","228e23386ed058f8a2456399cd68f63999d63adf",".claude\u002Fskills\u002Fflutter-apply-architecture-best-practices","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui","https:\u002F\u002Fgithub.com\u002Fmictlanix","https:\u002F\u002Fmictlanix.com","2026-11-15 04:02:27",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add mictlanix\u002Fmbe-ui --skill flutter-apply-architecture-best-practices",{"tool":40,"command":41},"bunx","bunx skills add mictlanix\u002Fmbe-ui --skill flutter-apply-architecture-best-practices",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mictlanix\u002Fmbe-ui --skill flutter-apply-architecture-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflutter-apply-architecture-best-practices\u002FSKILL.md",true,[],[49,56,61,68,75,82],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M75QCZHHB42Q7KJTZHQZXZ77","speckit-wireframes-draft","Draw low-fi wireframes for every screen and state the spec describes","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.specify\u002Fextensions\u002Fwireframes\u002F.specify-dev\u002Fagent-commands\u002Fclaude\u002Fspeckit-wireframes-draft\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M75QCXRSD7HM7AFZH4HA9E6S","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspeckit-wireframes-draft\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M75QCVS17DXXBTQ8DE2SSXVR","speckit-taskstoissues","Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspeckit-taskstoissues\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M75QCS3M02XD4PW58EXS6458","speckit-tasks","Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspeckit-tasks\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M75QCP9NASXGDNYZF6XYJZBD","speckit-specify","Create or update the feature specification from a natural language feature description.","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspeckit-specify\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M75QCKBPS4K60R4YPRQ8HBJ9","speckit-plan","Execute the implementation planning workflow using the plan template to generate design artifacts.","https:\u002F\u002Fgithub.com\u002Fmictlanix\u002Fmbe-ui\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspeckit-plan\u002FSKILL.md",[],[]]