agent-flutter 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -52,6 +52,13 @@ Use this rule when at least one condition is true:
|
|
|
52
52
|
|
|
53
53
|
### Step 4: Localization and Content Cleanup
|
|
54
54
|
- Move all user-facing text to `LocaleKey` + `.tr`.
|
|
55
|
+
- Create/Update feature localization JSON files:
|
|
56
|
+
- `lib/src/locale/json/en/<feature>.json`
|
|
57
|
+
- `lib/src/locale/json/ja/<feature>.json`
|
|
58
|
+
- Create/Update feature key module:
|
|
59
|
+
- `lib/src/locale/keys/<feature>_locale_key.dart`
|
|
60
|
+
- Ensure `lang_en.dart` / `lang_ja.dart` only aggregate feature maps (do not inject random inline feature strings).
|
|
61
|
+
- Ensure EN/JA JSON key parity for the refactored feature.
|
|
55
62
|
- Do not keep demo/static strings inside production widget tree.
|
|
56
63
|
- If temporary mock is needed, source it from `app_demo_data.dart`.
|
|
57
64
|
|
|
@@ -69,10 +76,14 @@ Use this rule when at least one condition is true:
|
|
|
69
76
|
- Verify SVG rendering without unexpected tint/color shift.
|
|
70
77
|
- Normalize convert-generated asset folders and names:
|
|
71
78
|
- Detect non-standard convert folders (for example: `assets/figma/**`).
|
|
72
|
-
- Move/rename assets to
|
|
79
|
+
- Move/rename assets to feature-scoped locations:
|
|
80
|
+
- `assets/images/<feature>/**`
|
|
81
|
+
- `assets/images/icons/<feature>/**`
|
|
73
82
|
- Rename files to meaningful `snake_case` names based on feature and purpose.
|
|
74
|
-
- Replace convert-style asset constants in `lib/src/utils/app_assets.dart` with
|
|
83
|
+
- Replace convert-style asset constants in `lib/src/utils/app_assets.dart` with feature-scoped naming.
|
|
75
84
|
- Update all usages in Dart code to new `AppAssets` constants.
|
|
85
|
+
- Prevent cross-feature collisions (same filename/constant for different meanings).
|
|
86
|
+
- Keep shared assets explicitly under shared scope only when truly reused.
|
|
76
87
|
- Remove orphan/unused old asset files and constants.
|
|
77
88
|
|
|
78
89
|
### Step 7: Verify and Prepare for PR
|
|
@@ -96,15 +107,21 @@ After refactor, output must include:
|
|
|
96
107
|
- List of renamed files/classes.
|
|
97
108
|
- List of extracted components.
|
|
98
109
|
- List of localized keys added/updated.
|
|
110
|
+
- Localization JSON files created/updated per feature (`en/ja`) and parity status.
|
|
99
111
|
- List of token replacements (`raw -> AppColors/AppStyles/AppDimensions`).
|
|
100
|
-
- Asset rename mapping (`old path/name -> new path/name`) and updated `AppAssets` constants.
|
|
112
|
+
- Asset rename mapping (`old path/name -> new path/name`) and updated feature-scoped `AppAssets` constants.
|
|
113
|
+
- Feature asset placement report (`feature -> directories/constants`) to prove no cross-feature mixing.
|
|
101
114
|
- Commit/push/PR confirmation answers and execution results.
|
|
102
115
|
- Remaining known gaps (if any) with exact file paths.
|
|
103
116
|
|
|
104
117
|
## 5. Anti-Patterns (Do Not)
|
|
105
118
|
- Do not keep generated class names in final code.
|
|
106
119
|
- Do not leave hardcoded colors/text if a project token/key exists.
|
|
120
|
+
- Do not keep feature localization inline in `lang_en.dart`/`lang_ja.dart` when feature JSON exists.
|
|
121
|
+
- Do not keep unmatched keys between `json/en/<feature>.json` and `json/ja/<feature>.json`.
|
|
107
122
|
- Do not keep convert-only asset naming/folders in final code if they violate project standard.
|
|
123
|
+
- Do not place feature-specific assets in generic folders without feature namespace.
|
|
124
|
+
- Do not reuse ambiguous asset constants across different features.
|
|
108
125
|
- Do not parse API JSON directly in UI widgets.
|
|
109
126
|
- Do not submit refactor that only changes formatting but leaves architectural violations.
|
|
110
127
|
|
|
@@ -115,6 +132,7 @@ Use this prompt to trigger this rule:
|
|
|
115
132
|
> Source: `<path-to-generated-page-or-component>`.
|
|
116
133
|
> Keep visual fidelity, but enforce architecture/tokens/localization/state correctness.
|
|
117
134
|
> Extract reusable components and remove convert artifacts.
|
|
118
|
-
> Normalize asset folder/naming and update `AppAssets`
|
|
135
|
+
> Normalize asset folder/naming by feature and update `AppAssets` with feature-scoped constants.
|
|
136
|
+
> Split localization by feature JSON (en/ja) and update LocaleKey feature module.
|
|
119
137
|
> Then ask: commit now? push now? create PR now?
|
|
120
138
|
> Return changed files and verification checklist results.
|
|
@@ -67,18 +67,25 @@ alwaysApply: false
|
|
|
67
67
|
|
|
68
68
|
### **C. Localization (Priority P1)**
|
|
69
69
|
- **No Raw Strings**: All user-facing text MUST be localized.
|
|
70
|
-
- **
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
- `lib/src/locale/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
- **JSON Per Feature (Required)**:
|
|
71
|
+
- Each feature must have its own JSON files:
|
|
72
|
+
- `lib/src/locale/json/en/<feature>.json`
|
|
73
|
+
- `lib/src/locale/json/ja/<feature>.json`
|
|
74
|
+
- One JSON file equals one function/feature scope. Do not mix multiple features in one JSON.
|
|
75
|
+
- Keep key parity between `en` and `ja` for the same feature.
|
|
76
|
+
- **LocaleKey By Feature (Required)**:
|
|
77
|
+
- Split key declarations by feature:
|
|
78
|
+
- `lib/src/locale/keys/<feature>_locale_key.dart`
|
|
79
|
+
- `lib/src/locale/locale_key.dart` should act as barrel/aggregator entry for all feature key files.
|
|
80
|
+
- Key naming format remains snake_case with feature prefix: `feature_screen_element`.
|
|
81
|
+
- **Aggregator Contract (Required)**:
|
|
82
|
+
- `lang_en.dart` and `lang_ja.dart` are aggregators that merge feature maps from JSON-derived modules.
|
|
83
|
+
- Do not hardcode new feature strings directly inside `lang_en.dart`/`lang_ja.dart` except app-level bootstrap keys.
|
|
84
|
+
- `translation_manager.dart` must keep consuming `enUs` and `jaJp` variables.
|
|
85
|
+
- **Usage**: Use `.tr` extension with `LocaleKey`.
|
|
86
|
+
- **Common Keys**:
|
|
87
|
+
- Maintain `common` localization as separate JSON modules (`common.json`) per language.
|
|
88
|
+
- Reuse common keys (`ok`, `cancel`, `loading`, `error`, ...) instead of duplicating per feature.
|
|
82
89
|
```dart
|
|
83
90
|
// ✅ Correct
|
|
84
91
|
Text(LocaleKey.home_title.tr);
|
|
@@ -119,6 +126,16 @@ alwaysApply: false
|
|
|
119
126
|
- **Rule**: Follow the [Assets Management Skill](../skills/flutter-assets-management/SKILL.md) strictly.
|
|
120
127
|
- **Naming**: MUST match Figma layer names in `snake_case`.
|
|
121
128
|
- **Registry**: All assets MUST be defined in `lib/src/utils/app_assets.dart`.
|
|
129
|
+
- **Feature-Scoped Assets (Required)**:
|
|
130
|
+
- Group assets by feature to avoid collisions/misuse:
|
|
131
|
+
- `assets/images/<feature>/...`
|
|
132
|
+
- `assets/images/icons/<feature>/...`
|
|
133
|
+
- Do not put new feature assets into generic/global folders unless truly shared.
|
|
134
|
+
- Shared cross-feature assets must live in explicit shared folder and use shared-prefixed constants.
|
|
135
|
+
- **Feature-Scoped AppAssets Constants (Required)**:
|
|
136
|
+
- Constant names must include feature prefix (for example: `homeDemoIconBellSvg`, `visitRecordImgHeaderPng`).
|
|
137
|
+
- Prefer splitting asset declarations by feature module, with `app_assets.dart` as aggregator entry.
|
|
138
|
+
- When refactoring, replace old ambiguous constants with feature-scoped names.
|
|
122
139
|
- **Usage**:
|
|
123
140
|
```dart
|
|
124
141
|
// ✅ Correct
|
|
@@ -129,9 +146,10 @@ alwaysApply: false
|
|
|
129
146
|
```
|
|
130
147
|
- **Workflow**:
|
|
131
148
|
1. Rename layer in Figma to `snake_case`.
|
|
132
|
-
2. Export to `assets/images
|
|
133
|
-
3. Register path in `AppAssets`.
|
|
134
|
-
4. Use `AppAssets
|
|
149
|
+
2. Export to feature folder (`assets/images/<feature>/` or `assets/images/icons/<feature>/`).
|
|
150
|
+
3. Register path with feature-scoped constant in `AppAssets`.
|
|
151
|
+
4. Use `AppAssets.<featureScopedName>` in code.
|
|
152
|
+
5. Remove/replace old ambiguous asset names and unused files.
|
|
135
153
|
- **SVG Hygiene (Priority P1)**:
|
|
136
154
|
- Flatten stroke → fill để tint/recolor an toàn.
|
|
137
155
|
- Remove mask/clip/filter phức tạp; đảm bảo `viewBox` 24×24 cho icon.
|
|
@@ -188,8 +206,16 @@ Follow these steps when creating a new UI screen:
|
|
|
188
206
|
|
|
189
207
|
### **Step 5: Localization**
|
|
190
208
|
- **Identify Strings**: List all text in the new UI (See [GetX Localization Skill](../skills/getx-localization-standard/SKILL.md)).
|
|
191
|
-
- **
|
|
192
|
-
-
|
|
209
|
+
- **Create Feature JSON Files**:
|
|
210
|
+
- `lib/src/locale/json/en/<feature>.json`
|
|
211
|
+
- `lib/src/locale/json/ja/<feature>.json`
|
|
212
|
+
- **Update Keys**:
|
|
213
|
+
- Add/update keys in `lib/src/locale/keys/<feature>_locale_key.dart`.
|
|
214
|
+
- Ensure `locale_key.dart` exports/aggregates the feature key module.
|
|
215
|
+
- **Update Aggregators**:
|
|
216
|
+
- Merge new feature translations into `lang_en.dart` and `lang_ja.dart` via feature module maps.
|
|
217
|
+
- Ensure `enUs` and `jaJp` remain valid and synchronized.
|
|
218
|
+
- **Parity Check**: `en` and `ja` JSON for the same feature must have identical key sets.
|
|
193
219
|
|
|
194
220
|
### **Step 6: Main Page Implementation**
|
|
195
221
|
- Create `<page_name>_page.dart` (See [UI Widgets Skill](../skills/flutter-ui-widgets/SKILL.md)).
|
|
@@ -281,6 +307,12 @@ Follow these steps when creating a new UI screen:
|
|
|
281
307
|
## **4. Checklist Before PR**
|
|
282
308
|
- [ ] No hardcoded colors/styles?
|
|
283
309
|
- [ ] No raw strings? (Localization used)
|
|
310
|
+
- [ ] **Localization JSON per feature created?** (`json/en/<feature>.json` + `json/ja/<feature>.json`)
|
|
311
|
+
- [ ] **LocaleKey split by feature?** (`keys/<feature>_locale_key.dart`)
|
|
312
|
+
- [ ] **EN/JA key parity passed?** (same keys between feature JSON files)
|
|
313
|
+
- [ ] **lang_en/lang_ja are aggregator-only?** (no random inline feature strings)
|
|
314
|
+
- [ ] **Assets grouped by feature?** (`assets/images/<feature>` and `assets/images/icons/<feature>`)
|
|
315
|
+
- [ ] **AppAssets constants are feature-scoped?** (no ambiguous generic names)
|
|
284
316
|
- [ ] Used `App*` widgets where possible?
|
|
285
317
|
- [ ] Page broken down into `components/`?
|
|
286
318
|
- [ ] Logic separated into `interactor/`?
|