ai-flow-dev 2.2.0 → 2.2.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.
Files changed (68) hide show
  1. package/README.md +13 -17
  2. package/dist/cli.js +8 -2
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +1 -1
  5. package/prompts/backend/flow-build-phase-0.md +286 -4
  6. package/prompts/backend/flow-build-phase-1.md +19 -0
  7. package/prompts/backend/flow-build-phase-2.md +19 -0
  8. package/prompts/backend/flow-build-phase-3.md +19 -0
  9. package/prompts/backend/flow-build-phase-4.md +19 -0
  10. package/prompts/backend/flow-build-phase-5.md +19 -0
  11. package/prompts/backend/flow-build-phase-6.md +19 -0
  12. package/prompts/backend/flow-build-phase-7.md +19 -0
  13. package/prompts/backend/flow-build-phase-9.md +14 -0
  14. package/prompts/backend/flow-check-review.md +20 -0
  15. package/prompts/backend/flow-check-test.md +14 -0
  16. package/prompts/backend/flow-check.md +65 -0
  17. package/prompts/backend/flow-commit.md +51 -0
  18. package/prompts/backend/flow-docs-sync.md +53 -53
  19. package/prompts/backend/flow-work-feature.md +42 -0
  20. package/prompts/backend/flow-work-fix.md +33 -0
  21. package/prompts/backend/flow-work-refactor.md +32 -0
  22. package/prompts/backend/flow-work-resume.md +32 -0
  23. package/prompts/backend/flow-work.md +127 -0
  24. package/prompts/frontend/flow-build-phase-0.md +363 -35
  25. package/prompts/frontend/flow-build-phase-1.md +433 -404
  26. package/prompts/frontend/flow-build-phase-2.md +508 -872
  27. package/prompts/frontend/flow-build-phase-3.md +629 -562
  28. package/prompts/frontend/flow-build-phase-4.md +438 -382
  29. package/prompts/frontend/flow-build-phase-5.md +559 -362
  30. package/prompts/frontend/flow-build-phase-6.md +383 -452
  31. package/prompts/frontend/flow-build-phase-7.md +818 -392
  32. package/prompts/frontend/flow-build-phase-9.md +14 -0
  33. package/prompts/frontend/flow-check-review.md +20 -0
  34. package/prompts/frontend/flow-check-test.md +14 -0
  35. package/prompts/frontend/flow-check.md +65 -0
  36. package/prompts/frontend/flow-commit.md +51 -0
  37. package/prompts/frontend/flow-docs-sync.md +36 -34
  38. package/prompts/frontend/flow-work-feature.md +42 -0
  39. package/prompts/frontend/flow-work-fix.md +33 -0
  40. package/prompts/frontend/flow-work-refactor.md +32 -0
  41. package/prompts/frontend/flow-work-resume.md +32 -0
  42. package/prompts/frontend/flow-work.md +127 -0
  43. package/prompts/mobile/flow-build-phase-0.md +366 -37
  44. package/prompts/mobile/flow-build-phase-1.md +438 -493
  45. package/prompts/mobile/flow-build-phase-2.md +458 -464
  46. package/prompts/mobile/flow-build-phase-3.md +613 -487
  47. package/prompts/mobile/flow-build-phase-4.md +439 -258
  48. package/prompts/mobile/flow-build-phase-5.md +582 -250
  49. package/prompts/mobile/flow-build-phase-6.md +389 -359
  50. package/prompts/mobile/flow-build-phase-7.md +871 -285
  51. package/prompts/mobile/flow-build-phase-9.md +14 -0
  52. package/prompts/mobile/flow-check-review.md +20 -0
  53. package/prompts/mobile/flow-check-test.md +14 -0
  54. package/prompts/mobile/flow-check.md +65 -0
  55. package/prompts/mobile/flow-commit.md +51 -0
  56. package/prompts/mobile/flow-docs-sync.md +37 -40
  57. package/prompts/mobile/flow-work-feature.md +42 -0
  58. package/prompts/mobile/flow-work-fix.md +33 -0
  59. package/prompts/mobile/flow-work-refactor.md +32 -0
  60. package/prompts/mobile/flow-work-resume.md +32 -0
  61. package/prompts/mobile/flow-work.md +127 -0
  62. package/prompts/shared/smart-skip-preflight.md +214 -0
  63. package/prompts/backend/flow-dev-commit.md +0 -829
  64. package/prompts/backend/flow-dev-feature.md +0 -1948
  65. package/prompts/backend/flow-dev-fix.md +0 -952
  66. package/prompts/backend/flow-dev-refactor.md +0 -690
  67. package/prompts/backend/flow-dev-review.md +0 -372
  68. package/prompts/backend/flow-dev-work.md +0 -1081
@@ -1,32 +1,54 @@
1
- # Phase 1: Platform & Framework Selection
1
+ ## PHASE 1: Discovery & Business (15-20 min)
2
+
3
+ > **Order for this phase:** 1.1 → 1.2 → 1.3 → 1.4 → 1.5 → 1.6 → 1.7 → 1.8 → 1.9 → 1.10
4
+
5
+ > **📌 Scope-based behavior:**
6
+ > - **MVP/Basic Scope:** Focus only on core requirements. Skip advanced business logic questions.
7
+ > - **Production-Ready Scope:** In-depth exploration of compliance, scalability, and long-term business goals.
8
+
9
+ ### Objective
10
+ Define the project's core purpose, business rules, and high-level requirements to ensure the foundation is solid before technical design begins.
2
11
 
3
- **Duration:** 20-25 minutes
4
- **Questions:** ~17 questions
5
- **Output:** project-brief.md, parts of AGENT.md, parts of ai-instructions.md
6
12
  ---
7
- ## 🎯 Objective
8
13
 
