ai-flow-dev 2.2.0 → 2.2.4

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 (74) hide show
  1. package/README.md +28 -24
  2. package/dist/cli.js +228 -418
  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-build.md +2 -0
  15. package/prompts/backend/flow-check-review.md +20 -0
  16. package/prompts/backend/flow-check-test.md +14 -0
  17. package/prompts/backend/flow-check.md +67 -0
  18. package/prompts/backend/flow-commit.md +53 -0
  19. package/prompts/backend/flow-docs-sync.md +55 -53
  20. package/prompts/backend/flow-work-feature.md +42 -0
  21. package/prompts/backend/flow-work-fix.md +33 -0
  22. package/prompts/backend/flow-work-refactor.md +32 -0
  23. package/prompts/backend/flow-work-resume.md +32 -0
  24. package/prompts/backend/flow-work.md +129 -0
  25. package/prompts/frontend/flow-build-phase-0.md +363 -35
  26. package/prompts/frontend/flow-build-phase-1.md +433 -404
  27. package/prompts/frontend/flow-build-phase-2.md +508 -872
  28. package/prompts/frontend/flow-build-phase-3.md +629 -562
  29. package/prompts/frontend/flow-build-phase-4.md +438 -382
  30. package/prompts/frontend/flow-build-phase-5.md +559 -362
  31. package/prompts/frontend/flow-build-phase-6.md +383 -452
  32. package/prompts/frontend/flow-build-phase-7.md +818 -392
  33. package/prompts/frontend/flow-build-phase-9.md +14 -0
  34. package/prompts/frontend/flow-build.md +2 -0
  35. package/prompts/frontend/flow-check-review.md +20 -0
  36. package/prompts/frontend/flow-check-test.md +14 -0
  37. package/prompts/frontend/flow-check.md +67 -0
  38. package/prompts/frontend/flow-commit.md +53 -0
  39. package/prompts/frontend/flow-docs-sync.md +39 -35
  40. package/prompts/frontend/flow-work-feature.md +42 -0
  41. package/prompts/frontend/flow-work-fix.md +33 -0
  42. package/prompts/frontend/flow-work-refactor.md +32 -0
  43. package/prompts/frontend/flow-work-resume.md +32 -0
  44. package/prompts/frontend/flow-work.md +129 -0
  45. package/prompts/mobile/flow-build-phase-0.md +366 -37
  46. package/prompts/mobile/flow-build-phase-1.md +438 -493
  47. package/prompts/mobile/flow-build-phase-2.md +458 -464
  48. package/prompts/mobile/flow-build-phase-3.md +613 -487
  49. package/prompts/mobile/flow-build-phase-4.md +439 -258
  50. package/prompts/mobile/flow-build-phase-5.md +582 -250
  51. package/prompts/mobile/flow-build-phase-6.md +389 -359
  52. package/prompts/mobile/flow-build-phase-7.md +871 -285
  53. package/prompts/mobile/flow-build-phase-9.md +14 -0
  54. package/prompts/mobile/flow-build.md +2 -0
  55. package/prompts/mobile/flow-check-review.md +20 -0
  56. package/prompts/mobile/flow-check-test.md +14 -0
  57. package/prompts/mobile/flow-check.md +67 -0
  58. package/prompts/mobile/flow-commit.md +53 -0
  59. package/prompts/mobile/flow-docs-sync.md +39 -40
  60. package/prompts/mobile/flow-work-feature.md +42 -0
  61. package/prompts/mobile/flow-work-fix.md +33 -0
  62. package/prompts/mobile/flow-work-refactor.md +32 -0
  63. package/prompts/mobile/flow-work-resume.md +32 -0
  64. package/prompts/mobile/flow-work.md +129 -0
  65. package/prompts/shared/smart-skip-preflight.md +214 -0
  66. package/templates/AGENT.template.md +13 -3
  67. package/templates/backend/.clauderules.template +5 -4
  68. package/templates/backend/.cursorrules.template +1 -1
  69. package/prompts/backend/flow-dev-commit.md +0 -829
  70. package/prompts/backend/flow-dev-feature.md +0 -1948
  71. package/prompts/backend/flow-dev-fix.md +0 -952
  72. package/prompts/backend/flow-dev-refactor.md +0 -690
  73. package/prompts/backend/flow-dev-review.md +0 -372
  74. package/prompts/backend/flow-dev-work.md +0 -1081
