ai-flow-dev 2.7.0 → 2.8.0

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 (171) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +573 -570
  3. package/package.json +74 -74
  4. package/prompts/backend/flow-build-phase-0.md +535 -535
  5. package/prompts/backend/flow-build-phase-1.md +626 -626
  6. package/prompts/backend/flow-build-phase-10.md +340 -340
  7. package/prompts/backend/flow-build-phase-2.md +573 -573
  8. package/prompts/backend/flow-build-phase-3.md +834 -834
  9. package/prompts/backend/flow-build-phase-4.md +554 -554
  10. package/prompts/backend/flow-build-phase-5.md +703 -703
  11. package/prompts/backend/flow-build-phase-6.md +524 -524
  12. package/prompts/backend/flow-build-phase-7.md +1001 -1001
  13. package/prompts/backend/flow-build-phase-8.md +1407 -1407
  14. package/prompts/backend/flow-build-phase-9.md +477 -477
  15. package/prompts/backend/flow-build.md +137 -137
  16. package/prompts/backend/flow-check-review.md +656 -20
  17. package/prompts/backend/flow-check-test.md +526 -14
  18. package/prompts/backend/flow-check.md +725 -67
  19. package/prompts/backend/flow-commit.md +88 -119
  20. package/prompts/backend/flow-docs-sync.md +354 -354
  21. package/prompts/backend/flow-finish.md +919 -0
  22. package/prompts/backend/flow-release.md +949 -0
  23. package/prompts/backend/flow-work-feature.md +61 -61
  24. package/prompts/backend/flow-work-fix.md +46 -46
  25. package/prompts/backend/flow-work-refactor.md +48 -48
  26. package/prompts/backend/flow-work-resume.md +34 -34
  27. package/prompts/backend/flow-work.md +1098 -1286
  28. package/prompts/desktop/flow-build-phase-0.md +359 -359
  29. package/prompts/desktop/flow-build-phase-1.md +295 -295
  30. package/prompts/desktop/flow-build-phase-10.md +357 -357
  31. package/prompts/desktop/flow-build-phase-2.md +282 -282
  32. package/prompts/desktop/flow-build-phase-3.md +291 -291
  33. package/prompts/desktop/flow-build-phase-4.md +308 -308
  34. package/prompts/desktop/flow-build-phase-5.md +269 -269
  35. package/prompts/desktop/flow-build-phase-6.md +350 -350
  36. package/prompts/desktop/flow-build-phase-7.md +297 -297
  37. package/prompts/desktop/flow-build-phase-8.md +541 -541
  38. package/prompts/desktop/flow-build-phase-9.md +439 -439
  39. package/prompts/desktop/flow-build.md +156 -156
  40. package/prompts/desktop/flow-check-review.md +656 -20
  41. package/prompts/desktop/flow-check-test.md +526 -14
  42. package/prompts/desktop/flow-check.md +725 -67
  43. package/prompts/desktop/flow-commit.md +88 -119
  44. package/prompts/desktop/flow-docs-sync.md +354 -354
  45. package/prompts/desktop/flow-finish.md +910 -0
  46. package/prompts/desktop/flow-release.md +662 -0
  47. package/prompts/desktop/flow-work-feature.md +61 -61
  48. package/prompts/desktop/flow-work-fix.md +46 -46
  49. package/prompts/desktop/flow-work-refactor.md +48 -48
  50. package/prompts/desktop/flow-work-resume.md +34 -34
  51. package/prompts/desktop/flow-work.md +1202 -1390
  52. package/prompts/frontend/flow-build-phase-0.md +425 -425
  53. package/prompts/frontend/flow-build-phase-1.md +626 -626
  54. package/prompts/frontend/flow-build-phase-10.md +33 -33
  55. package/prompts/frontend/flow-build-phase-2.md +573 -573
  56. package/prompts/frontend/flow-build-phase-3.md +782 -782
  57. package/prompts/frontend/flow-build-phase-4.md +554 -554
  58. package/prompts/frontend/flow-build-phase-5.md +703 -703
  59. package/prompts/frontend/flow-build-phase-6.md +524 -524
  60. package/prompts/frontend/flow-build-phase-7.md +1001 -1001
  61. package/prompts/frontend/flow-build-phase-8.md +872 -872
  62. package/prompts/frontend/flow-build-phase-9.md +94 -94
  63. package/prompts/frontend/flow-build.md +137 -137
  64. package/prompts/frontend/flow-check-review.md +656 -20
  65. package/prompts/frontend/flow-check-test.md +526 -14
  66. package/prompts/frontend/flow-check.md +725 -67
  67. package/prompts/frontend/flow-commit.md +88 -119
  68. package/prompts/frontend/flow-docs-sync.md +550 -550
  69. package/prompts/frontend/flow-finish.md +910 -0
  70. package/prompts/frontend/flow-release.md +519 -0
  71. package/prompts/frontend/flow-work-api.md +1540 -0
  72. package/prompts/frontend/flow-work-feature.md +61 -61
  73. package/prompts/frontend/flow-work-fix.md +38 -38
  74. package/prompts/frontend/flow-work-refactor.md +48 -48
  75. package/prompts/frontend/flow-work-resume.md +34 -34
  76. package/prompts/frontend/flow-work.md +1583 -1320
  77. package/prompts/mobile/flow-build-phase-0.md +425 -425
  78. package/prompts/mobile/flow-build-phase-1.md +626 -626
  79. package/prompts/mobile/flow-build-phase-10.md +32 -32
  80. package/prompts/mobile/flow-build-phase-2.md +573 -573
  81. package/prompts/mobile/flow-build-phase-3.md +782 -782
  82. package/prompts/mobile/flow-build-phase-4.md +554 -554
  83. package/prompts/mobile/flow-build-phase-5.md +703 -703
  84. package/prompts/mobile/flow-build-phase-6.md +524 -524
  85. package/prompts/mobile/flow-build-phase-7.md +1001 -1001
  86. package/prompts/mobile/flow-build-phase-8.md +888 -888
  87. package/prompts/mobile/flow-build-phase-9.md +90 -90
  88. package/prompts/mobile/flow-build.md +135 -135
  89. package/prompts/mobile/flow-check-review.md +656 -20
  90. package/prompts/mobile/flow-check-test.md +526 -14
  91. package/prompts/mobile/flow-check.md +725 -67
  92. package/prompts/mobile/flow-commit.md +88 -119
  93. package/prompts/mobile/flow-docs-sync.md +620 -620
  94. package/prompts/mobile/flow-finish.md +910 -0
  95. package/prompts/mobile/flow-release.md +751 -0
  96. package/prompts/mobile/flow-work-api.md +1493 -0
  97. package/prompts/mobile/flow-work-feature.md +61 -61
  98. package/prompts/mobile/flow-work-fix.md +46 -46
  99. package/prompts/mobile/flow-work-refactor.md +48 -48
  100. package/prompts/mobile/flow-work-resume.md +34 -34
  101. package/prompts/mobile/flow-work.md +1593 -1329
  102. package/prompts/shared/mermaid-guidelines.md +102 -102
  103. package/prompts/shared/scope-levels.md +114 -114
  104. package/prompts/shared/smart-skip-preflight.md +214 -214
  105. package/prompts/shared/story-points.md +55 -55
  106. package/prompts/shared/task-format.md +74 -74
  107. package/prompts/shared/task-summary-template.md +277 -277
  108. package/templates/AGENT.template.md +443 -443
  109. package/templates/backend/.clauderules.template +112 -112
  110. package/templates/backend/.cursorrules.template +102 -102
  111. package/templates/backend/README.template.md +2 -2
  112. package/templates/backend/ai-instructions.template.md +2 -2
  113. package/templates/backend/copilot-instructions.template.md +2 -2
  114. package/templates/backend/docs/api.template.md +320 -320
  115. package/templates/backend/docs/business-flows.template.md +97 -97
  116. package/templates/backend/docs/code-standards.template.md +2 -2
  117. package/templates/backend/docs/contributing.template.md +3 -3
  118. package/templates/backend/docs/data-model.template.md +520 -520
  119. package/templates/backend/docs/testing.template.md +2 -2
  120. package/templates/backend/project-brief.template.md +2 -2
  121. package/templates/backend/specs/configuration.template.md +2 -2
  122. package/templates/backend/specs/security.template.md +2 -2
  123. package/templates/desktop/.clauderules.template +112 -112
  124. package/templates/desktop/.cursorrules.template +102 -102
  125. package/templates/desktop/README.template.md +170 -170
  126. package/templates/desktop/ai-instructions.template.md +366 -366
  127. package/templates/desktop/copilot-instructions.template.md +140 -140
  128. package/templates/desktop/docs/docs/api.template.md +320 -320
  129. package/templates/desktop/docs/docs/architecture.template.md +724 -724
  130. package/templates/desktop/docs/docs/business-flows.template.md +102 -102
  131. package/templates/desktop/docs/docs/code-standards.template.md +792 -792
  132. package/templates/desktop/docs/docs/contributing.template.md +149 -149
  133. package/templates/desktop/docs/docs/data-model.template.md +520 -520
  134. package/templates/desktop/docs/docs/operations.template.md +720 -720
  135. package/templates/desktop/docs/docs/testing.template.md +722 -722
  136. package/templates/desktop/project-brief.template.md +150 -150
  137. package/templates/desktop/specs/specs/configuration.template.md +121 -121
  138. package/templates/desktop/specs/specs/security.template.md +392 -392
  139. package/templates/frontend/README.template.md +2 -2
  140. package/templates/frontend/ai-instructions.template.md +2 -2
  141. package/templates/frontend/docs/api-integration.template.md +362 -362
  142. package/templates/frontend/docs/components.template.md +2 -2
  143. package/templates/frontend/docs/error-handling.template.md +360 -360
  144. package/templates/frontend/docs/operations.template.md +107 -107
  145. package/templates/frontend/docs/performance.template.md +124 -124
  146. package/templates/frontend/docs/pwa.template.md +119 -119
  147. package/templates/frontend/docs/state-management.template.md +2 -2
  148. package/templates/frontend/docs/styling.template.md +2 -2
  149. package/templates/frontend/docs/testing.template.md +2 -2
  150. package/templates/frontend/project-brief.template.md +2 -2
  151. package/templates/frontend/specs/accessibility.template.md +95 -95
  152. package/templates/frontend/specs/configuration.template.md +2 -2
  153. package/templates/frontend/specs/security.template.md +175 -175
  154. package/templates/fullstack/README.template.md +252 -252
  155. package/templates/fullstack/ai-instructions.template.md +444 -444
  156. package/templates/fullstack/project-brief.template.md +157 -157
  157. package/templates/fullstack/specs/configuration.template.md +340 -340
  158. package/templates/mobile/README.template.md +167 -167
  159. package/templates/mobile/ai-instructions.template.md +196 -196
  160. package/templates/mobile/docs/app-store.template.md +135 -135
  161. package/templates/mobile/docs/architecture.template.md +63 -63
  162. package/templates/mobile/docs/native-features.template.md +94 -94
  163. package/templates/mobile/docs/navigation.template.md +59 -59
  164. package/templates/mobile/docs/offline-strategy.template.md +65 -65
  165. package/templates/mobile/docs/permissions.template.md +56 -56
  166. package/templates/mobile/docs/state-management.template.md +85 -85
  167. package/templates/mobile/docs/testing.template.md +109 -109
  168. package/templates/mobile/project-brief.template.md +69 -69
  169. package/templates/mobile/specs/build-configuration.template.md +91 -91
  170. package/templates/mobile/specs/deployment.template.md +92 -92
  171. package/templates/work.template.md +47 -47