9
- Determine the **business goal and technical foundation** for your mobile application:
14
+ ## 🔍 Pre-Flight Check (Smart Skip Logic)
15
+
16
+ > 📎 **Reference:** See [prompts/shared/smart-skip-preflight.md](../shared/smart-skip-preflight.md) for the complete smart skip logic.
17
+
18
+ **Execute Pre-Flight Check for Phase 1:**
19
+
20
+ - **Target File**: `project-brief.md`
21
+ - **Phase Name**: "BUSINESS CONTEXT"
22
+ - **Key Items**: Project name, description, users, objectives, system type, features, scope, constraints, metrics, business flows
23
+ - **Typical Gaps**: Business objectives, success metrics, constraints
24
+
25
+ **Proceed with appropriate scenario based on audit data from `.ai-flow/cache/audit-data.json`**
10
26
 
11
- 1. What is the core goal and purpose of the project?
12
- 2. What platforms will you target?
13
- 3. What framework will you use?
14
- 4. What minimum OS versions will you support?
15
- 5. What development tools and languages?
16
27
  ---
17
- ## 📋 Questions
18
28
 
19
- ### Question 1.1: Project Name & Description (with Smart Refinement)
29
+ ## Phase 1 Questions (Full Mode)
30
+
31
+ > **📌 Note:** If Phase 0 was executed, some questions may already be answered. Skip those and only ask what's missing.
32
+
33
+ **1.1 Project Name & Description (with Smart Refinement)**
20
34
 
21
35
  > **🧠 Intelligent Refinement System**: This question detects vague descriptions and guides the developer to enrich them. It only asks what's missing and responds in the developer's language.
22
36
 
23
37
  ```
38
+ [If detected from Phase 0, show:]
39
+ ✅ Project Name: [detected name]
40
+ ✅ Description: [detected description]
41
+
42
+ Is this correct? (Y/N)
43
+ If no, please provide correct values.
44
+
45
+ [If NOT detected, ask:]
24
46
  What is the project name?
25
47
 
26
48
  Provide an initial description of your project.
27
49
  (Don't worry about perfection - we'll refine it together if needed!)
28
50
 
29
- Example: "A native iOS app for tracking wildlife sightings in the Amazon"
51
+ Example: "A backend for managing gym memberships"
30
52
  ```
31
53
 
32
54
  **🔍 AI Internal: Ambiguity Analysis**
@@ -35,10 +57,10 @@ After receiving the description, silently analyze for these criteria:
35
57
 
36
58
  | Criterion | Check For | Score +1 if present |
37
59
  |-----------|-----------|---------------------|
38
- | **WHO** | Specific user type mentioned (not just "users") | "tourists", "researchers", "drivers" |
39
- | **WHAT** | Specific action/function (not just "app", "system") | "scan barcodes", "record audio", "track GPS" |
40
- | **WHY** | Purpose or value mentioned | "to protect species", "to optimize routes" |
41
- | **DOMAIN** | Industry/vertical indicated | "environmental", "logistics", "social" |
60
+ | **WHO** | Specific user type mentioned (not just "users") | "gym members", "restaurant owners" |
61
+ | **WHAT** | Specific action/function (not just "manage") | "track workouts", "process payments" |
62
+ | **WHY** | Purpose or value mentioned | "to replace spreadsheets", "to launch app" |
63
+ | **DOMAIN** | Industry/vertical indicated | "fitness", "fintech", "healthcare" |
42
64
  | **DETAIL** | Description has 10+ meaningful words | Not counting articles |
43
65
 
44
66
  **Scoring Rules:**
@@ -61,27 +83,28 @@ Your description: "[original description]"
61
83
  [ONLY show questions for MISSING criteria:]
62
84
 
63
85
  [If WHO is missing:]
64
- 1️⃣ WHO will use this mobile app?
65
- A) End consumers (App Store/Play Store)
66
- B) Internal employees (Enterprise)
67
- C) Partners/Contractors
68
- D) Other: __
86
+ 1️⃣ WHO will use this system?
87
+ A) End consumers (B2C)
88
+ B) Business users (B2B)
89
+ C) Internal team
90
+ D) Other systems (APIs)
91
+ E) Other: __
69
92
 
70
93
  [If WHAT is missing:]
71
- 2️⃣ WHAT is the core mobile action users will perform?
72
- A) Transactional (Buy/Sell)
73
- B) Utility (Tools/Monitoring)
74
- C) Social (Chat/Share)
75
- D) Media (Photo/Video)
76
- E) Informational (News/Content)
94
+ 2️⃣ WHAT is the core action users will perform?
95
+ A) Buy/sell products or services
96
+ B) Manage/organize information
97
+ C) Communicate/collaborate
98
+ D) Monitor/analyze data
99
+ E) Create/publish content
77
100
  F) Other: __
78
101
 
79
102
  [If WHY is missing:]
80
- 3️⃣ WHY is this mobile project needed?
81
- A) New product launch
82
- B) Companion to web app
83
- C) Offline-first requirement
84
- D) Better mobile performance
103
+ 3️⃣ WHY is this project needed?
104
+ A) Replace manual/legacy process
105
+ B) Launch new product/business
106
+ C) Improve existing system
107
+ D) Enable new capability
85
108
  E) Other: __
86
109
 
87
110
  [If DOMAIN is missing:]
@@ -89,12 +112,12 @@ Your description: "[original description]"
89
112
  A) E-commerce/Retail
90
113
  B) Fitness/Health
91
114
  C) Finance/Payments
92
- D) Education/Learning
115
+ D) Education
93
116
  E) Social/Community
94
117
  F) Business tools (CRM, ERP)
95
118
  G) Other: __
96
119
 
97
- Your answers: __
120
+ Your answers: __ (e.g., "A, B, A, E" or describe freely)
98
121
  ```
99
122
 
100
123
  ---
@@ -108,574 +131,496 @@ After gathering missing info, generate 3 polished versions:
108
131
 
109
132
  ✨ Based on your input, here are 3 professional descriptions:
110
133
 
111
- A) Concise (for App Store subtitle):
112
- "[Generated 1-line description]"
134
+ A) Concise (for package.json):
135
+ "[Generated 1-line description with WHO + WHAT]"
113
136
 
114
137
  B) Descriptive (for README.md):
115
- "[Generated 2-3 line description with Mobile focus]"
138
+ "[Generated 2-3 line description with WHO + WHAT + WHY]"
116
139
 
117
- C) User-centric (for Marketing):
118
- "[Generated benefit-driven description]"
140
+ C) Technical (for AGENT.md):
141
+ "[Generated technical description with DOMAIN + WHAT]"
119
142
 
120
143
  Which do you prefer? (1-3, or 4 to edit, 5 to start over)
121
144
  ```