@@ -1,33 +1,54 @@
1
- # Phase 1: Discovery & UX Requirements
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:** 15-20 minutes
4
- **Questions:** ~11 questions
5
- **Output:** project-brief.md, parts of AGENT.md
6
12
  ---
7
- ## 🎯 Objective
8
13
 
9
- Understand the **user-facing aspects** and core goal of the 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 type of application is being built?
13
- 3. Who are the target users?
14
- 4. What are the key user journeys?
15
- 5. What devices and browsers must be supported?
16
- 6. What are the UX priorities?
17
27
  ---
18
- ## 📋 Questions
19
28
 
20
- ### 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)**
21
34
 
22
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.
23
36
 
24
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:]
25
46
  What is the project name?
26
47
 
27
48
  Provide an initial description of your project.
28
49
  (Don't worry about perfection - we'll refine it together if needed!)
29
50
 
30
- Example: "A frontend dashboard for managing inventory in real-time"
51
+ Example: "A backend for managing gym memberships"
31
52
  ```
32
53
 
33
54
  **🔍 AI Internal: Ambiguity Analysis**
@@ -36,10 +57,10 @@ After receiving the description, silently analyze for these criteria:
36
57
 
37
58
  | Criterion | Check For | Score +1 if present |
38
59
  |-----------|-----------|---------------------|
39
- | **WHO** | Specific user type mentioned (not just "users") | "store managers", "traders", "students" |
40
- | **WHAT** | Specific action/function (not just "view", "show") | "compare prices", "edit profiles", "visualize data" |
41
- | **WHY** | Purpose or value mentioned | "to increase conversion", "to save time", "to improve UX" |
42
- | **DOMAIN** | Industry/vertical indicated | "fintech", "e-commerce", "social media" |
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" |
43
64
  | **DETAIL** | Description has 10+ meaningful words | Not counting articles |
44
65
 
45
66
  **Scoring Rules:**
@@ -62,27 +83,28 @@ Your description: "[original description]"
62
83
  [ONLY show questions for MISSING criteria:]
63
84
 
64
85
  [If WHO is missing:]
65
- 1️⃣ WHO will use this application?
86
+ 1️⃣ WHO will use this system?
66
87
  A) End consumers (B2C)
67
88
  B) Business users (B2B)
68
- C) Internal team / Admin
69
- D) Other: __
89
+ C) Internal team
90
+ D) Other systems (APIs)
91
+ E) Other: __
70
92
 
71
93
  [If WHAT is missing:]
72
- 2️⃣ WHAT is the core UX action users will perform?
73
- A) Browse & Shop
74
- B) Manage & Configure
75
- C) Read & Consume
76
- D) Create & Publish
77
- E) Analyze & Visualize
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
78
100
  F) Other: __
79
101
 
80
102
  [If WHY is missing:]
81
103
  3️⃣ WHY is this project needed?
82
- A) Launch new product
83
- B) Replace legacy UI
84
- C) Better mobile experience
85
- D) Specific new feature
104
+ A) Replace manual/legacy process
105
+ B) Launch new product/business
106
+ C) Improve existing system
107
+ D) Enable new capability
86
108
  E) Other: __
87
109
 
88
110
  [If DOMAIN is missing:]
@@ -95,7 +117,7 @@ Your description: "[original description]"
95
117
  F) Business tools (CRM, ERP)
96
118
  G) Other: __
97
119
 
98
- Your answers: __
120
+ Your answers: __ (e.g., "A, B, A, E" or describe freely)
99
121
  ```
100
122
 
101
123
  ---
@@ -110,488 +132,495 @@ After gathering missing info, generate 3 polished versions:
110
132
  ✨ Based on your input, here are 3 professional descriptions:
111
133
 
112
134
  A) Concise (for package.json):
113
- "[Generated 1-line description]"
135
+ "[Generated 1-line description with WHO + WHAT]"
114
136
 
115
137
  B) Descriptive (for README.md):
116
- "[Generated 2-3 line description with UX focus]"
138
+ "[Generated 2-3 line description with WHO + WHAT + WHY]"
117
139
 