@@ -1,888 +1,888 @@
1
- # 🏆 Phase 8: Project Setup & Final Documentation
2
-
3
- **Context:** Phases 1-7 have collected all project information. Now we'll initialize the framework (if needed) and generate all final documentation.
4
-
5
- **Duration:** 10-15 minutes
6
-
7
- **Goal:** Set up the project structure and create comprehensive documentation that consolidates all information from previous phases.
8
- ---
9
- ## 📋 Phase 8 Overview
10
-
11
- This final phase will:
12
-
13
- 1. **Detect project state** (new vs existing project)
14
- 2. **Initialize framework** (optional, for new projects)
15
- 3. **Generate final documentation** (platform guides, deployment, app store)
16
- 4. **Generate master index** (AGENT.md)
17
- 5. **Generate README.md** (with intelligent merge if needed)
18
- 6. **Create tool-specific configs** (based on AI tool selection)
19
- ---
20
- // turbo
21
- ## 8.1: Project State Detection
22
-
23
- ```
24
- 🔍 Detecting current project state...
25
-
26
- **⚠️ CRITICAL: Ignore AI Flow documentation and Meta files during detection:**
27
- - Files: project-brief.md, ai-instructions.md, AGENT.md, .env.example, .cursorrules, .clauderules, .geminirules
28
- - Directories: .ai-flow/, .agent/, docs/, specs/
29
- ```
30
-
31
- **Auto-detect:**
32
-
33
- - [ ] Check for existing source code (`src/`, `app/`, `ios/`, `android/`, `lib/`, etc.)
34
- - [ ] Check for framework files (`package.json`, `pubspec.yaml`, `Podfile`, `build.gradle`, etc.)
35
- - [ ] Check for platform directories (`ios/`, `android/`, `lib/` for Flutter)
36
- - [ ] Check for existing README.md (framework-generated or custom)
37
-
38
- **Classification:**
39
-
40
- - **New Project**: No source code, no framework files
41
- - **Initialized Framework**: Has framework files, has source code
42
- - **Existing Project**: Has source code but AI Flow docs were just created
43
-
44
- **Present Detection Results:**
45
-
46
- ```
47
- 📊 Project State Detection:
48
-
49
- Type: [New Project | Initialized Framework | Existing Project]
50
-
51
- Found:
52
- - Source directories: [list or none]
53
- - Framework files: [list or none]
54
- - Platform directories: [ios/, android/, or none]
55
- - Package manager: [npm/yarn/flutter/etc. or none]
56
- - README.md: [exists: yes/no]
57
-
58
- Recommendation: [Next action based on state]
59
- ```
60
- ---
61
- ## 8.2: Framework Initialization (Optional)
62
-
63
- **Only if:** Project state = "New Project"
64
-
65
- ### 8.2.1: Ask User Preference
66
-
67
- ```
68
- 🎯 Your project appears to be new.
69
-
70
- Would you like me to initialize the [FRAMEWORK_NAME] project structure now?
71
-
72
- Options:
73
- A) ✅ Yes, initialize [FRAMEWORK_NAME] (recommended)
74
- B) ⏭️ Skip for now (manual setup later)
75
-
76
- → Your choice:
77
- ```
78
-
79
- **If user chooses A (initialize):**
80
-
81
- ### 8.2.2: Pre-initialization Backup
82
-
83
- ```
84
- 📦 Preparing for framework initialization...
85
-
86
- Creating backup of AI Flow documentation:
87
- → Moving .ai-flow/ docs to .ai-flow/temp-backup/
88
-
89
- Files to backup:
90
- ✅ project-brief.md
91
- ✅ docs/app-structure.md
92
- ✅ docs/architecture.md
93
- ✅ ai-instructions.md
94
- ✅ docs/code-standards.md
95
- ✅ docs/testing.md
96
- ✅ docs/app-store.md
97
- ✅ specs/build-configuration.md
98
- ✅ specs/deployment.md
99
- ✅ .env.example
100
-
101
- Backup complete! Safe to initialize framework.
102
- ```
103
-
104
- ### 8.2.3: Execute Framework CLI
105
-
106
- **Based on framework detected in Phase 1:**
107
-
108
- **React Native:**
109
-
110
- ```bash
111
- # React Native CLI
112
- npx react-native@latest init ProjectName --skip-git
113
-
114
- # Expo (managed workflow)
115
- npx create-expo-app@latest . --template blank-typescript
116
-
117
- # Expo (bare workflow)
118
- npx create-expo-app@latest . --template bare-typescript
119
- ```
120
-
121
- **Flutter:**
122
-
123
- ```bash
124
- # Flutter CLI
125
- flutter create . --org com.yourcompany --platforms ios,android
126
-
127
- # Flutter with specific template
128
- flutter create . --template app --org com.yourcompany
129
- ```
130
-
131
- **Native iOS:**
132
-
133
- ```bash
134
- # SwiftUI app
135
- xcodegen generate
136
- # Or manually create Xcode project
137
- ```
138
-
139
- **Native Android:**
140
-
141
- ```bash
142
- # Android Studio template
143
- # Create manually through Android Studio or use Gradle
144
- ```
145
-
146
- **Other cross-platform:**
147
-
148
- ```bash
149
- # Ionic
150
- ionic start . blank --type=angular --capacitor
151
-
152
- # Capacitor
153
- npm init @capacitor/app
154
-
155
- # NativeScript
156
- ns create . --template @nativescript/template-blank-ts
157
-
158
- # Kotlin Multiplatform Mobile
159
- # Create through IntelliJ IDEA or Android Studio
160
- ```
161
-
162
- **Show progress:**
163
-
164
- ```
165
- 🚀 Initializing [FRAMEWORK_NAME]...
166
-
167
- [Framework CLI output]
168
-
169
- ✅ Framework initialized successfully!
170
- ```
171
-
172
- ### 8.2.4: Restore AI Flow Documentation
173
-
174
- ```
175
- 📥 Restoring AI Flow documentation...
176
-
177
- Moving files from .ai-flow/temp-backup/ back to .ai-flow/
178
-
179
- ✅ All AI Flow docs restored!
180
- ```
181
-
182
- ### 8.2.5: Handle README.md Conflict
183
-
184
- **If framework created README.md:**
185
-
186
- ```
187
- ⚠️ Framework generated its own README.md
188
-
189
- I'll merge it with AI Flow's comprehensive README:
190
-
191
- Strategy:
192
- 1. Keep framework's quick start section (if valuable)
193
- 2. Replace with AI Flow's comprehensive content
194
- 3. Preserve any framework-specific setup instructions
195
-
196
- Merging...
197
- ```
198
-
199
- **Merge Logic:**
200
-
201
- - Extract framework's "Getting Started" or "Installation" section
202
- - Use AI Flow's README template as base
203
- - Insert framework's quick start in appropriate section
204
- - Ensure no duplication
205
- - Keep AI Flow's structure (overview, features, tech stack, etc.)
206
-
207
- **If user chooses B (skip):**
208
-
209
- ```
210
- ⏭️ Skipping framework initialization.
211
-
212
- You can initialize manually later with:
213
- [Show appropriate CLI command]
214
-
215
- Proceeding to documentation generation...
216
- ```
217
- ---
218
- ## 8.3: Generate Final Documentation
219
-
220
- ```
221
- 📖 Re-reading all generated documents to ensure accuracy...
222
-
223
- ✅ Re-reading project-brief.md
224
- ✅ Re-reading docs/app-structure.md
225
- ✅ Re-reading docs/architecture.md
226
- ✅ Re-reading ai-instructions.md
227
- ✅ Re-reading docs/code-standards.md
228
- ✅ Re-reading docs/testing.md
229
- ✅ Re-reading docs/app-store.md
230
- ✅ Re-reading specs/build-configuration.md
231
- ✅ Re-reading specs/deployment.md
232
- ✅ Re-reading .env.example
233
-
234
- ✅ Context fully loaded and updated!
235
-
236
- 🎉 Now generating final 5 documents:
237
-
238
- 1. docs/platform-guides.md - iOS and Android specific implementations
239
- 2. docs/navigation-guide.md - Navigation patterns and screen flow
240
- 3. docs/contributing.md - Contribution guidelines
241
- 4. .gitignore - Ignore patterns for React Native/Flutter
242
- 5. AGENT.md - Universal AI configuration (master index)
243
- 6. README.md - Project overview (consolidates all phases)
244
-
245
- Generating...
246
- ```
247
-
248
- ### 8.3.1: Generate docs/platform-guides.md
249
-
250
- - **Template:** `.ai-flow/templates/docs/platform-guides.template.md`
251
- - **Content from:** Phase 2 (app structure) + Phase 4 (platform permissions)
252
- - **Requirements:**
253
- - iOS-specific implementations
254
- - Android-specific implementations
255
- - Platform-specific APIs usage
256
- - Native module integration (if any)
257
- - Platform permissions setup
258
-
259
- **📝 Action:** Write the complete file to `docs/platform-guides.md`
260
-
261
- ```
262
- ✅ Generated: docs/platform-guides.md
263
- ```
264
-
265
- ### 8.3.2: Generate docs/navigation-guide.md
266
-
267
- - **Template:** `.ai-flow/templates/docs/navigation-guide.template.md`
268
- - **Content from:** Phase 2 (navigation) + Phase 3 (architecture)
269
- - **Requirements:**
270
- - Navigation strategy (stack, tabs, drawer)
271
- - Screen hierarchy
272
- - Deep linking setup
273
- - Navigation parameters
274
- - Authentication flow
275
-
276
- **📝 Action:** Write the complete file to `docs/navigation-guide.md`
277
-
278
- ```
279
- ✅ Generated: docs/navigation-guide.md
280
- ```
281
-
282
- ### 8.3.3: Generate docs/contributing.md
283
-
284
- - **Template:** `.ai-flow/templates/docs/contributing.template.md`
285
- - **Content from:** Phase 5 (code standards) + Phase 7 (deployment)
286
- - **Requirements:**
287
- - Git workflow from Phase 5
288
- - Commit message format
289
- - Code review process
290
- - Setup instructions
291
- - Testing requirements from Phase 6
292
- - Build and release process
293
-
294
- **📝 Action:** Write the complete file to `docs/contributing.md`
295
-
296
- ```
297
- ✅ Generated: docs/contributing.md
298
- ```
299
- ---
300
- ## 8.3.4: Generate .gitignore
301
-
302
- **IMPORTANT:** Generate a comprehensive `.gitignore` file based on the mobile framework selected in previous phases.
303
-
304
- ```
305
- 📝 Generating .gitignore for your mobile stack...
306
- ```
307
-
308
- **Strategy:**
309
-
310
- 1. **Detect framework from Phase 3** (React Native, Flutter, etc.)
311
- 2. **Detect package manager** (npm, yarn, pub)
312
- 3. **Combine relevant patterns**
313
-
314
- **React Native patterns:**
315
-
316
- ```gitignore
317
- # React Native
318
- node_modules/
319
- npm-debug.log*
320
- yarn-debug.log*
321
- yarn-error.log*
322
- .pnpm-debug.log*
323
-
324
- # Metro bundler
325
- .metro-health-check*
326
-
327
- # OSX
328
- .DS_Store
329
-
330
- # Android
331
- android/app/build/
332
- android/app/release/
333
- android/.gradle/
334
- android/local.properties
335
- android/.idea/
336
- android/*.iml
337
- android/app/debug/
338
- android/app/profile/
339
- android/keystore.properties
340
- android/key.properties
341
-
342
- # iOS
343
- ios/Pods/
344
- ios/**/*.mode1v3
345
- ios/**/*.mode2v3
346
- ios/**/*.perspectivev3
347
- ios/**/*.pbxuser
348
- ios/**/*.xcworkspace/xcuserdata
349
- ios/**/.DS_Store
350
- ios/build/
351
- ios/.xcode.env.local
352
- DerivedData/
353
-
354
- # Expo
355
- .expo/
356
- .expo-shared/
357
- web-build/
358
- dist/
359
-
360
- # Testing
361
- coverage/
362
- .nyc_output/
363
-
364
- # Environment
365
- .env
366
- .env*.local
367
-
368
- # IDE
369
- .vscode/
370
- .idea/
371
- *.swp
372
- *.swo
373
- *~
374
-
375
- # Logs
376
- logs/
377
- *.log
378
- ```
379
-
380
- **Flutter patterns:**
381
-
382
- ```gitignore
383
- # Flutter
384
- .dart_tool/
385
- .flutter-plugins
386
- .flutter-plugins-dependencies
387
- .packages
388
- .pub-cache/
389
- .pub/
390
- build/
391
- flutter_*.png
392
- linked_*.ds
393
- unlinked.ds
394
- unlinked_spec.ds
395
-
396
- # Android
397
- android/app/debug/
398
- android/app/profile/
399
- android/app/release/
400
- android/.gradle/
401
- android/local.properties
402
- android/gradle/
403
- android/gradlew
404
- android/gradlew.bat
405
- android/key.properties
406
-
407
- # iOS
408
- ios/Flutter/.last_build_id
409
- ios/Flutter/flutter_export_environment.sh
410
- ios/Pods/
411
- ios/**/*.mode1v3
412
- ios/**/*.mode2v3
413
- ios/**/*.pbxuser
414
- ios/**/*.perspectivev3
415
- ios/**/*.xcworkspace/xcuserdata
416
- ios/Runner.xcworkspace/
417
-
418
- # Web
419
- web/packages/
420
-
421
- # macOS
422
- macos/Flutter/
423
-
424
- # Testing
425
- coverage/
426
- .test_coverage.dart
427
-
428
- # Environment
429
- .env
430
- .env*.local
431
-
432
- # IDE
433
- .vscode/
434
- .idea/
435
- *.swp
436
- *.swo
437
- *.iml
438
-
439
- # OS
440
- .DS_Store
441
- Thumbs.db
442
- ```
443
-
444
- **📝 Action:** Generate and write `.gitignore` to project root.
445
-
446
- **Selection logic:**
447
-
448
- - If React Native → Use React Native patterns
449
- - If Flutter → Use Flutter patterns
450
- - If Expo detected → Add Expo-specific patterns
451
-
452
- ```
453
- ✅ Generated: .gitignore
454
- Patterns included: [React Native | Flutter] + Platform-specific
455
- ```
456
- ---
457
- ## 8.4: Generate AGENT.md (Master Index)
458
-
459
- - **Template:** `.ai-flow/templates/AGENT.template.md`
460
- - **Content from:** ALL phases (this is the aggregator)
461
- - **Requirements:**
462
- - **CRITICAL:** Re-read ALL previously generated documents before filling
463
- - List all documents with descriptions
464
- - Provide quick reference to tech stack
465
- - Include critical architecture rules
466
- - Link to all specs and docs
467
- - Summarize key decisions from each phase
468
- - Include common commands
469
-
470
- **Structure:**
471
-
472
- ```markdown
473
- # 🤖 AGENT.md - Universal AI Assistant Configuration
474
-
475
- ## 📚 Documentation Index
476
-
477
- ### Core Documents
478
-
479
- 1. **project-brief.md** - [1-sentence description]
480
- 2. **ai-instructions.md** - [1-sentence description]
481
-
482
- ### Documentation
483
-
484
- 3. **docs/app-structure.md** - [1-sentence description]
485
- 4. **docs/architecture.md** - [1-sentence description]
486
- 5. **docs/platform-guides.md** - [1-sentence description]
487
- 6. **docs/navigation-guide.md** - [1-sentence description]
488
- 7. **docs/code-standards.md** - [1-sentence description]
489
- 8. **docs/testing.md** - [1-sentence description]
490
- 9. **docs/app-store.md** - [1-sentence description]
491
- 10. **docs/contributing.md** - [1-sentence description]
492
-
493
- ### Specifications
494
-
495
- 11. **specs/build-configuration.md** - [1-sentence description]
496
- 12. **specs/deployment.md** - [1-sentence description]
497
- 13. **.env.example** - Environment variables template
498
- 14. **README.md** - Project overview and setup
499
-
500
- ## 🎯 Quick Reference
501
-
502
- ### Tech Stack
503
-
504
- [List from Phase 1 & 3]
505
-
506
- ### Critical Rules
507
-
508
- [Key rules from code-standards.md and ai-instructions.md]
509
-
510
- ### Common Commands
511
-
512
- [From deployment.md and contributing.md]
513
- ```
514
-
515
- **📝 Action:**
516
-
517
- ```
518
- 🔄 Re-reading all generated documents for AGENT.md generation...
519
-
520
- ✅ Reading .ai-flow/project-brief.md
521
- ✅ Reading .ai-flow/ai-instructions.md
522
- ✅ Reading docs/app-structure.md
523
- ✅ Reading docs/architecture.md
524
- ✅ Reading docs/platform-guides.md
525
- ✅ Reading docs/navigation-guide.md
526
- ✅ Reading docs/code-standards.md
527
- ✅ Reading docs/testing.md
528
- ✅ Reading docs/app-store.md
529
- ✅ Reading specs/build-configuration.md
530
- ✅ Reading specs/deployment.md
531
- ✅ Reading docs/contributing.md
532
-
533
- ✅ All context loaded!
534
- ```
535
-
536
- **📝 Action:** Write the complete file to `.ai-flow/AGENT.md`
537
-
538
- ```
539
- ✅ Generated: .ai-flow/AGENT.md (Master Index)
540
- ```
541
- ---
542
- ## 8.5: Generate README.md (Intelligent Merge)
543
-
544
- - **Template:** `.ai-flow/templates/README.template.md`
545
- - **Content from:** ALL phases (most comprehensive document)
546
- - **Requirements:**
547
- - **CRITICAL:** Re-read ALL documents before generating
548
- - Include project overview from Phase 1
549
- - List features from Phase 1
550
- - Show tech stack from Phase 1 & 3
551
- - Include quick start from Phase 7
552
- - Link to all documentation
553
- - Include deployment info from Phase 7
554
- - Add app store links placeholders
555
-
556
- **Merge Strategy (if framework README exists):**
557
-
558
- 1. **Read framework's README.md** (if exists from step 8.2)
559
- 2. **Extract valuable sections:**
560
- - Installation commands specific to framework
561
- - Framework-specific setup instructions
562
- - Running on iOS/Android commands
563
- - Troubleshooting tips
564
- 3. **Use AI Flow template as base structure:**
565
- - Project name and description (from Phase 1)
566
- - Features (from Phase 1)
567
- - Tech stack (from Phase 1 & 3)
568
- - Architecture overview (link to docs/architecture.md)
569
- - Getting started (merge with framework's instructions)
570
- - Platform setup (iOS/Android requirements)
571
- - Testing (link to docs/testing.md)
572
- - Deployment (from Phase 7)
573
- - Contributing (link to docs/contributing.md)
574
- 4. **Insert framework-specific content** in "Getting Started" section
575
- 5. **Ensure no duplication**
576
- 6. **Validate all links** work correctly
577
-
578
- **📝 Action:** Write the complete file to `.ai-flow/README.md`
579
-
580
- ```
581
- ✅ Generated: .ai-flow/README.md
582
- [If merged] Merged with framework's setup instructions
583
- ```
584
- ---
585
- ## 8.6: Create Tool-Specific Configs
586
-
587
- **Based on AI tool selection from Phase 1:**
588
-
589
- ### If Claude selected:
590
-
591
- **Create `.clauderules`:**
592
-
593
- ```markdown
594
- # Claude AI Configuration
595
-
596
- This project uses AI Flow documentation structure.
597
-
598
- ## Primary Reference
599
-
600
- Read `.ai-flow/AGENT.md` first for complete documentation index.
601
-
602
- ## Key Documents
603
-
604
- - Project overview: `.ai-flow/project-brief.md`
605
- - AI instructions: `.ai-flow/ai-instructions.md`
606
- - Architecture: `docs/architecture.md`
607
- - App Structure: `docs/app-structure.md`
608
- - Platform Guides: `docs/platform-guides.md`
609
- - Navigation: `docs/navigation-guide.md`
610
- - Code standards: `docs/code-standards.md`
611
-
612
- ## Working Instructions
613
-
614
- When writing code:
615
-
616
- 1. Follow patterns in `docs/code-standards.md`
617
- 2. Reference app structure in `docs/app-structure.md`
618
- 3. Follow platform guidelines from `docs/platform-guides.md`
619
- 4. Implement navigation per `docs/navigation-guide.md`
620
- 5. Write tests per `docs/testing.md`
621
-
622
- ## Critical Rules
623
-
624
- [Extract top 5-10 rules from ai-instructions.md]
625
- ```
626
-
627
- ### If Cursor selected:
628
-
629
- **Create `.cursorrules`:**
630
-
631
- ```markdown
632
- # Cursor AI Configuration
633
-
634
- Project uses AI Flow documentation in `.ai-flow/` directory.
635
-
636
- ## Documentation Index
637
-
638
- See `.ai-flow/AGENT.md` for complete document list.
639
-
640
- ## Quick Reference
641
-
642
- - Tech Stack: [from Phase 1 & 3]
643
- - Architecture: `docs/architecture.md`
644
- - Platform Guides: `docs/platform-guides.md`
645
- - Code Standards: `docs/code-standards.md`
646
-
647
- ## Code Generation Rules
648
-
649
- [Extract key rules from ai-instructions.md]
650
- ```
651
-
652
- ### If GitHub Copilot selected:
653
-
654
- **Create `.github/copilot-instructions.md`:**
655
-
656
- ```markdown
657
- # GitHub Copilot Instructions
658
-
659
- ## Project Context
660
-
661
- [Project description from Phase 1]
662
-
663
- ## Documentation Structure
664
-
665
- This project uses AI Flow. All documentation is in `.ai-flow/` directory.
666
-
667
- Master index: `.ai-flow/AGENT.md`
668
-
669
- ## Key References
670
-
671
- - Architecture: `docs/architecture.md`
672
- - App Structure: `docs/app-structure.md`
673
- - Platform Guides: `docs/platform-guides.md`
674
- - Navigation: `docs/navigation-guide.md`
675
- - Code Standards: `docs/code-standards.md`
676
- - Testing: `docs/testing.md`
677
-
678
- ## Code Generation Guidelines
679
-
680
- [Extract guidelines from ai-instructions.md and code-standards.md]
681
-
682
- ## Tech Stack
683
-
684
- [From Phase 1 & 3]
685
- ```
686
-
687
- **📝 Action:** Generate the tool-specific config files based on selection:
688
-
689
- - If Claude → Write `.clauderules`
690
- - If Cursor → Write `.cursorrules`
691
- - If Copilot → Write `.github/copilot-instructions.md`
692
- - If "All" → Write all three files
693
-
694
- ```
695
- ✅ Generated tool-specific configs:
696
- [List generated files based on selection]
697
- ```
698
- ---
699
- ## 8.7: Final Validation & Success Message
700
-
701
- ```
702
- 🔍 Validating all generated files...
703
-
704
- ✅ Checking for placeholder text...
705
- ✅ Validating file references...
706
- ✅ Ensuring all links work...
707
- ✅ Verifying template completeness...
708
-
709
- All validations passed!
710
- ```
711
-
712
- **Show complete summary:**
713
-
714
- ```
715
- 🎉 AI Flow Complete!
716
-
717
- Generated 15 documents successfully:
718
-
719
- Phase 1:
720
- ✅ project-brief.md
721
-
722
- Phase 2:
723
- ✅ docs/app-structure.md
724
-
725
- Phase 3:
726
- ✅ docs/architecture.md
727
- ✅ ai-instructions.md
728
-
729
- Phase 5:
730
- ✅ docs/code-standards.md
731
-
732
- Phase 6:
733
- ✅ docs/testing.md
734
-
735
- Phase 7:
736
- ✅ docs/app-store.md
737
- ✅ specs/build-configuration.md
738
- ✅ specs/deployment.md
739
- ✅ .env.example
740
-
741
- Phase 8:
742
- ✅ docs/platform-guides.md
743
- ✅ docs/navigation-guide.md
744
- ✅ docs/contributing.md
745
- ✅ .gitignore
746
- ✅ README.md
747
- ✅ AGENT.md
748
-
749
- [If framework initialized:]
750
- ✅ [FRAMEWORK_NAME] project initialized
751
-
752
- [If README merged:]
753
- ✅ README.md merged with framework's setup instructions
754
-
755
- Tool-specific configs:
756
- ✅ [List generated configs]
757
- ---
758
- 📁 Project Structure:
759
-
760
- your-app/
761
- ├── .ai-flow/ # AI Flow documentation
762
- │ ├── AGENT.md ⭐ Start here!
763
- │ ├── project-brief.md
764
- │ ├── ai-instructions.md
765
- │ ├── docs/
766
- │ │ ├── app-structure.md
767
- │ │ ├── architecture.md
768
- │ │ ├── platform-guides.md
769
- │ │ ├── navigation-guide.md
770
- │ │ ├── code-standards.md
771
- │ │ ├── testing.md
772
- │ │ ├── app-store.md
773
- │ │ └── contributing.md
774
- │ ├── specs/
775
- │ │ ├── build-configuration.md
776
- │ │ └── deployment.md
777
- │ └── templates/ # Original templates
778
- ├── ios/ # iOS platform (if initialized)
779
- ├── android/ # Android platform (if initialized)
780
- ├── src/ or lib/ # Source code (if initialized)
781
- ├── README.md
782
- ├── .env.example
783
- ├── .gitignore
784
- └── [tool configs] # .clauderules, .cursorrules, etc.
785
- ---
786
- Next steps:
787
-
788
- 1. ⭐ **Read `.ai-flow/AGENT.md`** - Master index of all documentation
789
- 2. 📖 **Review generated documents** - Customize as needed
790
- 3. 🔧 **Set up environment** - Copy `.env.example` to `.env` and configure
791
- [If NOT initialized:]
792
- 4. 🚀 **Initialize framework** - Run: `[show command from Phase 1]`
793
- [If initialized:]
794
- 4. 🚀 **Install dependencies** - Run platform-specific setup:
795
- • React Native: `npm install && cd ios && pod install`
796
- • Flutter: `flutter pub get`
797
- • Expo: `npm install`
798
- 5. 📱 **Run on device/simulator**:
799
- • iOS: `npm run ios` or `flutter run`
800
- • Android: `npm run android` or `flutter run`
801
- 6. 💾 **Initialize git** (if not done) - `git init && git add . && git commit -m "Initial commit with AI Flow docs"`
802
- 7. 🧪 **Start developing!** - Your AI assistant now has complete project context
803
- ---
804
- 💡 **Remember:**
805
- - Documents are **living artifacts** - update them as project evolves
806
- - All AI assistants will reference these docs for future work
807
- - AGENT.md is the **single source of truth** for AI context
808
-
809
- 🤖 **AI Assistant Usage:**
810
- Your AI assistant (Claude, Cursor, Copilot) will now:
811
- - ✅ Understand complete project context
812
- - ✅ Follow your architecture patterns
813
- - ✅ Generate code matching your standards
814
- - ✅ Reference your app structure
815
- - ✅ Apply platform-specific best practices
816
- - ✅ Write tests per your guidelines
817
-
818
- Happy building! 🎉📱
819
- ```
820
- ---
821
- ## EXECUTION CHECKLIST FOR AI ASSISTANT
822
-
823
- When executing Phase 8:
824
-
825
- **8.1 Project State Detection:**
826
-
827
- - [ ] Scan for source directories (src/, lib/, app/)
828
- - [ ] Check for platform directories (ios/, android/)
829
- - [ ] Check for framework files (package.json, pubspec.yaml, etc.)
830
- - [ ] Check for existing README.md
831
- - [ ] Classify project: New / Initialized / Existing
832
- - [ ] Present detection results
833
-
834
- **8.2 Framework Initialization (if new project):**
835
-
836
- - [ ] Ask user if they want to initialize
837
- - [ ] If yes:
838
- - [ ] Backup .ai-flow/ docs
839
- - [ ] Execute framework CLI command
840
- - [ ] Restore .ai-flow/ docs
841
- - [ ] Handle README.md conflict
842
- - [ ] If no: Show manual command and continue
843
-
844
- **8.3 Generate Final Documentation:**
845
-
846
- - [ ] Re-read ALL previously generated documents
847
- - [ ] Generate docs/platform-guides.md
848
- - [ ] Generate docs/navigation-guide.md
849
- - [ ] Generate docs/contributing.md
850
-
851
- **8.4 Generate AGENT.md:**
852
-
853
- - [ ] Re-read ALL documents again
854
- - [ ] Create master index
855
- - [ ] Include quick reference
856
- - [ ] Validate all links
857
-
858
- **8.5 Generate README.md:**
859
-
860
- - [ ] Re-read ALL documents
861
- - [ ] If framework README exists: merge intelligently
862
- - [ ] If no framework README: create from template
863
- - [ ] Validate all internal links
864
-
865
- **8.6 Create Tool-Specific Configs:**
866
-
867
- - [ ] Create configs based on AI tool selection
868
-
869
- **8.7 Final Validation:**
870
-
871
- - [ ] Check for placeholders
872
- - [ ] Validate file references
873
- - [ ] Show success message
874
-
875
- **ESTIMATED TIME:** 10-15 minutes
876
- ---
877
- **Next Phase:** Phase 9 - Project Roadmap (Post-Documentation)
878
-
879
- Read: `.ai-flow/prompts/mobile/flow-build-phase-9.md`
880
-
881
- ---
882
-
883
- **Last Updated:** 2025-12-21
884
- **Version:** 2.1.9
885
-
886
-
887
-
888
-
1
+ # 🏆 Phase 8: Project Setup & Final Documentation
2
+
3
+ **Context:** Phases 1-7 have collected all project information. Now we'll initialize the framework (if needed) and generate all final documentation.
4
+
5
+ **Duration:** 10-15 minutes
6
+
7
+ **Goal:** Set up the project structure and create comprehensive documentation that consolidates all information from previous phases.
8
+ ---
9
+ ## 📋 Phase 8 Overview
10
+
11
+ This final phase will:
12
+
13
+ 1. **Detect project state** (new vs existing project)
14
+ 2. **Initialize framework** (optional, for new projects)
15
+ 3. **Generate final documentation** (platform guides, deployment, app store)
16
+ 4. **Generate master index** (AGENT.md)
17
+ 5. **Generate README.md** (with intelligent merge if needed)
18
+ 6. **Create tool-specific configs** (based on AI tool selection)
19
+ ---
20
+ // turbo
21
+ ## 8.1: Project State Detection
22
+
23
+ ```
24
+ 🔍 Detecting current project state...
25
+
26
+ **⚠️ CRITICAL: Ignore AI Flow documentation and Meta files during detection:**
27
+ - Files: project-brief.md, ai-instructions.md, AGENT.md, .env.example, .cursorrules, .clauderules, .geminirules
28
+ - Directories: .ai-flow/, .agent/, docs/, specs/
29
+ ```
30
+
31
+ **Auto-detect:**
32
+
33
+ - [ ] Check for existing source code (`src/`, `app/`, `ios/`, `android/`, `lib/`, etc.)
34
+ - [ ] Check for framework files (`package.json`, `pubspec.yaml`, `Podfile`, `build.gradle`, etc.)
35
+ - [ ] Check for platform directories (`ios/`, `android/`, `lib/` for Flutter)
36
+ - [ ] Check for existing README.md (framework-generated or custom)
37
+
38
+ **Classification:**
39
+
40
+ - **New Project**: No source code, no framework files
41
+ - **Initialized Framework**: Has framework files, has source code
42
+ - **Existing Project**: Has source code but AI Flow docs were just created
43
+
44
+ **Present Detection Results:**
45
+
46
+ ```
47
+ 📊 Project State Detection:
48
+
49
+ Type: [New Project | Initialized Framework | Existing Project]
50
+
51
+ Found:
52
+ - Source directories: [list or none]
53
+ - Framework files: [list or none]
54
+ - Platform directories: [ios/, android/, or none]
55
+ - Package manager: [npm/yarn/flutter/etc. or none]
56
+ - README.md: [exists: yes/no]
57
+
58
+ Recommendation: [Next action based on state]
59
+ ```
60
+ ---
61
+ ## 8.2: Framework Initialization (Optional)
62
+
63
+ **Only if:** Project state = "New Project"
64
+
65
+ ### 8.2.1: Ask User Preference
66
+
67
+ ```
68
+ 🎯 Your project appears to be new.
69
+
70
+ Would you like me to initialize the [FRAMEWORK_NAME] project structure now?
71
+
72
+ Options:
73
+ A) ✅ Yes, initialize [FRAMEWORK_NAME] (recommended)
74
+ B) ⏭️ Skip for now (manual setup later)
75
+
76
+ → Your choice:
77
+ ```
78
+
79
+ **If user chooses A (initialize):**
80
+
81
+ ### 8.2.2: Pre-initialization Backup
82
+
83
+ ```
84
+ 📦 Preparing for framework initialization...
85
+
86
+ Creating backup of AI Flow documentation:
87
+ → Moving .ai-flow/ docs to .ai-flow/temp-backup/
88
+
89
+ Files to backup:
90
+ ✅ project-brief.md
91
+ ✅ docs/app-structure.md
92
+ ✅ docs/architecture.md
93
+ ✅ ai-instructions.md
94
+ ✅ docs/code-standards.md
95
+ ✅ docs/testing.md
96
+ ✅ docs/app-store.md
97
+ ✅ specs/build-configuration.md
98
+ ✅ specs/deployment.md
99
+ ✅ .env.example
100
+
101
+ Backup complete! Safe to initialize framework.
102
+ ```
103
+
104
+ ### 8.2.3: Execute Framework CLI
105
+
106
+ **Based on framework detected in Phase 1:**
107
+
108
+ **React Native:**
109
+
110
+ ```bash
111
+ # React Native CLI
112
+ npx react-native@latest init ProjectName --skip-git
113
+
114
+ # Expo (managed workflow)
115
+ npx create-expo-app@latest . --template blank-typescript
116
+
117
+ # Expo (bare workflow)
118
+ npx create-expo-app@latest . --template bare-typescript
119
+ ```
120
+
121
+ **Flutter:**
122
+
123
+ ```bash
124
+ # Flutter CLI
125
+ flutter create . --org com.yourcompany --platforms ios,android
126
+
127
+ # Flutter with specific template
128
+ flutter create . --template app --org com.yourcompany
129
+ ```
130
+
131
+ **Native iOS:**
132
+
133
+ ```bash
134
+ # SwiftUI app
135
+ xcodegen generate
136
+ # Or manually create Xcode project
137
+ ```
138
+
139
+ **Native Android:**
140
+
141
+ ```bash
142
+ # Android Studio template
143
+ # Create manually through Android Studio or use Gradle
144
+ ```
145
+
146
+ **Other cross-platform:**
147
+
148
+ ```bash
149
+ # Ionic
150
+ ionic start . blank --type=angular --capacitor
151
+
152
+ # Capacitor
153
+ npm init @capacitor/app
154
+
155
+ # NativeScript
156
+ ns create . --template @nativescript/template-blank-ts
157
+
158
+ # Kotlin Multiplatform Mobile
159
+ # Create through IntelliJ IDEA or Android Studio
160
+ ```
161
+
162
+ **Show progress:**
163
+
164
+ ```
165
+ 🚀 Initializing [FRAMEWORK_NAME]...
166
+
167
+ [Framework CLI output]
168
+
169
+ ✅ Framework initialized successfully!
170
+ ```
171
+
172
+ ### 8.2.4: Restore AI Flow Documentation
173
+
174
+ ```
175
+ 📥 Restoring AI Flow documentation...
176
+
177
+ Moving files from .ai-flow/temp-backup/ back to .ai-flow/
178
+
179
+ ✅ All AI Flow docs restored!
180
+ ```
181
+
182
+ ### 8.2.5: Handle README.md Conflict
183
+
184
+ **If framework created README.md:**
185
+
186
+ ```
187
+ ⚠️ Framework generated its own README.md
188
+
189
+ I'll merge it with AI Flow's comprehensive README:
190
+
191
+ Strategy:
192
+ 1. Keep framework's quick start section (if valuable)
193
+ 2. Replace with AI Flow's comprehensive content
194
+ 3. Preserve any framework-specific setup instructions
195
+
196
+ Merging...
197
+ ```
198
+
199
+ **Merge Logic:**
200
+
201
+ - Extract framework's "Getting Started" or "Installation" section
202
+ - Use AI Flow's README template as base
203
+ - Insert framework's quick start in appropriate section
204
+ - Ensure no duplication
205
+ - Keep AI Flow's structure (overview, features, tech stack, etc.)
206
+
207
+ **If user chooses B (skip):**
208
+
209
+ ```
210
+ ⏭️ Skipping framework initialization.
211
+
212
+ You can initialize manually later with:
213
+ [Show appropriate CLI command]
214
+
215
+ Proceeding to documentation generation...
216
+ ```
217
+ ---
218
+ ## 8.3: Generate Final Documentation
219
+
220
+ ```
221
+ 📖 Re-reading all generated documents to ensure accuracy...
222
+
223
+ ✅ Re-reading project-brief.md
224
+ ✅ Re-reading docs/app-structure.md
225
+ ✅ Re-reading docs/architecture.md
226
+ ✅ Re-reading ai-instructions.md
227
+ ✅ Re-reading docs/code-standards.md
228
+ ✅ Re-reading docs/testing.md
229
+ ✅ Re-reading docs/app-store.md
230
+ ✅ Re-reading specs/build-configuration.md
231
+ ✅ Re-reading specs/deployment.md
232
+ ✅ Re-reading .env.example
233
+
234
+ ✅ Context fully loaded and updated!
235
+
236
+ 🎉 Now generating final 5 documents:
237
+
238
+ 1. docs/platform-guides.md - iOS and Android specific implementations
239
+ 2. docs/navigation-guide.md - Navigation patterns and screen flow
240
+ 3. docs/contributing.md - Contribution guidelines
241
+ 4. .gitignore - Ignore patterns for React Native/Flutter
242
+ 5. AGENT.md - Universal AI configuration (master index)
243
+ 6. README.md - Project overview (consolidates all phases)
244
+
245
+ Generating...
246
+ ```
247
+
248
+ ### 8.3.1: Generate docs/platform-guides.md
249
+
250
+ - **Template:** `.ai-flow/templates/docs/platform-guides.template.md`
251
+ - **Content from:** Phase 2 (app structure) + Phase 4 (platform permissions)
252
+ - **Requirements:**
253
+ - iOS-specific implementations
254
+ - Android-specific implementations
255
+ - Platform-specific APIs usage
256
+ - Native module integration (if any)
257
+ - Platform permissions setup
258
+
259
+ **📝 Action:** Write the complete file to `docs/platform-guides.md`
260
+
261
+ ```
262
+ ✅ Generated: docs/platform-guides.md
263
+ ```
264
+
265
+ ### 8.3.2: Generate docs/navigation-guide.md
266
+
267
+ - **Template:** `.ai-flow/templates/docs/navigation-guide.template.md`
268
+ - **Content from:** Phase 2 (navigation) + Phase 3 (architecture)
269
+ - **Requirements:**
270
+ - Navigation strategy (stack, tabs, drawer)
271
+ - Screen hierarchy
272
+ - Deep linking setup
273
+ - Navigation parameters
274
+ - Authentication flow
275
+
276
+ **📝 Action:** Write the complete file to `docs/navigation-guide.md`
277
+
278
+ ```
279
+ ✅ Generated: docs/navigation-guide.md
280
+ ```
281
+
282
+ ### 8.3.3: Generate docs/contributing.md
283
+
284
+ - **Template:** `.ai-flow/templates/docs/contributing.template.md`
285
+ - **Content from:** Phase 5 (code standards) + Phase 7 (deployment)
286
+ - **Requirements:**
287
+ - Git workflow from Phase 5
288
+ - Commit message format
289
+ - Code review process
290
+ - Setup instructions
291
+ - Testing requirements from Phase 6
292
+ - Build and release process
293
+
294
+ **📝 Action:** Write the complete file to `docs/contributing.md`
295
+
296
+ ```
297
+ ✅ Generated: docs/contributing.md
298
+ ```
299
+ ---
300
+ ## 8.3.4: Generate .gitignore
301
+
302
+ **IMPORTANT:** Generate a comprehensive `.gitignore` file based on the mobile framework selected in previous phases.
303
+
304
+ ```
305
+ 📝 Generating .gitignore for your mobile stack...
306
+ ```
307
+
308
+ **Strategy:**
309
+
310
+ 1. **Detect framework from Phase 3** (React Native, Flutter, etc.)
311
+ 2. **Detect package manager** (npm, yarn, pub)
312
+ 3. **Combine relevant patterns**
313
+
314
+ **React Native patterns:**
315
+
316
+ ```gitignore
317
+ # React Native
318
+ node_modules/
319
+ npm-debug.log*
320
+ yarn-debug.log*
321
+ yarn-error.log*
322
+ .pnpm-debug.log*
323
+
324
+ # Metro bundler
325
+ .metro-health-check*
326
+
327
+ # OSX
328
+ .DS_Store
329
+
330
+ # Android
331
+ android/app/build/
332
+ android/app/release/
333
+ android/.gradle/
334
+ android/local.properties
335
+ android/.idea/
336
+ android/*.iml
337
+ android/app/debug/
338
+ android/app/profile/
339
+ android/keystore.properties
340
+ android/key.properties
341
+
342
+ # iOS
343
+ ios/Pods/
344
+ ios/**/*.mode1v3
345
+ ios/**/*.mode2v3
346
+ ios/**/*.perspectivev3
347
+ ios/**/*.pbxuser
348
+ ios/**/*.xcworkspace/xcuserdata
349
+ ios/**/.DS_Store
350
+ ios/build/
351
+ ios/.xcode.env.local
352
+ DerivedData/
353
+
354
+ # Expo
355
+ .expo/
356
+ .expo-shared/
357
+ web-build/
358
+ dist/
359
+
360
+ # Testing
361
+ coverage/
362
+ .nyc_output/
363
+
364
+ # Environment
365
+ .env
366
+ .env*.local
367
+
368
+ # IDE
369
+ .vscode/
370
+ .idea/
371
+ *.swp
372
+ *.swo
373
+ *~
374
+
375
+ # Logs
376
+ logs/
377
+ *.log
378
+ ```
379
+
380
+ **Flutter patterns:**
381
+
382
+ ```gitignore
383
+ # Flutter
384
+ .dart_tool/
385
+ .flutter-plugins
386
+ .flutter-plugins-dependencies
387
+ .packages
388
+ .pub-cache/
389
+ .pub/
390
+ build/
391
+ flutter_*.png
392
+ linked_*.ds
393
+ unlinked.ds
394
+ unlinked_spec.ds
395
+
396
+ # Android
397
+ android/app/debug/
398
+ android/app/profile/
399
+ android/app/release/
400
+ android/.gradle/
401
+ android/local.properties
402
+ android/gradle/
403
+ android/gradlew
404
+ android/gradlew.bat
405
+ android/key.properties
406
+
407
+ # iOS
408
+ ios/Flutter/.last_build_id
409
+ ios/Flutter/flutter_export_environment.sh
410
+ ios/Pods/
411
+ ios/**/*.mode1v3
412
+ ios/**/*.mode2v3
413
+ ios/**/*.pbxuser
414
+ ios/**/*.perspectivev3
415
+ ios/**/*.xcworkspace/xcuserdata
416
+ ios/Runner.xcworkspace/
417
+
418
+ # Web
419
+ web/packages/
420
+
421
+ # macOS
422
+ macos/Flutter/
423
+
424
+ # Testing
425
+ coverage/
426
+ .test_coverage.dart
427
+
428
+ # Environment
429
+ .env
430
+ .env*.local
431
+
432
+ # IDE
433
+ .vscode/
434
+ .idea/
435
+ *.swp
436
+ *.swo
437
+ *.iml
438
+
439
+ # OS
440
+ .DS_Store
441
+ Thumbs.db
442
+ ```
443
+
444
+ **📝 Action:** Generate and write `.gitignore` to project root.
445
+
446
+ **Selection logic:**
447
+
448
+ - If React Native → Use React Native patterns
449
+ - If Flutter → Use Flutter patterns
450
+ - If Expo detected → Add Expo-specific patterns
451
+
452
+ ```
453
+ ✅ Generated: .gitignore
454
+ Patterns included: [React Native | Flutter] + Platform-specific
455
+ ```
456
+ ---
457
+ ## 8.4: Generate AGENT.md (Master Index)
458
+
459
+ - **Template:** `.ai-flow/templates/AGENT.template.md`
460
+ - **Content from:** ALL phases (this is the aggregator)
461
+ - **Requirements:**
462
+ - **CRITICAL:** Re-read ALL previously generated documents before filling
463
+ - List all documents with descriptions
464
+ - Provide quick reference to tech stack
465
+ - Include critical architecture rules
466
+ - Link to all specs and docs
467
+ - Summarize key decisions from each phase
468
+ - Include common commands
469
+
470
+ **Structure:**
471
+
472
+ ```markdown
473
+ # 🤖 AGENT.md - Universal AI Assistant Configuration
474
+
475
+ ## 📚 Documentation Index
476
+
477
+ ### Core Documents
478
+
479
+ 1. **project-brief.md** - [1-sentence description]
480
+ 2. **ai-instructions.md** - [1-sentence description]
481
+
482
+ ### Documentation
483
+
484
+ 3. **docs/app-structure.md** - [1-sentence description]
485
+ 4. **docs/architecture.md** - [1-sentence description]
486
+ 5. **docs/platform-guides.md** - [1-sentence description]
487
+ 6. **docs/navigation-guide.md** - [1-sentence description]
488
+ 7. **docs/code-standards.md** - [1-sentence description]
489
+ 8. **docs/testing.md** - [1-sentence description]
490
+ 9. **docs/app-store.md** - [1-sentence description]
491
+ 10. **docs/contributing.md** - [1-sentence description]
492
+
493
+ ### Specifications
494
+
495
+ 11. **specs/build-configuration.md** - [1-sentence description]
496
+ 12. **specs/deployment.md** - [1-sentence description]
497
+ 13. **.env.example** - Environment variables template
498
+ 14. **README.md** - Project overview and setup
499
+
500
+ ## 🎯 Quick Reference
501
+
502
+ ### Tech Stack
503
+
504
+ [List from Phase 1 & 3]
505
+
506
+ ### Critical Rules
507
+
508
+ [Key rules from code-standards.md and ai-instructions.md]
509
+
510
+ ### Common Commands
511
+
512
+ [From deployment.md and contributing.md]
513
+ ```
514
+
515
+ **📝 Action:**
516
+
517
+ ```
518
+ 🔄 Re-reading all generated documents for AGENT.md generation...
519
+
520
+ ✅ Reading .ai-flow/project-brief.md
521
+ ✅ Reading .ai-flow/ai-instructions.md
522
+ ✅ Reading docs/app-structure.md
523
+ ✅ Reading docs/architecture.md
524
+ ✅ Reading docs/platform-guides.md
525
+ ✅ Reading docs/navigation-guide.md
526
+ ✅ Reading docs/code-standards.md
527
+ ✅ Reading docs/testing.md
528
+ ✅ Reading docs/app-store.md
529
+ ✅ Reading specs/build-configuration.md
530
+ ✅ Reading specs/deployment.md
531
+ ✅ Reading docs/contributing.md
532
+
533
+ ✅ All context loaded!
534
+ ```
535
+
536
+ **📝 Action:** Write the complete file to `.ai-flow/AGENT.md`
537
+
538
+ ```
539
+ ✅ Generated: .ai-flow/AGENT.md (Master Index)
540
+ ```
541
+ ---
542
+ ## 8.5: Generate README.md (Intelligent Merge)
543
+
544
+ - **Template:** `.ai-flow/templates/README.template.md`
545
+ - **Content from:** ALL phases (most comprehensive document)
546
+ - **Requirements:**
547
+ - **CRITICAL:** Re-read ALL documents before generating
548
+ - Include project overview from Phase 1
549
+ - List features from Phase 1
550
+ - Show tech stack from Phase 1 & 3
551
+ - Include quick start from Phase 7
552
+ - Link to all documentation
553
+ - Include deployment info from Phase 7
554
+ - Add app store links placeholders
555
+
556
+ **Merge Strategy (if framework README exists):**
557
+
558
+ 1. **Read framework's README.md** (if exists from step 8.2)
559
+ 2. **Extract valuable sections:**
560
+ - Installation commands specific to framework
561
+ - Framework-specific setup instructions
562
+ - Running on iOS/Android commands
563
+ - Troubleshooting tips
564
+ 3. **Use AI Flow template as base structure:**
565
+ - Project name and description (from Phase 1)
566
+ - Features (from Phase 1)
567
+ - Tech stack (from Phase 1 & 3)
568
+ - Architecture overview (link to docs/architecture.md)
569
+ - Getting started (merge with framework's instructions)
570
+ - Platform setup (iOS/Android requirements)
571
+ - Testing (link to docs/testing.md)
572
+ - Deployment (from Phase 7)
573
+ - Contributing (link to docs/contributing.md)
574
+ 4. **Insert framework-specific content** in "Getting Started" section
575
+ 5. **Ensure no duplication**
576
+ 6. **Validate all links** work correctly
577
+
578
+ **📝 Action:** Write the complete file to `.ai-flow/README.md`
579
+
580
+ ```
581
+ ✅ Generated: .ai-flow/README.md
582
+ [If merged] Merged with framework's setup instructions
583
+ ```
584
+ ---
585
+ ## 8.6: Create Tool-Specific Configs
586
+
587
+ **Based on AI tool selection from Phase 1:**
588
+
589
+ ### If Claude selected:
590
+
591
+ **Create `.clauderules`:**
592
+
593
+ ```markdown
594
+ # Claude AI Configuration
595
+
596
+ This project uses AI Flow documentation structure.
597
+
598
+ ## Primary Reference
599
+
600
+ Read `.ai-flow/AGENT.md` first for complete documentation index.
601
+
602
+ ## Key Documents
603
+
604
+ - Project overview: `.ai-flow/project-brief.md`
605
+ - AI instructions: `.ai-flow/ai-instructions.md`
606
+ - Architecture: `docs/architecture.md`
607
+ - App Structure: `docs/app-structure.md`
608
+ - Platform Guides: `docs/platform-guides.md`
609
+ - Navigation: `docs/navigation-guide.md`
610
+ - Code standards: `docs/code-standards.md`
611
+
612
+ ## Working Instructions
613
+
614
+ When writing code:
615
+
616
+ 1. Follow patterns in `docs/code-standards.md`
617
+ 2. Reference app structure in `docs/app-structure.md`
618
+ 3. Follow platform guidelines from `docs/platform-guides.md`
619
+ 4. Implement navigation per `docs/navigation-guide.md`
620
+ 5. Write tests per `docs/testing.md`
621
+
622
+ ## Critical Rules
623
+
624
+ [Extract top 5-10 rules from ai-instructions.md]
625
+ ```
626
+
627
+ ### If Cursor selected:
628
+
629
+ **Create `.cursorrules`:**
630
+
631
+ ```markdown
632
+ # Cursor AI Configuration
633
+
634
+ Project uses AI Flow documentation in `.ai-flow/` directory.
635
+
636
+ ## Documentation Index
637
+
638
+ See `.ai-flow/AGENT.md` for complete document list.
639
+
640
+ ## Quick Reference
641
+
642
+ - Tech Stack: [from Phase 1 & 3]
643
+ - Architecture: `docs/architecture.md`
644
+ - Platform Guides: `docs/platform-guides.md`
645
+ - Code Standards: `docs/code-standards.md`
646
+
647
+ ## Code Generation Rules
648
+
649
+ [Extract key rules from ai-instructions.md]
650
+ ```
651
+
652
+ ### If GitHub Copilot selected:
653
+
654
+ **Create `.github/copilot-instructions.md`:**
655
+
656
+ ```markdown
657
+ # GitHub Copilot Instructions
658
+
659
+ ## Project Context
660
+
661
+ [Project description from Phase 1]
662
+
663
+ ## Documentation Structure
664
+
665
+ This project uses AI Flow. All documentation is in `.ai-flow/` directory.
666
+
667
+ Master index: `.ai-flow/AGENT.md`
668
+
669
+ ## Key References
670
+
671
+ - Architecture: `docs/architecture.md`
672
+ - App Structure: `docs/app-structure.md`
673
+ - Platform Guides: `docs/platform-guides.md`
674
+ - Navigation: `docs/navigation-guide.md`
675
+ - Code Standards: `docs/code-standards.md`
676
+ - Testing: `docs/testing.md`
677
+
678
+ ## Code Generation Guidelines
679
+
680
+ [Extract guidelines from ai-instructions.md and code-standards.md]
681
+
682
+ ## Tech Stack
683
+
684
+ [From Phase 1 & 3]
685
+ ```
686
+
687
+ **📝 Action:** Generate the tool-specific config files based on selection:
688
+
689
+ - If Claude → Write `.clauderules`
690
+ - If Cursor → Write `.cursorrules`
691
+ - If Copilot → Write `.github/copilot-instructions.md`
692
+ - If "All" → Write all three files
693
+
694
+ ```
695
+ ✅ Generated tool-specific configs:
696
+ [List generated files based on selection]
697
+ ```
698
+ ---
699
+ ## 8.7: Final Validation & Success Message
700
+
701
+ ```
702
+ 🔍 Validating all generated files...
703
+
704
+ ✅ Checking for placeholder text...
705
+ ✅ Validating file references...
706
+ ✅ Ensuring all links work...
707
+ ✅ Verifying template completeness...
708
+
709
+ All validations passed!
710
+ ```
711
+
712
+ **Show complete summary:**
713
+
714
+ ```
715
+ 🎉 AI Flow Complete!
716
+
717
+ Generated 15 documents successfully:
718
+
719
+ Phase 1:
720
+ ✅ project-brief.md
721
+
722
+ Phase 2:
723
+ ✅ docs/app-structure.md
724
+
725
+ Phase 3:
726
+ ✅ docs/architecture.md
727
+ ✅ ai-instructions.md
728
+
729
+ Phase 5:
730
+ ✅ docs/code-standards.md
731
+
732
+ Phase 6:
733
+ ✅ docs/testing.md
734
+
735
+ Phase 7:
736
+ ✅ docs/app-store.md
737
+ ✅ specs/build-configuration.md
738
+ ✅ specs/deployment.md
739
+ ✅ .env.example
740
+
741
+ Phase 8:
742
+ ✅ docs/platform-guides.md
743
+ ✅ docs/navigation-guide.md
744
+ ✅ docs/contributing.md
745
+ ✅ .gitignore
746
+ ✅ README.md
747
+ ✅ AGENT.md
748
+
749
+ [If framework initialized:]
750
+ ✅ [FRAMEWORK_NAME] project initialized
751
+
752
+ [If README merged:]
753
+ ✅ README.md merged with framework's setup instructions
754
+
755
+ Tool-specific configs:
756
+ ✅ [List generated configs]
757
+ ---
758
+ 📁 Project Structure:
759
+
760
+ your-app/
761
+ ├── .ai-flow/ # AI Flow documentation
762
+ │ ├── AGENT.md ⭐ Start here!
763
+ │ ├── project-brief.md
764
+ │ ├── ai-instructions.md
765
+ │ ├── docs/
766
+ │ │ ├── app-structure.md
767
+ │ │ ├── architecture.md
768
+ │ │ ├── platform-guides.md
769
+ │ │ ├── navigation-guide.md
770
+ │ │ ├── code-standards.md
771
+ │ │ ├── testing.md
772
+ │ │ ├── app-store.md
773
+ │ │ └── contributing.md
774
+ │ ├── specs/
775
+ │ │ ├── build-configuration.md
776
+ │ │ └── deployment.md
777
+ │ └── templates/ # Original templates
778
+ ├── ios/ # iOS platform (if initialized)
779
+ ├── android/ # Android platform (if initialized)
780
+ ├── src/ or lib/ # Source code (if initialized)
781
+ ├── README.md
782
+ ├── .env.example
783
+ ├── .gitignore
784
+ └── [tool configs] # .clauderules, .cursorrules, etc.
785
+ ---
786
+ Next steps:
787
+
788
+ 1. ⭐ **Read `.ai-flow/AGENT.md`** - Master index of all documentation
789
+ 2. 📖 **Review generated documents** - Customize as needed
790
+ 3. 🔧 **Set up environment** - Copy `.env.example` to `.env` and configure
791
+ [If NOT initialized:]
792
+ 4. 🚀 **Initialize framework** - Run: `[show command from Phase 1]`
793
+ [If initialized:]
794
+ 4. 🚀 **Install dependencies** - Run platform-specific setup:
795
+ • React Native: `npm install && cd ios && pod install`
796
+ • Flutter: `flutter pub get`
797
+ • Expo: `npm install`
798
+ 5. 📱 **Run on device/simulator**:
799
+ • iOS: `npm run ios` or `flutter run`
800
+ • Android: `npm run android` or `flutter run`
801
+ 6. 💾 **Initialize git** (if not done) - `git init && git add . && git commit -m "Initial commit with AI Flow docs"`
802
+ 7. 🧪 **Start developing!** - Your AI assistant now has complete project context
803
+ ---
804
+ 💡 **Remember:**
805
+ - Documents are **living artifacts** - update them as project evolves
806
+ - All AI assistants will reference these docs for future work
807
+ - AGENT.md is the **single source of truth** for AI context
808
+
809
+ 🤖 **AI Assistant Usage:**
810
+ Your AI assistant (Claude, Cursor, Copilot) will now:
811
+ - ✅ Understand complete project context
812
+ - ✅ Follow your architecture patterns
813
+ - ✅ Generate code matching your standards
814
+ - ✅ Reference your app structure
815
+ - ✅ Apply platform-specific best practices
816
+ - ✅ Write tests per your guidelines
817
+
818
+ Happy building! 🎉📱
819
+ ```
820
+ ---
821
+ ## EXECUTION CHECKLIST FOR AI ASSISTANT
822
+
823
+ When executing Phase 8:
824
+
825
+ **8.1 Project State Detection:**
826
+
827
+ - [ ] Scan for source directories (src/, lib/, app/)
828
+ - [ ] Check for platform directories (ios/, android/)
829
+ - [ ] Check for framework files (package.json, pubspec.yaml, etc.)
830
+ - [ ] Check for existing README.md
831
+ - [ ] Classify project: New / Initialized / Existing
832
+ - [ ] Present detection results
833
+
834
+ **8.2 Framework Initialization (if new project):**
835
+
836
+ - [ ] Ask user if they want to initialize
837
+ - [ ] If yes:
838
+ - [ ] Backup .ai-flow/ docs
839
+ - [ ] Execute framework CLI command
840
+ - [ ] Restore .ai-flow/ docs
841
+ - [ ] Handle README.md conflict
842
+ - [ ] If no: Show manual command and continue
843
+
844
+ **8.3 Generate Final Documentation:**
845
+
846
+ - [ ] Re-read ALL previously generated documents
847
+ - [ ] Generate docs/platform-guides.md
848
+ - [ ] Generate docs/navigation-guide.md
849
+ - [ ] Generate docs/contributing.md
850
+
851
+ **8.4 Generate AGENT.md:**
852
+
853
+ - [ ] Re-read ALL documents again
854
+ - [ ] Create master index
855
+ - [ ] Include quick reference
856
+ - [ ] Validate all links
857
+
858
+ **8.5 Generate README.md:**
859
+
860
+ - [ ] Re-read ALL documents
861
+ - [ ] If framework README exists: merge intelligently
862
+ - [ ] If no framework README: create from template
863
+ - [ ] Validate all internal links
864
+
865
+ **8.6 Create Tool-Specific Configs:**
866
+
867
+ - [ ] Create configs based on AI tool selection
868
+
869
+ **8.7 Final Validation:**
870
+
871
+ - [ ] Check for placeholders
872
+ - [ ] Validate file references
873
+ - [ ] Show success message
874
+
875
+ **ESTIMATED TIME:** 10-15 minutes
876
+ ---
877
+ **Next Phase:** Phase 9 - Project Roadmap (Post-Documentation)
878
+
879
+ Read: `.ai-flow/prompts/mobile/flow-build-phase-9.md`
880
+
881
+ ---
882
+
883
+ **Last Updated:** 2025-12-21
884
+ **Version:** 2.1.9
885
+
886
+
887
+
888
+