flutter-pro-max-cli 2.3.1 → 2.3.2
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/assets/templates/base/rules/01_skill_usage.md +22 -0
- package/assets/templates/base/{rules.md → rules/02_code_quality.md} +28 -29
- package/assets/templates/base/rules/03_interaction_flow.md +21 -0
- package/assets/templates/base/rules/04_app_consistency.md +58 -0
- package/assets/templates/base/rules/05_error_handling.md +43 -0
- package/assets/templates/base/rules/06_testing.md +48 -0
- package/assets/templates/base/rules/07_performance.md +47 -0
- package/assets/templates/base/rules/08_security.md +41 -0
- package/assets/templates/base/rules/09_state_management.md +54 -0
- package/assets/templates/base/rules/10_naming_conventions.md +70 -0
- package/assets/templates/base/rules/11_accessibility.md +56 -0
- package/assets/templates/base/skill-content-10k.md +40 -206
- package/assets/templates/base/skill-content-4k.md +9 -95
- package/assets/templates/base/skill-content.md +29 -370
- package/dist/utils/template.js +30 -13
- package/package.json +1 -1
|
@@ -4,215 +4,49 @@
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## How to Use
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Search
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
| `dart_fix` | Auto-fix errors | Run before commit |
|
|
17
|
-
| `flutter analyze` | Lint check | Catch issues early |
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 📐 CORE PHILOSOPHIES
|
|
22
|
-
|
|
23
|
-
### SOLID Principles (Mandatory)
|
|
24
|
-
|
|
25
|
-
| Principle | Rule | Example |
|
|
26
|
-
|-----------|------|---------|
|
|
27
|
-
| **S - Single Responsibility** | 1 class = 1 job | `LoginUseCase` only handles login |
|
|
28
|
-
| **O - Open/Closed** | Extend, don't modify | Use `abstract class` over `if-else` |
|
|
29
|
-
| **L - Liskov Substitution** | Subtypes replace base | `GoogleAuth extends AuthProvider` |
|
|
30
|
-
| **I - Interface Segregation** | No forced dependencies | Split `Readable` and `Writable` |
|
|
31
|
-
| **D - Dependency Inversion** | Depend on abstractions | Inject interface, not implementation |
|
|
32
|
-
|
|
33
|
-
### Pragmatic Rules
|
|
34
|
-
|
|
35
|
-
| Rule | Action |
|
|
36
|
-
|------|--------|
|
|
37
|
-
| **DRY** | Logic repeated >2x → Extract |
|
|
38
|
-
| **KISS** | Prefer simplest solution |
|
|
39
|
-
| **YAGNI** | Build only what's needed now |
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## ⛔ HARD CONSTRAINTS
|
|
44
|
-
|
|
45
|
-
### NO God Classes/Files
|
|
46
|
-
|
|
47
|
-
| Constraint | Limit | Action |
|
|
48
|
-
|------------|-------|--------|
|
|
49
|
-
| Public methods | ≤10 | 🔴 REFACTOR |
|
|
50
|
-
| Lines of logic | ≤200 | 🔴 REFACTOR |
|
|
51
|
-
| File size | ≤300 lines | 🔴 SPLIT |
|
|
52
|
-
| Classes per file | 1 main | 🔴 SEPARATE |
|
|
53
|
-
|
|
54
|
-
### Code Quality Standards
|
|
55
|
-
|
|
56
|
-
| Rule | Standard |
|
|
57
|
-
|------|----------|
|
|
58
|
-
| Line length | ≤80 characters |
|
|
59
|
-
| Naming | `PascalCase` types, `camelCase` members, `snake_case` files |
|
|
60
|
-
| Functions | <20 lines, single purpose |
|
|
61
|
-
| Null Safety | Sound. Avoid `!` unless guaranteed |
|
|
62
|
-
| Logging | `dart:developer` log(), NEVER print() |
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 🎯 DART BEST PRACTICES
|
|
67
|
-
|
|
68
|
-
### Async/Await
|
|
69
|
-
```dart
|
|
70
|
-
Future<User> fetchUser() async {
|
|
71
|
-
try {
|
|
72
|
-
final response = await api.getUser();
|
|
73
|
-
return User.fromJson(response);
|
|
74
|
-
} catch (e, s) {
|
|
75
|
-
developer.log('Failed', error: e, stackTrace: s);
|
|
76
|
-
rethrow;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
11
|
+
```bash
|
|
12
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --top 5
|
|
13
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --domain widget --top 5
|
|
14
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --stack riverpod --top 5
|
|
15
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --json --top 5
|
|
79
16
|
```
|
|
80
17
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
18
|
+
**Domains (17):** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`, `performance`, `ui-reasoning`, `accessibility`
|
|
19
|
+
|
|
20
|
+
**Stacks:** `riverpod`, `bloc`, `provider`
|
|
21
|
+
|
|
22
|
+
### Search Reference
|
|
23
|
+
|
|
24
|
+
| Domain | File | Content |
|
|
25
|
+
|--------|------|---------|
|
|
26
|
+
| Widgets | `widget.csv` | 65+ Flutter widgets |
|
|
27
|
+
| Packages | `package.csv` | 100+ packages |
|
|
28
|
+
| Patterns | `patterns.csv` | 100+ design patterns |
|
|
29
|
+
| Architecture | `architect.csv` | Clean Architecture layers |
|
|
30
|
+
| Performance | `flutter-performance.csv` | 35+ performance patterns |
|
|
31
|
+
| Accessibility | `mobile-accessibility.csv` | 35+ accessibility patterns |
|
|
32
|
+
| UI Reasoning | `ui-reasoning.csv` | 35+ UI decision rules |
|
|
33
|
+
| Charts | `charts.csv` | Chart recommendations |
|
|
34
|
+
| Colors | `colors.csv` | Color palettes |
|
|
35
|
+
| Typography | `typography.csv` | Font pairings |
|
|
36
|
+
| Styles | `styles.csv` | UI style guidelines |
|
|
37
|
+
| UX Guidelines | `ux-guidelines.csv` | UX best practices |
|
|
38
|
+
| Icons | `icons.csv` | Icon recommendations |
|
|
39
|
+
| Landing | `landing.csv` | Landing page patterns |
|
|
40
|
+
| Naming | `name_convention.csv` | Naming conventions |
|
|
41
|
+
| Products | `products.csv` | Product type styling |
|
|
42
|
+
| Prompts | `prompts.csv` | AI prompt templates |
|
|
43
|
+
|
|
44
|
+
### Tools
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
dart format . # Format code
|
|
48
|
+
dart fix --apply # Auto-fix
|
|
49
|
+
flutter analyze . # Lint check
|
|
50
|
+
flutter test . # Run tests
|
|
91
51
|
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## 🔧 FLUTTER STANDARDS
|
|
96
|
-
|
|
97
|
-
### State Management (Native-First)
|
|
98
|
-
```dart
|
|
99
|
-
// ValueNotifier for simple state
|
|
100
|
-
final counter = ValueNotifier<int>(0);
|
|
101
|
-
ValueListenableBuilder<int>(
|
|
102
|
-
valueListenable: counter,
|
|
103
|
-
builder: (_, value, __) => Text('Count: $value'),
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
// ChangeNotifier for complex state
|
|
107
|
-
class CartNotifier extends ChangeNotifier {
|
|
108
|
-
final List<Item> _items = [];
|
|
109
|
-
void addItem(Item item) {
|
|
110
|
-
_items.add(item);
|
|
111
|
-
notifyListeners();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
> ⚠️ NO Riverpod/Bloc/GetX unless explicitly requested
|
|
116
|
-
|
|
117
|
-
### Routing (GoRouter)
|
|
118
|
-
```dart
|
|
119
|
-
final router = GoRouter(routes: [
|
|
120
|
-
GoRoute(path: '/', builder: (_, __) => const HomeScreen()),
|
|
121
|
-
GoRoute(
|
|
122
|
-
path: 'details/:id',
|
|
123
|
-
builder: (_, state) => DetailScreen(id: state.pathParameters['id']!),
|
|
124
|
-
),
|
|
125
|
-
]);
|
|
126
|
-
MaterialApp.router(routerConfig: router);
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### JSON Serialization
|
|
130
|
-
```dart
|
|
131
|
-
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
132
|
-
class User {
|
|
133
|
-
final String firstName;
|
|
134
|
-
User({required this.firstName});
|
|
135
|
-
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## 🎨 THEMING (Material 3)
|
|
142
|
-
|
|
143
|
-
```dart
|
|
144
|
-
final lightTheme = ThemeData(
|
|
145
|
-
colorScheme: ColorScheme.fromSeed(
|
|
146
|
-
seedColor: Colors.deepPurple,
|
|
147
|
-
brightness: Brightness.light,
|
|
148
|
-
),
|
|
149
|
-
useMaterial3: true,
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
final darkTheme = ThemeData(
|
|
153
|
-
colorScheme: ColorScheme.fromSeed(
|
|
154
|
-
seedColor: Colors.deepPurple,
|
|
155
|
-
brightness: Brightness.dark,
|
|
156
|
-
),
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
MaterialApp(
|
|
160
|
-
theme: lightTheme,
|
|
161
|
-
darkTheme: darkTheme,
|
|
162
|
-
themeMode: ThemeMode.system,
|
|
163
|
-
);
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Network Images
|
|
167
|
-
```dart
|
|
168
|
-
Image.network(
|
|
169
|
-
'https://example.com/img.png',
|
|
170
|
-
loadingBuilder: (ctx, child, prog) =>
|
|
171
|
-
prog == null ? child : const CircularProgressIndicator(),
|
|
172
|
-
errorBuilder: (ctx, err, stack) => const Icon(Icons.error),
|
|
173
|
-
);
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## ⚡ PERFORMANCE
|
|
179
|
-
|
|
180
|
-
| Practice | Guideline |
|
|
181
|
-
|----------|-----------|
|
|
182
|
-
| `const` constructors | Use everywhere possible |
|
|
183
|
-
| `ListView.builder` | For long lists |
|
|
184
|
-
| `compute()` | For heavy tasks (JSON parsing) |
|
|
185
|
-
| `SizedBox` | Prefer over `Container` for spacing |
|
|
186
|
-
| Build methods | Keep pure, no side effects |
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## ♿ ACCESSIBILITY
|
|
191
|
-
|
|
192
|
-
| Requirement | Standard |
|
|
193
|
-
|-------------|----------|
|
|
194
|
-
| Contrast | Minimum 4.5:1 for text |
|
|
195
|
-
| Large Text | Minimum 3:1 |
|
|
196
|
-
| Dynamic Scaling | Test up to 200% |
|
|
197
|
-
| Semantics | Label all interactive elements |
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## ✅ PRE-DELIVERY CHECKLIST
|
|
202
|
-
|
|
203
|
-
### Architecture
|
|
204
|
-
- [ ] No God Class (≤10 methods, ≤200 lines)
|
|
205
|
-
- [ ] No God File (≤300 lines)
|
|
206
|
-
- [ ] SOLID compliance
|
|
207
|
-
|
|
208
|
-
### Code Quality
|
|
209
|
-
- [ ] `const` constructors
|
|
210
|
-
- [ ] Sound Null Safety
|
|
211
|
-
- [ ] `dart_format` applied
|
|
212
|
-
- [ ] `flutter analyze` passed
|
|
213
|
-
|
|
214
|
-
### Testing
|
|
215
|
-
- [ ] Unit tests for domain
|
|
216
|
-
- [ ] Widget tests for UI
|
|
217
|
-
- [ ] Integration tests for E2E
|
|
218
52
|
{{QUICK_REFERENCE}}
|
|
@@ -4,105 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Search
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- `dart_fix` - Auto-fix errors
|
|
14
|
-
- `flutter analyze` - Lint check
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Core Rules
|
|
19
|
-
|
|
20
|
-
### SOLID (Mandatory)
|
|
21
|
-
| Principle | Rule |
|
|
22
|
-
|-----------|------|
|
|
23
|
-
| **S** | 1 class = 1 responsibility |
|
|
24
|
-
| **O** | Open for extension, closed for modification |
|
|
25
|
-
| **L** | Subtypes replaceable for base types |
|
|
26
|
-
| **I** | No forced unused dependencies |
|
|
27
|
-
| **D** | Depend on abstractions |
|
|
28
|
-
|
|
29
|
-
### Hard Limits
|
|
30
|
-
| Constraint | Limit |
|
|
31
|
-
|------------|-------|
|
|
32
|
-
| God Class | ≤10 methods, ≤200 lines |
|
|
33
|
-
| God File | ≤300 lines |
|
|
34
|
-
| Functions | <20 lines |
|
|
35
|
-
| Line length | ≤80 chars |
|
|
36
|
-
|
|
37
|
-
### Naming
|
|
38
|
-
- `PascalCase` - Types/Classes
|
|
39
|
-
- `camelCase` - Members/Variables
|
|
40
|
-
- `snake_case` - Files
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Flutter Standards
|
|
45
|
-
|
|
46
|
-
### State Management (Native-First)
|
|
47
|
-
```dart
|
|
48
|
-
// ValueNotifier for simple state
|
|
49
|
-
final counter = ValueNotifier<int>(0);
|
|
50
|
-
ValueListenableBuilder(
|
|
51
|
-
valueListenable: counter,
|
|
52
|
-
builder: (_, value, __) => Text('$value'),
|
|
53
|
-
);
|
|
9
|
+
```bash
|
|
10
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --top 5
|
|
11
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --domain widget --top 5
|
|
12
|
+
python3 {{SCRIPT_PATH}}/search.py "<keyword>" --stack riverpod --top 5
|
|
54
13
|
```
|
|
55
|
-
> ⚠️ NO Riverpod/Bloc/GetX unless requested
|
|
56
14
|
|
|
57
|
-
|
|
58
|
-
```dart
|
|
59
|
-
final router = GoRouter(routes: [
|
|
60
|
-
GoRoute(path: '/', builder: (_, __) => HomeScreen()),
|
|
61
|
-
]);
|
|
62
|
-
MaterialApp.router(routerConfig: router);
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Theming (Material 3)
|
|
66
|
-
```dart
|
|
67
|
-
ThemeData(
|
|
68
|
-
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
69
|
-
useMaterial3: true,
|
|
70
|
-
);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Performance
|
|
74
|
-
- `const` constructors everywhere
|
|
75
|
-
- `ListView.builder` for lists
|
|
76
|
-
- `compute()` for heavy tasks
|
|
77
|
-
- `SizedBox` over `Container`
|
|
78
|
-
|
|
79
|
-
---
|
|
15
|
+
**Domains:** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`, `performance`, `ui-reasoning`, `accessibility`
|
|
80
16
|
|
|
81
|
-
##
|
|
17
|
+
## Tools
|
|
82
18
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
import 'dart:developer' as dev;
|
|
86
|
-
dev.log('Message', name: 'app.module', error: e);
|
|
19
|
+
```bash
|
|
20
|
+
dart format . && flutter analyze . && flutter test .
|
|
87
21
|
```
|
|
88
|
-
> ❌ NEVER use `print()`
|
|
89
|
-
|
|
90
|
-
### JSON Model
|
|
91
|
-
```dart
|
|
92
|
-
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
93
|
-
class User {
|
|
94
|
-
final String name;
|
|
95
|
-
User({required this.name});
|
|
96
|
-
factory User.fromJson(Map<String, dynamic> j) => _$UserFromJson(j);
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## Checklist
|
|
103
|
-
- [ ] No God Class/File
|
|
104
|
-
- [ ] `const` constructors
|
|
105
|
-
- [ ] Sound null safety
|
|
106
|
-
- [ ] `dart_format` applied
|
|
107
|
-
- [ ] Tests written
|
|
108
22
|
{{QUICK_REFERENCE}}
|