118
- C) Creative (for Marketing/Landing):
119
- "[Generated catchy description]"
140
+ C) Technical (for AGENT.md):
141
+ "[Generated technical description with DOMAIN + WHAT]"
120
142
 
121
143
  Which do you prefer? (1-3, or 4 to edit, 5 to start over)
122
144
  ```
123
145
 
124
- **Your choice:**
125
-
126
146
  ---
127
147
 
128
- ### Question 1.2: Application Type
129
-
130
- **What type of frontend application are you building?**
148
+ **✅ Final Confirmation**
131
149
 
132
- A) ⭐ **Single Page Application (SPA)**
150
+ ```
151
+ ✅ Your final project description:
133
152
 
134
- - Example: Gmail, Notion, Figma
135
- - Characteristics: Client-side routing, dynamic updates, minimal page reloads
136
- - Best for: Web apps, dashboards, admin panels
153
+ 📋 Name: [project name]
154
+ 📝 Description: "[final polished description]"
137
155
 
138
- B) 🔥 **Multi-Page Application (MPA)**
156
+ Proceed to next question? (Y to continue)
157
+ ```
139
158
 
140
- - Example: E-commerce sites, blogs, marketing sites
141
- - Characteristics: Server-rendered pages, traditional navigation
142
- - Best for: Content-heavy sites, SEO-critical apps
159
+ ---
143
160
 
144
- C) **Progressive Web App (PWA)**
161
+ **1.2 Project Overview (Confirmation + Expansion)**
145
162
 
146
- - Example: Twitter Lite, Starbucks PWA
147
- - Characteristics: Offline support, installable, push notifications
148
- - Best for: Mobile-first apps, offline-first experiences
163
+ > **📌 Smart Skip**: If 1.1 already captured WHO/WHAT/WHY completely, this becomes a quick confirmation.
149
164
 
150
- D) 🏆 **Server-Side Rendered (SSR) App**
165
+ ```
166
+ [If 1.1 refinement was complete (score >= 4), show:]
151
167
 
152
- - Example: Next.js apps, Nuxt apps
153
- - Characteristics: Initial server render, hydration, SEO-friendly
154
- - Best for: Hybrid apps, dynamic content with SEO needs
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]
155
172
 
156
- E) **Static Site (SSG)**
173
+ Is this complete? (Y) Or would you like to add more context? (N)
157
174
 
158
- - Example: Documentation sites, portfolios
159
- - Characteristics: Pre-rendered at build time, fast, CDN-friendly
160
- - Best for: Blogs, documentation, landing pages
175
+ [If user says Y → Skip to 1.3]
176
+ [If user says N Ask:]
177
+ What additional context would you like to add?
161
178
 
162
- **Your answer:**
163
179
  ---
164
- ### Question 1.3: Target Users (Confirmation + Expansion)
165
180
 
166
- ```
167
- [If WHO was captured in 1.1, show:]
181
+ [If 1.1 was NOT refined OR any WHO/WHAT/WHY still missing, ask:]
168
182
 
169
- Based on your description, your target users are: [WHO from 1.1]
183
+ [ONLY ask for MISSING elements - check what was NOT captured in 1.1:]
170
184
 
171
- Describe your user personas more deeply (3-5 bullet points):
185
+ [If WHO still unclear:]
186
+ Who are the primary users of this system?
172
187
 
173
- - Demographics (age, tech-savviness, etc.)
174
- - Use cases / goals
175
- - Device preferences
176
- - Accessibility needs
188
+ [If WHAT still unclear:]
189
+ What is the core value proposition?
177
190
 
178
- ---
191
+ [If WHY still unclear:]
192
+ What makes this project necessary?
179
193
 
180
- [If WHO was NOT captured in 1.1, ask normally:]
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
+ ```
181
197
 
182
- Who are your primary target users?
198
+ **1.3 Target Users (Confirmation + Additional Types)**
183
199
 
184
- Describe your user personas (3-5 bullet points):
200
+ > **📌 Smart Skip**: If 1.1 already identified user types, this confirms and expands.
185
201
 