122
145
 
123
- **Your choice:**
124
-
125
146
  ---
126
147
 
127
- ### Question 1.2: Project Overview (Confirmation + Expansion)
128
-
129
- > **📌 Smart Skip**: If 1.1 already captured WHO/WHAT/WHY completely, this becomes a quick confirmation.
148
+ **✅ Final Confirmation**
130
149
 
131
150
  ```
132
- [If 1.1 refinement was complete (score >= 4), show:]
151
+ Your final project description:
133
152
 
134
- Based on your description, I understand:
135
- Users: [WHO from 1.1]
136
- • Goal: [WHAT from 1.1]
137
- • Need: [WHY from 1.1]
153
+ 📋 Name: [project name]
154
+ 📝 Description: "[final polished description]"
138
155
 
139
- Is this correct? (Y) Or would you like to add more context? (N)
140
-
141
- ---
142
-
143
- [If 1.1 was NOT refined OR missing elements, ask:]
144
-
145
- Briefly describe the core problem this app solves:
146
- - Who are the primary users?
147
- - What is the main benefit?
148
- - Why build a mobile app instead of a web app?
156
+ Proceed to next question? (Y to continue)
149
157
  ```
150
158
 
151
- **Your answer:**
152
-
153
159
  ---
154
- ### Question 1.3: Target Platforms
155
160
 
156
- **What platforms will your app support?**
161
+ **1.2 Project Overview (Confirmation + Expansion)**
157
162
 
158
- A) **iOS Only**
159
-
160
- - Apple App Store only
161
- - Swift or React Native iOS
162
- - Best for: Apple-focused products, faster initial launch
163
-
164
- B) ⭐ **Android Only**
165
-
166
- - Google Play Store only
167
- - Kotlin or React Native Android
168
- - Best for: Android-focused products, wider market reach
163
+ > **📌 Smart Skip**: If 1.1 already captured WHO/WHAT/WHY completely, this becomes a quick confirmation.
169
164
 
170
- C) 🔥 **iOS + Android (Cross-Platform)** (Recommended)
165
+ ```
166
+ [If 1.1 refinement was complete (score >= 4), show:]
171
167
 
172
- - Both App Store and Play Store
173
- - React Native, Flutter, or Ionic
174
- - Best for: Maximum reach, shared codebase
168
+ Based on your description, I understand:
169
+ Users: [WHO from 1.1]
170
+ Core Action: [WHAT from 1.1]
171
+ • Purpose: [WHY from 1.1]
175
172
 
176
- D) **iOS + Android + Web (Universal)**
173
+ Is this complete? (Y) Or would you like to add more context? (N)
177
174
 
178
- - Mobile apps + web version
179
- - React Native Web, Flutter Web, or PWA
180
- - Best for: Multi-platform presence
175
+ [If user says Y Skip to 1.3]
176
+ [If user says N Ask:]
177
+ What additional context would you like to add?
181
178
 
182
- **Your answer:**
183
179
  ---
184
- ### Question 1.4: Mobile Framework
185
-
186
- **What framework will you use to build your mobile app?**
187
-
188
- **If iOS Only:**
189
-
190
- - A) ⭐ **Native iOS (Swift)** - Best performance, full native features
191
- - B) **Native iOS (Objective-C)** - Legacy support
192
- - C) **React Native** - Cross-platform, JavaScript
193
- - D) **Flutter** - Cross-platform, Dart
194
-
195
- **If Android Only:**
196
180
 
197
- - A) **Native Android (Kotlin)** - Best performance, full native features
198
- - B) **Native Android (Java)** - Legacy support
199
- - C) **React Native** - Cross-platform, JavaScript
200
- - D) **Flutter** - Cross-platform, Dart
181
+ [If 1.1 was NOT refined OR any WHO/WHAT/WHY still missing, ask:]
201
182
 
202
- **If Cross-Platform:**
183
+ [ONLY ask for MISSING elements - check what was NOT captured in 1.1:]
203
184
 
204
- - A) **React Native** (Recommended)
205
- - JavaScript/TypeScript
206
- - Large ecosystem
207
- - Hot reload
208
- - Best for: Teams familiar with React
185
+ [If WHO still unclear:]
186
+ Who are the primary users of this system?
209
187
 
210
- - B) 🔥 **Flutter** (Popular)
211
- - Dart language
212
- - Excellent performance
213
- - Beautiful UI out of the box
214
- - Best for: Teams wanting native-like performance
188
+ [If WHAT still unclear:]
189
+ What is the core value proposition?
215
190
 
216
- - C) **Ionic**
217
- - Web technologies (HTML/CSS/JS)
218
- - Capacitor for native features
219
- - Best for: Web developers transitioning to mobile
191
+ [If WHY still unclear:]
192
+ What makes this project necessary?
220
193
 
221
- - D) **Xamarin / .NET MAUI**
222
- - C# language
223
- - Microsoft ecosystem
224
- - Best for: .NET teams
225
-
226
- **Your answer:**
227
-
228
- **If React Native selected, ask:**
229
-
230
- - What React Native version? (Latest stable recommended)
231
- - Will you use Expo? (Y/n)
232
- - Expo: Faster development, managed workflow
233
- - Bare React Native: More control, custom native code
234
-
235
- **If Flutter selected, ask:**
236
-
237
- - What Flutter version? (Latest stable recommended)
238
- - Will you use Flutter for Web/Desktop too? (Y/n)
239
- ---
240
- ### Question 1.5: Minimum OS Versions
241
-
242
- **What minimum OS versions will you support?**
243
-
244
- **For iOS:**
245
-
246
- - A) ⭐ **iOS 15+** (Recommended)
247
- - Covers ~95% of active devices
248
- - Modern APIs available
249
- - Best for: Most apps
250
-
251
- - B) **iOS 14+**
252
- - Covers ~98% of active devices
253
- - Some older APIs needed
254
- - Best for: Maximum compatibility
255
-
256
- - C) **iOS 16+**
257
- - Covers ~85% of active devices
258
- - Latest features only
259
- - Best for: New apps, modern features
194
+ Example:
195
+ "A backend for a fitness tracking mobile app used by gym-goers (users). It allows users to log workouts, track progress over time, and share achievements with friends (value). This project is necessary to replace our legacy spreadsheet-based system and support our new iOS app launch."
196
+ ```
260
197
 
