agent-flutter 0.1.23 → 0.1.25
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
package/src/cli.js
CHANGED
|
@@ -724,6 +724,9 @@ When a task matches a skill, load the corresponding \`SKILL.md\` under:
|
|
|
724
724
|
|
|
725
725
|
For new project scaffolding, run:
|
|
726
726
|
\`bash .cursor/scripts/bootstrap_flutter_template.sh\`
|
|
727
|
+
|
|
728
|
+
After finishing UI/API tasks, ask user in order:
|
|
729
|
+
\`Commit now?\` -> \`Push now?\` -> \`Create PR now?\`
|
|
727
730
|
`;
|
|
728
731
|
}
|
|
729
732
|
|
|
@@ -737,7 +740,8 @@ Required order:
|
|
|
737
740
|
2. If task matches a skill, load \`.windsurf/skills/<skill>/SKILL.md\`.
|
|
738
741
|
3. For new project scaffolding, run \`bash .windsurf/scripts/bootstrap_flutter_template.sh\`.
|
|
739
742
|
4. Keep spec documentation synchronized after UI/API changes.
|
|
740
|
-
5. For completed UI/API features, follow \`.windsurf/rules/shared/ci-cd-pr.md
|
|
743
|
+
5. For completed UI/API features, follow \`.windsurf/rules/shared/ci-cd-pr.md\`.
|
|
744
|
+
6. Ask user in order: \`Commit now?\` -> \`Push now?\` -> \`Create PR now?\`.
|
|
741
745
|
`;
|
|
742
746
|
}
|
|
743
747
|
|
|
@@ -752,7 +756,8 @@ Execution checklist:
|
|
|
752
756
|
3. For new project scaffolding, run \`bash .clinerules/scripts/bootstrap_flutter_template.sh\`.
|
|
753
757
|
4. Preserve Flutter architecture conventions and localization requirements.
|
|
754
758
|
5. Update docs/specs after behavior changes.
|
|
755
|
-
6. For completed UI/API features, follow \`.clinerules/rules/ci-cd-pr.md
|
|
759
|
+
6. For completed UI/API features, follow \`.clinerules/rules/ci-cd-pr.md\`.
|
|
760
|
+
7. Ask user in order: \`Commit now?\` -> \`Push now?\` -> \`Create PR now?\`.
|
|
756
761
|
`;
|
|
757
762
|
}
|
|
758
763
|
|
|
@@ -767,7 +772,8 @@ Follow this order when generating code:
|
|
|
767
772
|
3. For new project scaffolding, run \`bash .github/scripts/bootstrap_flutter_template.sh\`.
|
|
768
773
|
4. Keep architecture, localization, and UI conventions aligned with local instructions.
|
|
769
774
|
5. Update specs/docs when UI/API behavior changes.
|
|
770
|
-
6. For completed UI/API features, follow \`.github/rules/ci-cd-pr.md
|
|
775
|
+
6. For completed UI/API features, follow \`.github/rules/ci-cd-pr.md\`.
|
|
776
|
+
7. Ask user in order: \`Commit now?\` -> \`Push now?\` -> \`Create PR now?\`.
|
|
771
777
|
`;
|
|
772
778
|
}
|
|
773
779
|
|
|
@@ -63,6 +63,9 @@ Use this after completing UI/API work to trigger CI/CD rule and PR creation:
|
|
|
63
63
|
Finalize this feature:
|
|
64
64
|
- Branch name: [e.g. feat/login-session-timeout]
|
|
65
65
|
- Commit message: [e.g. feat(auth): handle session timeout]
|
|
66
|
+
- Commit now?: [yes/no]
|
|
67
|
+
- Push now?: [yes/no]
|
|
68
|
+
- Create PR now?: [yes/no]
|
|
66
69
|
- Base branch: [e.g. dev]
|
|
67
70
|
- PR title: [e.g. feat(auth): handle session timeout]
|
|
68
71
|
- Feature summary: [...]
|
|
@@ -15,9 +15,13 @@ This is the required "done" flow before feature handoff.
|
|
|
15
15
|
- `fvm flutter analyze`
|
|
16
16
|
- Run related tests for the changed scope (unit/widget/integration when available).
|
|
17
17
|
2. Ensure spec/docs are updated if behavior changed.
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
18
|
+
3. Ask user explicitly: `Do you want me to commit now? (yes/no)`
|
|
19
|
+
4. If answer is `yes`, create commit with clear scope and summary.
|
|
20
|
+
5. Ask user explicitly: `Do you want me to push now? (yes/no)`
|
|
21
|
+
6. If answer is `yes`, push branch to remote.
|
|
22
|
+
7. Ask user explicitly: `Do you want me to create PR now? (yes/no)`
|
|
23
|
+
8. If answer is `yes`, create PR with mandatory template sections.
|
|
24
|
+
9. If any answer is `no`, stop at that step and return current status.
|
|
21
25
|
|
|
22
26
|
If any step is skipped, feature is not considered complete.
|
|
23
27
|
|
|
@@ -43,5 +47,7 @@ PR must follow `.github/pull_request_template.md` and include all sections:
|
|
|
43
47
|
- Branch protection must require this check before merge.
|
|
44
48
|
|
|
45
49
|
## 6. Agent Behavior
|
|
46
|
-
- After finishing UI/API tasks, agent must
|
|
47
|
-
- Agent
|
|
50
|
+
- After finishing UI/API tasks, agent must ask in order: commit -> push -> create PR.
|
|
51
|
+
- Agent must execute only steps explicitly confirmed by user (`yes`).
|
|
52
|
+
- If user confirms all steps, agent returns PR URL as final output.
|
|
53
|
+
- If user declines at any step, agent stops and returns current repository status.
|
|
@@ -51,6 +51,9 @@ If any item is missing, stop implementation and request contract clarification f
|
|
|
51
51
|
- UI/domain-only models: `lib/src/core/model/`
|
|
52
52
|
- Never pass raw `Map<String, dynamic>` across UI layers for non-trivial APIs.
|
|
53
53
|
- Reuse-first: check existing models before creating new ones.
|
|
54
|
+
- Required API fields must not silently fallback to fake defaults in `fromJson`.
|
|
55
|
+
- Nullable/non-nullable and enum values must match backend contract explicitly.
|
|
56
|
+
- Date/number parsing must be guarded (safe parse/cast), not optimistic cast.
|
|
54
57
|
|
|
55
58
|
### D. Repository Boundary
|
|
56
59
|
- All remote calls must be wrapped by repository classes in `lib/src/core/repository/`.
|
|
@@ -83,6 +86,11 @@ If any item is missing, stop implementation and request contract clarification f
|
|
|
83
86
|
- Prefer typed fields and safe nullability.
|
|
84
87
|
- Add parser methods (`fromJson/toJson`) consistently.
|
|
85
88
|
- Apply reuse/evolution checklist from [dart-model-reuse](../skills/dart-model-reuse/SKILL.md).
|
|
89
|
+
- Validate model correctness against contract:
|
|
90
|
+
- Required/optional fields match schema.
|
|
91
|
+
- Enum/status values are constrained.
|
|
92
|
+
- No hidden fallback defaults for required fields.
|
|
93
|
+
- Update `spec/model-registry.md` for any model additions/changes.
|
|
86
94
|
|
|
87
95
|
### Step 4: Implement Repository Method
|
|
88
96
|
- Repository extends/reuses `Api`.
|
|
@@ -107,6 +115,7 @@ If any item is missing, stop implementation and request contract clarification f
|
|
|
107
115
|
- UI reads bloc state and renders loading/error/success.
|
|
108
116
|
- No API parsing logic in widget tree.
|
|
109
117
|
- All strings shown from API errors must pass localization policy in [getx-localization-standard](../skills/getx-localization-standard/SKILL.md).
|
|
118
|
+
- UI should consume repository-mapped typed models only (not raw response JSON/map).
|
|
110
119
|
|
|
111
120
|
## 5. Minimal Reference Pattern
|
|
112
121
|
|
|
@@ -137,6 +146,9 @@ class FeatureRepository extends Api {
|
|
|
137
146
|
## 7. Verification Checklist Before PR
|
|
138
147
|
- [ ] Endpoint added in `api_url.dart` and consumed from repository only.
|
|
139
148
|
- [ ] Request/response models are separated and typed.
|
|
149
|
+
- [ ] Model correctness validated against API contract (required/nullable/enum/date/number).
|
|
150
|
+
- [ ] No hidden fallback defaults for required contract fields in `fromJson`.
|
|
151
|
+
- [ ] UI/Bloc consumes typed models only (no raw JSON/map parsing).
|
|
140
152
|
- [ ] Bloc uses `PageState` lifecycle correctly.
|
|
141
153
|
- [ ] All displayed text/error is localized via `LocaleKey`.
|
|
142
154
|
- [ ] Flavor run verified at least on staging command.
|
|
@@ -14,6 +14,14 @@ alwaysApply: false
|
|
|
14
14
|
- **Shadows**: Normalize `BoxShadow` closest to CSS box-shadow; do not change blur/spread arbitrarily.
|
|
15
15
|
- **Backgrounds**: Use `DecorationImage` + appropriate `BoxFit` (cover/contain) and correct alignment.
|
|
16
16
|
|
|
17
|
+
### **UI Correctness Gate (Priority P1)**
|
|
18
|
+
- Every new/updated screen must pass visual + behavioral correctness, not only "looks similar".
|
|
19
|
+
- Required state coverage for each screen: `loading`, `success`, `empty`, `error` (and `permission/unauthorized` if applicable).
|
|
20
|
+
- Required responsive check: at least widths `320`, `390`, `430`.
|
|
21
|
+
- Required accessibility check: text scale `1.0` and `1.3` without overflow/clipping.
|
|
22
|
+
- No layout overflow warnings are allowed in debug console.
|
|
23
|
+
- Tap targets should remain usable (recommended minimum 44x44 when interactive).
|
|
24
|
+
|
|
17
25
|
### **Overrides (Per-Component)**
|
|
18
26
|
- App* widgets must allow overriding tokens: `size`, `radius`, `padding/margin`, `backgroundColor`, `textStyle`, `iconSize`, `constraints`.
|
|
19
27
|
- Defaults must come from tokens (`AppStyles`, `AppColors`, `AppDimensions`) and act only as fallbacks; do not hardcode.
|
|
@@ -91,6 +99,16 @@ alwaysApply: false
|
|
|
91
99
|
- **No dynamic data in UI**: Pages/components MUST receive typed models via constructor/BLoC state; do not hardcode demo lists in widgets.
|
|
92
100
|
- **Demo/Mock Data Location**: Keep all demo/sample data in `lib/src/utils/app_demo_data.dart` only. Import from there when previewing or testing UI.
|
|
93
101
|
- **Reuse-first**: Before creating a new model, check the [Model Registry](../../spec/model-registry.md) and follow [Dart Model Reuse Skill](../skills/dart-model-reuse/SKILL.md). Prefer extending existing models (optional fields) or composition over duplication.
|
|
102
|
+
- **Model Correctness Gate (Priority P1)**:
|
|
103
|
+
- Each model class must state purpose/source in class doc (Request/Response/UI).
|
|
104
|
+
- Do not use `dynamic`/`Object?` for API payload fields unless contract truly allows unknown schema.
|
|
105
|
+
- Required contract fields must not silently fallback to fake defaults (`''`, `0`, `false`) in `fromJson`.
|
|
106
|
+
- Nullable/non-nullable must match backend contract.
|
|
107
|
+
- Date/number parsing must use guarded conversion (`DateTime.tryParse`, safe numeric casting).
|
|
108
|
+
- UI layer must consume typed UI/domain model only, not raw response map/json.
|
|
109
|
+
- **Mapper Boundary (Required)**:
|
|
110
|
+
- If API response shape differs from UI needs, map in repository or mapper layer (`lib/src/core/mapper/`).
|
|
111
|
+
- Widgets and page blocs must not parse JSON directly.
|
|
94
112
|
|
|
95
113
|
### **E. Composition & State**
|
|
96
114
|
- **State**: Default to `StatelessWidget`. Use `StatefulWidget` only for local UI logic (animations, focus).
|
|
@@ -147,6 +165,7 @@ Follow these steps when creating a new UI screen:
|
|
|
147
165
|
- Check Figma/Design.
|
|
148
166
|
- Identify reusable components -> Are they in `lib/src/ui/widgets`?
|
|
149
167
|
- Identify unique components -> Plan to put them in `components/`.
|
|
168
|
+
- Define UI state matrix before coding: loading/success/empty/error + action states (enabled/disabled).
|
|
150
169
|
|
|
151
170
|
### **Step 2: Scaffolding**
|
|
152
171
|
- Create the folder structure (See [Lib Src Architecture Skill](../skills/flutter-standard-lib-src-architecture/SKILL.md)):
|
|
@@ -157,6 +176,11 @@ Follow these steps when creating a new UI screen:
|
|
|
157
176
|
### **Step 3: Data Modeling (If API involved)**
|
|
158
177
|
- Create Request model in `lib/src/core/model/request/`.
|
|
159
178
|
- Create Response model in `lib/src/core/model/response/`.
|
|
179
|
+
- Validate each model against API contract before UI wiring:
|
|
180
|
+
- Required vs nullable fields are correct.
|
|
181
|
+
- Enum/status values are represented safely (enum or controlled constants).
|
|
182
|
+
- No silent fallback for required fields.
|
|
183
|
+
- Update `spec/model-registry.md` when adding/changing model.
|
|
160
184
|
|
|
161
185
|
### **Step 4: Logic & Binding**
|
|
162
186
|
- Create the Controller/Bloc in `interactor/` (See [Bloc Skill](../skills/flutter-bloc-state-management/SKILL.md)).
|
|
@@ -174,9 +198,13 @@ Follow these steps when creating a new UI screen:
|
|
|
174
198
|
- Use `AppColors` / `AppStyles`.
|
|
175
199
|
- Use `App*` widgets.
|
|
176
200
|
- Use `LocaleKey.my_key.tr` for text.
|
|
177
|
-
- **Radius & Icon**:
|
|
201
|
+
- **Radius & Icon**:
|
|
178
202
|
- If Figma requires radius = 14, **must** use `BorderRadius.circular(14)` at the corresponding component.
|
|
179
203
|
- Icon 24×24; if framed, use container 40×40/44×44 per Figma.
|
|
204
|
+
- **Behavioral Correctness (STRICT)**:
|
|
205
|
+
- Implement and render all required states from Step 1 (loading/success/empty/error...).
|
|
206
|
+
- Avoid overflow on small width and long localization strings.
|
|
207
|
+
- UI must not depend on mock constants inside widget tree for production flow.
|
|
180
208
|
- **Documentation Comments (STRICT)**:
|
|
181
209
|
- Add top-of-class `///` description for every Page and Component, summarizing its purpose and main actions.
|
|
182
210
|
- Generator reads these docs to build `spec/ui-workflow.md` (run `dart run tool/generate_ui_workflow_spec.dart`).
|
|
@@ -190,7 +218,7 @@ Follow these steps when creating a new UI screen:
|
|
|
190
218
|
```
|
|
191
219
|
|
|
192
220
|
### **Step 7: Component Extraction**
|
|
193
|
-
- **Rule**: If a widget block is > 50 lines or reused twice, extract it to `components/` (See [
|
|
221
|
+
- **Rule**: If a widget block is > 50 lines or reused twice, extract it to `components/` (See [Flutter UI Widgets Skill](../skills/flutter-ui-widgets/SKILL.md)).
|
|
194
222
|
- Keep the main `build()` method clean and readable.
|
|
195
223
|
|
|
196
224
|
### **Step 8: Route Registration (Choose One)**
|
|
@@ -257,6 +285,14 @@ Follow these steps when creating a new UI screen:
|
|
|
257
285
|
- [ ] Page broken down into `components/`?
|
|
258
286
|
- [ ] Logic separated into `interactor/`?
|
|
259
287
|
- [ ] **Data Models Separated?** (Request/Response in `core/model/`)
|
|
288
|
+
- [ ] **Model Correctness Gate passed?** (required/nullable/enum/date/number mapping validated)
|
|
289
|
+
- [ ] **No hidden fallback defaults for required fields?** (`fromJson` does not hide bad contract)
|
|
290
|
+
- [ ] **Mapper Boundary respected?** (UI/Bloc does not parse raw JSON/Map)
|
|
291
|
+
- [ ] **Model Registry Updated?** (`spec/model-registry.md` reflects new/changed models)
|
|
292
|
+
- [ ] **UI Correctness Gate passed?** (loading/success/empty/error implemented and verified)
|
|
293
|
+
- [ ] **Responsive check passed?** (320/390/430 widths)
|
|
294
|
+
- [ ] **Accessibility text scale check passed?** (`1.0` and `1.3` no overflow/clipping)
|
|
295
|
+
- [ ] **No debug overflow/error logs from layout?**
|
|
260
296
|
- [ ] File naming matches `<feature>_<type>.dart`?
|
|
261
297
|
- [ ] **Route Registered?**
|
|
262
298
|
- [ ] If Full Screen: Added to `AppPages`?
|