186
- - Demographics (age, tech-savviness, etc.)
187
- - Use cases / goals
188
- - Device preferences
189
- - Accessibility needs
190
202
  ```
203
+ [If WHO was captured in 1.1, show:]
191
204
 
192
- **Example:**
193
-
194
- ```
195
- - Small business owners (30-50 years old, moderate tech skills)
196
- - Goal: Manage inventory and track sales
197
- - Devices: Desktop (70%), Mobile (30%)
198
- - Accessibility: WCAG 2.1 AA compliance required
199
- ```
205
+ ✅ Based on your description, your target users are: [WHO from 1.1]
200
206
 
201
- **Your answer:**
202
- ---
203
- ### Question 1.4: Key User Journeys (Confirmation + Expansion)
207
+ Would you like to add any additional user types? Select any that apply:
204
208
 
205
- ```
206
- [If WHAT was captured in 1.1, show:]
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
207
215
 
208
- ✅ Based on your description, a core journey is: [WHAT from 1.1]
216
+ ---
209
217
 
210
- What are the 3-5 most critical user flows?
218
+ [If WHO was NOT captured in 1.1, ask normally:]
211
219
 
212
- ---
220
+ Who will use this system? Select all that apply:
213
221
 
214
- [If WHAT was NOT captured in 1.1, ask normally:]
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
215
227
 
216
- What are the 3-5 most critical user flows?
228
+ (Can select multiple)
217
229
  ```
218
230
 
219
- **Example:**
231
+ **1.4 Business Objectives**
220
232
 
221
233
  ```
222
- 1. Sign up Email verification Onboarding wizard → Dashboard
223
- 2. Create new project → Add team members → Set up integrations
224
- 3. Browse products → Add to cart → Checkout → Payment confirmation
225
- 4. Search for content → Filter results → View details → Save favorite
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.
226
246
  ```
227
247
 
228
- **Your answer:**
229
- ---
230
- ### Question 1.5: Device & Browser Support
231
-
232
- **What devices and browsers must you support?**
233
-
234
- A) ⭐ **Modern Browsers Only** (Last 2 versions)
235
-
236
- - Chrome, Firefox, Safari, Edge
237
- - Mobile: iOS Safari 14+, Chrome Android
238
- - Pros: Use latest web features, smaller bundle size
239
- - Cons: May exclude <5% of users
240
-
241
- B) 🔥 **Broad Compatibility** (Last 3-4 years)
242
-
243
- - Include IE11, older Safari versions
244
- - Requires polyfills and transpilation
245
- - Pros: Wider audience reach
246
- - Cons: Larger bundle, limited features
247
-
248
- C) **Mobile-First**
249
-
250
- - Prioritize iOS Safari and Chrome Android
251
- - Responsive design for desktop
252
- - Best for: Consumer apps, e-commerce
253
-
254
- D) **Desktop-First**
255
-
256
- - Optimize for desktop browsers
257
- - Mobile as secondary experience
258
- - Best for: Admin panels, dashboards, B2B tools
259
-
260
- **Your answer:**
261
- ---
262
- ### Question 1.6: Responsive Strategy
263
-
264
- **How will you handle different screen sizes?**
265
-
266
- A) ⭐ **Mobile-First Responsive** (Recommended)
248
+ **1.5 System Type (Confirmation + Validation)**
267
249
 
268
- - Design for mobile first, scale up for desktop
269
- - Breakpoints: 640px (mobile), 768px (tablet), 1024px (desktop)
270
- - Best for: Most modern apps
250
+ > **📌 Smart Skip**: If 1.1 already identified the domain/industry, this confirms it.
271
251
 
272
- B) **Desktop-First Responsive**
273
-
274
- - Design for desktop, scale down for mobile
275
- - Best for: Complex dashboards with dense data
276
-
277
- C) **Adaptive (Multiple Designs)**
252
+ ```
253
+ [If DOMAIN was captured in 1.1, show:]
278
254
 
279
- - Separate designs for mobile vs desktop
280
- - Example: Different layouts/features per breakpoint
281
- - Best for: Apps with very different mobile/desktop experiences
255
+ Based on your description, this appears to be a: [DOMAIN from 1.1] system
282
256
 
283
- D) **Fixed Width (Desktop Only)**
257
+ Is this correct?
284
258
 
285
- - No mobile optimization
286
- - Best for: Internal tools, admin panels (desktop-only users)
259
+ A) Yes, that's correct
260
+ B) 🔄 No, it's actually: [show options below]
287
261
 