261
- - D) **iOS 17+**
262
- - Covers ~60% of active devices
263
- - Cutting-edge features
264
- - Best for: Premium apps, latest tech
198
+ **1.3 Target Users (Confirmation + Additional Types)**
265
199
 
266
- **For Android:**
200
+ > **📌 Smart Skip**: If 1.1 already identified user types, this confirms and expands.
267
201
 
268
- - A) ⭐ **Android 8.0 (API 26)+** (Recommended)
269
- - Covers ~95% of active devices
270
- - Modern APIs available
271
- - Best for: Most apps
202
+ ```
203
+ [If WHO was captured in 1.1, show:]
272
204
 
273
- - B) **Android 7.0 (API 24)+**
274
- - Covers ~98% of active devices
275
- - Some older APIs needed
276
- - Best for: Maximum compatibility
205
+ Based on your description, your target users are: [WHO from 1.1]
277
206
 
278
- - C) **Android 10 (API 29)+**
279
- - Covers ~85% of active devices
280
- - Latest features only
281
- - Best for: New apps, modern features
207
+ Would you like to add any additional user types? Select any that apply:
282
208
 
283
- - D) **Android 12 (API 31)+**
284
- - Covers ~70% of active devices
285
- - Cutting-edge features
286
- - Best for: Premium apps, latest tech
209
+ A) 🌐 External end-users (B2C) - Public-facing application
210
+ B) 🏢 Internal employees (B2B/Enterprise) - Company internal tool
211
+ C) 🔌 Other systems/services (API consumers) - Integration platform
212
+ D) 👥 Partners/Third-parties - Partner ecosystem
213
+ E) 📱 Mobile/Web apps - Backend for frontend
214
+ F) ✅ No additional users - [WHO from 1.1] is complete
287
215
 
288
- **Your answer:**
289
216
  ---
290
- ### Question 1.6: Programming Language
291
217
 
292
- **What programming language will you use?**
218
+ [If WHO was NOT captured in 1.1, ask normally:]
293
219
 
294
- **If React Native:**
220
+ Who will use this system? Select all that apply:
295
221
 
296
- - A) **TypeScript** (Recommended)
297
- - Type safety
298
- - Better IDE support
299
- - Industry standard
222
+ A) 🌐 External end-users (B2C) - Public-facing application
223
+ B) 🏢 Internal employees (B2B/Enterprise) - Company internal tool
224
+ C) 🔌 Other systems/services (API consumers) - Integration platform
225
+ D) 👥 Partners/Third-parties - Partner ecosystem
226
+ E) 📱 Mobile/Web apps - Backend for frontend
300
227
 
301
- - B) **JavaScript**
302
- - Faster initial development
303
- - Less boilerplate
304
- - Best for: Small projects, rapid prototyping
228
+ (Can select multiple)
229
+ ```
305
230
 
306
- **If Flutter:**
231
+ **1.4 Business Objectives**
307
232
 
308
- - **Dart** (Required - Flutter uses Dart)
233
+ ```
234
+ What are the top 3 measurable objectives for this project?
235
+
236
+ Examples:
237
+ - Process 10,000 transactions/day
238
+ - Reduce customer onboarding time by 50%
239
+ - Support 1M active users
240
+ - Achieve 99.9% uptime SLA
241
+
242
+ Your objectives:
243
+ 1.
244
+ 2.
245
+ 3.
246
+ ```
309
247
 
310
- **If Native iOS:**
248
+ **1.5 System Type (Confirmation + Validation)**
311
249
 
312
- - A) **Swift** (Recommended)
313
- - Modern, safe language
314
- - Apple's preferred language
250
+ > **📌 Smart Skip**: If 1.1 already identified the domain/industry, this confirms it.
315
251
 
316
- - B) **Objective-C**
317
- - Legacy support
318
- - Best for: Maintaining existing apps
252
+ ```
253
+ [If DOMAIN was captured in 1.1, show:]
319
254
 
320
- **If Native Android:**
255
+ Based on your description, this appears to be a: [DOMAIN from 1.1] system
321
256
 
322
- - A) ⭐ **Kotlin** (Recommended)
323
- - Modern, concise language
324
- - Google's preferred language
257
+ Is this correct?
325
258
 
326
- - B) **Java**
327
- - Legacy support
328
- - Best for: Maintaining existing apps
259
+ A) ✅ Yes, that's correct
260
+ B) 🔄 No, it's actually: [show options below]
329
261
 
330
- **Your answer:**
331
262
  ---
332
- ### Question 1.7: Development Environment
333
-
334
- **What development tools will you use?**
335
263
 
336
- **For iOS Development:**
264
+ [If DOMAIN was NOT captured in 1.1, OR user selected B above:]
337
265
 
338
- - A) **Xcode** (Required for iOS)
339
- - Version: Latest stable (15.x)
340
- - Includes iOS Simulator
341
- - Interface Builder, Instruments
266
+ What type of system are you building? (This helps suggest common features)
342
267
 
343
- **For Android Development:**
268
+ A) 🛒 E-commerce/Marketplace
269
+ B) 📱 SaaS/B2B Platform
270
+ C) 📊 CRM/ERP/Business Tool
271
+ D) 🎮 Social/Community Platform
272
+ E) 📋 Content Management
273
+ F) 🏦 FinTech/Payment
274
+ G) 🏥 Healthcare/Booking
275
+ H) 📚 Education/Learning
276
+ I) 🔧 DevTools/API Platform
277
+ J) Other: __
344
278
 
345
- - A) ⭐ **Android Studio** (Required for Android)
346
- - Version: Latest stable
347
- - Includes Android Emulator
348
- - Gradle build system
349
-
350
- **For Cross-Platform:**
351
-
352
- - **VS Code** or **Android Studio** / **Xcode** (for native modules)
353
-
354
- **Additional Tools:**
355
-
356
- - **Flipper** - Debugging tool (React Native)
357
- - **React Native Debugger** - Debugging (React Native)
358
- - **Dart DevTools** - Debugging (Flutter)
359
-
360
- **Your answer:**
361
- ---
362
- ### Question 1.8: Package Manager
363
-
364
- **What package manager will you use?**
365
-
366
- **If React Native:**
367
-
368
- - A) ⭐ **npm** (Recommended)
369
- - B) **yarn**
370
- - C) **pnpm**
279
+ Your choice: __
280
+ ```
371
281
 
