
create-new-feature
by DanhDue
A Digital Wallet App base on the Clean Architecture.
SKILL.md
name: create_new_feature description: Guide for creating a new feature or subfeature following the project's Clean Architecture + MVI pattern.
Create New Feature Skill
This skill guides the agent through the process of creating a new feature (New Module) or adding a subfeature to an existing module (Subfeature).
[!IMPORTANT] Import Convention: Always use full package paths (e.g.,
import 'package:bloc_digital_wallet/core/network/app_uri.dart';) instead of relative imports (e.g.,import '../../core/network/app_uri.dart';).
1. Analyze Request & Codebase
Goal: Determine the context and type of feature requested.
- Analyze User Request: Identify keywords (e.g., "add forgot password", "create notifications").
- Check Existing Modules:
- List directories in
lib/features/. - Determine if the requested feature belongs to an existing module.
- List directories in
- Determine Type:
- Subfeature: Adds functionality to an existing module (e.g., adding
forgot_passwordtoauthentication). - New Module: Introduces a completely new domain concept (e.g.,
notifications,chat).
- Subfeature: Adds functionality to an existing module (e.g., adding
2. Prepare & Confirm (CRITICAL STEP)
Goal: Validate the plan with the user before generating code.
Action: Present a plan and ask for confirmation using the following template:
To proceed, I need to confirm:
MODULE INFORMATION:
- Feature Type: [New Module / Subfeature]
- [If Subfeature] Target Module: [existing_module_name]
- [If New Module] Module Name: [suggested_name]
- Feature Functionality: [brief description]
- UI Requirements: [screen/widgets needed]
- API Endpoints: [list key endpoints if known]
CONFIRMATION:
Should I proceed with creating this as a [New Module/Subfeature]?
WAIT for user confirmation before proceeding to Step 3.
3. Generate Structure (Mason)
Goal: Generate the boilerplate structure.
- If New Module:
mason make mvi_feature --feature_name [feature_name] - If Subfeature:
mason make mvi_subfeature --module_name [module_name] --subfeature_name [subfeature_name]
4. Implement Domain Layer
Goal: Define business logic interfaces.
-
Entity: Create
[feature]_entity.dartwith@freezedand@JsonKeyannotations.- Use
abstract classwith_$ClassNamemixin pattern - Import
freezed_annotationandfoundation.dart - Use
@JsonKey(name: 'field_name')for each field - ⚠️ IMPORTANT: All entities and models will use freezed with
@JsonKeyannotations.
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:flutter/foundation.dart'; part '[feature]_entity.freezed.dart'; part '[feature]_entity.g.dart'; @freezed abstract class [Feature]Entity with _$[Feature]Entity { const factory [Feature]Entity({ @JsonKey(name: 'id') int? id, @JsonKey(name: 'name') String? name, }) = _[Feature]Entity; factory [Feature]Entity.fromJson(Map<String, Object?> json) => _$[Feature]EntityFromJson(json); } - Use
-
Repository Interface: Define
[feature]_repository.dart. -
Use Cases: Create use cases for each business action (e.g.,
get_data_usecase.dart).
5. Implement Data Layer
Goal: Implement data handling.
- Model: Create
[feature]_model.dartwith@freezed,@JsonKey, andjson_serializable.- Same pattern as Entity with
abstract classand_$ClassNamemixin
- Same pattern as Entity with
- Remote DataSource: Implement
[feature]_remote_datasource.dart(useSafeCallApiMixin). - Repository Impl: Implement
[feature]_repository_impl.dart.
6. Implement Presentation Layer (MVI)
Goal: Build the UI and State Management.
- Defines:
- Actions: User intents (e.g.,
LoadDataAction). - States: UI states (e.g.,
Loading,Loaded). - Events: One-time effects (e.g.,
ShowDetailsEvent).
- Actions: User intents (e.g.,
- BLoC: Implement logic in
[feature]_bloc.dart. - UI Pages: Implement
[feature]_page.dart.- Style: Use
context.appThemes. - Text: Use
context.t(i18n). - Figma: If provided, use
figma-dev-mode-mcp-serverto fetch specs.
- Style: Use
7. Configuration & Verification
Goal: Wire everything up and verify.
- Routes: Add new routes to
lib/app_router.dartandAppRoutesconstants. - Translations: Add keys to
en.i18n.jsonandvi.i18n.json. - Generate Code:
melos genAlls - Format & Analyze:
dart format lib/ fvm flutter analyze --no-fatal-infos - Final Check: Verify "No issues found!" and functionality matches requirements.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です