288
- **Your answer:**
289
262
  ---
290
- ### Question 1.7: Internationalization (i18n)
291
263
 
292
- **Do you need multi-language support?**
264
+ [If DOMAIN was NOT captured in 1.1, OR user selected B above:]
293
265
 
294
- A) **Single Language Only**
266
+ What type of system are you building? (This helps suggest common features)
295
267
 
296
- - No i18n needed
297
- - Fastest 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: __
298
278
 
299
- B) **Multi-Language (Static)**
279
+ Your choice: __
280
+ ```
300
281
 
301
- - Support 2-5 languages
302
- - Translations managed in code (JSON files)
303
- - Example: English, Spanish, French
282
+ **1.6 Core Features**
304
283
 
305
- C) 🌍 **Multi-Language (Dynamic)**
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
+ ```
306
328
 
307
- - Support 10+ languages
308
- - CMS-driven translations or API-based
309
- - Example: Crowdin, Phrase integration
329
+ **1.7 Scope Definition**
310
330
 
311
- D) **Right-to-Left (RTL) Support**
331
+ ```
332
+ Now let's prioritize: What will you build in this first version, and what will you leave for future versions?
312
333
 
313
- - Include Arabic, Hebrew, etc.
314
- - Requires bidirectional layout support
334
+ This helps us focus the documentation on what you're building now, while noting what comes later.
315
335
 
316
- **Your answer:**
336
+ 📋 What will you build in this first version? (Select from the features listed above)
317
337
 
318
- **If multi-language selected, list target languages:**
338
+ [Show features from question 1.6 and allow selection]
319
339
  ---
320
- ### Question 1.8: Authentication Requirements
321
-
322
- **What authentication method will you use?**
323
-
324
- A) **Email/Password (Traditional)**
325
-
326
- - Users sign up with email and password
327
- - Requires password reset flow
328
- - Best for: Most apps
329
-
330
- B) 🔥 **Social Login (OAuth)**
331
-
332
- - Google, GitHub, Facebook, etc.
333
- - Faster signup, lower friction
334
- - Best for: Consumer apps
335
-
336
- C) **Magic Link / Passwordless**
337
-
338
- - Email-based login link
339
- - No password management
340
- - Best for: B2B SaaS, low-security apps
341
-
342
- D) **SSO / SAML (Enterprise)**
343
-
344
- - Okta, Auth0, Azure AD integration
345
- - Best for: Enterprise B2B apps
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
+ ```
346
357
 
347
- E) **Multi-Factor Authentication (MFA)**
358
+ **1.8 Constraints**
348
359
 
349
- - SMS, authenticator app, WebAuthn
350
- - Best for: High-security apps (finance, healthcare)
360
+ ```
361
+ What constraints does this project have? Select all that apply:
351
362
 
352
- F) **No Authentication**
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
353
370
 
354
- - Public app, no user accounts
355
- - Best for: Marketing sites, public tools
371
+ For each selected, provide details:
356
372
 
357
- **Your answer:**
358
- ---
359
- ### Question 1.9: Data Privacy & Compliance
373
+ Example:
374
+ - Time: Must launch MVP by Q3 2024
375
+ - Compliance: Must be GDPR compliant as we serve EU users
376
+ ```
360
377
 
361
- **What data privacy requirements do you have?**
378
+ **1.9 Success Metrics**
362
379
 
363
- A) ⭐ **Standard (No Special Requirements)**
380
+ ```
381
+ How will you measure success?
364
382
 
365
- - Basic privacy policy
366
- - No regulated data
383
+ 1. Expected Users:
384
+ - Initial launch: __ users
385
+ - Year 1 goal: __ users
367
386
 
368
- B) **GDPR Compliance (EU)**
387
+ 2. Performance Targets:
388
+ - Response time: < __ ms
389
+ - Uptime: __ %
369
390
 
370
- - Cookie consent banner
371
- - Right to be forgotten
372
- - Data export capabilities
391
+ 3. Business Goals:
392
+ - [Goal 1]
393
+ - [Goal 2]
373
394
 
374
- C) **CCPA Compliance (California)**
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)
375
399
 
376
- - "Do Not Sell" option
377
- - Data deletion requests
400
+ 🏆 Standard for Production/Scale:
401
+ - Users: 100,000+ active
402
+ - Response time: < 200ms (API), < 50ms (DB)
403
+ - Uptime: 99.99% (High Availability)
404
+ ```
378
405
 
