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.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +408 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +791 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/fs-utils.d.ts +2 -0
  8. package/dist/fs-utils.d.ts.map +1 -0
  9. package/dist/fs-utils.js +46 -0
  10. package/dist/fs-utils.js.map +1 -0
  11. package/package.json +71 -0
  12. package/prompts/backend/flow-dev-feature.md +1318 -0
  13. package/prompts/backend/flow-dev-fix.md +903 -0
  14. package/prompts/backend/flow-dev-refactor.md +715 -0
  15. package/prompts/backend/flow-dev-review.md +401 -0
  16. package/prompts/backend/flow-dev-work.md +1129 -0
  17. package/prompts/backend/flow-docs-gen-phase-0.md +1840 -0
  18. package/prompts/backend/flow-docs-gen-phase-1.md +435 -0
  19. package/prompts/backend/flow-docs-gen-phase-2.md +460 -0
  20. package/prompts/backend/flow-docs-gen-phase-3.md +684 -0
  21. package/prompts/backend/flow-docs-gen-phase-4.md +516 -0
  22. package/prompts/backend/flow-docs-gen-phase-5.md +637 -0
  23. package/prompts/backend/flow-docs-gen-phase-6.md +465 -0
  24. package/prompts/backend/flow-docs-gen-phase-7.md +1207 -0
  25. package/prompts/backend/flow-docs-gen.md +820 -0
  26. package/prompts/backend/flow-docs-sync.md +526 -0
  27. package/prompts/backend/flow-project-init.md +248 -0
  28. package/prompts/backend/flow-project-roadmap.md +1159 -0
  29. package/prompts/frontend/flow-docs-gen-phase-0.md +494 -0
  30. package/prompts/frontend/flow-docs-gen-phase-1.md +449 -0
  31. package/prompts/frontend/flow-docs-gen-phase-2.md +983 -0
  32. package/prompts/frontend/flow-docs-gen-phase-3.md +685 -0
  33. package/prompts/frontend/flow-docs-gen-phase-4.md +480 -0
  34. package/prompts/frontend/flow-docs-gen-phase-5.md +483 -0
  35. package/prompts/frontend/flow-docs-gen-phase-6.md +570 -0
  36. package/prompts/frontend/flow-docs-gen-phase-7.md +582 -0
  37. package/prompts/frontend/flow-docs-gen.md +413 -0
  38. package/prompts/frontend/flow-docs-sync.md +561 -0
  39. package/prompts/mobile/flow-docs-gen-phase-0.md +387 -0
  40. package/prompts/mobile/flow-docs-gen-phase-1.md +530 -0
  41. package/prompts/mobile/flow-docs-gen-phase-2.md +584 -0
  42. package/prompts/mobile/flow-docs-gen-phase-3.md +659 -0
  43. package/prompts/mobile/flow-docs-gen-phase-4.md +363 -0
  44. package/prompts/mobile/flow-docs-gen-phase-5.md +369 -0
  45. package/prompts/mobile/flow-docs-gen-phase-6.md +490 -0
  46. package/prompts/mobile/flow-docs-gen-phase-7.md +407 -0
  47. package/prompts/mobile/flow-docs-gen.md +430 -0
  48. package/prompts/mobile/flow-docs-sync.md +634 -0
  49. package/templates/backend/.clauderules.template +111 -0
  50. package/templates/backend/.cursorrules.template +102 -0
  51. package/templates/backend/.env.example.template +122 -0
  52. package/templates/backend/README.template.md +200 -0
  53. package/templates/backend/ai-instructions.template.md +354 -0
  54. package/templates/backend/copilot-instructions.template.md +160 -0
  55. package/templates/backend/docs/api.template.md +251 -0
  56. package/templates/backend/docs/architecture.template.md +612 -0
  57. package/templates/backend/docs/business-flows.template.md +109 -0
  58. package/templates/backend/docs/code-standards.template.md +828 -0
  59. package/templates/backend/docs/contributing.template.md +163 -0
  60. package/templates/backend/docs/data-model.template.md +416 -0
  61. package/templates/backend/docs/operations.template.md +591 -0
  62. package/templates/backend/docs/testing.template.md +762 -0
  63. package/templates/backend/project-brief.template.md +176 -0
  64. package/templates/backend/specs/configuration.template.md +133 -0
  65. package/templates/backend/specs/security.template.md +422 -0
  66. package/templates/frontend/README.template.md +121 -0
  67. package/templates/frontend/ai-instructions.template.md +368 -0
  68. package/templates/frontend/docs/api-integration.template.md +390 -0
  69. package/templates/frontend/docs/components.template.md +567 -0
  70. package/templates/frontend/docs/error-handling.template.md +385 -0
  71. package/templates/frontend/docs/operations.template.md +123 -0
  72. package/templates/frontend/docs/performance.template.md +140 -0
  73. package/templates/frontend/docs/pwa.template.md +135 -0
  74. package/templates/frontend/docs/state-management.template.md +394 -0
  75. package/templates/frontend/docs/styling.template.md +779 -0
  76. package/templates/frontend/docs/testing.template.md +736 -0
  77. package/templates/frontend/project-brief.template.md +55 -0
  78. package/templates/frontend/specs/accessibility.template.md +111 -0
  79. package/templates/frontend/specs/configuration.template.md +520 -0
  80. package/templates/frontend/specs/security.template.md +197 -0
  81. package/templates/fullstack/README.template.md +282 -0
  82. package/templates/fullstack/ai-instructions.template.md +487 -0
  83. package/templates/fullstack/project-brief.template.md +197 -0
  84. package/templates/fullstack/specs/configuration.template.md +380 -0
  85. package/templates/mobile/AGENT.template.md +251 -0
  86. package/templates/mobile/README.template.md +195 -0
  87. package/templates/mobile/ai-instructions.template.md +221 -0
  88. package/templates/mobile/docs/app-store.template.md +163 -0
  89. package/templates/mobile/docs/architecture.template.md +100 -0
  90. package/templates/mobile/docs/native-features.template.md +137 -0
  91. package/templates/mobile/docs/navigation.template.md +81 -0
  92. package/templates/mobile/docs/offline-strategy.template.md +90 -0
  93. package/templates/mobile/docs/permissions.template.md +70 -0
  94. package/templates/mobile/docs/state-management.template.md +116 -0
  95. package/templates/mobile/docs/testing.template.md +146 -0
  96. package/templates/mobile/project-brief.template.md +97 -0
  97. package/templates/mobile/specs/build-configuration.template.md +116 -0
  98. package/templates/mobile/specs/deployment.template.md +114 -0
  99. package/templates/shared/AGENT.template.md +252 -0
