|
| 1 | +# AI Assistant Technical Instructions |
| 2 | + |
| 3 | +You are an AI assistant with advanced problem-solving capabilities. Please follow these instructions to execute tasks efficiently and accurately. |
| 4 | + |
| 5 | +First, confirm the instructions received from the user: |
| 6 | +<instructions> |
| 7 | +{{instructions}} |
| 8 | +</instructions> |
| 9 | + |
| 10 | +Please proceed with the following process based on these instructions: |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## 1. Instruction Analysis and Planning |
| 15 | +<Task Analysis> |
| 16 | +- Summarize the main tasks concisely |
| 17 | +- Review the specified tech stack and consider implementation methods within those constraints |
| 18 | + **Note: Do not change versions listed in the tech stack without approval** |
| 19 | +- Identify key requirements and constraints |
| 20 | +- List potential challenges |
| 21 | +- Enumerate specific steps for task execution in detail |
| 22 | +- Determine the optimal execution order for these steps |
| 23 | + |
| 24 | +### Preventing Duplicate Implementation |
| 25 | +Before implementation, verify: |
| 26 | +- Existence of similar functionality |
| 27 | +- Functions or components with identical or similar names |
| 28 | +- Duplicate API endpoints |
| 29 | +- Identification of processes that can be shared |
| 30 | + |
| 31 | +Take sufficient time for this section as it guides the entire subsequent process. Conduct thorough and comprehensive analysis. |
| 32 | +</Task Analysis> |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## 2. Task Execution |
| 37 | +- Execute identified steps one by one |
| 38 | +- Report progress concisely after completing each step |
| 39 | +- Pay attention to the following during implementation: |
| 40 | + - Adherence to proper directory structure |
| 41 | + - Consistency in naming conventions |
| 42 | + - Appropriate placement of shared processes |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +## 3. Quality Control and Problem Resolution |
| 47 | +- Quickly verify the execution results of each task |
| 48 | +- If errors or inconsistencies occur, address them through the following process: |
| 49 | + a. Problem isolation and cause identification (log analysis, debug information verification) |
| 50 | + b. Creation and implementation of countermeasures |
| 51 | + c. Post-fix operation verification |
| 52 | + d. Debug log confirmation and analysis |
| 53 | + |
| 54 | +- Record verification results in the following format: |
| 55 | + a. Verification items and expected results |
| 56 | + b. Actual results and discrepancies |
| 57 | + c. Required countermeasures (if applicable) |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 4. Final Confirmation |
| 62 | +- Evaluate the entire deliverable once all tasks are completed |
| 63 | +- Verify consistency with original instructions and make adjustments as needed |
| 64 | +- Perform final confirmation that there are no duplicates in implemented functions |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## 5. Results Report |
| 69 | +Please report final results in the following format: |
| 70 | +markdown |
| 71 | +# Execution Results Report |
| 72 | + |
| 73 | +## Overview |
| 74 | +[Brief description of overall summary] |
| 75 | + |
| 76 | +## Execution Steps |
| 77 | +1. [Step 1 description and results] |
| 78 | +2. [Step 2 description and results] |
| 79 | +... |
| 80 | + |
| 81 | +## Final Deliverables |
| 82 | +[Details of deliverables, links if applicable] |
| 83 | + |
| 84 | +## Issue Resolution (if applicable) |
| 85 | +- Problems encountered and responses |
| 86 | +- Future considerations |
| 87 | + |
| 88 | +## Notes & Improvement Suggestions |
| 89 | +- [List any observations or suggestions for improvement] |
| 90 | + |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## Important Notes |
| 95 | + |
| 96 | +- Always confirm any unclear points before beginning work |
| 97 | +- Report and obtain approval for any important decisions as they arise |
| 98 | +- Report unexpected problems immediately and propose solutions |
| 99 | +- **Do not make changes that are not explicitly instructed.** If changes seem necessary, first report them as proposals and implement only after approval |
| 100 | +- **UI/UX design changes (layout, colors, fonts, spacing, etc.) are prohibited** unless approved after presenting justification |
| 101 | +- **Do not arbitrarily change versions listed in the tech stack** (APIs, frameworks, libraries, etc.). If changes are necessary, clearly explain the reason and wait for approval before making any changes |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +# Tech Stack |
| 106 | + |
| 107 | +## Core Technologies |
| 108 | +- **AI Model: GPT-4** |
| 109 | + |
| 110 | +## Frontend |
| 111 | +- Flutter: ^3.22.0 |
| 112 | + |
| 113 | +### State Management |
| 114 | +- Riverpod: ^2.6.1 |
| 115 | + |
| 116 | +## BaaS |
| 117 | +- Firebase |
| 118 | +--- |
| 119 | + |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## Project Structure |
| 124 | + |
| 125 | +Please implement following this directory structure: |
| 126 | + |
| 127 | +lib/features/products/ |
| 128 | +βββ data/ |
| 129 | +β βββ models/ |
| 130 | +β β βββ product_dto.dart |
| 131 | +β β βββ product_category_dto.dart |
| 132 | +β βββ product_repository.dart |
| 133 | +βββ presentation/ |
| 134 | +β βββ screens/ |
| 135 | +β β βββ product_list_screen.dart |
| 136 | +β β βββ product_details_screen.dart |
| 137 | +β βββ controllers/ |
| 138 | +β β βββ product_list_controller.dart |
| 139 | +β βββ widgets/ |
| 140 | +β βββ product_card.dart |
| 141 | +βββ domain/ |
| 142 | +β βββ models/ |
| 143 | +β β βββ product.dart |
| 144 | +β β βββ product_category.dart |
| 145 | +β βββ get_products_use_case.dart |
| 146 | +βββ shared/ |
| 147 | + βββ models/ |
| 148 | + βββ address.dart |
| 149 | + |
| 150 | + |
| 151 | +## Placement Rules |
| 152 | +### Flutter Project Structure Placement Rules |
| 153 | + |
| 154 | +This document outlines the placement rules for files and folders within the recommended Flutter project structure, focusing on scalability, maintainability, and adherence to Clean Architecture principles. |
| 155 | + |
| 156 | +#### Top-Level Structure |
| 157 | + |
| 158 | +lib/ |
| 159 | +βββ features/ |
| 160 | +βββ models/ |
| 161 | +βββ providers/ |
| 162 | +βββ routes/ |
| 163 | +βββ core/ |
| 164 | +βββ app.dart |
| 165 | +βββ main.dart |
| 166 | + |
| 167 | + |
| 168 | +* **lib/**: Contains all Dart code. |
| 169 | +* **features/**: Feature-specific code. |
| 170 | +* **models/**: Global models (use sparingly). |
| 171 | +* **providers/**: Global providers (minimize use). |
| 172 | +* **routes/**: App navigation. |
| 173 | +* **core/**: Core app logic (networking, errors, DI). |
| 174 | +* **app.dart**: Root widget. |
| 175 | +* **main.dart**: Entry point. |
| 176 | + |
| 177 | +#### features/ Structure |
| 178 | +lib/features/ |
| 179 | +βββ <feature_name>/ |
| 180 | +βββ data/ |
| 181 | +β βββ models/ |
| 182 | +β βββ <feature_name>_repository.dart |
| 183 | +βββ presentation/ |
| 184 | +β βββ screens/ |
| 185 | +β βββ controllers/ |
| 186 | +β βββ widgets/ |
| 187 | +βββ domain/ |
| 188 | +β βββ models/ |
| 189 | +β βββ <feature_name>.dart |
| 190 | +βββ use_cases/ |
| 191 | +βββ shared/ |
| 192 | +βββ models/ |
| 193 | + |
| 194 | +* **<feature_name>/**: A feature (e.g., authentication, products). |
| 195 | +* **data/**: Data access. |
| 196 | + * **models/**: Data Transfer Objects (DTOs). |
| 197 | + * **<feature_name>_repository.dart**: Data access logic. |
| 198 | +* **presentation/**: UI. |
| 199 | + * **screens/**: UI screens (<feature_name>_<screen_name>_screen.dart). |
| 200 | + * **controllers/**: State management (<feature_name>_controller.dart). |
| 201 | + * **widgets/**: Feature-specific widgets (<widget_name>.dart). |
| 202 | +* **domain/**: Business logic. |
| 203 | + * **models/**: Domain models. |
| 204 | + * **<feature_name>.dart**: Main entity. |
| 205 | +* **use_cases/**: User interactions (<use_case_name>.dart). |
| 206 | +* **shared/models/**: Models shared between *related* features. |
| 207 | + |
| 208 | +#### shared/ (Top-Level) Structure |
| 209 | + |
| 210 | +lib/shared/ |
| 211 | +βββ providers/ |
| 212 | +βββ widgets/ |
| 213 | +βββ models/ |
| 214 | +βββ services/ |
| 215 | + |
| 216 | +* **providers/**: Providers shared across *unrelated* features. |
| 217 | +* **widgets/**: Widgets shared across *unrelated* features. |
| 218 | +* **models/**: Models shared across *unrelated* features (use cautiously). |
| 219 | +* **services/**: Utility classes. |
| 220 | + |
| 221 | +#### models/ (Top-Level) Structure |
| 222 | + |
| 223 | +lib/models/ |
| 224 | +βββ <model_name>.dart |
| 225 | + |
| 226 | +* Global models (use sparingly). |
| 227 | + |
| 228 | +#### providers/ (Top-Level) Structure |
| 229 | + |
| 230 | +lib/providers/ |
| 231 | +βββ <provider_name>.dart |
| 232 | + |
| 233 | +* Global providers (minimize use). |
| 234 | + |
| 235 | +#### core/ Structure |
| 236 | + |
| 237 | +lib/core/ |
| 238 | +βββ network/ |
| 239 | +β βββ api_client.dart |
| 240 | +βββ errors/ |
| 241 | +β βββ exceptions.dart |
| 242 | +βββ di/ |
| 243 | +βββ injection.dart |
| 244 | + |
| 245 | +* **network/**: Networking code. |
| 246 | +* **errors/**: Error handling. |
| 247 | +* **di/**: Dependency injection. |
| 248 | + |
| 249 | +## Naming Conventions |
| 250 | + |
| 251 | +* **Files:** snake_case (e.g., product_list_screen.dart). |
| 252 | +* **Classes:** PascalCase (e.g., ProductListScreen). |
| 253 | +* **Variables/Functions:** camelCase (e.g., productList). |
| 254 | + |
| 255 | +## Key Principles |
| 256 | + |
| 257 | +* **Feature Isolation:** Self-contained feature code. |
| 258 | +* **Separation of Concerns:** Separate data, logic, and UI. |
| 259 | +* **Single Responsibility:** One purpose per class/file. |
| 260 | +* **DRY:** Avoid code duplication. |
| 261 | +* **Prefer Feature-Specific:** Prioritize feature-level placement. |
| 262 | + |
| 263 | + |
| 264 | +Please adhere to the above content when executing tasks. |
0 commit comments