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,363 @@
|
|
|
1
|
+
# Phase 4: Permissions & Native Features
|
|
2
|
+
|
|
3
|
+
**Duration:** 15-20 minutes
|
|
4
|
+
**Questions:** ~10 questions
|
|
5
|
+
**Output:** docs/permissions.md, docs/native-features.md, parts of ai-instructions.md
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Objective
|
|
10
|
+
|
|
11
|
+
Define what **native features and permissions** your app will use:
|
|
12
|
+
|
|
13
|
+
1. What permissions will you request?
|
|
14
|
+
2. What native features will you integrate?
|
|
15
|
+
3. How will you handle permission requests?
|
|
16
|
+
4. What third-party SDKs will you use?
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 📋 Questions
|
|
21
|
+
|
|
22
|
+
### Question 4.1: Camera Permission
|
|
23
|
+
|
|
24
|
+
**Will your app use the camera?**
|
|
25
|
+
|
|
26
|
+
A) ⭐ **Yes - Photo Capture**
|
|
27
|
+
- Take photos within app
|
|
28
|
+
- Requires: Camera permission
|
|
29
|
+
- Best for: Social apps, productivity apps
|
|
30
|
+
|
|
31
|
+
B) **Yes - Video Recording**
|
|
32
|
+
- Record videos
|
|
33
|
+
- Requires: Camera + Microphone permissions
|
|
34
|
+
- Best for: Video apps, social media
|
|
35
|
+
|
|
36
|
+
C) **Yes - QR Code Scanning**
|
|
37
|
+
- Scan QR codes
|
|
38
|
+
- Requires: Camera permission
|
|
39
|
+
- Best for: Payment apps, utilities
|
|
40
|
+
|
|
41
|
+
D) **No Camera Access**
|
|
42
|
+
- No camera features
|
|
43
|
+
- Best for: Most apps
|
|
44
|
+
|
|
45
|
+
**Your answer:**
|
|
46
|
+
|
|
47
|
+
**If camera selected, ask:**
|
|
48
|
+
- What library will you use?
|
|
49
|
+
- React Native: react-native-camera, react-native-vision-camera
|
|
50
|
+
- Flutter: camera, image_picker
|
|
51
|
+
- Native: AVFoundation (iOS), Camera2 (Android)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Question 4.2: Location Permission
|
|
56
|
+
|
|
57
|
+
**Will your app use location services?**
|
|
58
|
+
|
|
59
|
+
A) ⭐ **Yes - When In Use** (Recommended)
|
|
60
|
+
- Location only when app is active
|
|
61
|
+
- Requires: Location When In Use permission
|
|
62
|
+
- Best for: Most location-based apps
|
|
63
|
+
|
|
64
|
+
B) **Yes - Always**
|
|
65
|
+
- Location even when app is backgrounded
|
|
66
|
+
- Requires: Always permission (harder to get approved)
|
|
67
|
+
- Best for: Navigation, fitness tracking
|
|
68
|
+
|
|
69
|
+
C) **Yes - Approximate Location**
|
|
70
|
+
- Approximate location only (less privacy-invasive)
|
|
71
|
+
- Best for: Location-based content
|
|
72
|
+
|
|
73
|
+
D) **No Location Access**
|
|
74
|
+
- No location features
|
|
75
|
+
- Best for: Most apps
|
|
76
|
+
|
|
77
|
+
**Your answer:**
|
|
78
|
+
|
|
79
|
+
**If location selected, ask:**
|
|
80
|
+
- What library will you use?
|
|
81
|
+
- React Native: @react-native-community/geolocation, react-native-maps
|
|
82
|
+
- Flutter: geolocator, google_maps_flutter
|
|
83
|
+
- Native: CoreLocation (iOS), Location Services (Android)
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Question 4.3: Push Notifications
|
|
88
|
+
|
|
89
|
+
**Will your app send push notifications?**
|
|
90
|
+
|
|
91
|
+
A) ⭐ **Yes - User Notifications** (Recommended)
|
|
92
|
+
- Notify users of important events
|
|
93
|
+
- Requires: Notification permission
|
|
94
|
+
- Best for: Most apps
|
|
95
|
+
|
|
96
|
+
B) **Yes - Background Notifications**
|
|
97
|
+
- Notify even when app is closed
|
|
98
|
+
- Requires: Background modes
|
|
99
|
+
- Best for: Real-time apps
|
|
100
|
+
|
|
101
|
+
C) **No Push Notifications**
|
|
102
|
+
- No notifications
|
|
103
|
+
- Best for: Simple apps, privacy-focused apps
|
|
104
|
+
|
|
105
|
+
**Your answer:**
|
|
106
|
+
|
|
107
|
+
**If notifications selected, ask:**
|
|
108
|
+
- What service will you use?
|
|
109
|
+
- Firebase Cloud Messaging (FCM)
|
|
110
|
+
- OneSignal
|
|
111
|
+
- Pusher
|
|
112
|
+
- Custom backend
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### Question 4.4: Photo Library Access
|
|
117
|
+
|
|
118
|
+
**Will your app access the photo library?**
|
|
119
|
+
|
|
120
|
+
A) ⭐ **Yes - Read Only**
|
|
121
|
+
- Select photos from library
|
|
122
|
+
- Requires: Photo Library Read permission
|
|
123
|
+
- Best for: Most apps that need photos
|
|
124
|
+
|
|
125
|
+
B) **Yes - Read & Write**
|
|
126
|
+
- Save photos to library
|
|
127
|
+
- Requires: Photo Library Write permission
|
|
128
|
+
- Best for: Photo editing apps
|
|
129
|
+
|
|
130
|
+
C) **No Photo Library Access**
|
|
131
|
+
- No photo library features
|
|
132
|
+
- Best for: Apps that don't need photos
|
|
133
|
+
|
|
134
|
+
**Your answer:**
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### Question 4.5: Contacts Access
|
|
139
|
+
|
|
140
|
+
**Will your app access contacts?**
|
|
141
|
+
|
|
142
|
+
A) ⭐ **Yes - Read Contacts**
|
|
143
|
+
- Import contacts
|
|
144
|
+
- Requires: Contacts Read permission
|
|
145
|
+
- Best for: Social apps, messaging apps
|
|
146
|
+
|
|
147
|
+
B) **Yes - Read & Write**
|
|
148
|
+
- Add contacts
|
|
149
|
+
- Requires: Contacts Write permission
|
|
150
|
+
- Best for: Contact management apps
|
|
151
|
+
|
|
152
|
+
C) **No Contacts Access**
|
|
153
|
+
- No contact features
|
|
154
|
+
- Best for: Most apps
|
|
155
|
+
|
|
156
|
+
**Your answer:**
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### Question 4.6: Biometric Authentication
|
|
161
|
+
|
|
162
|
+
**Will your app use biometric authentication?**
|
|
163
|
+
|
|
164
|
+
A) ⭐ **Yes - Face ID / Touch ID / Fingerprint** (Recommended)
|
|
165
|
+
- Secure authentication
|
|
166
|
+
- Requires: Face ID / Touch ID permission
|
|
167
|
+
- Best for: Secure apps, banking apps
|
|
168
|
+
|
|
169
|
+
B) **No Biometric Auth**
|
|
170
|
+
- Traditional password/PIN only
|
|
171
|
+
- Best for: Simple apps
|
|
172
|
+
|
|
173
|
+
**Your answer:**
|
|
174
|
+
|
|
175
|
+
**If biometric selected, ask:**
|
|
176
|
+
- What library will you use?
|
|
177
|
+
- React Native: react-native-biometrics, react-native-touch-id
|
|
178
|
+
- Flutter: local_auth
|
|
179
|
+
- Native: LocalAuthentication (iOS), BiometricPrompt (Android)
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### Question 4.7: File System Access
|
|
184
|
+
|
|
185
|
+
**Will your app access the file system?**
|
|
186
|
+
|
|
187
|
+
A) ⭐ **Yes - Document Picker**
|
|
188
|
+
- Let users select files
|
|
189
|
+
- Requires: File access permission
|
|
190
|
+
- Best for: Document apps, file managers
|
|
191
|
+
|
|
192
|
+
B) **Yes - File Storage**
|
|
193
|
+
- Save files to device
|
|
194
|
+
- Requires: Storage permission
|
|
195
|
+
- Best for: File management apps
|
|
196
|
+
|
|
197
|
+
C) **No File System Access**
|
|
198
|
+
- No file features
|
|
199
|
+
- Best for: Most apps
|
|
200
|
+
|
|
201
|
+
**Your answer:**
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
### Question 4.8: Microphone Access
|
|
206
|
+
|
|
207
|
+
**Will your app use the microphone?**
|
|
208
|
+
|
|
209
|
+
A) ⭐ **Yes - Audio Recording**
|
|
210
|
+
- Record audio
|
|
211
|
+
- Requires: Microphone permission
|
|
212
|
+
- Best for: Voice notes, recording apps
|
|
213
|
+
|
|
214
|
+
B) **Yes - Voice Calls**
|
|
215
|
+
- Make voice/video calls
|
|
216
|
+
- Requires: Microphone permission
|
|
217
|
+
- Best for: Communication apps
|
|
218
|
+
|
|
219
|
+
C) **No Microphone Access**
|
|
220
|
+
- No audio recording
|
|
221
|
+
- Best for: Most apps
|
|
222
|
+
|
|
223
|
+
**Your answer:**
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
### Question 4.9: Third-Party SDKs
|
|
228
|
+
|
|
229
|
+
**What third-party SDKs will you integrate?**
|
|
230
|
+
|
|
231
|
+
**Analytics:**
|
|
232
|
+
- A) Firebase Analytics
|
|
233
|
+
- B) Mixpanel
|
|
234
|
+
- C) Amplitude
|
|
235
|
+
- D) None
|
|
236
|
+
|
|
237
|
+
**Crash Reporting:**
|
|
238
|
+
- A) Firebase Crashlytics
|
|
239
|
+
- B) Sentry
|
|
240
|
+
- C) Bugsnag
|
|
241
|
+
- D) None
|
|
242
|
+
|
|
243
|
+
**Authentication:**
|
|
244
|
+
- A) Firebase Auth
|
|
245
|
+
- B) Auth0
|
|
246
|
+
- C) AWS Cognito
|
|
247
|
+
- D) Custom backend
|
|
248
|
+
|
|
249
|
+
**Maps:**
|
|
250
|
+
- A) Google Maps
|
|
251
|
+
- B) Mapbox
|
|
252
|
+
- C) Apple Maps (iOS only)
|
|
253
|
+
- D) None
|
|
254
|
+
|
|
255
|
+
**Payments:**
|
|
256
|
+
- A) Stripe
|
|
257
|
+
- B) PayPal
|
|
258
|
+
- C) Apple Pay / Google Pay
|
|
259
|
+
- D) None
|
|
260
|
+
|
|
261
|
+
**Social Login:**
|
|
262
|
+
- A) Firebase Auth (Google, Facebook, Apple)
|
|
263
|
+
- B) Auth0 Social Connections
|
|
264
|
+
- C) Custom OAuth
|
|
265
|
+
- D) None
|
|
266
|
+
|
|
267
|
+
**Your answer:** (Select all that apply)
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### Question 4.10: Permission Request Strategy
|
|
272
|
+
|
|
273
|
+
**How will you request permissions?**
|
|
274
|
+
|
|
275
|
+
A) ⭐ **Just-In-Time** (Recommended)
|
|
276
|
+
- Request when feature is needed
|
|
277
|
+
- Explain why permission is needed
|
|
278
|
+
- Best for: Better user experience
|
|
279
|
+
|
|
280
|
+
B) **On First Launch**
|
|
281
|
+
- Request all permissions upfront
|
|
282
|
+
- Less ideal (can overwhelm users)
|
|
283
|
+
- Best for: Apps that need all permissions
|
|
284
|
+
|
|
285
|
+
C) **Progressive**
|
|
286
|
+
- Request permissions as features are discovered
|
|
287
|
+
- Best for: Apps with optional features
|
|
288
|
+
|
|
289
|
+
**Your answer:**
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### Question 4.11: Permission Denial Handling
|
|
294
|
+
|
|
295
|
+
**How will you handle denied permissions?**
|
|
296
|
+
|
|
297
|
+
A) ⭐ **Graceful Degradation** (Recommended)
|
|
298
|
+
- App works without permission
|
|
299
|
+
- Show alternative options
|
|
300
|
+
- Best for: Better UX
|
|
301
|
+
|
|
302
|
+
B) **Show Settings Prompt**
|
|
303
|
+
- Guide user to enable in settings
|
|
304
|
+
- Best for: Critical permissions
|
|
305
|
+
|
|
306
|
+
C) **Block Feature**
|
|
307
|
+
- Feature unavailable if permission denied
|
|
308
|
+
- Best for: Core features
|
|
309
|
+
|
|
310
|
+
**Your answer:**
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## ✅ Phase 4 Completion
|
|
315
|
+
|
|
316
|
+
After answering all questions, summarize:
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
320
|
+
✅ Phase 4 Complete: Permissions & Native Features
|
|
321
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
322
|
+
|
|
323
|
+
Selected Permissions:
|
|
324
|
+
- Camera: Photo capture (react-native-vision-camera)
|
|
325
|
+
- Location: When in use (@react-native-community/geolocation)
|
|
326
|
+
- Push Notifications: Yes (Firebase Cloud Messaging)
|
|
327
|
+
- Photo Library: Read only
|
|
328
|
+
- Biometric Auth: Face ID / Touch ID
|
|
329
|
+
|
|
330
|
+
Third-Party SDKs:
|
|
331
|
+
- Analytics: Firebase Analytics
|
|
332
|
+
- Crash Reporting: Firebase Crashlytics
|
|
333
|
+
- Maps: Google Maps
|
|
334
|
+
- Authentication: Firebase Auth
|
|
335
|
+
|
|
336
|
+
Permission Strategy: Just-In-Time requests with graceful degradation
|
|
337
|
+
|
|
338
|
+
Proceed to Phase 5 (Code Standards)? (Y/n)
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## 📝 Generated Documents
|
|
344
|
+
|
|
345
|
+
After Phase 4, generate/update:
|
|
346
|
+
|
|
347
|
+
- `docs/permissions.md` - Permission handling guide
|
|
348
|
+
- `docs/native-features.md` - Native features integration guide
|
|
349
|
+
- `ai-instructions.md` - Add permission and native feature rules
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
**Next Phase:** Phase 5 - Code Standards
|
|
354
|
+
|
|
355
|
+
Read: `.ai-flow/prompts/mobile/flow-docs-gen-phase-5-standards.md`
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
**Last Updated:** 2025-01-XX
|
|
360
|
+
|
|
361
|
+
**Version:** 1.4.0
|
|
362
|
+
|
|
363
|
+
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# Phase 5: Code Standards & Best Practices
|
|
2
|
+
|
|
3
|
+
**Duration:** 15-20 minutes
|
|
4
|
+
**Questions:** ~10 questions
|
|
5
|
+
**Output:** docs/code-standards.md, parts of ai-instructions.md
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🎯 Objective
|
|
10
|
+
|
|
11
|
+
Define coding conventions and standards for your mobile app:
|
|
12
|
+
|
|
13
|
+
1. File and component naming conventions
|
|
14
|
+
2. Code formatting and linting rules
|
|
15
|
+
3. Import organization
|
|
16
|
+
4. Commit message standards
|
|
17
|
+
5. Mobile-specific best practices
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📋 Questions
|
|
22
|
+
|
|
23
|
+
### Question 5.1: File Naming Convention
|
|
24
|
+
|
|
25
|
+
**How will you name your files?**
|
|
26
|
+
|
|
27
|
+
**If React Native:**
|
|
28
|
+
- A) ⭐ **PascalCase for components** (Recommended)
|
|
29
|
+
- Components: `UserProfile.tsx`, `Button.tsx`
|
|
30
|
+
- Screens: `HomeScreen.tsx`, `ProfileScreen.tsx`
|
|
31
|
+
- Hooks: `useAuth.ts`, `useLocalStorage.ts`
|
|
32
|
+
- Utils: `formatDate.ts`, `apiClient.ts`
|
|
33
|
+
|
|
34
|
+
- B) **kebab-case for all files**
|
|
35
|
+
- Components: `user-profile.tsx`, `button.tsx`
|
|
36
|
+
|
|
37
|
+
**If Flutter:**
|
|
38
|
+
- A) ⭐ **snake_case** (Dart convention)
|
|
39
|
+
- Files: `user_profile.dart`, `home_screen.dart`
|
|
40
|
+
- Classes: `UserProfile`, `HomeScreen`
|
|
41
|
+
|
|
42
|
+
**If Native iOS:**
|
|
43
|
+
- A) ⭐ **PascalCase** (Swift convention)
|
|
44
|
+
- Files: `UserProfile.swift`, `HomeViewController.swift`
|
|
45
|
+
|
|
46
|
+
**If Native Android:**
|
|
47
|
+
- A) ⭐ **PascalCase for classes, camelCase for files** (Kotlin convention)
|
|
48
|
+
- Files: `UserProfile.kt`, `HomeActivity.kt`
|
|
49
|
+
|
|
50
|
+
**Your answer:**
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### Question 5.2: Component/Screen Naming Convention
|
|
55
|
+
|
|
56
|
+
**How will you name components and screens?**
|
|
57
|
+
|
|
58
|
+
**If React Native:**
|
|
59
|
+
- A) ⭐ **PascalCase** (Recommended)
|
|
60
|
+
- Components: `<UserProfile />`, `<Button />`
|
|
61
|
+
- Screens: `<HomeScreen />`, `<ProfileScreen />`
|
|
62
|
+
|
|
63
|
+
**If Flutter:**
|
|
64
|
+
- A) ⭐ **PascalCase for widgets**
|
|
65
|
+
- Widgets: `UserProfile`, `HomeScreen`
|
|
66
|
+
|
|
67
|
+
**If Native:**
|
|
68
|
+
- A) ⭐ **PascalCase for classes**
|
|
69
|
+
- iOS: `UserProfileViewController`
|
|
70
|
+
- Android: `UserProfileActivity`
|
|
71
|
+
|
|
72
|
+
**Your answer:**
|
|
73
|
+
|
|
74
|
+
**Named exports vs default exports?**
|
|
75
|
+
|
|
76
|
+
**If React Native:**
|
|
77
|
+
- A) ⭐ **Named exports** (Recommended)
|
|
78
|
+
```typescript
|
|
79
|
+
export const Button = () => { ... }
|
|
80
|
+
// Usage: import { Button } from './Button'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- B) **Default exports**
|
|
84
|
+
```typescript
|
|
85
|
+
export default function Button() { ... }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Your answer:**
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Question 5.3: Linting & Formatting
|
|
93
|
+
|
|
94
|
+
**What linting/formatting tools will you use?**
|
|
95
|
+
|
|
96
|
+
**If React Native:**
|
|
97
|
+
- A) ⭐ **ESLint + Prettier** (Recommended)
|
|
98
|
+
- ESLint: Code quality rules
|
|
99
|
+
- Prettier: Code formatting
|
|
100
|
+
|
|
101
|
+
- B) **Biome** (All-in-one, faster)
|
|
102
|
+
|
|
103
|
+
**If Flutter:**
|
|
104
|
+
- A) ⭐ **dart format** (Built-in)
|
|
105
|
+
- B) **dart analyze** (Linting)
|
|
106
|
+
|
|
107
|
+
**If Native iOS:**
|
|
108
|
+
- A) ⭐ **SwiftLint** (Recommended)
|
|
109
|
+
- B) **SwiftFormat**
|
|
110
|
+
|
|
111
|
+
**If Native Android:**
|
|
112
|
+
- A) ⭐ **ktlint** (Recommended)
|
|
113
|
+
- B) **Detekt**
|
|
114
|
+
|
|
115
|
+
**Your answer:**
|
|
116
|
+
|
|
117
|
+
**ESLint config (if React Native):**
|
|
118
|
+
- A) ⭐ **@react-native-community/eslint-config**
|
|
119
|
+
- B) **eslint-config-airbnb**
|
|
120
|
+
- C) **Custom config**
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### Question 5.4: Import Organization
|
|
125
|
+
|
|
126
|
+
**How will you organize imports?**
|
|
127
|
+
|
|
128
|
+
**If React Native:**
|
|
129
|
+
```typescript
|
|
130
|
+
// 1. External libraries
|
|
131
|
+
import React from 'react';
|
|
132
|
+
import { useQuery } from '@tanstack/react-query';
|
|
133
|
+
|
|
134
|
+
// 2. Internal modules
|
|
135
|
+
import { Button } from '@/components/Button';
|
|
136
|
+
import { useAuth } from '@/hooks/useAuth';
|
|
137
|
+
|
|
138
|
+
// 3. Relative imports
|
|
139
|
+
import { UserCard } from './UserCard';
|
|
140
|
+
|
|
141
|
+
// 4. Types
|
|
142
|
+
import type { User } from '@/types';
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**If Flutter:**
|
|
146
|
+
```dart
|
|
147
|
+
// 1. Dart SDK
|
|
148
|
+
import 'dart:async';
|
|
149
|
+
|
|
150
|
+
// 2. External packages
|
|
151
|
+
import 'package:flutter/material.dart';
|
|
152
|
+
import 'package:provider/provider.dart';
|
|
153
|
+
|
|
154
|
+
// 3. Internal modules
|
|
155
|
+
import 'package:myapp/models/user.dart';
|
|
156
|
+
import 'package:myapp/services/auth_service.dart';
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Your answer:**
|
|
160
|
+
|
|
161
|
+
**Import alias for src/?**
|
|
162
|
+
- `@/` (React Native)
|
|
163
|
+
- `~/` (Alternative)
|
|
164
|
+
- No alias (relative paths only)
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Question 5.5: TypeScript/Dart Strictness
|
|
169
|
+
|
|
170
|
+
**How strict should TypeScript/Dart be?**
|
|
171
|
+
|
|
172
|
+
**If React Native (TypeScript):**
|
|
173
|
+
- A) ⭐ **Strict mode** (Recommended)
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"strict": true,
|
|
177
|
+
"noUncheckedIndexedAccess": true
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
- B) **Moderate**
|
|
182
|
+
- C) **Lenient**
|
|
183
|
+
|
|
184
|
+
**If Flutter (Dart):**
|
|
185
|
+
- A) ⭐ **Strict analysis** (Recommended)
|
|
186
|
+
```yaml
|
|
187
|
+
analyzer:
|
|
188
|
+
errors:
|
|
189
|
+
invalid_annotation_target: error
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Your answer:**
|
|
193
|
+
|
|
194
|
+
**`any` type policy (TypeScript):**
|
|
195
|
+
- A) ❌ Never allow `any`
|
|
196
|
+
- B) ⚠️ Allow with warning
|
|
197
|
+
- C) ✅ Allow freely (not recommended)
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### Question 5.6: Code Comments
|
|
202
|
+
|
|
203
|
+
**What's your commenting policy?**
|
|
204
|
+
|
|
205
|
+
A) ⭐ **JSDoc for public APIs, inline for complex logic** (Recommended)
|
|
206
|
+
```typescript
|
|
207
|
+
/**
|
|
208
|
+
* Fetches user data from the API
|
|
209
|
+
* @param userId - The user's unique identifier
|
|
210
|
+
* @returns User object or null if not found
|
|
211
|
+
*/
|
|
212
|
+
export async function fetchUser(userId: string): Promise<User | null> {
|
|
213
|
+
// Check cache first
|
|
214
|
+
const cached = cache.get(userId);
|
|
215
|
+
if (cached) return cached;
|
|
216
|
+
return api.get(`/users/${userId}`);
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
B) **JSDoc everywhere**
|
|
221
|
+
C) **Minimal comments**
|
|
222
|
+
D) **No comment policy**
|
|
223
|
+
|
|
224
|
+
**Your answer:**
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### Question 5.7: Component/Screen Structure
|
|
229
|
+
|
|
230
|
+
**How will you structure components and screens?**
|
|
231
|
+
|
|
232
|
+
**If React Native:**
|
|
233
|
+
```
|
|
234
|
+
screens/
|
|
235
|
+
├── HomeScreen/
|
|
236
|
+
│ ├── HomeScreen.tsx
|
|
237
|
+
│ ├── HomeScreen.test.tsx
|
|
238
|
+
│ ├── HomeScreen.styles.ts
|
|
239
|
+
│ └── index.ts
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**If Flutter:**
|
|
243
|
+
```
|
|
244
|
+
lib/
|
|
245
|
+
├── screens/
|
|
246
|
+
│ ├── home_screen.dart
|
|
247
|
+
│ └── home_screen_test.dart
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Your answer:**
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
### Question 5.8: Error Handling Patterns
|
|
255
|
+
|
|
256
|
+
**How will you handle errors?**
|
|
257
|
+
|
|
258
|
+
**If React Native:**
|
|
259
|
+
- A) ⭐ **Error Boundaries + Try-Catch**
|
|
260
|
+
- Error Boundaries for render errors
|
|
261
|
+
- Try-Catch for async errors
|
|
262
|
+
|
|
263
|
+
**If Flutter:**
|
|
264
|
+
- A) ⭐ **Try-Catch + Global Error Handler**
|
|
265
|
+
- FlutterError.onError for global errors
|
|
266
|
+
|
|
267
|
+
**If Native:**
|
|
268
|
+
- A) ⭐ **Try-Catch + Crash Reporting**
|
|
269
|
+
- Sentry, Firebase Crashlytics
|
|
270
|
+
|
|
271
|
+
**Your answer:**
|
|
272
|
+
|
|
273
|
+
**Error logging:**
|
|
274
|
+
- Firebase Crashlytics
|
|
275
|
+
- Sentry
|
|
276
|
+
- Console only (development)
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
### Question 5.9: Mobile-Specific Best Practices
|
|
281
|
+
|
|
282
|
+
**What mobile-specific practices will you enforce?**
|
|
283
|
+
|
|
284
|
+
Select all that apply:
|
|
285
|
+
|
|
286
|
+
- [ ] **Performance:** Avoid unnecessary re-renders
|
|
287
|
+
- [ ] **Memory:** Dispose resources properly (listeners, timers)
|
|
288
|
+
- [ ] **Battery:** Optimize background tasks
|
|
289
|
+
- [ ] **Network:** Handle offline scenarios gracefully
|
|
290
|
+
- [ ] **Permissions:** Request permissions just-in-time
|
|
291
|
+
- [ ] **Accessibility:** Support screen readers (TalkBack/VoiceOver)
|
|
292
|
+
- [ ] **Platform Differences:** Handle iOS vs Android differences
|
|
293
|
+
- [ ] **App State:** Handle app backgrounding/foregrounding
|
|
294
|
+
- [ ] **Deep Links:** Support universal links/app links
|
|
295
|
+
- [ ] **Push Notifications:** Handle notification taps
|
|
296
|
+
|
|
297
|
+
**Your answer:**
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
### Question 5.10: Commit Message Convention
|
|
302
|
+
|
|
303
|
+
**What commit message format will you use?**
|
|
304
|
+
|
|
305
|
+
A) ⭐ **Conventional Commits** (Recommended)
|
|
306
|
+
```
|
|
307
|
+
<type>(<scope>): <subject>
|
|
308
|
+
|
|
309
|
+
<body>
|
|
310
|
+
|
|
311
|
+
<footer>
|
|
312
|
+
```
|
|
313
|
+
- Types: feat, fix, docs, style, refactor, test, chore
|
|
314
|
+
- Example: `feat(auth): add biometric login`
|
|
315
|
+
|
|
316
|
+
B) **Simple descriptive**
|
|
317
|
+
C) **No convention**
|
|
318
|
+
|
|
319
|
+
**Your answer:**
|
|
320
|
+
|
|
321
|
+
**Enforce with:**
|
|
322
|
+
- commitlint (pre-commit hook)
|
|
323
|
+
- Manual review
|
|
324
|
+
- No enforcement
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## ✅ Phase 5 Completion
|
|
329
|
+
|
|
330
|
+
After answering all questions, summarize:
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
334
|
+
✅ Phase 5 Complete: Code Standards
|
|
335
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
336
|
+
|
|
337
|
+
Selected Standards:
|
|
338
|
+
- File Naming: PascalCase for components
|
|
339
|
+
- Linting: ESLint + Prettier
|
|
340
|
+
- TypeScript: Strict mode
|
|
341
|
+
- Import Organization: Grouped by type
|
|
342
|
+
- Error Handling: Error Boundaries + Try-Catch
|
|
343
|
+
- Commit Messages: Conventional Commits
|
|
344
|
+
|
|
345
|
+
Proceed to Phase 6 (Testing Strategy)? (Y/n)
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 📝 Generated Documents
|
|
351
|
+
|
|
352
|
+
After Phase 5, generate/update:
|
|
353
|
+
|
|
354
|
+
- `docs/code-standards.md` - Code standards and conventions
|
|
355
|
+
- `ai-instructions.md` - Add code standards rules
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
**Next Phase:** Phase 6 - Testing Strategy
|
|
360
|
+
|
|
361
|
+
Read: `.ai-flow/prompts/mobile/flow-docs-gen-phase-6-testing.md`
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
**Last Updated:** 2025-01-XX
|
|
366
|
+
|
|
367
|
+
**Version:** 1.4.0
|
|
368
|
+
|
|
369
|
+
|