372
- **If Flutter:**
282
+ **1.6 Core Features**
373
283
 
374
- - **pub** (Flutter's built-in package manager)
284
+ ```
285
+ What are the main functionalities your system needs?
286
+
287
+ Think about what your users will be able to do with your system. You can list them freely, or select from common features suggested below based on your system type.
288
+
289
+ 🛒 E-commerce common features:
290
+ 1) User authentication (register/login)
291
+ 2) Product catalog with search/filters
292
+ 3) Shopping cart
293
+ 4) Checkout and payment processing
294
+ 5) Order management
295
+ 6) Inventory tracking
296
+ 7) Admin dashboard
297
+ 📱 SaaS common features:
298
+ 1) User authentication with SSO
299
+ 2) Multi-tenant organization/workspace management
300
+ 3) Role-based access control (RBAC)
301
+ 4) Subscription and billing
302
+ 5) Dashboard and analytics
303
+ 6) API access
304
+ 7) Admin panel
305
+ 📊 CRM/Business Tool common features:
306
+ 1) User/team management
307
+ 2) Contact/customer database
308
+ 3) Activity tracking and logging
309
+ 4) Reporting and analytics
310
+ 5) Integrations (email, calendar, etc.)
311
+ 6) Search and filters
312
+ 7) Export functionality
313
+ 🎮 Social/Community common features:
314
+ 1) User profiles
315
+ 2) Posts/content creation
316
+ 3) Feed/timeline
317
+ 4) Comments and reactions
318
+ 5) Follow/friend system
319
+ 6) Notifications
320
+ 7) Moderation tools
321
+ ⭐ Your specific features (add any custom functionalities):
322
+ -
323
+ -
324
+ -
325
+
326
+ List all functionalities your system needs (select from above or add your own):
327
+ ```
375
328
 
376
- **If Native iOS:**
329
+ **1.7 Scope Definition**
377
330
 
378
- - **CocoaPods** or **Swift Package Manager**
331
+ ```
332
+ Now let's prioritize: What will you build in this first version, and what will you leave for future versions?
379
333
 
380
- **If Native Android:**
334
+ This helps us focus the documentation on what you're building now, while noting what comes later.
381
335
 
382
- - **Gradle** (built-in)
336
+ 📋 What will you build in this first version? (Select from the features listed above)
383
337
 
384
- **Your answer:**
338
+ [Show features from question 1.6 and allow selection]
385
339
  ---
386
- ### Question 1.9: Build Tools & CI/CD
387
-
388
- **What build and deployment tools will you use?**
389
-
390
- A) **Fastlane** (Recommended for iOS/Android)
391
-
392
- - Automates builds, screenshots, deployment
393
- - Works with React Native, Flutter, Native
394
- - Best for: Most projects
395
-
396
- B) **Codemagic**
397
-
398
- - Cloud-based CI/CD for Flutter/React Native
399
- - Easy setup, good for small teams
400
-
401
- C) **GitHub Actions**
402
-
403
- - Flexible, free for public repos
404
- - Custom workflows
340
+ ⏭️ What will you leave for future versions? (What you're NOT building now)
341
+
342
+ Common things to defer:
343
+ 1) Mobile native apps (building web/API first)
344
+ 2) Advanced analytics/ML features
345
+ 3) Third-party integrations (v2)
346
+ 4) White-label/multi-branding
347
+ 5) Internationalization (i18n)
348
+ 6) Advanced automation/workflows
349
+ 7) Video/live streaming features
350
+ ⭐ Other features to defer (add your own):
351
+ -
352
+ -
353
+ -
354
+
355
+ 💡 Tip: It's okay to start simple! You can always expand later. This helps us create focused documentation for your current needs.
356
+ ```
405
357
 
406
- D) **Bitrise**
358
+ **1.8 Constraints**
407
359
 
408
- - Mobile-focused CI/CD
409
- - Good for complex workflows
360
+ ```
361
+ What constraints does this project have? Select all that apply:
410
362
 
411
- E) **Manual Builds**
363
+ A) Time - Must launch by specific date
364
+ B) 💰 Budget - Limited development resources
365
+ C) 📜 Compliance - Regulatory requirements (GDPR, HIPAA, SOC2, etc.)
366
+ D) 🔧 Technology - Must use specific tech stack
367
+ E) 📊 Scale - Must handle specific traffic/data volume
368
+ F) 🔐 Security - High security requirements
369
+ G) ⚡ Performance - Strict latency/throughput requirements
412
370
 
413
- - Build locally, upload manually
414
- - Best for: Learning, small projects
371
+ For each selected, provide details:
415
372
 
416
- **Your answer:**
417
- ---
418
- ### Question 1.10: Code Signing Strategy
373
+ Example:
374
+ - Time: Must launch MVP by Q3 2024
375
+ - Compliance: Must be GDPR compliant as we serve EU users
376
+ ```
419
377
 
