ai-flow-dev 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +408 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +791 -0
- package/dist/cli.js.map +1 -0
- package/dist/fs-utils.d.ts +2 -0
- package/dist/fs-utils.d.ts.map +1 -0
- package/dist/fs-utils.js +46 -0
- package/dist/fs-utils.js.map +1 -0
- package/package.json +71 -0
- package/prompts/backend/flow-dev-feature.md +1318 -0
- package/prompts/backend/flow-dev-fix.md +903 -0
- package/prompts/backend/flow-dev-refactor.md +715 -0
- package/prompts/backend/flow-dev-review.md +401 -0
- package/prompts/backend/flow-dev-work.md +1129 -0
- package/prompts/backend/flow-docs-gen-phase-0.md +1840 -0
- package/prompts/backend/flow-docs-gen-phase-1.md +435 -0
- package/prompts/backend/flow-docs-gen-phase-2.md +460 -0
- package/prompts/backend/flow-docs-gen-phase-3.md +684 -0
- package/prompts/backend/flow-docs-gen-phase-4.md +516 -0
- package/prompts/backend/flow-docs-gen-phase-5.md +637 -0
- package/prompts/backend/flow-docs-gen-phase-6.md +465 -0
- package/prompts/backend/flow-docs-gen-phase-7.md +1207 -0
- package/prompts/backend/flow-docs-gen.md +820 -0
- package/prompts/backend/flow-docs-sync.md +526 -0
- package/prompts/backend/flow-project-init.md +248 -0
- package/prompts/backend/flow-project-roadmap.md +1159 -0
- package/prompts/frontend/flow-docs-gen-phase-0.md +494 -0
- package/prompts/frontend/flow-docs-gen-phase-1.md +449 -0
- package/prompts/frontend/flow-docs-gen-phase-2.md +983 -0
- package/prompts/frontend/flow-docs-gen-phase-3.md +685 -0
- package/prompts/frontend/flow-docs-gen-phase-4.md +480 -0
- package/prompts/frontend/flow-docs-gen-phase-5.md +483 -0
- package/prompts/frontend/flow-docs-gen-phase-6.md +570 -0
- package/prompts/frontend/flow-docs-gen-phase-7.md +582 -0
- package/prompts/frontend/flow-docs-gen.md +413 -0
- package/prompts/frontend/flow-docs-sync.md +561 -0
- package/prompts/mobile/flow-docs-gen-phase-0.md +387 -0
- package/prompts/mobile/flow-docs-gen-phase-1.md +530 -0
- package/prompts/mobile/flow-docs-gen-phase-2.md +584 -0
- package/prompts/mobile/flow-docs-gen-phase-3.md +659 -0
- package/prompts/mobile/flow-docs-gen-phase-4.md +363 -0
- package/prompts/mobile/flow-docs-gen-phase-5.md +369 -0
- package/prompts/mobile/flow-docs-gen-phase-6.md +490 -0
- package/prompts/mobile/flow-docs-gen-phase-7.md +407 -0
- package/prompts/mobile/flow-docs-gen.md +430 -0
- package/prompts/mobile/flow-docs-sync.md +634 -0
- package/templates/backend/.clauderules.template +111 -0
- package/templates/backend/.cursorrules.template +102 -0
- package/templates/backend/.env.example.template +122 -0
- package/templates/backend/README.template.md +200 -0
- package/templates/backend/ai-instructions.template.md +354 -0
- package/templates/backend/copilot-instructions.template.md +160 -0
- package/templates/backend/docs/api.template.md +251 -0
- package/templates/backend/docs/architecture.template.md +612 -0
- package/templates/backend/docs/business-flows.template.md +109 -0
- package/templates/backend/docs/code-standards.template.md +828 -0
- package/templates/backend/docs/contributing.template.md +163 -0
- package/templates/backend/docs/data-model.template.md +416 -0
- package/templates/backend/docs/operations.template.md +591 -0
- package/templates/backend/docs/testing.template.md +762 -0
- package/templates/backend/project-brief.template.md +176 -0
- package/templates/backend/specs/configuration.template.md +133 -0
- package/templates/backend/specs/security.template.md +422 -0
- package/templates/frontend/README.template.md +121 -0
- package/templates/frontend/ai-instructions.template.md +368 -0
- package/templates/frontend/docs/api-integration.template.md +390 -0
- package/templates/frontend/docs/components.template.md +567 -0
- package/templates/frontend/docs/error-handling.template.md +385 -0
- package/templates/frontend/docs/operations.template.md +123 -0
- package/templates/frontend/docs/performance.template.md +140 -0
- package/templates/frontend/docs/pwa.template.md +135 -0
- package/templates/frontend/docs/state-management.template.md +394 -0
- package/templates/frontend/docs/styling.template.md +779 -0
- package/templates/frontend/docs/testing.template.md +736 -0
- package/templates/frontend/project-brief.template.md +55 -0
- package/templates/frontend/specs/accessibility.template.md +111 -0
- package/templates/frontend/specs/configuration.template.md +520 -0
- package/templates/frontend/specs/security.template.md +197 -0
- package/templates/fullstack/README.template.md +282 -0
- package/templates/fullstack/ai-instructions.template.md +487 -0
- package/templates/fullstack/project-brief.template.md +197 -0
- package/templates/fullstack/specs/configuration.template.md +380 -0
- package/templates/mobile/AGENT.template.md +251 -0
- package/templates/mobile/README.template.md +195 -0
- package/templates/mobile/ai-instructions.template.md +221 -0
- package/templates/mobile/docs/app-store.template.md +163 -0
- package/templates/mobile/docs/architecture.template.md +100 -0
- package/templates/mobile/docs/native-features.template.md +137 -0
- package/templates/mobile/docs/navigation.template.md +81 -0
- package/templates/mobile/docs/offline-strategy.template.md +90 -0
- package/templates/mobile/docs/permissions.template.md +70 -0
- package/templates/mobile/docs/state-management.template.md +116 -0
- package/templates/mobile/docs/testing.template.md +146 -0
- package/templates/mobile/project-brief.template.md +97 -0
- package/templates/mobile/specs/build-configuration.template.md +116 -0
- package/templates/mobile/specs/deployment.template.md +114 -0
- package/templates/shared/AGENT.template.md +252 -0
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
# Phase 2: Navigation & Architecture
|
|
2
|
+
|
|
3
|
+
**Duration:** 15-20 minutes
|
|
4
|
+
**Questions:** ~10 questions
|
|
5
|
+
**Output:** docs/navigation.md, docs/architecture.md, parts of ai-instructions.md
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Objective
|
|
10
|
+
|
|
11
|
+
Define the **navigation structure and architecture** for your mobile app:
|
|
12
|
+
|
|
13
|
+
1. What navigation patterns will you use?
|
|
14
|
+
2. How will you organize screens and components?
|
|
15
|
+
3. What architecture pattern will you follow?
|
|
16
|
+
4. How will you structure your codebase?
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📋 Questions
|
|
21
|
+
|
|
22
|
+
### Question 2.1: Navigation Pattern
|
|
23
|
+
|
|
24
|
+
**What navigation pattern will your app use?**
|
|
25
|
+
|
|
26
|
+
**For React Native:**
|
|
27
|
+
- A) ⭐ **Stack Navigation** (Recommended)
|
|
28
|
+
- Hierarchical navigation (push/pop)
|
|
29
|
+
- Best for: Most apps, detail screens
|
|
30
|
+
- Library: React Navigation Stack
|
|
31
|
+
|
|
32
|
+
- B) 🔥 **Tab Navigation**
|
|
33
|
+
- Bottom tabs or top tabs
|
|
34
|
+
- Best for: Multi-section apps (Home, Search, Profile, etc.)
|
|
35
|
+
- Library: React Navigation Tabs
|
|
36
|
+
|
|
37
|
+
- C) **Drawer Navigation**
|
|
38
|
+
- Side menu drawer
|
|
39
|
+
- Best for: Apps with many sections
|
|
40
|
+
- Library: React Navigation Drawer
|
|
41
|
+
|
|
42
|
+
- D) **Combined (Tab + Stack)** (Most Common)
|
|
43
|
+
- Bottom tabs with stack navigators per tab
|
|
44
|
+
- Best for: Complex apps with multiple sections
|
|
45
|
+
- Example: Instagram, Twitter
|
|
46
|
+
|
|
47
|
+
**For Flutter:**
|
|
48
|
+
- A) ⭐ **Navigator 2.0 / GoRouter** (Recommended)
|
|
49
|
+
- Declarative routing
|
|
50
|
+
- Best for: Modern Flutter apps
|
|
51
|
+
|
|
52
|
+
- B) **AutoRoute**
|
|
53
|
+
- Code generation for routes
|
|
54
|
+
- Best for: Type-safe routing
|
|
55
|
+
|
|
56
|
+
- C) **Traditional Navigator**
|
|
57
|
+
- Imperative navigation
|
|
58
|
+
- Best for: Simple apps
|
|
59
|
+
|
|
60
|
+
**For Native iOS:**
|
|
61
|
+
- A) ⭐ **UINavigationController** (Standard)
|
|
62
|
+
- B) **UITabBarController** (Tabs)
|
|
63
|
+
- C) **Coordinator Pattern** (Advanced)
|
|
64
|
+
|
|
65
|
+
**For Native Android:**
|
|
66
|
+
- A) ⭐ **Navigation Component** (Recommended)
|
|
67
|
+
- B) **Jetpack Compose Navigation** (If using Compose)
|
|
68
|
+
|
|
69
|
+
**Your answer:**
|
|
70
|
+
|
|
71
|
+
**If Combined selected, ask:**
|
|
72
|
+
- How many bottom tabs? (3-5 recommended)
|
|
73
|
+
- What are the main sections? (e.g., Home, Search, Profile, Settings)
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Question 2.2: Screen Organization
|
|
78
|
+
|
|
79
|
+
**How will you organize your screens?**
|
|
80
|
+
|
|
81
|
+
A) ⭐ **Feature-based** (Recommended)
|
|
82
|
+
- Group by feature/domain
|
|
83
|
+
- Example: `screens/auth/`, `screens/home/`, `screens/profile/`
|
|
84
|
+
- Best for: Medium to large apps
|
|
85
|
+
|
|
86
|
+
B) **Flat Structure**
|
|
87
|
+
- All screens in one folder
|
|
88
|
+
- Example: `screens/LoginScreen.tsx`, `screens/HomeScreen.tsx`
|
|
89
|
+
- Best for: Small apps (<10 screens)
|
|
90
|
+
|
|
91
|
+
C) **Domain-driven**
|
|
92
|
+
- Group by business domain
|
|
93
|
+
- Example: `screens/user/`, `screens/product/`, `screens/order/`
|
|
94
|
+
- Best for: Large, complex apps
|
|
95
|
+
|
|
96
|
+
D) **Route-based**
|
|
97
|
+
- Match folder structure to routes
|
|
98
|
+
- Example: `screens/(tabs)/home/`, `screens/(tabs)/profile/`
|
|
99
|
+
- Best for: File-based routing (Expo Router)
|
|
100
|
+
|
|
101
|
+
**Your answer:**
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### Question 2.3: Component Organization
|
|
106
|
+
|
|
107
|
+
**How will you organize your components?**
|
|
108
|
+
|
|
109
|
+
A) ⭐ **Atomic Design** (Recommended)
|
|
110
|
+
- atoms/, molecules/, organisms/, templates/
|
|
111
|
+
- Best for: Design system consistency
|
|
112
|
+
|
|
113
|
+
B) **Feature-based Components**
|
|
114
|
+
- components/ shared across features
|
|
115
|
+
- features/[feature]/components/ for feature-specific
|
|
116
|
+
- Best for: Feature isolation
|
|
117
|
+
|
|
118
|
+
C) **Flat Structure**
|
|
119
|
+
- All components in components/
|
|
120
|
+
- Best for: Small apps
|
|
121
|
+
|
|
122
|
+
D) **Type-based**
|
|
123
|
+
- components/buttons/, components/cards/, components/forms/
|
|
124
|
+
- Best for: Component library approach
|
|
125
|
+
|
|
126
|
+
**Your answer:**
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### Question 2.4: Architecture Pattern
|
|
131
|
+
|
|
132
|
+
**What architecture pattern will you follow?**
|
|
133
|
+
|
|
134
|
+
A) ⭐ **Feature-based Architecture** (Recommended)
|
|
135
|
+
- Each feature is self-contained
|
|
136
|
+
- Example: features/auth/, features/home/
|
|
137
|
+
- Best for: Most React Native/Flutter apps
|
|
138
|
+
|
|
139
|
+
B) 🔥 **Clean Architecture** (Popular)
|
|
140
|
+
- Separation: Presentation / Domain / Data layers
|
|
141
|
+
- Best for: Complex apps, testability
|
|
142
|
+
|
|
143
|
+
C) **MVVM (Model-View-ViewModel)**
|
|
144
|
+
- Common in Flutter and Native
|
|
145
|
+
- Best for: State-heavy apps
|
|
146
|
+
|
|
147
|
+
D) **MVI (Model-View-Intent)**
|
|
148
|
+
- Unidirectional data flow
|
|
149
|
+
- Best for: Predictable state management
|
|
150
|
+
|
|
151
|
+
E) **Simple (No strict pattern)**
|
|
152
|
+
- Organize as needed
|
|
153
|
+
- Best for: Small apps, MVPs
|
|
154
|
+
|
|
155
|
+
**Your answer:**
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### Question 2.5: Folder Structure
|
|
160
|
+
|
|
161
|
+
**What folder structure will you use?**
|
|
162
|
+
|
|
163
|
+
**Example for Feature-based:**
|
|
164
|
+
```
|
|
165
|
+
src/
|
|
166
|
+
├── features/
|
|
167
|
+
│ ├── auth/
|
|
168
|
+
│ │ ├── screens/
|
|
169
|
+
│ │ ├── components/
|
|
170
|
+
│ │ ├── hooks/
|
|
171
|
+
│ │ └── store/
|
|
172
|
+
│ ├── home/
|
|
173
|
+
│ └── profile/
|
|
174
|
+
├── components/ (shared)
|
|
175
|
+
├── navigation/
|
|
176
|
+
├── services/
|
|
177
|
+
├── utils/
|
|
178
|
+
└── types/
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Example for Clean Architecture:**
|
|
182
|
+
```
|
|
183
|
+
lib/
|
|
184
|
+
├── presentation/
|
|
185
|
+
│ ├── pages/
|
|
186
|
+
│ ├── widgets/
|
|
187
|
+
│ └── providers/
|
|
188
|
+
├── domain/
|
|
189
|
+
│ ├── entities/
|
|
190
|
+
│ ├── repositories/
|
|
191
|
+
│ └── usecases/
|
|
192
|
+
└── data/
|
|
193
|
+
├── models/
|
|
194
|
+
├── repositories/
|
|
195
|
+
└── datasources/
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Your preference:** (Describe or select from examples)
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### Question 2.6: Navigation Library
|
|
203
|
+
|
|
204
|
+
**Which navigation library will you use?**
|
|
205
|
+
|
|
206
|
+
**If React Native:**
|
|
207
|
+
- A) ⭐ **React Navigation** (Recommended)
|
|
208
|
+
- Most popular, well-maintained
|
|
209
|
+
- Works with Expo and bare React Native
|
|
210
|
+
- Version: 6.x
|
|
211
|
+
|
|
212
|
+
- B) **React Native Navigation** (Wix)
|
|
213
|
+
- Native navigation, better performance
|
|
214
|
+
- Requires native setup
|
|
215
|
+
- Best for: Performance-critical apps
|
|
216
|
+
|
|
217
|
+
**If Flutter:**
|
|
218
|
+
- A) ⭐ **GoRouter** (Recommended)
|
|
219
|
+
- Declarative, type-safe
|
|
220
|
+
- Best for: Modern Flutter apps
|
|
221
|
+
|
|
222
|
+
- B) **AutoRoute**
|
|
223
|
+
- Code generation
|
|
224
|
+
- Best for: Complex routing
|
|
225
|
+
|
|
226
|
+
**Your answer:**
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### Question 2.7: Deep Linking Strategy
|
|
231
|
+
|
|
232
|
+
**How will you handle deep links?**
|
|
233
|
+
|
|
234
|
+
A) ⭐ **Universal Links (iOS) + App Links (Android)** (Recommended)
|
|
235
|
+
- Standard deep linking
|
|
236
|
+
- Opens app directly
|
|
237
|
+
- Best for: Most apps
|
|
238
|
+
|
|
239
|
+
B) **Custom URL Scheme**
|
|
240
|
+
- myapp://path/to/screen
|
|
241
|
+
- Simpler but less secure
|
|
242
|
+
- Best for: Internal links
|
|
243
|
+
|
|
244
|
+
C) **No Deep Linking**
|
|
245
|
+
- App only, no external links
|
|
246
|
+
- Best for: Standalone apps
|
|
247
|
+
|
|
248
|
+
**Your answer:**
|
|
249
|
+
|
|
250
|
+
**If deep linking selected, ask:**
|
|
251
|
+
- What URL scheme? (e.g., `myapp://`, `https://myapp.com`)
|
|
252
|
+
- What screens need deep links? (e.g., product details, user profiles)
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
### Question 2.8: Navigation State Management
|
|
257
|
+
|
|
258
|
+
**How will you manage navigation state?**
|
|
259
|
+
|
|
260
|
+
A) ⭐ **Navigation Library Built-in** (Recommended)
|
|
261
|
+
- React Navigation manages its own state
|
|
262
|
+
- Flutter Navigator manages its own state
|
|
263
|
+
- Best for: Most apps
|
|
264
|
+
|
|
265
|
+
B) **Redux / State Management Library**
|
|
266
|
+
- Centralized navigation state
|
|
267
|
+
- Best for: Complex navigation flows
|
|
268
|
+
|
|
269
|
+
C) **Custom State Management**
|
|
270
|
+
- Your own navigation state
|
|
271
|
+
- Best for: Advanced use cases
|
|
272
|
+
|
|
273
|
+
**Your answer:**
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### Question 2.9: Screen Transitions
|
|
278
|
+
|
|
279
|
+
**What screen transition animations will you use?**
|
|
280
|
+
|
|
281
|
+
A) ⭐ **Default Transitions** (Recommended)
|
|
282
|
+
- Platform-native transitions
|
|
283
|
+
- iOS: Slide from right
|
|
284
|
+
- Android: Slide up/fade
|
|
285
|
+
- Best for: Most apps
|
|
286
|
+
|
|
287
|
+
B) **Custom Transitions**
|
|
288
|
+
- Fade, scale, slide custom directions
|
|
289
|
+
- Best for: Branded experience
|
|
290
|
+
|
|
291
|
+
C) **No Animations**
|
|
292
|
+
- Instant transitions
|
|
293
|
+
- Best for: Performance-critical apps
|
|
294
|
+
|
|
295
|
+
**Your answer:**
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
### Question 2.10: Navigation Guards / Authentication Flow
|
|
300
|
+
|
|
301
|
+
**How will you handle protected routes?**
|
|
302
|
+
|
|
303
|
+
A) ⭐ **Navigation Guards** (Recommended)
|
|
304
|
+
- Check auth state before navigation
|
|
305
|
+
- Redirect to login if not authenticated
|
|
306
|
+
- Best for: Most apps
|
|
307
|
+
|
|
308
|
+
B) **Separate Navigation Stacks**
|
|
309
|
+
- Auth stack vs App stack
|
|
310
|
+
- Switch between stacks based on auth state
|
|
311
|
+
- Best for: Clear separation
|
|
312
|
+
|
|
313
|
+
C) **No Protection**
|
|
314
|
+
- All screens accessible
|
|
315
|
+
- Handle auth in components
|
|
316
|
+
- Best for: Simple apps
|
|
317
|
+
|
|
318
|
+
**Your answer:**
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
#### 🎨 MERMAID NAVIGATION DIAGRAM FORMATS - CRITICAL
|
|
323
|
+
|
|
324
|
+
**Use these exact formats** for mobile navigation diagrams:
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
##### 1️⃣ Navigation Structure (Tab + Stack Pattern)
|
|
329
|
+
|
|
330
|
+
Use `graph TD` to show navigation hierarchy:
|
|
331
|
+
|
|
332
|
+
```mermaid
|
|
333
|
+
graph TD
|
|
334
|
+
subgraph "App Navigation"
|
|
335
|
+
ROOT[Root Navigator]
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
subgraph "Tab Navigator"
|
|
339
|
+
TAB1[Home Tab]
|
|
340
|
+
TAB2[Search Tab]
|
|
341
|
+
TAB3[Profile Tab]
|
|
342
|
+
TAB4[Settings Tab]
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
subgraph "Stack Navigators"
|
|
346
|
+
subgraph "Home Stack"
|
|
347
|
+
H1[Home Screen]
|
|
348
|
+
H2[Product Detail]
|
|
349
|
+
H3[Cart]
|
|
350
|
+
H4[Checkout]
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
subgraph "Search Stack"
|
|
354
|
+
S1[Search Screen]
|
|
355
|
+
S2[Results]
|
|
356
|
+
S3[Filter]
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
subgraph "Profile Stack"
|
|
360
|
+
P1[Profile Screen]
|
|
361
|
+
P2[Edit Profile]
|
|
362
|
+
P3[Orders History]
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
ROOT --> TAB1
|
|
367
|
+
ROOT --> TAB2
|
|
368
|
+
ROOT --> TAB3
|
|
369
|
+
ROOT --> TAB4
|
|
370
|
+
|
|
371
|
+
TAB1 --> H1
|
|
372
|
+
H1 --> H2
|
|
373
|
+
H2 --> H3
|
|
374
|
+
H3 --> H4
|
|
375
|
+
|
|
376
|
+
TAB2 --> S1
|
|
377
|
+
S1 --> S2
|
|
378
|
+
S2 --> S3
|
|
379
|
+
|
|
380
|
+
TAB3 --> P1
|
|
381
|
+
P1 --> P2
|
|
382
|
+
P1 --> P3
|
|
383
|
+
|
|
384
|
+
style ROOT fill:#e3f2fd
|
|
385
|
+
style TAB1 fill:#e1f5ff
|
|
386
|
+
style TAB2 fill:#e1f5ff
|
|
387
|
+
style TAB3 fill:#e1f5ff
|
|
388
|
+
style TAB4 fill:#e1f5ff
|
|
389
|
+
style H1 fill:#fff4e6
|
|
390
|
+
style S1 fill:#fff4e6
|
|
391
|
+
style P1 fill:#fff4e6
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Use for:** Tab-based apps with nested stacks (Instagram, Twitter pattern)
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
##### 2️⃣ Authentication Flow
|
|
399
|
+
|
|
400
|
+
Use `graph LR` to show auth-protected navigation:
|
|
401
|
+
|
|
402
|
+
```mermaid
|
|
403
|
+
graph LR
|
|
404
|
+
subgraph "Unauthenticated"
|
|
405
|
+
SPLASH[Splash Screen]
|
|
406
|
+
ONBOARD[Onboarding]
|
|
407
|
+
LOGIN[Login Screen]
|
|
408
|
+
REGISTER[Register Screen]
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
subgraph "Authenticated"
|
|
412
|
+
MAIN[Main App<br/>Tab Navigator]
|
|
413
|
+
HOME[Home]
|
|
414
|
+
PROFILE[Profile]
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
SPLASH -->|First Launch| ONBOARD
|
|
418
|
+
SPLASH -->|Returning User| CHECK{Authenticated?}
|
|
419
|
+
ONBOARD --> LOGIN
|
|
420
|
+
LOGIN --> REGISTER
|
|
421
|
+
LOGIN -->|Success| MAIN
|
|
422
|
+
REGISTER -->|Success| MAIN
|
|
423
|
+
|
|
424
|
+
CHECK -->|Yes| MAIN
|
|
425
|
+
CHECK -->|No| LOGIN
|
|
426
|
+
|
|
427
|
+
MAIN --> HOME
|
|
428
|
+
MAIN --> PROFILE
|
|
429
|
+
|
|
430
|
+
style SPLASH fill:#e3f2fd
|
|
431
|
+
style CHECK fill:#fff9c4
|
|
432
|
+
style MAIN fill:#e8f5e9
|
|
433
|
+
style LOGIN fill:#fce4ec
|
|
434
|
+
style REGISTER fill:#fce4ec
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**Use for:** Apps with authentication/onboarding flows
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
##### 3️⃣ Deep Linking Routes
|
|
442
|
+
|
|
443
|
+
Use `graph TD` to show deep link structure:
|
|
444
|
+
|
|
445
|
+
```mermaid
|
|
446
|
+
graph TD
|
|
447
|
+
subgraph "Deep Link Routes"
|
|
448
|
+
ROOT[myapp://]
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
subgraph "Public Routes"
|
|
452
|
+
PRODUCT[/product/:id]
|
|
453
|
+
CATEGORY[/category/:slug]
|
|
454
|
+
PROMO[/promo/:code]
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
subgraph "Protected Routes"
|
|
458
|
+
ORDER[/order/:id<br/>⚠️ Auth Required]
|
|
459
|
+
PROFILE_VIEW[/profile/:userId<br/>⚠️ Auth Required]
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
ROOT --> PRODUCT
|
|
463
|
+
ROOT --> CATEGORY
|
|
464
|
+
ROOT --> PROMO
|
|
465
|
+
ROOT --> ORDER
|
|
466
|
+
ROOT --> PROFILE_VIEW
|
|
467
|
+
|
|
468
|
+
PRODUCT -->|Opens| PD[Product Detail Screen]
|
|
469
|
+
CATEGORY -->|Opens| CL[Category List Screen]
|
|
470
|
+
ORDER -->|Opens| OD[Order Detail Screen]
|
|
471
|
+
|
|
472
|
+
style ROOT fill:#e3f2fd
|
|
473
|
+
style PRODUCT fill:#e8f5e9
|
|
474
|
+
style CATEGORY fill:#e8f5e9
|
|
475
|
+
style PROMO fill:#e8f5e9
|
|
476
|
+
style ORDER fill:#fce4ec
|
|
477
|
+
style PROFILE_VIEW fill:#fce4ec
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
**Use for:** Apps with universal links/app links
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
##### 4️⃣ Screen Hierarchy (Feature-based)
|
|
485
|
+
|
|
486
|
+
Use `graph TB` to show folder/screen organization:
|
|
487
|
+
|
|
488
|
+
```mermaid
|
|
489
|
+
graph TB
|
|
490
|
+
subgraph "Mobile App Structure"
|
|
491
|
+
subgraph "screens/"
|
|
492
|
+
subgraph "auth/"
|
|
493
|
+
A1[LoginScreen.tsx]
|
|
494
|
+
A2[RegisterScreen.tsx]
|
|
495
|
+
A3[ForgotPasswordScreen.tsx]
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
subgraph "home/"
|
|
499
|
+
H1[HomeScreen.tsx]
|
|
500
|
+
H2[ProductDetailScreen.tsx]
|
|
501
|
+
end
|
|
502
|
+
|
|
503
|
+
subgraph "profile/"
|
|
504
|
+
P1[ProfileScreen.tsx]
|
|
505
|
+
P2[EditProfileScreen.tsx]
|
|
506
|
+
P3[OrdersScreen.tsx]
|
|
507
|
+
end
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
subgraph "navigation/"
|
|
511
|
+
NAV[RootNavigator.tsx]
|
|
512
|
+
TAB[TabNavigator.tsx]
|
|
513
|
+
STACK[StackNavigators.tsx]
|
|
514
|
+
end
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
NAV --> TAB
|
|
518
|
+
TAB --> STACK
|
|
519
|
+
STACK -.-> H1
|
|
520
|
+
STACK -.-> P1
|
|
521
|
+
STACK -.-> A1
|
|
522
|
+
|
|
523
|
+
style NAV fill:#e3f2fd
|
|
524
|
+
style TAB fill:#e1f5ff
|
|
525
|
+
style STACK fill:#fff4e6
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
**Use for:** Documenting folder structure and file organization
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
**Diagram Guidelines:**
|
|
533
|
+
- Color code by level (Root=light blue, Tabs=blue, Stacks=orange, Screens=default)
|
|
534
|
+
- Use subgraphs to group related screens
|
|
535
|
+
- Show authentication checks with decision diamonds
|
|
536
|
+
- Include deep link routes with ⚠️ for protected routes
|
|
537
|
+
- Update screen names based on actual app structure
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## ✅ Phase 2 Completion
|
|
542
|
+
|
|
543
|
+
After answering all questions, summarize:
|
|
544
|
+
|
|
545
|
+
```
|
|
546
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
547
|
+
✅ Phase 2 Complete: Navigation & Architecture
|
|
548
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
549
|
+
|
|
550
|
+
Selected Architecture:
|
|
551
|
+
- Navigation: Tab + Stack Navigation
|
|
552
|
+
- Library: React Navigation 6.0
|
|
553
|
+
- Architecture: Feature-based
|
|
554
|
+
- Component Organization: Atomic Design
|
|
555
|
+
- Folder Structure: Feature-based
|
|
556
|
+
- Deep Linking: Universal Links + App Links
|
|
557
|
+
- Auth Flow: Navigation Guards
|
|
558
|
+
|
|
559
|
+
Proceed to Phase 3 (State & Data Management)? (Y/n)
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
## 📝 Generated Documents
|
|
565
|
+
|
|
566
|
+
After Phase 2, generate/update:
|
|
567
|
+
|
|
568
|
+
- `docs/navigation.md` - Navigation patterns and setup guide
|
|
569
|
+
- `docs/architecture.md` - System architecture overview
|
|
570
|
+
- `ai-instructions.md` - Add navigation and architecture rules
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
**Next Phase:** Phase 3 - State & Data Management
|
|
575
|
+
|
|
576
|
+
Read: `.ai-flow/prompts/mobile/flow-docs-gen-phase-3-state.md`
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
**Last Updated:** 2025-01-XX
|
|
581
|
+
|
|
582
|
+
**Version:** 1.4.0
|
|
583
|
+
|
|
584
|
+
|