379
- D) 🏆 **HIPAA Compliance (Healthcare)**
406
+ **1.10 Main Business Flows**
380
407
 
381
- - Encrypted data transmission
382
- - Audit logs
383
- - Strict access controls
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.
384
409
 
385
- E) **SOC 2 / ISO 27001 (Enterprise)**
410
+ `````
411
+ List the main business flows of the system (e.g., sales, inventory update, invoicing, user registration).
386
412
 
387
- - Security audit requirements
388
- - Detailed logging and monitoring
413
+ For each flow, you can add a brief description (optional).
389
414
 
390
- F) **Multiple Regulations**
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.
391
416
 
392
- - Combine GDPR + CCPA + others
393
- - Most restrictive controls apply
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.
394
425
 
395
- **Your answer:**
426
+ The AI will automatically generate flow diagrams (mermaid) for each documented process.
396
427
  ---
397
- ### Question 1.10: Offline Support
398
-
399
- **Do users need offline access?**
400
-
401
- A) ⭐ **Online Only**
402
-
403
- - Requires internet connection
404
- - Simplest implementation
405
-
406
- B) **Basic Offline (Read-Only)**
407
-
408
- - Cache data for offline viewing
409
- - No offline editing
410
- - Example: News apps, documentation
411
-
412
- C) 🔥 **Full Offline (Sync)**
413
-
414
- - Offline editing with sync when online
415
- - Requires conflict resolution
416
- - Example: Note apps, task managers
417
- - Technologies: Service Workers, IndexedDB
418
-
419
- D) **Offline-First**
420
-
421
- - Works offline by default
422
- - Syncs in background
423
- - Best for: Mobile apps, unreliable networks
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
+ ```
424
536
 
425
- **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
426
554
  ---
427
- ### Question 1.11: Performance Priorities
428
-
429
- **What are your performance priorities?** (Select top 3)
430
-
431
- A) ⭐ **Fast Initial Load (LCP < 2.5s)**
432
-
433
- - Optimize Core Web Vitals
434
- - Code splitting, lazy loading
435
- - Best for: SEO, user retention
436
-
437
- B) **Smooth Interactions (FID < 100ms)**
438
-
439
- - Debounce inputs, optimize re-renders
440
- - Best for: Interactive apps, dashboards
441
-
442
- C) **Visual Stability (CLS < 0.1)**
443
-
444
- - Prevent layout shifts
445
- - Reserve space for dynamic content
446
- - Best for: Content-heavy sites
447
-
448
- D) **Low Bundle Size**
449
-
450
- - Minimize JavaScript payload
451
- - Tree shaking, compression
452
- - Best for: Mobile users, slow networks
453
-
454
- E) **Fast Time to Interactive (TTI)**
455
-
456
- - Hydration optimization
457
- - Critical CSS inlining
458
- - Best for: SSR apps
459
-
460
- F) **Perceived Performance**
461
-
462
- - Skeleton screens, optimistic UI
463
- - Best for: User experience
555
+ ```
464
556
 
465
- **Your answer (top 3):**
466
- ---
467
- ## 📊 Phase 1 Summary
557
+ ### Phase 1 Output
468
558
 
469
- Before proceeding to Phase 2, confirm the following:
559
+ After gathering all information, confirm:
470
560
 
471
561
  ```