420
- **How will you handle code signing?**
378
+ **1.9 Success Metrics**
421
379
 
422
- **For iOS:**
380
+ ```
381
+ How will you measure success?
423
382
 
424
- - A) ⭐ **Automatic Signing** (Recommended)
425
- - Xcode manages certificates
426
- - Easier for most developers
383
+ 1. Expected Users:
384
+ - Initial launch: __ users
385
+ - Year 1 goal: __ users
427
386
 
428
- - B) **Manual Signing**
429
- - More control
430
- - Required for enterprise apps
387
+ 2. Performance Targets:
388
+ - Response time: < __ ms
389
+ - Uptime: __ %
431
390
 
432
- **For Android:**
391
+ 3. Business Goals:
392
+ - [Goal 1]
393
+ - [Goal 2]
433
394
 
434
- - A) **Automatic Signing** (Recommended)
435
- - Gradle manages keystores
436
- - Easier for most developers
395
+ Standard for MVP:
396
+ - Users: 1,000 initial / 10,000 Year 1
397
+ - Response time: < 500ms (API), < 100ms (DB)
398
+ - Uptime: 99.9% (Standard cloud SLA)
437
399
 
438
- - B) **Manual Signing**
439
- - More control
440
- - Required for some enterprise scenarios
400
+ 🏆 Standard for Production/Scale:
401
+ - Users: 100,000+ active
402
+ - Response time: < 200ms (API), < 50ms (DB)
403
+ - Uptime: 99.99% (High Availability)
404
+ ```
441
405
 
442
- **Your answer:**
443
- ---
444
- ### Question 1.11: App Store Accounts
406
+ **1.10 Main Business Flows**
445
407
 
446
- **Do you have App Store accounts set up?**
408
+ > Note: If you omit any common flow or functionality, the AI will suggest and document typical processes relevant to your system type, based on best practices and common use cases.
447
409
 
448
- **For iOS:**
410
+ `````
411
+ List the main business flows of the system (e.g., sales, inventory update, invoicing, user registration).
449
412
 
450
- - A) ✅ **Yes, Apple Developer Account** ($99/year)
451
- - B) ❌ **No, will set up later**
452
- - C) **Enterprise Account** ($299/year)
413
+ For each flow, you can add a brief description (optional).
453
414
 
454
- **For Android:**
415
+ If you wish, you can specify the main steps of any flow (numbered format). If you do not specify them, the AI will deduce typical steps based on the name and description.
455
416
 
456
- - A) ✅ **Yes, Google Play Developer Account** ($25 one-time)
457
- - B) **No, will set up later**
417
+ Example:
418
+ - Sales: Process of purchasing products by the customer.
419
+ 1. Customer selects products
420
+ 2. Order is created
421
+ 3. Inventory is updated
422
+ 4. Invoice is generated
423
+ - Inventory: Automatic stock update after each sale.
424
+ - Invoicing: Invoice generation after purchase.
458
425
 
459
- **Your answer:**
426
+ The AI will automatically generate flow diagrams (mermaid) for each documented process.
460
427
  ---
461
- ### Question 1.12: Beta Testing Strategy
462
-
463
- **How will you handle beta testing?**
464
-
465
- A) ⭐ **TestFlight (iOS) + Firebase App Distribution (Android)**
466
-
467
- - Free, easy to use
468
- - Best for: Most projects
469
-
470
- B) **TestFlight (iOS) + Google Play Internal Testing (Android)**
471
-
472
- - Official store channels
473
- - Best for: Store-focused testing
474
-
475
- C) **HockeyApp / App Center**
476
-
477
- - Microsoft's solution
478
- - Good for enterprise
479
-
480
- D) **No Beta Testing**
481
-
482
- - Direct to production
483
- - Best for: MVPs, internal apps
428
+ #### 🎨 MERMAID BUSINESS FLOW DIAGRAM FORMAT - CRITICAL
429
+
430
+ **Use this exact format** for business process flows:
431
+
432
+ ````markdown
433
+ ```mermaid
434
+ flowchart TD
435
+ Start([User Visits Site]) --> Browse[Browse Product Catalog]
436
+ Browse --> Search{Search or<br/>Browse Categories?}
437
+
438
+ Search -->|Use Search| Filter[Apply Search Filters]
439
+ Search -->|Browse| Category[Select Category]
440
+
441
+ Filter --> Results[View Search Results]
442
+ Category --> Results
443
+
444
+ Results --> Select[Select Product]
445
+ Select --> Details[View Product Details]
446
+ Details --> Decision{Add to Cart?}
447
+
448
+ Decision -->|Yes| AddCart[Add Item to Cart]
449
+ Decision -->|No| Browse
450
+
451
+ AddCart --> MoreShopping{Continue<br/>Shopping?}
452
+ MoreShopping -->|Yes| Browse
453
+ MoreShopping -->|No| Cart[View Shopping Cart]
454
+
455
+ Cart --> ReviewCart{Cart OK?}
456
+ ReviewCart -->|Modify| Browse
457
+ ReviewCart -->|Proceed| Checkout[Start Checkout]
458
+
459
+ Checkout --> Address[Enter/Confirm Address]
460
+ Address --> Payment[Enter Payment Info]
461
+ Payment --> Review[Review Order]
462
+ Review --> ProcessPayment[Process Payment]
463
+
464
+ ProcessPayment --> PaymentResult{Payment<br/>Success?}
465
+
466
+ PaymentResult -->|Success| Confirm[Order Confirmation]
467
+ PaymentResult -->|Declined| Retry{Retry<br/>Payment?}
468
+
469
+ Retry -->|Yes| Payment
470
+ Retry -->|No| SaveCart[Save Cart for Later]
471
+ SaveCart --> End1([Exit: Saved])
472
+
473
+ Confirm --> Email[Send Confirmation Email]
474
+ Email --> Inventory[Update Inventory]
475
+ Inventory --> Invoice[Generate Invoice]
476
+ Invoice --> End2([Order Complete])
477
+
478
+ style Start fill:#e1f5ff
479
+ style End1 fill:#ffe1e1
480
+ style End2 fill:#e1ffe1
481
+ style ProcessPayment fill:#fff4e1
482
+ style Confirm fill:#d4edda
483
+ `````
484
+
485
+ ````
486
+
487
+ **Flowchart Syntax:**
488
+ - `flowchart TD` = Top-Down flow (recommended)
489
+ - `flowchart LR` = Left-Right flow
490
+ - `flowchart BT` = Bottom-Top
491
+ - `flowchart RL` = Right-Left
492
+
493
+ **Node Shapes:**
494
+ - `[Rectangle]` = Process step/action
495
+ - `{Diamond}` = Decision point (Yes/No, multiple options)
496
+ - `([Rounded Rectangle])` = Start/End terminal
497
+ - `[(Cylinder)]` = Database operation
498
+ - `[[Subroutine]]` = Sub-process
499
+ - `[/Parallelogram/]` = Input/Output
500
+ - `((Circle))` = Connection point
501
+
502
+ **Arrow Types:**
503
+ - `-->` = Solid arrow (standard flow)
504
+ - `-.->` = Dotted arrow (optional/conditional)
505
+ - `==>` = Thick arrow (emphasis)
506
+ - `-->|Label|` = Labeled arrow (decision branch)
507
+
508
+ **Best Practices for Business Flows:**
509
+ 1. **Always start with a terminal**: `([Start])`
510
+ 2. **Always end with a terminal**: `([End])`
511
+ 3. **Label decision branches**: Use `-->|Yes|` or `-->|No|`
512
+ 4. **Use line breaks in labels**: `{Continue<br/>Shopping?}` for readability
513
+ 5. **Apply consistent styling**: Same colors for similar node types
514
+ 6. **Keep it readable**: Avoid spaghetti flows, group related steps
515
+ 7. **Show all paths**: Every decision should have all branches defined
516
+ 8. **Include error paths**: Payment failures, validation errors, etc.
517
+
518
+ **Multiple Flow Example (Advanced):**
519
+
520
+ ```mermaid
521
+ flowchart TD
522
+ subgraph "Customer Journey"
523
+ C1[Browse] --> C2[Select]
524
+ C2 --> C3[Purchase]
525
+ end
526
+
527
+ subgraph "Backend Processing"
528
+ B1[Validate Order] --> B2[Process Payment]
529
+ B2 --> B3[Update Inventory]
530
+ B3 --> B4[Send Notifications]
531
+ end
532
+
533
+ C3 --> B1
534
+ B4 --> C4[Confirmation]
535
+ ```
484
536
 
485
- **Your answer:**
537
+ **Color Coding Guide:**
538
+ - Blue (`#e1f5ff`): Start/Entry points
539
+ - Green (`#e1ffe1`): Success/Completion
540
+ - Red (`#ffe1e1`): Failure/Error states
541
+ - Yellow (`#fff4e1`): Critical operations (Payment, Auth)
542
+ - Purple (`#f0e1ff`): External integrations
543
+
544
+ **Common Business Flows to Document:**
545
+ - User Registration/Login
546
+ - Purchase/Checkout Process
547
+ - Content Creation/Publishing
548
+ - Approval/Review Workflows
549
+ - Data Import/Export
550
+ - Notification/Alert Flows
551
+ - Customer Support Ticket Lifecycle
552
+
553
+ **Validation:** Test at https://mermaid.live/ before saving
486
554
  ---