@@ -0,0 +1,490 @@
1
+ # Phase 6: Testing Strategy
2
+
3
+ **Duration:** 15-25 minutes
4
+ **Questions:** ~12 questions
5
+ **Output:** docs/testing.md, parts of ai-instructions.md
6
+
7
+ ---
8
+
9
+ ## 🎯 Objective
10
+
11
+ Define your mobile testing strategy:
12
+
13
+ 1. What testing frameworks will you use?
14
+ 2. What types of tests will you write?
15
+ 3. How will you test on devices/emulators?
16
+ 4. What coverage targets?
17
+ 5. How will tests run in CI/CD?
18
+
19
+ ---
20
+
21
+ ## 📋 Questions
22
+
23
+ ### Question 6.1: Unit Testing Framework
24
+
25
+ **What unit test framework will you use?**
26
+
27
+ **If React Native:**
28
+ - A) ⭐ **Jest** (Recommended)
29
+ - Built-in with React Native
30
+ - Snapshot testing
31
+ - Best for: Most React Native apps
32
+
33
+ - B) **Vitest**
34
+ - Faster, ESM native
35
+ - Best for: Modern setups
36
+
37
+ **If Flutter:**
38
+ - A) ⭐ **Flutter Test** (Built-in)
39
+ - Widget testing
40
+ - Unit testing
41
+ - Best for: All Flutter apps
42
+
43
+ **If Native iOS:**
44
+ - A) ⭐ **XCTest** (Built-in)
45
+ - Unit tests
46
+ - UI tests
47
+ - Best for: All iOS apps
48
+
49
+ **If Native Android:**
50
+ - A) ⭐ **JUnit** (Standard)
51
+ - Unit tests
52
+ - Best for: All Android apps
53
+
54
+ **Your answer:**
55
+
56
+ ---
57
+
58
+ ### Question 6.2: Component/Screen Testing
59
+
60
+ **How will you test components and screens?**
61
+
62
+ **If React Native:**
63
+ - A) ⭐ **React Native Testing Library** (Recommended)
64
+ - User-centric testing
65
+ - Accessible queries
66
+ - Best for: All React Native apps
67
+
68
+ **If Flutter:**
69
+ - A) ⭐ **Widget Testing** (Built-in)
70
+ - Test widgets in isolation
71
+ - Best for: All Flutter apps
72
+
73
+ **If Native iOS:**
74
+ - A) ⭐ **XCUITest** (Built-in)
75
+ - UI testing framework
76
+ - Best for: All iOS apps
77
+
78
+ **If Native Android:**
79
+ - A) ⭐ **Espresso** (Recommended)
80
+ - UI testing framework
81
+ - Best for: All Android apps
82
+
83
+ **Your answer:**
84
+
85
+ ---
86
+
87
+ ### Question 6.3: E2E Testing Framework
88
+
89
+ **What E2E testing tool will you use?**
90
+
91
+ **If React Native:**
92
+ - A) ⭐ **Detox** (Recommended)
93
+ - Gray-box E2E testing
94
+ - Works with iOS and Android
95
+ - Best for: Most React Native apps
96
+
97
+ - B) **Maestro**
98
+ - Declarative E2E testing
99
+ - Cross-platform
100
+ - Best for: Simple E2E flows
101
+
102
+ - C) **Appium**
103
+ - WebDriver-based
104
+ - Cross-platform
105
+ - Best for: Complex E2E scenarios
106
+
107
+ **If Flutter:**
108
+ - A) ⭐ **Integration Test** (Built-in)
109
+ - Flutter's integration testing
110
+ - Best for: Most Flutter apps
111
+
112
+ - B) **Maestro**
113
+ - Declarative E2E testing
114
+ - Best for: Simple E2E flows
115
+
116
+ **If Native:**
117
+ - A) ⭐ **Appium** (Recommended)
118
+ - Cross-platform
119
+ - Works with iOS and Android
120
+ - Best for: Native apps
121
+
122
+ **Your answer:**
123
+
124
+ ---
125
+
126
+ ### Question 6.4: Testing on Physical Devices
127
+
128
+ **How will you test on physical devices?**
129
+
130
+ A) ⭐ **TestFlight (iOS) + Firebase App Distribution (Android)** (Recommended)
131
+ - Beta testing on real devices
132
+ - Best for: Most apps
133
+
134
+ B) **TestFlight (iOS) + Google Play Internal Testing (Android)**
135
+ - Official store channels
136
+ - Best for: Store-focused testing
137
+
138
+ C) **Device Farm Services**
139
+ - AWS Device Farm
140
+ - BrowserStack App Automate
141
+ - Sauce Labs
142
+ - Best for: Multiple device testing
143
+
144
+ D) **Manual Testing Only**
145
+ - Test on personal devices
146
+ - Best for: Small teams, MVPs
147
+
148
+ **Your answer:**
149
+
150
+ ---
151
+
152
+ ### Question 6.5: Emulator/Simulator Strategy
153
+
154
+ **How will you use emulators/simulators?**
155
+
156
+ A) ⭐ **Local Emulators + CI Emulators** (Recommended)
157
+ - Develop locally with iOS Simulator / Android Emulator
158
+ - Run tests in CI with emulators
159
+ - Best for: Most teams
160
+
161
+ B) **Local Only**
162
+ - No CI emulator testing
163
+ - Best for: Small teams
164
+
165
+ C) **Cloud Emulators Only**
166
+ - Use cloud services for all testing
167
+ - Best for: Teams without local setup
168
+
169
+ **Your answer:**
170
+
171
+ ---
172
+
173
+ ### Question 6.6: Testing Pyramid Distribution
174
+
175
+ **What test distribution will you target?**
176
+
177
+ A) ⭐ **Standard Pyramid** (Recommended)
178
+ - 70% Unit tests
179
+ - 20% Integration tests
180
+ - 10% E2E tests
181
+ - Best for: Most apps
182
+
183
+ B) **Heavy Unit**
184
+ - 85% Unit tests
185
+ - 10% Integration tests
186
+ - 5% E2E tests
187
+ - Best for: Logic-heavy apps
188
+
189
+ C) **Heavy Integration**
190
+ - 50% Unit tests
191
+ - 40% Integration tests
192
+ - 10% E2E tests
193
+ - Best for: UI-heavy apps
194
+
195
+ **Your answer:**
196
+
197
+ ---
198
+
199
+ #### 🎨 MOBILE TESTING PYRAMID VISUALIZATION
200
+
201
+ **Use this diagram format** to visualize mobile test distribution strategy:
202
+
203
+ ```mermaid
204
+ graph TB
205
+ subgraph "Mobile Testing Pyramid"
206
+ E2E["📱 E2E Tests (10%)<br/>Detox/Appium<br/>Slow, Expensive<br/>Full user flows on device"]
207
+ INT["🔗 Integration Tests (20%)<br/>Component + API<br/>Medium Speed<br/>Screen rendering + navigation"]
208
+ UNIT["⚡ Unit Tests (70%)<br/>Jest/XCTest<br/>Fast, Cheap<br/>Business logic, hooks, utilities"]
209
+ end
210
+
211
+ E2E --> INT
212
+ INT --> UNIT
213
+
214
+ style E2E fill:#fce4ec,stroke:#c2185b,stroke-width:2px
215
+ style INT fill:#fff4e6,stroke:#f57c00,stroke-width:2px
216
+ style UNIT fill:#e8f5e9,stroke:#388e3c,stroke-width:3px
217
+
218
+ classDef note fill:#f5f5f5,stroke:#666,stroke-dasharray: 5 5
219
+
220
+ note1["Run on Real Devices/Emulators<br/>Test platform-specific behavior<br/>Slow feedback (minutes)"]:::note
221
+ note2["Test screen components<br/>Navigation flows<br/>API integration<br/>Medium feedback"]:::note
222
+ note3["Test pure functions<br/>Redux reducers<br/>Utilities, validators<br/>Fast feedback (seconds)"]:::note
223
+
224
+ E2E -.-> note1
225
+ INT -.-> note2
226
+ UNIT -.-> note3
227
+ ```
228
+
229
+ **Mobile-Specific Testing Layers:**
230
+
231
+ ```mermaid
232
+ graph TB
233
+ subgraph "Mobile Test Types"
234
+ E2E_LAYER["E2E Layer<br/>Detox, Maestro, Appium"]
235
+ SCREEN_LAYER["Screen Tests<br/>React Native Testing Library<br/>Flutter Widget Tests"]
236
+ COMPONENT_LAYER["Component Tests<br/>Rendering, Props, Events"]
237
+ LOGIC_LAYER["Unit Tests<br/>Hooks, Utils, State Logic"]
238
+ STATIC_LAYER["Static Analysis<br/>TypeScript, ESLint"]
239
+ end
240
+
241
+ E2E_LAYER --> SCREEN_LAYER
242
+ SCREEN_LAYER --> COMPONENT_LAYER
243
+ COMPONENT_LAYER --> LOGIC_LAYER
244
+ LOGIC_LAYER --> STATIC_LAYER
245
+
246
+ DEVICES["Real Devices<br/>iOS + Android"]
247
+ EMULATORS["Emulators/Simulators<br/>Fast feedback"]
248
+
249
+ E2E_LAYER -.->|Run on| DEVICES
250
+ SCREEN_LAYER -.->|Run on| EMULATORS
251
+
252
+ style E2E_LAYER fill:#fce4ec,stroke:#c2185b,stroke-width:2px
253
+ style SCREEN_LAYER fill:#fff4e6,stroke:#f57c00,stroke-width:2px
254
+ style COMPONENT_LAYER fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
255
+ style LOGIC_LAYER fill:#e1f5ff,stroke:#1976d2,stroke-width:2px
256
+ style STATIC_LAYER fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
257
+ ```
258
+
259
+ **Platform-Specific Testing Considerations:**
260
+
261
+ ```mermaid
262
+ graph LR
263
+ subgraph "Cross-Platform Mobile Testing"
264
+ SHARED[Shared Business Logic<br/>Unit Tests (Jest)]
265
+ RN_SCREEN[React Native<br/>Screen Tests]
266
+ FLUTTER_WIDGET[Flutter<br/>Widget Tests]
267
+ end
268
+
269
+ subgraph "Platform Tests"
270
+ IOS_E2E[iOS E2E<br/>XCUITest/Detox]
271
+ ANDROID_E2E[Android E2E<br/>Espresso/Detox]
272
+ end
273
+
274
+ SHARED --> RN_SCREEN
275
+ SHARED --> FLUTTER_WIDGET
276
+
277
+ RN_SCREEN --> IOS_E2E
278
+ RN_SCREEN --> ANDROID_E2E
279
+
280
+ FLUTTER_WIDGET --> IOS_E2E
281
+ FLUTTER_WIDGET --> ANDROID_E2E
282
+
283
+ style SHARED fill:#e8f5e9
284
+ style RN_SCREEN fill:#e1f5ff
285
+ style FLUTTER_WIDGET fill:#e1f5ff
286
+ style IOS_E2E fill:#fce4ec
287
+ style ANDROID_E2E fill:#fff4e6
288
+ ```
289
+
290
+ **When to Use Each Diagram:**
291
+
292
+ - **Testing Pyramid**: Best for understanding test distribution strategy
293
+ - **Mobile Test Types**: Best for showing all testing layers including emulators/devices
294
+ - **Cross-Platform**: Best for React Native/Flutter apps with shared logic
295
+
296
+ **Diagram Guidelines:**
297
+ - Color code by test type (E2E=pink, Integration=orange, Unit=green)
298
+ - Show device vs emulator distinction
299
+ - Include platform-specific considerations (iOS/Android)
300
+ - Highlight speed/cost trade-offs
301
+ - Update percentages based on selected strategy (A, B, or C)
302
+
303
+ ---
304
+
305
+ ---
306
+
307
+ ### Question 6.7: Code Coverage Targets
308
+
309
+ **What code coverage targets will you set?**
310
+
311
+ A) ⭐ **80% Overall** (Recommended)
312
+ - 80% line coverage
313
+ - 70% branch coverage
314
+ - Best for: Most apps
315
+
316
+ B) **90% Overall**
317
+ - 90% line coverage
318
+ - 80% branch coverage
319
+ - Best for: Critical apps
320
+
321
+ C) **70% Overall**
322
+ - 70% line coverage
323
+ - 60% branch coverage
324
+ - Best for: MVPs, small apps
325
+
326
+ D) **No Coverage Target**
327
+ - Test what's important
328
+ - Best for: Very small projects
329
+
330
+ **Your answer:**
331
+
332
+ ---
333
+
334
+ ### Question 6.8: Snapshot Testing
335
+
336
+ **Will you use snapshot testing?**
337
+
338
+ **If React Native:**
339
+ - A) ⭐ **Yes - Jest Snapshots** (Recommended)
340
+ - Catch unintended UI changes
341
+ - Best for: Component regression testing
342
+
343
+ - B) **No Snapshot Testing**
344
+ - Manual visual review
345
+ - Best for: Rapidly changing UIs
346
+
347
+ **If Flutter:**
348
+ - A) ⭐ **Yes - Golden Tests** (Recommended)
349
+ - Flutter's snapshot testing
350
+ - Best for: Widget regression testing
351
+
352
+ **Your answer:**
353
+
354
+ ---
355
+
356
+ ### Question 6.9: Performance Testing
357
+
358
+ **Will you test app performance?**
359
+
360
+ A) ⭐ **Yes - Basic Performance** (Recommended)
361
+ - App launch time
362
+ - Screen render time
363
+ - Memory usage
364
+ - Best for: Most apps
365
+
366
+ B) **Yes - Comprehensive Performance**
367
+ - FPS monitoring
368
+ - Network performance
369
+ - Battery usage
370
+ - Best for: Performance-critical apps
371
+
372
+ C) **No Performance Testing**
373
+ - Manual testing only
374
+ - Best for: MVPs
375
+
376
+ **Your answer:**
377
+
378
+ ---
379
+
380
+ ### Question 6.10: Accessibility Testing
381
+
382
+ **Will you test accessibility?**
383
+
384
+ A) ⭐ **Yes - Basic Accessibility** (Recommended)
385
+ - Screen reader support (TalkBack/VoiceOver)
386
+ - Touch target sizes
387
+ - Color contrast
388
+ - Best for: Most apps
389
+
390
+ B) **Yes - Comprehensive Accessibility**
391
+ - WCAG 2.1 AA compliance
392
+ - Full accessibility audit
393
+ - Best for: Public-facing apps
394
+
395
+ C) **No Accessibility Testing**
396
+ - Not a priority
397
+ - Best for: Internal apps
398
+
399
+ **Your answer:**
400
+
401
+ ---
402
+
403
+ ### Question 6.11: CI/CD Testing Strategy
404
+
405
+ **How will tests run in CI/CD?**
406
+
407
+ A) ⭐ **Run All Tests on PR** (Recommended)
408
+ - Unit tests: Fast (<5 min)
409
+ - Integration tests: Medium (<15 min)
410
+ - E2E tests: Slow (<30 min)
411
+ - Best for: Most teams
412
+
413
+ B) **Run Unit Tests on PR, E2E on Merge**
414
+ - Faster PR feedback
415
+ - E2E on main branch
416
+ - Best for: Large teams
417
+
418
+ C) **Run Tests Manually**
419
+ - No automated testing
420
+ - Best for: Very small teams
421
+
422
+ **Your answer:**
423
+
424
+ ---
425
+
426
+ ### Question 6.12: Test Data Management
427
+
428
+ **How will you manage test data?**
429
+
430
+ A) ⭐ **Mock Data + Test Fixtures** (Recommended)
431
+ - Mock API responses
432
+ - Use fixtures for consistent data
433
+ - Best for: Most apps
434
+
435
+ B) **Test Database**
436
+ - Separate test database
437
+ - Best for: Integration testing
438
+
439
+ C) **Real API (Staging)**
440
+ - Use staging environment
441
+ - Best for: E2E testing
442
+
443
+ **Your answer:**
444
+
445
+ ---
446
+
447
+ ## ✅ Phase 6 Completion
448
+
449
+ After answering all questions, summarize:
450
+
451
+ ```
452
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
453
+ ✅ Phase 6 Complete: Testing Strategy
454
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
455
+
456
+ Selected Testing Stack:
457
+ - Unit Tests: Jest (React Native Testing Library)
458
+ - E2E Tests: Detox
459
+ - Device Testing: TestFlight + Firebase App Distribution
460
+ - Coverage Target: 80% overall
461
+ - Snapshot Testing: Yes (Jest Snapshots)
462
+ - Performance Testing: Basic
463
+ - Accessibility Testing: Basic
464
+ - CI/CD: Run all tests on PR
465
+
466
+ Proceed to Phase 7 (Store Deployment)? (Y/n)
467
+ ```
468
+
469
+ ---
470
+
471
+ ## 📝 Generated Documents
472
+
473
+ After Phase 6, generate/update:
474
+
475
+ - `docs/testing.md` - Testing strategy and setup guide
476
+ - `ai-instructions.md` - Add testing rules
477
+
478
+ ---
479
+
480
+ **Next Phase:** Phase 7 - Store Deployment
481
+
482
+ Read: `.ai-flow/prompts/mobile/flow-docs-gen-phase-7-deployment.md`
483
+
484
+ ---
485
+
486
+ **Last Updated:** 2025-01-XX
487
+
488
+ **Version:** 1.4.0
489
+
490
+