472
- ---
473
- 📋 PHASE 1 SUMMARY: DISCOVERY & UX
474
- ---
475
- Project Name: [Answer from 1.1]
476
- Project Description: [Answer from 1.1]
477
- Application Type: [Answer from 1.2]
478
- Target Users: [Answer from 1.3]
479
- Key User Journeys: [Answer from 1.4]
480
- Device/Browser Support: [Answer from 1.5]
481
- Responsive Strategy: [Answer from 1.6]
482
- Internationalization: [Answer from 1.7]
483
- Authentication: [Answer from 1.8]
484
- Data Privacy: [Answer from 1.9]
485
- Offline Support: [Answer from 1.10]
486
- Performance Priorities: [Answer from 1.11]
487
-
488
- Is this correct? (Y/n)
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.
489
578
  ```
490
-
491
- If **Yes:** Proceed to Phase 2
492
-
493
- If **No:** Allow user to correct specific answers
494
579
  ---
495
- ## 📝 Document Generation (Partial)
496
-
497
- At the end of Phase 1, generate or update:
498
-
499
- ### 1. project-brief.md (Partial)
500
-
501
- ```markdown
502
- # {{PROJECT_NAME}} - Project Brief
503
-
504
- ## Overview
505
-
506
- {{PROJECT_DESCRIPTION}}
507
-
508
- ## Application Type
509
-
510
- {{APPLICATION_TYPE}}
511
-
512
- ## Target Users
513
-
514
- {{TARGET_USERS}}
515
-
516
- ## Key User Journeys
517
-
518
- 1. {{USER_JOURNEY_1}}
519
- 2. {{USER_JOURNEY_2}}
520
- 3. {{USER_JOURNEY_3}}
521
- 4. {{USER_JOURNEY_4}}
522
- 5. {{USER_JOURNEY_5}}
523
-
524
- ## Technical Requirements
525
-
526
- ### Browser Support
580
+ ### 📄 Generate Phase 1 Documents
527
581
 
528
- {{BROWSER_SUPPORT}}
582
+ **Generate `project-brief.md` automatically:**
529
583
 
530
- ### Responsive Strategy
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`
531
587
 
532
- {{RESPONSIVE_STRATEGY}}
533
-
534
- ### Internationalization
535
-
536
- {{I18N_SUPPORT}}
537
-
538
- ### Authentication
539
-
540
- {{AUTH_METHOD}}
541
-
542
- ### Data Privacy
543
-
544
- {{DATA_PRIVACY_COMPLIANCE}}
545
-
546
- ### Offline Support
588
+ ```
589
+ ✅ Generated: project-brief.md
547
590
 
548
- {{OFFLINE_SUPPORT}}
591
+ The document has been created with all the information from Phase 1.
549
592
 
550
- ### Performance Priorities
593
+ 📝 Would you like to make any corrections before continuing?
551
594
 
552
- {{PERFORMANCE_PRIORITIES}}
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.
553
597
  ```
554
598
 
555
- ### 2. AGENT.md (Partial)
556
-
557
- ```markdown
558
- # AGENT.md
599
+ **If user edits the file:**
600
+ Execute `read_file('project-brief.md')` to refresh context before continuing.
601
+ ---
559
602
 
560
- ## About This Project
603
+ ## 📝 Generated Documents
561
604
 
562
- **Project Name:** {{PROJECT_NAME}}
605
+ After Phase 1, generate/update:
606
+ - `project-brief.md` - Core project discovery and requirements
563
607
 
564
- **Type:** {{APPLICATION_TYPE}}
608
+ ---
565
609
 
566
- **Target Users:** {{TARGET_USERS}}
610
+ **Next Phase:** Phase 2 - Data Architecture (15-20 min)
567
611
 
568
- ## Key Features
612
+ Read: `.ai-flow/prompts/backend/flow-build-phase-2.md`
569
613
 
570
- {{KEY_USER_JOURNEYS}}
614
+ ---
571
615
 
572
- ## Requirements
616
+ **Last Updated:** 2025-12-20
617
+ **Version:** 2.1.8
573
618
 
574
- - Browser Support: {{BROWSER_SUPPORT}}
575
- - Responsive: {{RESPONSIVE_STRATEGY}}
576
- - i18n: {{I18N_SUPPORT}}
577
- - Authentication: {{AUTH_METHOD}}
578
- - Compliance: {{DATA_PRIVACY_COMPLIANCE}}
579
- ```
580
619
  ---
581
- ## 🚀 Next Steps
582
620
 
583
- ```
584
- ✅ Phase 1 Complete!
621
+ ## PHASE 2: Data Architecture (15-20 min)
585
622
 
586
- Documents Generated:
587
- - project-brief.md (partial)
588
- - AGENT.md (partial)
623
+ ````
589
624
 
590
- Next: Phase 2 - Components & Framework
591
625
 
592
- Read: .ai-flow/prompts/frontend/flow-build-phase-2-components.md
593
- ```
594
- ---
595
- **Last Updated:** 2025-12-XX
596
626
 
597
- **Version:** 1.3.0