487
- ### Question 1.13: Analytics & Crash Reporting
488
-
489
- **What analytics and crash reporting will you use?**
490
-
491
- A) ⭐ **Firebase Analytics + Crashlytics** (Recommended)
492
-
493
- - Free, comprehensive
494
- - Works with iOS and Android
495
- - Best for: Most projects
496
-
497
- B) **Sentry**
498
-
499
- - Excellent error tracking
500
- - Good for: Production apps
501
-
502
- C) **Mixpanel / Amplitude**
503
-
504
- - Advanced analytics
505
- - Best for: Product analytics focus
555
+ ```
506
556
 
507
- D) **No Analytics**
557
+ ### Phase 1 Output
508
558
 
509
- - Privacy-focused
510
- - Best for: Privacy-critical apps
559
+ After gathering all information, confirm:
511
560
 
512
- **Your answer:**
561
+ ```
562
+ 📋 PHASE 1 SUMMARY:
563
+
564
+ Project: [name]
565
+ Description: [1 sentence]
566
+ Users: [list]
567
+ Objectives: [3 objectives]
568
+ System Type: [E-commerce/SaaS/etc.]
569
+ Core Features: [list of main functionalities]
570
+ First Version Features: [what will be built now]
571
+ Future Features: [what will be deferred]
572
+ Constraints: [list with details]
573
+ Success Metrics: [KPIs]
574
+ Business Flows: [list of main flows]
575
+
576
+ Is this correct? (Yes/No)
577
+ If corrections needed, specify which section.
578
+ ```
513
579
  ---
514
- ### Question 1.14: UI/UX Framework
515
-
516
- **What UI/UX framework or design system will you use?**
517
-
518
- **If React Native:**
519
-
520
- - A) ⭐ **React Native Paper** (Material Design)
521
- - Material Design components
522
- - Best for: Android-first apps
523
- - B) **React Native Elements**
524
- - Cross-platform components
525
- - Best for: Customizable UI
526
- - C) **NativeBase**
527
- - Component library
528
- - Best for: Rapid development
529
- - D) **Custom UI Components**
530
- - Build your own components
531
- - Best for: Brand-specific design
532
-
533
- **If Flutter:**
534
-
535
- - A) ⭐ **Material Design 3** (Default)
536
- - Google's Material Design
537
- - Best for: Most apps
538
- - B) **Cupertino Design**
539
- - iOS-style components
540
- - Best for: iOS-first apps
541
- - C) **Custom Theme**
542
- - Custom design system
543
- - Best for: Brand-specific design
580
+ ### 📄 Generate Phase 1 Documents
544
581
 
545
- **If Native iOS:**
582
+ **Generate `project-brief.md` automatically:**
546
583
 
547
- - A) **UIKit** (Standard)
548
- - B) **SwiftUI** (Modern)
584
+ - Use template: `.ai-flow/templates/project-brief.template.md`
585
+ - Fill with all Phase 1 information
586
+ - Write to project root: `project-brief.md`
549
587
 
550
- **If Native Android:**
588
+ ```
589
+ ✅ Generated: project-brief.md
551
590
 
