agent-flutter 0.1.21 → 0.1.22
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
|
@@ -697,8 +697,7 @@ Use local instructions from \`.cursor\`.
|
|
|
697
697
|
Priority:
|
|
698
698
|
1. \`.cursor/rules/shared/ui.md\`
|
|
699
699
|
2. \`.cursor/rules/shared/integration-api.md\`
|
|
700
|
-
3. \`.cursor/rules/shared/
|
|
701
|
-
4. \`.cursor/rules/shared/unit-test.md\` and \`.cursor/rules/shared/widget-test.md\`
|
|
700
|
+
3. \`.cursor/rules/shared/unit-test.md\` and \`.cursor/rules/shared/widget-test.md\`
|
|
702
701
|
|
|
703
702
|
When a task matches a skill, load the corresponding \`SKILL.md\` under:
|
|
704
703
|
\`.cursor/skills/<skill>/SKILL.md\`
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
alwaysApply: false
|
|
3
|
-
---
|
|
4
|
-
# AI Documentation Workflow (Function)
|
|
5
|
-
|
|
6
|
-
## **Goal**
|
|
7
|
-
To automatically generate and maintain detailed functional documentation in `spec/function-workflow.md`. This documentation bridges the gap between the high-level UI flow (from `ui-workflow.md`) and the technical implementation, focusing on **API integrations, Data Transformations, and State Management logic**.
|
|
8
|
-
|
|
9
|
-
## **Trigger**
|
|
10
|
-
This workflow is triggered when:
|
|
11
|
-
1. The `spec/ui-workflow.md` has been updated (Prerequisite).
|
|
12
|
-
2. Backend integration (API) is implemented for a feature.
|
|
13
|
-
3. Complex business logic is added (e.g., data validation, caching, error handling).
|
|
14
|
-
4. The user requests: "Update function workflow for [feature]".
|
|
15
|
-
|
|
16
|
-
## **Workflow Steps**
|
|
17
|
-
|
|
18
|
-
### **Step 1: Analyze the Implementation**
|
|
19
|
-
- **Input**: The feature folder (`lib/src/ui/<feature>`) and `spec/ui-workflow.md`.
|
|
20
|
-
- **Action**: Deep dive into the following files:
|
|
21
|
-
- `bloc/*_bloc.dart`: Identify Events, States, and Side Effects.
|
|
22
|
-
- `repository/*_repository.dart`: Identify API endpoints, Request/Response models.
|
|
23
|
-
- `model/*`: Analyze data structures.
|
|
24
|
-
- `core/managers/*`: Check for global state usage (e.g., Auth, Permission).
|
|
25
|
-
|
|
26
|
-
### **Step 2: Format the Documentation**
|
|
27
|
-
- **Output File**: `spec/function-workflow.md`
|
|
28
|
-
- **Format**: Append (or Update) a section for EACH feature using the following template:
|
|
29
|
-
|
|
30
|
-
```markdown
|
|
31
|
-
## [Feature Name] (e.g., Login)
|
|
32
|
-
**Ref UI**: [Link to UI Spec Section]
|
|
33
|
-
|
|
34
|
-
### **1. Data Model**
|
|
35
|
-
**Request**: `LoginRequest`
|
|
36
|
-
- `email` (String): Required, valid email format.
|
|
37
|
-
- `password` (String): Required, min 6 chars.
|
|
38
|
-
|
|
39
|
-
**Response**: `LoginResponse`
|
|
40
|
-
- `token` (String): JWT Token.
|
|
41
|
-
- `user` (UserDto): User profile info.
|
|
42
|
-
|
|
43
|
-
### **2. State Management (BLoC)**
|
|
44
|
-
**Events**:
|
|
45
|
-
- `LoginEvent(email, password)`: Triggers the login process.
|
|
46
|
-
- `LoginReset()`: Resets state to initial.
|
|
47
|
-
|
|
48
|
-
**States**:
|
|
49
|
-
- `LoginInitial`: Form inputs enabled.
|
|
50
|
-
- `LoginLoading`: Inputs disabled, loading spinner active.
|
|
51
|
-
- `LoginSuccess(user)`: Navigation trigger.
|
|
52
|
-
- `LoginFailure(error)`: Error message display.
|
|
53
|
-
|
|
54
|
-
### **3. Functional Logic**
|
|
55
|
-
1. **Validation**:
|
|
56
|
-
- Check `email` via Regex.
|
|
57
|
-
- Check `password.length >= 6`.
|
|
58
|
-
- *If invalid*: Emit `LoginFailure(ValidationError)`.
|
|
59
|
-
|
|
60
|
-
2. **API Call**:
|
|
61
|
-
- Call `AuthRepository.login(request)`.
|
|
62
|
-
- **Endpoint**: `POST /api/v1/auth/login`
|
|
63
|
-
- **Headers**: `Content-Type: application/json`
|
|
64
|
-
|
|
65
|
-
3. **Error Handling**:
|
|
66
|
-
- **401 Unauthorized**: "Incorrect credentials".
|
|
67
|
-
- **500 Server Error**: "System error, try again".
|
|
68
|
-
- **Network Error**: "Check connection".
|
|
69
|
-
|
|
70
|
-
4. **Post-Process**:
|
|
71
|
-
- Save `token` to `SecureStorage`.
|
|
72
|
-
- Update `UserManager.currentUser`.
|
|
73
|
-
- Emit `LoginSuccess`.
|
|
74
|
-
|
|
75
|
-
### **4. Dependencies & Services**
|
|
76
|
-
- `AuthRepository`: API communication.
|
|
77
|
-
- `SecureStorage`: Token persistence.
|
|
78
|
-
- `UserManager`: Global user state.
|
|
79
|
-
|
|
80
|
-
### **5. Technical Debt / Optimization**
|
|
81
|
-
- [ ] Add rate limiting on login attempts.
|
|
82
|
-
- [ ] Cache last used email for convenience.
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### **Step 3: Verification**
|
|
86
|
-
- **Consistency Check**: Ensure the "Functional Logic" aligns with the "User Flow" in `spec/ui-workflow.md`.
|
|
87
|
-
- **API Check**: Verify that the documented Endpoint and Request/Response models match the actual code in `Repository` and `Retrofit` clients.
|
|
88
|
-
- **Edge Cases**: Ensure error handling (Network, Validation, Server) is documented.
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## **Prompt for AI**
|
|
93
|
-
|
|
94
|
-
### **Case 1: Single Feature**
|
|
95
|
-
> "Analyze `lib/src/ui/<feature>` and update `spec/function-workflow.md` based on the UI spec."
|
|
96
|
-
|
|
97
|
-
### **Case 2: Sync with UI Spec**
|
|
98
|
-
> "Read `spec/ui-workflow.md` and generate the corresponding functional specs in `spec/function-workflow.md`."
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
alwaysApply: false
|
|
3
|
-
---
|
|
4
|
-
# New Template Project (Script-first)
|
|
5
|
-
|
|
6
|
-
Use the bootstrap script instead of generating the full workflow text.
|
|
7
|
-
|
|
8
|
-
## Script path
|
|
9
|
-
- Trae: `.trae/scripts/bootstrap_flutter_template.sh`
|
|
10
|
-
- Codex: `.codex/scripts/bootstrap_flutter_template.sh`
|
|
11
|
-
- Cursor: `.cursor/scripts/bootstrap_flutter_template.sh`
|
|
12
|
-
- Windsurf: `.windsurf/scripts/bootstrap_flutter_template.sh`
|
|
13
|
-
- Cline: `.clinerules/scripts/bootstrap_flutter_template.sh`
|
|
14
|
-
- GitHub: `.github/scripts/bootstrap_flutter_template.sh`
|
|
15
|
-
|
|
16
|
-
## Run
|
|
17
|
-
Interactive mode:
|
|
18
|
-
```bash
|
|
19
|
-
bash .codex/scripts/bootstrap_flutter_template.sh
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Non-interactive mode:
|
|
23
|
-
```bash
|
|
24
|
-
bash .codex/scripts/bootstrap_flutter_template.sh \
|
|
25
|
-
--name link_home_mobile \
|
|
26
|
-
--org com.company \
|
|
27
|
-
--flutter-version stable \
|
|
28
|
-
--dir ~/workspace \
|
|
29
|
-
--force \
|
|
30
|
-
--non-interactive
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Inputs
|
|
34
|
-
- `--name`: project folder name (required in non-interactive mode).
|
|
35
|
-
- `--org`: reverse-domain org id (default: `com.example`).
|
|
36
|
-
- `--flutter-version`: Flutter version for FVM (default: `stable`).
|
|
37
|
-
- `--dir`: parent folder to create project in (default: current directory).
|
|
38
|
-
- `--force`: allow overwrite in an existing non-empty directory.
|
|
39
|
-
|
|
40
|
-
## What the script does
|
|
41
|
-
1. Ensures FVM exists (auto-installs with `dart pub global activate fvm` if needed).
|
|
42
|
-
2. Creates Flutter project with FVM and selected version.
|
|
43
|
-
3. Adds core dependencies and dev dependencies.
|
|
44
|
-
4. Creates architecture folders and starter files (`main`, DI, locale, routing, home feature).
|
|
45
|
-
5. Creates `.env`, `.env.staging`, `.env.prod` and updates `.gitignore`.
|
|
46
|
-
|
|
47
|
-
## Validation
|
|
48
|
-
```bash
|
|
49
|
-
cd <project_name>
|
|
50
|
-
fvm flutter run
|
|
51
|
-
```
|