flutter-pro-max-cli 1.0.0 → 1.0.1
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/.agent/workflows/flutter-pro-max.md +60 -62
- package/assets/.agent/workflows/scripts/core.py +4 -0
- package/assets/.claude/skills/flutter-pro-max/SKILL.md +46 -63
- package/assets/.claude/skills/flutter-pro-max/scripts/core.py +4 -0
- package/assets/.codebuddy/commands/flutter-pro-max.md +142 -35
- package/assets/.codebuddy/commands/scripts/core.py +4 -0
- package/assets/.codex/skills/flutter-pro-max/SKILL.md +116 -51
- package/assets/.codex/skills/flutter-pro-max/scripts/core.py +4 -0
- package/assets/.cursor/commands/flutter-pro-max.md +65 -54
- package/assets/.cursor/commands/scripts/core.py +4 -0
- package/assets/.gemini/skills/flutter-pro-max/SKILL.md +116 -51
- package/assets/.gemini/skills/flutter-pro-max/scripts/core.py +4 -0
- package/assets/.github/prompts/flutter-pro-max.prompt.md +145 -41
- package/assets/.github/prompts/scripts/core.py +4 -0
- package/assets/.kiro/steering/flutter-pro-max.md +141 -37
- package/assets/.kiro/steering/scripts/core.py +4 -0
- package/assets/.qoder/rules/flutter-pro-max.md +141 -35
- package/assets/.qoder/rules/scripts/core.py +4 -0
- package/assets/.roo/commands/flutter-pro-max.md +141 -35
- package/assets/.roo/commands/scripts/core.py +4 -0
- package/assets/.trae/skills/flutter-pro-max/SKILL.md +141 -37
- package/assets/.trae/skills/flutter-pro-max/scripts/core.py +4 -0
- package/assets/.windsurf/workflows/flutter-pro-max.md +65 -54
- package/assets/.windsurf/workflows/scripts/core.py +4 -0
- package/package.json +1 -1
|
@@ -1,61 +1,165 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
description:
|
|
2
|
+
name: flutter-pro-max
|
|
3
|
+
description: Chuyên gia Flutter với kiến thức sâu về Clean Architecture, Performance và Modern Dart 3
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Flutter Pro Max - Flutter Design Intelligence
|
|
7
7
|
|
|
8
|
-
Searchable database
|
|
8
|
+
Searchable database của Flutter widgets, packages, design patterns, architecture guidelines, và best practices.
|
|
9
9
|
|
|
10
10
|
## Prerequisites
|
|
11
11
|
|
|
12
|
+
Chỉ cần Python (không cần pip install):
|
|
13
|
+
|
|
12
14
|
```bash
|
|
13
|
-
|
|
15
|
+
python3 --version || python --version
|
|
14
16
|
```
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## How to Use This Skill
|
|
21
|
+
|
|
22
|
+
Khi user yêu cầu Flutter work (design, build, create, implement, review, fix, improve), follow workflow này:
|
|
23
|
+
|
|
24
|
+
### Step 1: Analyze User Requirements
|
|
25
|
+
|
|
26
|
+
Trích xuất thông tin từ request:
|
|
27
|
+
- **Architecture**: Clean Architecture, Feature-First, DDD
|
|
28
|
+
- **State Management**: Riverpod (default), Bloc, Provider
|
|
29
|
+
- **UI Components**: Widgets, Layouts, Animations
|
|
30
|
+
- **Package needs**: Networking, Database, Security, etc.
|
|
31
|
+
|
|
32
|
+
### Step 2: Search Relevant Data
|
|
33
|
+
|
|
34
|
+
Sử dụng `search.py` để tìm kiếm (auto-detect domain):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 .shared/flutter-pro-max/scripts/search.py "<keyword>" --top 5
|
|
38
|
+
```
|
|
17
39
|
|
|
40
|
+
**Với domain cụ thể:**
|
|
18
41
|
```bash
|
|
19
|
-
python3 .
|
|
20
|
-
python3 .
|
|
42
|
+
python3 .shared/flutter-pro-max/scripts/search.py "<keyword>" --domain widget --top 5
|
|
43
|
+
python3 .shared/flutter-pro-max/scripts/search.py "<keyword>" --domain package --top 5
|
|
21
44
|
```
|
|
22
45
|
|
|
23
|
-
**
|
|
46
|
+
**Với stack filter (loại bỏ conflicts):**
|
|
24
47
|
```bash
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
python3 .shared/flutter-pro-max/scripts/search.py "<keyword>" --stack riverpod --top 5
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Available domains:** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`
|
|
52
|
+
|
|
53
|
+
**Available stacks:** `riverpod`, `bloc`, `provider`
|
|
27
54
|
|
|
28
|
-
|
|
29
|
-
python3 .github/prompts/scripts/search.py "chart bar" --top 5
|
|
55
|
+
### Step 3: Apply Technical Standards
|
|
30
56
|
|
|
31
|
-
|
|
32
|
-
python3 .github/prompts/scripts/search.py "font modern" --top 5
|
|
57
|
+
Luôn tuân thủ các tiêu chuẩn:
|
|
33
58
|
|
|
34
|
-
|
|
35
|
-
|
|
59
|
+
#### Dart 3 Modern Syntax
|
|
60
|
+
```dart
|
|
61
|
+
// ✅ Records
|
|
62
|
+
(String name, int age) getUserInfo() => ('John', 25);
|
|
63
|
+
|
|
64
|
+
// ✅ Pattern Matching
|
|
65
|
+
String getMessage(UIState state) => switch (state) {
|
|
66
|
+
LoadingState() => 'Loading...',
|
|
67
|
+
DataState(data: var d) => 'Data: $d',
|
|
68
|
+
ErrorState(message: var m) => 'Error: $m',
|
|
69
|
+
};
|
|
36
70
|
```
|
|
37
71
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
#### Performance Rules
|
|
73
|
+
- Luôn dùng `const` constructor khi có thể
|
|
74
|
+
- Ưu tiên `SizedBox` hơn `Container` cho spacing
|
|
75
|
+
- Dùng `ListView.builder` thay vì `ListView` + `children`
|
|
76
|
+
|
|
77
|
+
#### State Management
|
|
78
|
+
- **Default**: Riverpod với `riverpod_generator`
|
|
79
|
+
- **Alternative**: Bloc (khi user yêu cầu)
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Search Reference
|
|
84
|
+
|
|
85
|
+
### Available Data
|
|
86
|
+
|
|
87
|
+
| Domain | File | Content |
|
|
88
|
+
|--------|------|---------|
|
|
89
|
+
| Widgets | `widget.csv` | 65+ Flutter widgets với pro-tips |
|
|
90
|
+
| Packages | `package.csv` | 100+ packages với best practices |
|
|
91
|
+
| Patterns | `patterns.csv` | 100+ design patterns với code snippets |
|
|
92
|
+
| Architecture | `architect.csv` | Clean Architecture layer paths |
|
|
93
|
+
| Charts | `charts.csv` | Chart type recommendations |
|
|
94
|
+
| Colors | `colors.csv` | Color palettes by product type |
|
|
95
|
+
| Typography | `typography.csv` | Font pairings |
|
|
96
|
+
| Styles | `styles.csv` | UI style guidelines |
|
|
97
|
+
| UX Guidelines | `ux-guidelines.csv` | UX best practices |
|
|
98
|
+
| Icons | `icons.csv` | Icon recommendations |
|
|
99
|
+
| Landing | `landing.csv` | Landing page patterns |
|
|
100
|
+
| Naming | `name_convention.csv` | Naming conventions |
|
|
101
|
+
| Products | `products.csv` | Product type styling |
|
|
102
|
+
| Prompts | `prompts.csv` | AI prompt templates |
|
|
103
|
+
|
|
104
|
+
### Search Examples
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Auto-detect domain
|
|
108
|
+
python3 .shared/flutter-pro-max/scripts/search.py "ListView" --top 5
|
|
109
|
+
|
|
110
|
+
# Specific domain
|
|
111
|
+
python3 .shared/flutter-pro-max/scripts/search.py "network http" --domain package --top 5
|
|
112
|
+
|
|
113
|
+
# Stack filter
|
|
114
|
+
python3 .shared/flutter-pro-max/scripts/search.py "state" --stack riverpod --top 5
|
|
115
|
+
|
|
116
|
+
# JSON output
|
|
117
|
+
python3 .shared/flutter-pro-max/scripts/search.py "login" --json --top 3
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Example Workflow
|
|
123
|
+
|
|
124
|
+
**User Request:** "Tạo màn hình đăng nhập với Riverpod"
|
|
125
|
+
|
|
126
|
+
1. **Search widgets:**
|
|
127
|
+
```bash
|
|
128
|
+
python3 .shared/flutter-pro-max/scripts/search.py "form input" --domain widget --top 5
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
2. **Search patterns:**
|
|
132
|
+
```bash
|
|
133
|
+
python3 .shared/flutter-pro-max/scripts/search.py "authentication login" --domain pattern --top 5
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
3. **Search packages:**
|
|
137
|
+
```bash
|
|
138
|
+
python3 .shared/flutter-pro-max/scripts/search.py "validation" --domain package --stack riverpod --top 5
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
4. **Apply results** to generate code với Riverpod state management
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Pre-Delivery Checklist
|
|
146
|
+
|
|
147
|
+
### Code Quality
|
|
148
|
+
- [ ] Sử dụng `const` constructors
|
|
149
|
+
- [ ] Sound Null Safety (không dùng `!` bừa bãi)
|
|
150
|
+
- [ ] Dart 3 syntax (Records, Pattern Matching)
|
|
151
|
+
|
|
152
|
+
### Performance
|
|
153
|
+
- [ ] `ListView.builder` cho lists dài
|
|
154
|
+
- [ ] `SizedBox` thay vì `Container` cho spacing
|
|
155
|
+
- [ ] `const` widgets được đánh dấu
|
|
156
|
+
|
|
157
|
+
### Architecture
|
|
158
|
+
- [ ] Tuân thủ Clean Architecture layers
|
|
159
|
+
- [ ] Dependency Injection đúng cách
|
|
160
|
+
- [ ] Repository pattern cho data access
|
|
161
|
+
|
|
162
|
+
### State Management
|
|
163
|
+
- [ ] Riverpod providers được tổ chức hợp lý
|
|
164
|
+
- [ ] Không leak state giữa các features
|
|
165
|
+
- [ ] Error handling với AsyncValue
|
|
@@ -20,6 +20,10 @@ def _get_data_dir():
|
|
|
20
20
|
script_dir.parent / ".shared" / "data",
|
|
21
21
|
# When running from .shared/flutter-pro-max/scripts/
|
|
22
22
|
script_dir.parent.parent / "data",
|
|
23
|
+
# When running from .agent/workflows/scripts/ (nested 3 levels deep)
|
|
24
|
+
script_dir.parent.parent.parent / ".shared" / "data",
|
|
25
|
+
# When running from .claude/skills/flutter-pro-max/scripts/ (nested 4 levels deep)
|
|
26
|
+
script_dir.parent.parent.parent.parent / ".shared" / "data",
|
|
23
27
|
# Fallback: cwd
|
|
24
28
|
Path.cwd() / ".shared" / "data",
|
|
25
29
|
]
|
|
@@ -1,60 +1,164 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Chuyên gia Flutter với kiến thức sâu về Clean Architecture, Performance và Modern Dart 3
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Flutter Pro Max - Flutter Design Intelligence
|
|
6
6
|
|
|
7
|
-
Searchable database
|
|
7
|
+
Searchable database của Flutter widgets, packages, design patterns, architecture guidelines, và best practices.
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
11
|
+
Chỉ cần Python (không cần pip install):
|
|
12
|
+
|
|
11
13
|
```bash
|
|
12
|
-
|
|
14
|
+
python3 --version || python --version
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## How to Use This Steering
|
|
20
|
+
|
|
21
|
+
Khi user yêu cầu Flutter work (design, build, create, implement, review, fix, improve), follow workflow này:
|
|
22
|
+
|
|
23
|
+
### Step 1: Analyze User Requirements
|
|
24
|
+
|
|
25
|
+
Trích xuất thông tin từ request:
|
|
26
|
+
- **Architecture**: Clean Architecture, Feature-First, DDD
|
|
27
|
+
- **State Management**: Riverpod (default), Bloc, Provider
|
|
28
|
+
- **UI Components**: Widgets, Layouts, Animations
|
|
29
|
+
- **Package needs**: Networking, Database, Security, etc.
|
|
30
|
+
|
|
31
|
+
### Step 2: Search Relevant Data
|
|
32
|
+
|
|
33
|
+
Sử dụng `search.py` để tìm kiếm (auto-detect domain):
|
|
16
34
|
|
|
17
35
|
```bash
|
|
18
36
|
python3 .kiro/steering/scripts/search.py "<keyword>" --top 5
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Với domain cụ thể:**
|
|
40
|
+
```bash
|
|
41
|
+
python3 .kiro/steering/scripts/search.py "<keyword>" --domain widget --top 5
|
|
42
|
+
python3 .kiro/steering/scripts/search.py "<keyword>" --domain package --top 5
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Với stack filter (loại bỏ conflicts):**
|
|
46
|
+
```bash
|
|
19
47
|
python3 .kiro/steering/scripts/search.py "<keyword>" --stack riverpod --top 5
|
|
20
48
|
```
|
|
21
49
|
|
|
22
|
-
**
|
|
50
|
+
**Available domains:** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`
|
|
51
|
+
|
|
52
|
+
**Available stacks:** `riverpod`, `bloc`, `provider`
|
|
53
|
+
|
|
54
|
+
### Step 3: Apply Technical Standards
|
|
55
|
+
|
|
56
|
+
Luôn tuân thủ các tiêu chuẩn:
|
|
57
|
+
|
|
58
|
+
#### Dart 3 Modern Syntax
|
|
59
|
+
```dart
|
|
60
|
+
// ✅ Records
|
|
61
|
+
(String name, int age) getUserInfo() => ('John', 25);
|
|
62
|
+
|
|
63
|
+
// ✅ Pattern Matching
|
|
64
|
+
String getMessage(UIState state) => switch (state) {
|
|
65
|
+
LoadingState() => 'Loading...',
|
|
66
|
+
DataState(data: var d) => 'Data: $d',
|
|
67
|
+
ErrorState(message: var m) => 'Error: $m',
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Performance Rules
|
|
72
|
+
- Luôn dùng `const` constructor khi có thể
|
|
73
|
+
- Ưu tiên `SizedBox` hơn `Container` cho spacing
|
|
74
|
+
- Dùng `ListView.builder` thay vì `ListView` + `children`
|
|
75
|
+
|
|
76
|
+
#### State Management
|
|
77
|
+
- **Default**: Riverpod với `riverpod_generator`
|
|
78
|
+
- **Alternative**: Bloc (khi user yêu cầu)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Search Reference
|
|
83
|
+
|
|
84
|
+
### Available Data
|
|
85
|
+
|
|
86
|
+
| Domain | File | Content |
|
|
87
|
+
|--------|------|---------|
|
|
88
|
+
| Widgets | `widget.csv` | 65+ Flutter widgets với pro-tips |
|
|
89
|
+
| Packages | `package.csv` | 100+ packages với best practices |
|
|
90
|
+
| Patterns | `patterns.csv` | 100+ design patterns với code snippets |
|
|
91
|
+
| Architecture | `architect.csv` | Clean Architecture layer paths |
|
|
92
|
+
| Charts | `charts.csv` | Chart type recommendations |
|
|
93
|
+
| Colors | `colors.csv` | Color palettes by product type |
|
|
94
|
+
| Typography | `typography.csv` | Font pairings |
|
|
95
|
+
| Styles | `styles.csv` | UI style guidelines |
|
|
96
|
+
| UX Guidelines | `ux-guidelines.csv` | UX best practices |
|
|
97
|
+
| Icons | `icons.csv` | Icon recommendations |
|
|
98
|
+
| Landing | `landing.csv` | Landing page patterns |
|
|
99
|
+
| Naming | `name_convention.csv` | Naming conventions |
|
|
100
|
+
| Products | `products.csv` | Product type styling |
|
|
101
|
+
| Prompts | `prompts.csv` | AI prompt templates |
|
|
102
|
+
|
|
103
|
+
### Search Examples
|
|
104
|
+
|
|
23
105
|
```bash
|
|
24
|
-
#
|
|
106
|
+
# Auto-detect domain
|
|
25
107
|
python3 .kiro/steering/scripts/search.py "ListView" --top 5
|
|
26
108
|
|
|
27
|
-
#
|
|
28
|
-
python3 .kiro/steering/scripts/search.py "
|
|
109
|
+
# Specific domain
|
|
110
|
+
python3 .kiro/steering/scripts/search.py "network http" --domain package --top 5
|
|
29
111
|
|
|
30
|
-
#
|
|
31
|
-
python3 .kiro/steering/scripts/search.py "
|
|
112
|
+
# Stack filter
|
|
113
|
+
python3 .kiro/steering/scripts/search.py "state" --stack riverpod --top 5
|
|
32
114
|
|
|
33
|
-
#
|
|
34
|
-
python3 .kiro/steering/scripts/search.py "
|
|
115
|
+
# JSON output
|
|
116
|
+
python3 .kiro/steering/scripts/search.py "login" --json --top 3
|
|
35
117
|
```
|
|
36
118
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Example Workflow
|
|
122
|
+
|
|
123
|
+
**User Request:** "Tạo màn hình đăng nhập với Riverpod"
|
|
124
|
+
|
|
125
|
+
1. **Search widgets:**
|
|
126
|
+
```bash
|
|
127
|
+
python3 .kiro/steering/scripts/search.py "form input" --domain widget --top 5
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
2. **Search patterns:**
|
|
131
|
+
```bash
|
|
132
|
+
python3 .kiro/steering/scripts/search.py "authentication login" --domain pattern --top 5
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
3. **Search packages:**
|
|
136
|
+
```bash
|
|
137
|
+
python3 .kiro/steering/scripts/search.py "validation" --domain package --stack riverpod --top 5
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
4. **Apply results** to generate code với Riverpod state management
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Pre-Delivery Checklist
|
|
145
|
+
|
|
146
|
+
### Code Quality
|
|
147
|
+
- [ ] Sử dụng `const` constructors
|
|
148
|
+
- [ ] Sound Null Safety (không dùng `!` bừa bãi)
|
|
149
|
+
- [ ] Dart 3 syntax (Records, Pattern Matching)
|
|
150
|
+
|
|
151
|
+
### Performance
|
|
152
|
+
- [ ] `ListView.builder` cho lists dài
|
|
153
|
+
- [ ] `SizedBox` thay vì `Container` cho spacing
|
|
154
|
+
- [ ] `const` widgets được đánh dấu
|
|
155
|
+
|
|
156
|
+
### Architecture
|
|
157
|
+
- [ ] Tuân thủ Clean Architecture layers
|
|
158
|
+
- [ ] Dependency Injection đúng cách
|
|
159
|
+
- [ ] Repository pattern cho data access
|
|
160
|
+
|
|
161
|
+
### State Management
|
|
162
|
+
- [ ] Riverpod providers được tổ chức hợp lý
|
|
163
|
+
- [ ] Không leak state giữa các features
|
|
164
|
+
- [ ] Error handling với AsyncValue
|
|
@@ -20,6 +20,10 @@ def _get_data_dir():
|
|
|
20
20
|
script_dir.parent / ".shared" / "data",
|
|
21
21
|
# When running from .shared/flutter-pro-max/scripts/
|
|
22
22
|
script_dir.parent.parent / "data",
|
|
23
|
+
# When running from .agent/workflows/scripts/ (nested 3 levels deep)
|
|
24
|
+
script_dir.parent.parent.parent / ".shared" / "data",
|
|
25
|
+
# When running from .claude/skills/flutter-pro-max/scripts/ (nested 4 levels deep)
|
|
26
|
+
script_dir.parent.parent.parent.parent / ".shared" / "data",
|
|
23
27
|
# Fallback: cwd
|
|
24
28
|
Path.cwd() / ".shared" / "data",
|
|
25
29
|
]
|
|
@@ -1,58 +1,164 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Chuyên gia Flutter với kiến thức sâu về Clean Architecture, Performance và Modern Dart 3
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Flutter Pro Max - Flutter Design Intelligence
|
|
6
6
|
|
|
7
|
-
Searchable database
|
|
7
|
+
Searchable database của Flutter widgets, packages, design patterns, architecture guidelines, và best practices.
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
11
|
+
Chỉ cần Python (không cần pip install):
|
|
12
|
+
|
|
11
13
|
```bash
|
|
12
|
-
|
|
14
|
+
python3 --version || python --version
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## How to Use This Rule
|
|
20
|
+
|
|
21
|
+
Khi user yêu cầu Flutter work (design, build, create, implement, review, fix, improve), follow workflow này:
|
|
22
|
+
|
|
23
|
+
### Step 1: Analyze User Requirements
|
|
24
|
+
|
|
25
|
+
Trích xuất thông tin từ request:
|
|
26
|
+
- **Architecture**: Clean Architecture, Feature-First, DDD
|
|
27
|
+
- **State Management**: Riverpod (default), Bloc, Provider
|
|
28
|
+
- **UI Components**: Widgets, Layouts, Animations
|
|
29
|
+
- **Package needs**: Networking, Database, Security, etc.
|
|
30
|
+
|
|
31
|
+
### Step 2: Search Relevant Data
|
|
32
|
+
|
|
33
|
+
Sử dụng `search.py` để tìm kiếm (auto-detect domain):
|
|
16
34
|
|
|
17
35
|
```bash
|
|
18
36
|
python3 .qoder/rules/scripts/search.py "<keyword>" --top 5
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Với domain cụ thể:**
|
|
40
|
+
```bash
|
|
41
|
+
python3 .qoder/rules/scripts/search.py "<keyword>" --domain widget --top 5
|
|
42
|
+
python3 .qoder/rules/scripts/search.py "<keyword>" --domain package --top 5
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Với stack filter (loại bỏ conflicts):**
|
|
46
|
+
```bash
|
|
19
47
|
python3 .qoder/rules/scripts/search.py "<keyword>" --stack riverpod --top 5
|
|
20
48
|
```
|
|
21
49
|
|
|
22
|
-
**
|
|
50
|
+
**Available domains:** `widget`, `package`, `pattern`, `architect`, `chart`, `color`, `typography`, `style`, `ux`, `icon`, `landing`, `naming`, `product`, `prompt`
|
|
51
|
+
|
|
52
|
+
**Available stacks:** `riverpod`, `bloc`, `provider`
|
|
53
|
+
|
|
54
|
+
### Step 3: Apply Technical Standards
|
|
55
|
+
|
|
56
|
+
Luôn tuân thủ các tiêu chuẩn:
|
|
57
|
+
|
|
58
|
+
#### Dart 3 Modern Syntax
|
|
59
|
+
```dart
|
|
60
|
+
// ✅ Records
|
|
61
|
+
(String name, int age) getUserInfo() => ('John', 25);
|
|
62
|
+
|
|
63
|
+
// ✅ Pattern Matching
|
|
64
|
+
String getMessage(UIState state) => switch (state) {
|
|
65
|
+
LoadingState() => 'Loading...',
|
|
66
|
+
DataState(data: var d) => 'Data: $d',
|
|
67
|
+
ErrorState(message: var m) => 'Error: $m',
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Performance Rules
|
|
72
|
+
- Luôn dùng `const` constructor khi có thể
|
|
73
|
+
- Ưu tiên `SizedBox` hơn `Container` cho spacing
|
|
74
|
+
- Dùng `ListView.builder` thay vì `ListView` + `children`
|
|
75
|
+
|
|
76
|
+
#### State Management
|
|
77
|
+
- **Default**: Riverpod với `riverpod_generator`
|
|
78
|
+
- **Alternative**: Bloc (khi user yêu cầu)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Search Reference
|
|
83
|
+
|
|
84
|
+
### Available Data
|
|
85
|
+
|
|
86
|
+
| Domain | File | Content |
|
|
87
|
+
|--------|------|---------|
|
|
88
|
+
| Widgets | `widget.csv` | 65+ Flutter widgets với pro-tips |
|
|
89
|
+
| Packages | `package.csv` | 100+ packages với best practices |
|
|
90
|
+
| Patterns | `patterns.csv` | 100+ design patterns với code snippets |
|
|
91
|
+
| Architecture | `architect.csv` | Clean Architecture layer paths |
|
|
92
|
+
| Charts | `charts.csv` | Chart type recommendations |
|
|
93
|
+
| Colors | `colors.csv` | Color palettes by product type |
|
|
94
|
+
| Typography | `typography.csv` | Font pairings |
|
|
95
|
+
| Styles | `styles.csv` | UI style guidelines |
|
|
96
|
+
| UX Guidelines | `ux-guidelines.csv` | UX best practices |
|
|
97
|
+
| Icons | `icons.csv` | Icon recommendations |
|
|
98
|
+
| Landing | `landing.csv` | Landing page patterns |
|
|
99
|
+
| Naming | `name_convention.csv` | Naming conventions |
|
|
100
|
+
| Products | `products.csv` | Product type styling |
|
|
101
|
+
| Prompts | `prompts.csv` | AI prompt templates |
|
|
102
|
+
|
|
103
|
+
### Search Examples
|
|
104
|
+
|
|
23
105
|
```bash
|
|
24
|
-
#
|
|
106
|
+
# Auto-detect domain
|
|
25
107
|
python3 .qoder/rules/scripts/search.py "ListView" --top 5
|
|
26
108
|
|
|
27
|
-
#
|
|
28
|
-
python3 .qoder/rules/scripts/search.py "
|
|
109
|
+
# Specific domain
|
|
110
|
+
python3 .qoder/rules/scripts/search.py "network http" --domain package --top 5
|
|
29
111
|
|
|
30
|
-
#
|
|
31
|
-
python3 .qoder/rules/scripts/search.py "
|
|
112
|
+
# Stack filter
|
|
113
|
+
python3 .qoder/rules/scripts/search.py "state" --stack riverpod --top 5
|
|
32
114
|
|
|
33
|
-
#
|
|
34
|
-
python3 .qoder/rules/scripts/search.py "
|
|
115
|
+
# JSON output
|
|
116
|
+
python3 .qoder/rules/scripts/search.py "login" --json --top 3
|
|
35
117
|
```
|
|
36
118
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Example Workflow
|
|
122
|
+
|
|
123
|
+
**User Request:** "Tạo màn hình đăng nhập với Riverpod"
|
|
124
|
+
|
|
125
|
+
1. **Search widgets:**
|
|
126
|
+
```bash
|
|
127
|
+
python3 .qoder/rules/scripts/search.py "form input" --domain widget --top 5
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
2. **Search patterns:**
|
|
131
|
+
```bash
|
|
132
|
+
python3 .qoder/rules/scripts/search.py "authentication login" --domain pattern --top 5
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
3. **Search packages:**
|
|
136
|
+
```bash
|
|
137
|
+
python3 .qoder/rules/scripts/search.py "validation" --domain package --stack riverpod --top 5
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
4. **Apply results** to generate code với Riverpod state management
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Pre-Delivery Checklist
|
|
145
|
+
|
|
146
|
+
### Code Quality
|
|
147
|
+
- [ ] Sử dụng `const` constructors
|
|
148
|
+
- [ ] Sound Null Safety (không dùng `!` bừa bãi)
|
|
149
|
+
- [ ] Dart 3 syntax (Records, Pattern Matching)
|
|
150
|
+
|
|
151
|
+
### Performance
|
|
152
|
+
- [ ] `ListView.builder` cho lists dài
|
|
153
|
+
- [ ] `SizedBox` thay vì `Container` cho spacing
|
|
154
|
+
- [ ] `const` widgets được đánh dấu
|
|
155
|
+
|
|
156
|
+
### Architecture
|
|
157
|
+
- [ ] Tuân thủ Clean Architecture layers
|
|
158
|
+
- [ ] Dependency Injection đúng cách
|
|
159
|
+
- [ ] Repository pattern cho data access
|
|
160
|
+
|
|
161
|
+
### State Management
|
|
162
|
+
- [ ] Riverpod providers được tổ chức hợp lý
|
|
163
|
+
- [ ] Không leak state giữa các features
|
|
164
|
+
- [ ] Error handling với AsyncValue
|
|
@@ -20,6 +20,10 @@ def _get_data_dir():
|
|
|
20
20
|
script_dir.parent / ".shared" / "data",
|
|
21
21
|
# When running from .shared/flutter-pro-max/scripts/
|
|
22
22
|
script_dir.parent.parent / "data",
|
|
23
|
+
# When running from .agent/workflows/scripts/ (nested 3 levels deep)
|
|
24
|
+
script_dir.parent.parent.parent / ".shared" / "data",
|
|
25
|
+
# When running from .claude/skills/flutter-pro-max/scripts/ (nested 4 levels deep)
|
|
26
|
+
script_dir.parent.parent.parent.parent / ".shared" / "data",
|
|
23
27
|
# Fallback: cwd
|
|
24
28
|
Path.cwd() / ".shared" / "data",
|
|
25
29
|
]
|