552
- - A) **Material Design Components**
553
- - B) **Jetpack Compose**
591
+ The document has been created with all the information from Phase 1.
554
592
 
555
- **Your answer:**
593
+ 📝 Would you like to make any corrections before continuing?
556
594
 
557
- **If cross-platform, ask:**
595
+ If yes: Edit project-brief.md and type "ready" when done. I'll re-read it.
596
+ → If no: Type "continue" to proceed to Phase 2.
597
+ ```
558
598
 
559
- - Will you use platform-specific UI? (iOS uses Cupertino, Android uses Material)
560
- - Or unified design across platforms?
599
+ **If user edits the file:**
600
+ Execute `read_file('project-brief.md')` to refresh context before continuing.
561
601
  ---
562
- ### Question 1.15: Theme & Dark Mode
563
-
564
- **Will your app support dark mode?**
565
-
566
- A) ⭐ **Yes - System Theme** (Recommended)
567
-
568
- - Follows system dark/light mode
569
- - Best for: Most apps
570
602
 
571
- B) **Yes - Manual Toggle**
572
-
573
- - User can toggle dark/light mode
574
- - Best for: Apps with theme customization
575
-
576
- C) **No Dark Mode**
603
+ ## 📝 Generated Documents
577
604
 
578
- - Light mode only
579
- - Best for: Simple apps
605
+ After Phase 1, generate/update:
606
+ - `project-brief.md` - Core project discovery and requirements
580
607
 
581
- **Your answer:**
582
608
  ---
583
- ### Question 1.16: Internationalization (i18n)
584
609
 
585
- **Will your app support multiple languages?**
610
+ **Next Phase:** Phase 2 - Data Architecture (15-20 min)
586
611
 
587
- A) ⭐ **Yes - Multiple Languages** (Recommended)
612
+ Read: `.ai-flow/prompts/backend/flow-build-phase-2.md`
588
613
 
589
- - Support 2+ languages
590
- - Best for: Global apps
591
-
592
- B) **Yes - English Only (for now)**
593
-
594
- - Single language, but i18n-ready
595
- - Best for: MVPs planning expansion
596
-
597
- C) **No Internationalization**
598
-
599
- - Single language only
600
- - Best for: Local apps
601
-
602
- **Your answer:**
603
-
604
- **If multiple languages selected, ask:**
605
-
606
- - What i18n library?
607
- - React Native: react-i18next, react-native-localize
608
- - Flutter: intl, easy_localization
609
- - Native: NSLocalizedString (iOS), Resources (Android)
610
614
  ---
611
- ### Question 1.17: Image & Asset Management
612
-
613
- **How will you handle images and assets?**
614
615
 
615
- A) ⭐ **Local Assets + Remote Images** (Recommended)
616
+ **Last Updated:** 2025-12-20
617
+ **Version:** 2.1.8
616
618
 
617
- - Local assets for icons/logos
618
- - Remote images for content
619
- - Best for: Most apps
620
-
621
- B) **All Local Assets**
622
-
623
- - All images bundled with app
624
- - Best for: Small apps, offline-first
625
-
626
- C) **All Remote Images**
627
-
628
- - All images from CDN/server
629
- - Best for: Content-heavy apps
630
-
631
- **Your answer:**
632
-
633
- **If remote images selected, ask:**
634
-
635
- - What image optimization library?
636
- - React Native: react-native-fast-image, react-native-image-caching
637
- - Flutter: cached_network_image
638
- - Native: SDWebImage (iOS), Glide (Android)
639
619
  ---
640
- ## ✅ Phase 1 Completion
641
620
 
642
- After answering all questions, summarize:
621
+ ## PHASE 2: Data Architecture (15-20 min)
643
622
 
644
- ```
645
- ---
646
- ✅ Phase 1 Complete: Platform & Framework Selection
647
- ---
648
- Project Name: [Answer from 1.1]
649
- Project Description: [Answer from 1.1]
650
- Selected Stack:
651
- - Platforms: [Answer from 1.3]
652
- - Framework: [Answer from 1.4]
653
- - Language: [Answer from 1.6]
654
- - Minimum iOS: [Answer from 1.5]
655
- - Minimum Android: [Answer from 1.5]
656
- - Package Manager: [Answer from 1.8]
657
- - Build Tools: [Answer from 1.9]
658
- - Analytics: [Answer from 1.13]
659
- - UI Framework: [Answer from 1.14]
660
- - Dark Mode: [Answer from 1.15]
661
- - Internationalization: [Answer from 1.16]
662
- - Image Management: [Answer from 1.17]
663
-
664
- Proceed to Phase 2 (Navigation & Architecture)? (Y/n)
665
- ```
666
- ---
667
- ## 📝 Generated Documents
623
+ ````
668
624
 
669
- After Phase 1, generate/update:
670
-
671
- - `project-brief.md` - Add project goal, platforms, and framework information
672
- - `AGENT.md` - Update technical context section
673
- - `ai-instructions.md` - Add framework-specific rules and setup
674
- ---
675
- **Next Phase:** Phase 2 - Navigation & Architecture
676
625
 
677
- Read: `.ai-flow/prompts/mobile/flow-build-phase-2-navigation.md`
678
- ---
679
- **Last Updated:** 2025-12-XX
680
626
 
681
- **Version:** 1.5.0