ai-flow-dev 2.1.3 → 2.1.5
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/README.md +25 -38
- package/dist/cli.js +68 -46
- package/dist/cli.js.map +1 -1
- package/package.json +5 -5
- package/prompts/backend/flow-build-phase-0.md +31 -63
- package/prompts/backend/flow-build-phase-1.md +9 -17
- package/prompts/backend/flow-build-phase-10.md +199 -585
- package/prompts/backend/flow-build-phase-2.md +152 -86
- package/prompts/backend/flow-build-phase-3.md +108 -68
- package/prompts/backend/flow-build-phase-4.md +5 -8
- package/prompts/backend/flow-build-phase-5.md +39 -12
- package/prompts/backend/flow-build-phase-6.md +29 -8
- package/prompts/backend/flow-build-phase-7.md +120 -40
- package/prompts/backend/flow-build-phase-8.md +28 -65
- package/prompts/backend/flow-build-phase-9.md +267 -1298
- package/prompts/backend/flow-build.md +881 -957
- package/prompts/backend/flow-dev-commit.md +27 -50
- package/prompts/backend/flow-dev-feature.md +1929 -2017
- package/prompts/backend/flow-dev-fix.md +936 -964
- package/prompts/backend/flow-dev-refactor.md +672 -701
- package/prompts/backend/flow-dev-review.md +356 -389
- package/prompts/backend/flow-dev-work.md +1066 -1118
- package/prompts/backend/flow-docs-sync.md +20 -196
- package/prompts/frontend/flow-build-phase-0.md +503 -484
- package/prompts/frontend/flow-build-phase-1.md +445 -433
- package/prompts/frontend/flow-build-phase-2.md +910 -957
- package/prompts/frontend/flow-build-phase-3.md +692 -664
- package/prompts/frontend/flow-build-phase-4.md +478 -463
- package/prompts/frontend/flow-build-phase-5.md +488 -467
- package/prompts/frontend/flow-build-phase-6.md +571 -550
- package/prompts/frontend/flow-build-phase-7.md +560 -592
- package/prompts/frontend/flow-build-phase-8.md +17 -42
- package/prompts/frontend/flow-build.md +457 -503
- package/prompts/frontend/flow-docs-sync.md +14 -35
- package/prompts/mobile/flow-build-phase-0.md +104 -97
- package/prompts/mobile/flow-build-phase-1.md +137 -122
- package/prompts/mobile/flow-build-phase-2.md +123 -130
- package/prompts/mobile/flow-build-phase-3.md +144 -149
- package/prompts/mobile/flow-build-phase-4.md +140 -132
- package/prompts/mobile/flow-build-phase-5.md +70 -70
- package/prompts/mobile/flow-build-phase-6.md +136 -134
- package/prompts/mobile/flow-build-phase-7.md +24 -58
- package/prompts/mobile/flow-build-phase-8.md +17 -42
- package/prompts/mobile/flow-build.md +47 -97
- package/prompts/mobile/flow-docs-sync.md +13 -32
- package/prompts/shared/mermaid-guidelines.md +106 -0
- package/prompts/shared/scope-levels.md +126 -0
- package/prompts/shared/story-points.md +65 -0
- package/prompts/shared/task-format.md +86 -0
- package/templates/AGENT.template.md +194 -15
- package/templates/backend/README.template.md +2 -32
- package/templates/backend/ai-instructions.template.md +2 -32
- package/templates/backend/copilot-instructions.template.md +2 -22
- package/templates/backend/docs/api.template.md +89 -20
- package/templates/backend/docs/architecture.template.md +165 -53
- package/templates/backend/docs/business-flows.template.md +7 -14
- package/templates/backend/docs/code-standards.template.md +2 -38
- package/templates/backend/docs/contributing.template.md +2 -16
- package/templates/backend/docs/data-model.template.md +125 -21
- package/templates/backend/docs/operations.template.md +179 -50
- package/templates/backend/docs/testing.template.md +2 -42
- package/templates/backend/project-brief.template.md +2 -28
- package/templates/backend/specs/configuration.template.md +2 -14
- package/templates/backend/specs/security.template.md +2 -32
- package/templates/frontend/README.template.md +2 -18
- package/templates/frontend/ai-instructions.template.md +2 -20
- package/templates/frontend/docs/api-integration.template.md +12 -30
- package/templates/frontend/docs/components.template.md +2 -28
- package/templates/frontend/docs/error-handling.template.md +11 -27
- package/templates/frontend/docs/operations.template.md +8 -18
- package/templates/frontend/docs/performance.template.md +8 -18
- package/templates/frontend/docs/pwa.template.md +8 -18
- package/templates/frontend/docs/state-management.template.md +2 -28
- package/templates/frontend/docs/styling.template.md +2 -26
- package/templates/frontend/docs/testing.template.md +2 -28
- package/templates/frontend/project-brief.template.md +2 -16
- package/templates/frontend/specs/accessibility.template.md +8 -18
- package/templates/frontend/specs/configuration.template.md +2 -24
- package/templates/frontend/specs/security.template.md +10 -24
- package/templates/fullstack/README.template.md +17 -47
- package/templates/fullstack/ai-instructions.template.md +17 -45
- package/templates/fullstack/project-brief.template.md +16 -42
- package/templates/fullstack/specs/configuration.template.md +16 -42
- package/templates/mobile/README.template.md +11 -29
- package/templates/mobile/ai-instructions.template.md +11 -27
- package/templates/mobile/docs/app-store.template.md +11 -29
- package/templates/mobile/docs/architecture.template.md +14 -38
- package/templates/mobile/docs/native-features.template.md +16 -44
- package/templates/mobile/docs/navigation.template.md +9 -23
- package/templates/mobile/docs/offline-strategy.template.md +10 -26
- package/templates/mobile/docs/permissions.template.md +9 -23
- package/templates/mobile/docs/state-management.template.md +12 -32
- package/templates/mobile/docs/testing.template.md +14 -38
- package/templates/mobile/project-brief.template.md +12 -30
- package/templates/mobile/specs/build-configuration.template.md +10 -26
- package/templates/mobile/specs/deployment.template.md +9 -23
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
**YOU ARE AN EXPERT FRONTEND ARCHITECT AND DOCUMENTATION SPECIALIST.**
|
|
4
4
|
|
|
5
5
|
Your mission is to detect changes in the frontend codebase and update the project documentation automatically when the user executes `/flow-docs-sync`.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
6
|
+
---
|
|
9
7
|
## Command: `/flow-docs-sync`
|
|
10
8
|
|
|
11
9
|
### Objective
|
|
12
10
|
|
|
13
11
|
Detect changes in the frontend codebase compared to the last documented state (stored in `.ai-flow/cache/docs-analysis.json`) and update all affected documentation files automatically.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
12
|
+
---
|
|
17
13
|
## Execution Flow
|
|
18
14
|
|
|
19
15
|
### Step 1: Check for Analysis File
|
|
@@ -186,9 +182,7 @@ No updates required.
|
|
|
186
182
|
```
|
|
187
183
|
Update cancelled. Run `/flow-docs-sync` when you're ready to update the documentation.
|
|
188
184
|
```
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
185
|
+
---
|
|
192
186
|
## Change Detection Rules
|
|
193
187
|
|
|
194
188
|
### Components Detection
|
|
@@ -280,9 +274,7 @@ Update cancelled. Run `/flow-docs-sync` when you're ready to update the document
|
|
|
280
274
|
|
|
281
275
|
- Add new variables to configuration spec
|
|
282
276
|
- Maintain existing variables
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
277
|
+
---
|
|
286
278
|
## Important Rules
|
|
287
279
|
|
|
288
280
|
1. **Incremental Updates Only:**
|
|
@@ -308,9 +300,7 @@ Update cancelled. Run `/flow-docs-sync` when you're ready to update the document
|
|
|
308
300
|
- Regenerate component architecture diagrams when structure changes
|
|
309
301
|
- Regenerate architecture diagrams when structure changes
|
|
310
302
|
- Use mermaid format for all diagrams
|
|
311
|
-
|
|
312
|
-
---
|
|
313
|
-
|
|
303
|
+
---
|
|
314
304
|
## 📊 FRONTEND DIAGRAM REGENERATION GUIDELINES
|
|
315
305
|
|
|
316
306
|
When regenerating frontend diagrams, follow these **critical** formatting rules:
|
|
@@ -364,9 +354,7 @@ graph TD
|
|
|
364
354
|
style Btn fill:#fce4ec
|
|
365
355
|
```
|
|
366
356
|
````
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
357
|
+
---
|
|
370
358
|
### State Management Diagrams (state-management.md)
|
|
371
359
|
|
|
372
360
|
**Diagram Types:** `graph LR`, `sequenceDiagram`, `graph TD`
|
|
@@ -410,9 +398,7 @@ sequenceDiagram
|
|
|
410
398
|
Component-->>User: UI Updated
|
|
411
399
|
```
|
|
412
400
|
````
|
|
413
|
-
|
|
414
|
-
---
|
|
415
|
-
|
|
401
|
+
---
|
|
416
402
|
### Routing Diagrams (architecture.md or routing.md)
|
|
417
403
|
|
|
418
404
|
**Diagram Type:** `graph TD`
|
|
@@ -431,9 +417,7 @@ sequenceDiagram
|
|
|
431
417
|
- [ ] Nested routes show parent-child relationships
|
|
432
418
|
- [ ] Route parameters are documented
|
|
433
419
|
- [ ] Diagram matches actual router configuration
|
|
434
|
-
|
|
435
|
-
---
|
|
436
|
-
|
|
420
|
+
---
|
|
437
421
|
### Application Architecture Diagram (architecture.md)
|
|
438
422
|
|
|
439
423
|
**Diagram Type:** `graph TB`
|
|
@@ -474,9 +458,7 @@ graph TB
|
|
|
474
458
|
````
|
|
475
459
|
|
|
476
460
|
**Use for:** System architecture overview, integration documentation, onboarding
|
|
477
|
-
|
|
478
|
-
---
|
|
479
|
-
|
|
461
|
+
---
|
|
480
462
|
### Common Formatting Rules (ALL Frontend Diagrams)
|
|
481
463
|
|
|
482
464
|
**CRITICAL - Code Fence Syntax:**
|
|
@@ -510,16 +492,12 @@ graph TB
|
|
|
510
492
|
3. Maintain existing styling and layout patterns
|
|
511
493
|
4. Update relationships based on code changes
|
|
512
494
|
5. Verify entire diagram still renders after changes
|
|
513
|
-
|
|
514
|
-
---
|
|
515
|
-
|
|
495
|
+
---
|
|
516
496
|
5. **Error Handling:**
|
|
517
497
|
- If document doesn't exist, create it following template
|
|
518
498
|
- If docs-analysis.json is corrupted, regenerate it
|
|
519
499
|
- If comparison fails, show error and suggest full Phase 0 re-run
|
|
520
|
-
|
|
521
|
-
---
|
|
522
|
-
|
|
500
|
+
---
|
|
523
501
|
## Example Execution
|
|
524
502
|
|
|
525
503
|
```
|
|
@@ -553,10 +531,11 @@ AI:
|
|
|
553
531
|
|
|
554
532
|
Documentation synchronized successfully.
|
|
555
533
|
```
|
|
534
|
+
---
|
|
535
|
+
**BEGIN EXECUTION when user runs `/flow-docs-sync`**
|
|
536
|
+
|
|
556
537
|
|
|
557
|
-
---
|
|
558
538
|
|
|
559
|
-
**BEGIN EXECUTION when user runs `/flow-docs-sync`**
|
|
560
539
|
|
|
561
540
|
|
|
562
541
|
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
**⚡ AUTOMATED ANALYSIS - Minimal User Input Required**
|
|
4
4
|
|
|
5
5
|
This phase automatically analyzes your existing mobile codebase to pre-populate answers for the build questionnaire.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
6
|
+
---
|
|
9
7
|
## 🎯 Objective
|
|
10
8
|
|
|
11
9
|
Detect the current mobile stack, architecture patterns, and configuration from existing code to:
|
|
@@ -14,9 +12,7 @@ Detect the current mobile stack, architecture patterns, and configuration from e
|
|
|
14
12
|
2. **Validate assumptions** - Confirm detected patterns with user
|
|
15
13
|
3. **Save time** - Reduce questionnaire from ~100 min to ~50 min
|
|
16
14
|
4. **Maintain accuracy** - User can override any detection
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
15
|
+
---
|
|
20
16
|
## 📋 Detection Layers (Progressive)
|
|
21
17
|
|
|
22
18
|
### Layer 0: Cache Check (0-2 seconds)
|
|
@@ -24,6 +20,7 @@ Detect the current mobile stack, architecture patterns, and configuration from e
|
|
|
24
20
|
Check if `.ai-flow/cache/mobile-context.json` exists and is fresh (<7 days old).
|
|
25
21
|
|
|
26
22
|
**If found:**
|
|
23
|
+
|
|
27
24
|
```json
|
|
28
25
|
{
|
|
29
26
|
"platform": "iOS + Android",
|
|
@@ -42,9 +39,7 @@ Check if `.ai-flow/cache/mobile-context.json` exists and is fresh (<7 days old).
|
|
|
42
39
|
**If yes:** Skip to validation step
|
|
43
40
|
|
|
44
41
|
**If no or cache doesn't exist:** Proceed to Layer 1
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
42
|
+
---
|
|
48
43
|
### Layer 1: Fast Metadata Scan (10-20 seconds)
|
|
49
44
|
|
|
50
45
|
**Purpose:** Detect framework, platform, build tool, TypeScript
|
|
@@ -65,15 +60,21 @@ Check if `.ai-flow/cache/mobile-context.json` exists and is fresh (<7 days old).
|
|
|
65
60
|
const pkg = await detectPackageFile();
|
|
66
61
|
|
|
67
62
|
// 2. Detect Mobile Framework
|
|
68
|
-
const framework =
|
|
69
|
-
|
|
70
|
-
await fs.exists('pubspec.yaml')
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
const framework = pkg.dependencies?.['react-native']
|
|
64
|
+
? 'React Native'
|
|
65
|
+
: (await fs.exists('pubspec.yaml'))
|
|
66
|
+
? 'Flutter'
|
|
67
|
+
: (await fs.exists('ios/')) && (await fs.exists('android/'))
|
|
68
|
+
? 'Native (iOS + Android)'
|
|
69
|
+
: (await fs.exists('ios/'))
|
|
70
|
+
? 'Native iOS (Swift)'
|
|
71
|
+
: (await fs.exists('android/'))
|
|
72
|
+
? 'Native Android (Kotlin)'
|
|
73
|
+
: pkg.dependencies?.['@ionic/core']
|
|
74
|
+
? 'Ionic'
|
|
75
|
+
: pkg.dependencies?.['@capacitor/core']
|
|
76
|
+
? 'Capacitor'
|
|
77
|
+
: null;
|
|
77
78
|
|
|
78
79
|
// 3. Detect Platform Support
|
|
79
80
|
const platforms = [];
|
|
@@ -81,50 +82,68 @@ if (await fs.exists('ios/')) platforms.push('iOS');
|
|
|
81
82
|
if (await fs.exists('android/')) platforms.push('Android');
|
|
82
83
|
|
|
83
84
|
// 4. Detect Navigation Library
|
|
84
|
-
const navigation =
|
|
85
|
-
|
|
86
|
-
pkg.dependencies?.['react-native-navigation']
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
const navigation = pkg.dependencies?.['@react-navigation/native']
|
|
86
|
+
? 'React Navigation'
|
|
87
|
+
: pkg.dependencies?.['react-native-navigation']
|
|
88
|
+
? 'React Native Navigation'
|
|
89
|
+
: pkg.dependencies?.['go_router']
|
|
90
|
+
? 'GoRouter'
|
|
91
|
+
: pkg.dependencies?.['auto_route']
|
|
92
|
+
? 'AutoRoute'
|
|
93
|
+
: null;
|
|
90
94
|
|
|
91
95
|
// 5. Detect State Management
|
|
92
|
-
const stateManagement =
|
|
93
|
-
|
|
94
|
-
pkg.dependencies?.zustand
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
const stateManagement = pkg.dependencies?.['@reduxjs/toolkit']
|
|
97
|
+
? 'Redux Toolkit'
|
|
98
|
+
: pkg.dependencies?.zustand
|
|
99
|
+
? 'Zustand'
|
|
100
|
+
: pkg.dependencies?.mobx
|
|
101
|
+
? 'MobX'
|
|
102
|
+
: pkg.dependencies?.provider
|
|
103
|
+
? 'Provider'
|
|
104
|
+
: pkg.dependencies?.['flutter_riverpod']
|
|
105
|
+
? 'Riverpod'
|
|
106
|
+
: pkg.dependencies?.['flutter_bloc']
|
|
107
|
+
? 'Bloc'
|
|
108
|
+
: null;
|
|
100
109
|
|
|
101
110
|
// 6. Detect Storage Solution
|
|
102
|
-
const storage =
|
|
103
|
-
|
|
104
|
-
pkg.dependencies?.['react-native-mmkv']
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
const storage = pkg.dependencies?.['@react-native-async-storage/async-storage']
|
|
112
|
+
? 'AsyncStorage'
|
|
113
|
+
: pkg.dependencies?.['react-native-mmkv']
|
|
114
|
+
? 'MMKV'
|
|
115
|
+
: pkg.dependencies?.['@nozbe/watermelondb']
|
|
116
|
+
? 'WatermelonDB'
|
|
117
|
+
: pkg.dependencies?.realm
|
|
118
|
+
? 'Realm'
|
|
119
|
+
: pkg.dependencies?.hive
|
|
120
|
+
? 'Hive'
|
|
121
|
+
: (await fs.exists('ios/DataModel.xcdatamodeld'))
|
|
122
|
+
? 'Core Data'
|
|
123
|
+
: (await fs.exists('android/app/src/main/java/**/RoomDatabase.kt'))
|
|
124
|
+
? 'Room'
|
|
125
|
+
: null;
|
|
111
126
|
|
|
112
127
|
// 7. Detect TypeScript/Dart
|
|
113
128
|
const typescript = await fs.exists('tsconfig.json');
|
|
114
129
|
const dart = await fs.exists('pubspec.yaml');
|
|
115
130
|
|
|
116
131
|
// 8. Detect Testing Framework
|
|
117
|
-
const unitTest =
|
|
118
|
-
|
|
119
|
-
pkg.devDependencies?.vitest
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
const unitTest = pkg.devDependencies?.jest
|
|
133
|
+
? 'Jest'
|
|
134
|
+
: pkg.devDependencies?.vitest
|
|
135
|
+
? 'Vitest'
|
|
136
|
+
: (await fs.exists('test/')) && dart
|
|
137
|
+
? 'Flutter Test'
|
|
138
|
+
: null;
|
|
139
|
+
|
|
140
|
+
const e2eTest = pkg.devDependencies?.['detox']
|
|
141
|
+
? 'Detox'
|
|
142
|
+
: pkg.devDependencies?.['@maestrohq/cli']
|
|
143
|
+
? 'Maestro'
|
|
144
|
+
: pkg.devDependencies?.appium
|
|
145
|
+
? 'Appium'
|
|
146
|
+
: null;
|
|
128
147
|
```
|
|
129
148
|
|
|
130
149
|
#### Layer 1 Output
|
|
@@ -142,9 +161,7 @@ Testing: Jest + Detox
|
|
|
142
161
|
|
|
143
162
|
Continue to Layer 2 for structural analysis? (Y/n)
|
|
144
163
|
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
164
|
+
---
|
|
148
165
|
### Layer 2: Structural Analysis (30-90 seconds)
|
|
149
166
|
|
|
150
167
|
**Purpose:** Analyze navigation structure, component organization, and architecture patterns
|
|
@@ -163,10 +180,10 @@ Continue to Layer 2 for structural analysis? (Y/n)
|
|
|
163
180
|
const navigationPattern = detectNavigationPattern(srcFiles);
|
|
164
181
|
|
|
165
182
|
function detectNavigationPattern(files: string[]): string {
|
|
166
|
-
const hasStack = files.some(f => f.includes('Stack') || f.includes('createStackNavigator'));
|
|
167
|
-
const hasTab = files.some(f => f.includes('Tab') || f.includes('createBottomTabNavigator'));
|
|
168
|
-
const hasDrawer = files.some(f => f.includes('Drawer') || f.includes('createDrawerNavigator'));
|
|
169
|
-
|
|
183
|
+
const hasStack = files.some((f) => f.includes('Stack') || f.includes('createStackNavigator'));
|
|
184
|
+
const hasTab = files.some((f) => f.includes('Tab') || f.includes('createBottomTabNavigator'));
|
|
185
|
+
const hasDrawer = files.some((f) => f.includes('Drawer') || f.includes('createDrawerNavigator'));
|
|
186
|
+
|
|
170
187
|
if (hasTab && hasStack) return 'Tab + Stack Navigation';
|
|
171
188
|
if (hasDrawer && hasStack) return 'Drawer + Stack Navigation';
|
|
172
189
|
if (hasStack) return 'Stack Navigation';
|
|
@@ -178,11 +195,11 @@ function detectNavigationPattern(files: string[]): string {
|
|
|
178
195
|
const architecturePattern = detectArchitecture(srcFiles);
|
|
179
196
|
|
|
180
197
|
function detectArchitecture(files: string[]): string {
|
|
181
|
-
const hasFeatures = files.some(f => f.includes('/features/'));
|
|
182
|
-
const hasDomains = files.some(f => f.includes('/domain/'));
|
|
183
|
-
const hasPresentation = files.some(f => f.includes('/presentation/'));
|
|
184
|
-
const hasClean = files.some(f => f.includes('/data/') && f.includes('/domain/'));
|
|
185
|
-
|
|
198
|
+
const hasFeatures = files.some((f) => f.includes('/features/'));
|
|
199
|
+
const hasDomains = files.some((f) => f.includes('/domain/'));
|
|
200
|
+
const hasPresentation = files.some((f) => f.includes('/presentation/'));
|
|
201
|
+
const hasClean = files.some((f) => f.includes('/data/') && f.includes('/domain/'));
|
|
202
|
+
|
|
186
203
|
if (hasClean) return 'Clean Architecture';
|
|
187
204
|
if (hasFeatures) return 'Feature-based';
|
|
188
205
|
if (hasDomains) return 'Domain-driven';
|
|
@@ -194,12 +211,12 @@ function detectArchitecture(files: string[]): string {
|
|
|
194
211
|
const componentPattern = detectComponentPattern(srcFiles);
|
|
195
212
|
|
|
196
213
|
function detectComponentPattern(files: string[]): string {
|
|
197
|
-
const hasAtomic = files.some(
|
|
198
|
-
f.includes('/atoms/') || f.includes('/molecules/') || f.includes('/organisms/')
|
|
214
|
+
const hasAtomic = files.some(
|
|
215
|
+
(f) => f.includes('/atoms/') || f.includes('/molecules/') || f.includes('/organisms/')
|
|
199
216
|
);
|
|
200
|
-
const hasScreens = files.some(f => f.includes('/screens/'));
|
|
201
|
-
const hasWidgets = files.some(f => f.includes('/widgets/'));
|
|
202
|
-
|
|
217
|
+
const hasScreens = files.some((f) => f.includes('/screens/'));
|
|
218
|
+
const hasWidgets = files.some((f) => f.includes('/widgets/'));
|
|
219
|
+
|
|
203
220
|
if (hasAtomic) return 'Atomic Design';
|
|
204
221
|
if (hasScreens && hasWidgets) return 'Screens + Widgets';
|
|
205
222
|
if (hasScreens) return 'Screens-based';
|
|
@@ -226,14 +243,13 @@ Component Pattern: Screens + Components
|
|
|
226
243
|
|
|
227
244
|
Continue to Layer 3 for deep analysis? (Y/n)
|
|
228
245
|
```
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
246
|
+
---
|
|
232
247
|
### Layer 3: Selective Deep Analysis (Optional, 60-120 seconds)
|
|
233
248
|
|
|
234
249
|
**Purpose:** Extract advanced patterns, permissions, and native integrations
|
|
235
250
|
|
|
236
251
|
**Only proceed if:**
|
|
252
|
+
|
|
237
253
|
- User confirms (not automatic)
|
|
238
254
|
- Project is large (>20 screens)
|
|
239
255
|
- Accuracy is critical
|
|
@@ -246,32 +262,32 @@ const permissions = detectPermissions(srcFiles, platformFiles);
|
|
|
246
262
|
|
|
247
263
|
function detectPermissions(srcFiles: string[], platformFiles: string[]): string[] {
|
|
248
264
|
const detected = [];
|
|
249
|
-
|
|
265
|
+
|
|
250
266
|
// Check Info.plist (iOS)
|
|
251
|
-
const infoPlist = platformFiles.find(f => f.includes('Info.plist'));
|
|
267
|
+
const infoPlist = platformFiles.find((f) => f.includes('Info.plist'));
|
|
252
268
|
if (infoPlist) {
|
|
253
269
|
const content = fs.readFileSync(infoPlist, 'utf-8');
|
|
254
270
|
if (content.includes('NSCameraUsageDescription')) detected.push('Camera');
|
|
255
271
|
if (content.includes('NSLocationWhenInUseUsageDescription')) detected.push('Location');
|
|
256
272
|
if (content.includes('NSPhotoLibraryUsageDescription')) detected.push('Photo Library');
|
|
257
273
|
}
|
|
258
|
-
|
|
274
|
+
|
|
259
275
|
// Check AndroidManifest.xml (Android)
|
|
260
|
-
const manifest = platformFiles.find(f => f.includes('AndroidManifest.xml'));
|
|
276
|
+
const manifest = platformFiles.find((f) => f.includes('AndroidManifest.xml'));
|
|
261
277
|
if (manifest) {
|
|
262
278
|
const content = fs.readFileSync(manifest, 'utf-8');
|
|
263
279
|
if (content.includes('android.permission.CAMERA')) detected.push('Camera');
|
|
264
280
|
if (content.includes('android.permission.ACCESS_FINE_LOCATION')) detected.push('Location');
|
|
265
281
|
}
|
|
266
|
-
|
|
282
|
+
|
|
267
283
|
// Check code for permission requests
|
|
268
|
-
srcFiles.forEach(file => {
|
|
284
|
+
srcFiles.forEach((file) => {
|
|
269
285
|
const content = fs.readFileSync(file, 'utf-8');
|
|
270
286
|
if (content.includes('requestPermission') || content.includes('Permissions.')) {
|
|
271
287
|
// Extract permission type from context
|
|
272
288
|
}
|
|
273
289
|
});
|
|
274
|
-
|
|
290
|
+
|
|
275
291
|
return detected;
|
|
276
292
|
}
|
|
277
293
|
|
|
@@ -280,21 +296,19 @@ const nativeModules = detectNativeModules(srcFiles);
|
|
|
280
296
|
|
|
281
297
|
function detectNativeModules(files: string[]): string[] {
|
|
282
298
|
const modules = [];
|
|
283
|
-
|
|
284
|
-
files.forEach(file => {
|
|
299
|
+
|
|
300
|
+
files.forEach((file) => {
|
|
285
301
|
const content = fs.readFileSync(file, 'utf-8');
|
|
286
302
|
if (content.includes('react-native-camera')) modules.push('Camera');
|
|
287
303
|
if (content.includes('@react-native-async-storage')) modules.push('AsyncStorage');
|
|
288
304
|
if (content.includes('react-native-maps')) modules.push('Maps');
|
|
289
305
|
if (content.includes('@react-native-firebase')) modules.push('Firebase');
|
|
290
306
|
});
|
|
291
|
-
|
|
307
|
+
|
|
292
308
|
return modules;
|
|
293
309
|
}
|
|
294
310
|
```
|
|
295
|
-
|
|
296
|
-
---
|
|
297
|
-
|
|
311
|
+
---
|
|
298
312
|
## ✅ Validation & Confirmation
|
|
299
313
|
|
|
300
314
|
### Present Findings
|
|
@@ -302,10 +316,9 @@ function detectNativeModules(files: string[]): string[] {
|
|
|
302
316
|
After detection, show user a summary and ask for confirmation:
|
|
303
317
|
|
|
304
318
|
```
|
|
305
|
-
|
|
319
|
+
---
|
|
306
320
|
🔍 MOBILE STACK DETECTED
|
|
307
|
-
|
|
308
|
-
|
|
321
|
+
---
|
|
309
322
|
✅ Platform: iOS + Android
|
|
310
323
|
✅ Framework: React Native 0.72.0
|
|
311
324
|
✅ TypeScript: Yes
|
|
@@ -333,9 +346,7 @@ This will reduce the questionnaire from ~100 min to ~50 min.
|
|
|
333
346
|
|
|
334
347
|
Proceed to Phase 1? (Y/n)
|
|
335
348
|
```
|
|
336
|
-
|
|
337
|
-
---
|
|
338
|
-
|
|
349
|
+
---
|
|
339
350
|
## 💾 Cache Storage
|
|
340
351
|
|
|
341
352
|
Save detected context for future use:
|
|
@@ -363,9 +374,7 @@ Save detected context for future use:
|
|
|
363
374
|
```
|
|
364
375
|
|
|
365
376
|
**Cache invalidation:** 7 days or when package.json/pubspec.yaml is modified
|
|
366
|
-
|
|
367
|
-
---
|
|
368
|
-
|
|
377
|
+
---
|
|
369
378
|
## 🚀 Next Steps
|
|
370
379
|
|
|
371
380
|
After Phase 0 completes:
|
|
@@ -377,9 +386,7 @@ Next: Proceed to Phase 1 (Platform & Framework Selection)
|
|
|
377
386
|
|
|
378
387
|
Read: .ai-flow/prompts/mobile/flow-build-phase-1-platform.md
|
|
379
388
|
```
|
|
380
|
-
|
|
381
|
-
---
|
|
382
|
-
|
|
389
|
+
---
|
|
383
390
|
**Last Updated:** 2025-01-XX
|
|
384
391
|
|
|
385
392
|
**Version:** 1.4.0
|