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,872 +1,872 @@
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** (components, performance, operations)
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/`, `components/`, `pages/`, etc.)
34
- - [ ] Check for framework files (`package.json`, `angular.json`, `vite.config.ts`, `next.config.js`, etc.)
35
- - [ ] Check for package managers (`package.json`, `yarn.lock`, `pnpm-lock.yaml`)
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
- - Package manager: [npm/yarn/pnpm or none]
55
- - README.md: [exists: yes/no]
56
-
57
- Recommendation: [Next action based on state]
58
- ```
59
- ---
60
- ## 8.2: Framework Initialization (Optional)
61
-
62
- **Only if:** Project state = "New Project"
63
-
64
- ### 8.2.1: Ask User Preference
65
-
66
- ```
67
- 🎯 Your project appears to be new.
68
-
69
- Would you like me to initialize the [FRAMEWORK_NAME] project structure now?
70
-
71
- Options:
72
- A) ✅ Yes, initialize [FRAMEWORK_NAME] (recommended)
73
- B) ⏭️ Skip for now (manual setup later)
74
-
75
- → Your choice:
76
- ```
77
-
78
- **If user chooses A (initialize):**
79
-
80
- ### 8.2.2: Pre-initialization Backup
81
-
82
- ```
83
- 📦 Preparing for framework initialization...
84
-
85
- Creating backup of AI Flow documentation:
86
- → Moving .ai-flow/ docs to .ai-flow/temp-backup/
87
-
88
- Files to backup:
89
- ✅ project-brief.md
90
- ✅ docs/ui-structure.md
91
- ✅ docs/architecture.md
92
- ✅ ai-instructions.md
93
- ✅ docs/code-standards.md
94
- ✅ docs/testing.md
95
- ✅ docs/performance.md
96
- ✅ docs/operations.md
97
- ✅ specs/configuration.md
98
- ✅ .env.example
99
-
100
- Backup complete! Safe to initialize framework.
101
- ```
102
-
103
- ### 8.2.3: Execute Framework CLI
104
-
105
- **Based on framework detected in Phase 3:**
106
-
107
- **React:**
108
-
109
- ```bash
110
- # Create React App (traditional)
111
- npx create-react-app . --template typescript
112
-
113
- # Vite + React (recommended)
114
- npm create vite@latest . -- --template react-ts
115
-
116
- # Next.js (full-stack)
117
- npx create-next-app@latest . --typescript --eslint --tailwind --app --src-dir --import-alias "@/*"
118
- ```
119
-
120
- **Vue:**
121
-
122
- ```bash
123
- # Vue CLI
124
- vue create .
125
-
126
- # Vite + Vue (recommended)
127
- npm create vite@latest . -- --template vue-ts
128
-
129
- # Nuxt.js (full-stack)
130
- npx nuxi@latest init .
131
- ```
132
-
133
- **Angular:**
134
-
135
- ```bash
136
- # Angular CLI
137
- ng new . --routing --style=scss --skip-git
138
-
139
- # Angular with standalone components
140
- ng new . --standalone --routing --style=scss --skip-git
141
- ```
142
-
143
- **Svelte:**
144
-
145
- ```bash
146
- # SvelteKit
147
- npm create svelte@latest .
148
-
149
- # Vite + Svelte
150
- npm create vite@latest . -- --template svelte-ts
151
- ```
152
-
153
- **Other frameworks:**
154
-
155
- ```bash
156
- # Solid.js
157
- npx degit solidjs/templates/ts .
158
-
159
- # Preact
160
- npx preact-cli create default .
161
-
162
- # Remix
163
- npx create-remix@latest .
164
-
165
- # Astro
166
- npm create astro@latest .
167
- ```
168
-
169
- **Show progress:**
170
-
171
- ```
172
- 🚀 Initializing [FRAMEWORK_NAME]...
173
-
174
- [Framework CLI output]
175
-
176
- ✅ Framework initialized successfully!
177
- ```
178
-
179
- ### 8.2.4: Restore AI Flow Documentation
180
-
181
- ```
182
- 📥 Restoring AI Flow documentation...
183
-
184
- Moving files from .ai-flow/temp-backup/ back to .ai-flow/
185
-
186
- ✅ All AI Flow docs restored!
187
- ```
188
-
189
- ### 8.2.5: Handle README.md Conflict
190
-
191
- **If framework created README.md:**
192
-
193
- ```
194
- ⚠️ Framework generated its own README.md
195
-
196
- I'll merge it with AI Flow's comprehensive README:
197
-
198
- Strategy:
199
- 1. Keep framework's quick start section (if valuable)
200
- 2. Replace with AI Flow's comprehensive content
201
- 3. Preserve any framework-specific setup instructions
202
-
203
- Merging...
204
- ```
205
-
206
- **Merge Logic:**
207
-
208
- - Extract framework's "Getting Started" or "Installation" section
209
- - Use AI Flow's README template as base
210
- - Insert framework's quick start in appropriate section
211
- - Ensure no duplication
212
- - Keep AI Flow's structure (overview, features, tech stack, etc.)
213
-
214
- **If user chooses B (skip):**
215
-
216
- ```
217
- ⏭️ Skipping framework initialization.
218
-
219
- You can initialize manually later with:
220
- [Show appropriate CLI command]
221
-
222
- Proceeding to documentation generation...
223
- ```
224
- ---
225
- ## 8.3: Generate Final Documentation
226
-
227
- ```
228
- 📖 Re-reading all generated documents to ensure accuracy...
229
-
230
- ✅ Re-reading project-brief.md
231
- ✅ Re-reading docs/ui-structure.md
232
- ✅ Re-reading docs/architecture.md
233
- ✅ Re-reading ai-instructions.md
234
- ✅ Re-reading docs/code-standards.md
235
- ✅ Re-reading docs/testing.md
236
- ✅ Re-reading docs/performance.md
237
- ✅ Re-reading docs/operations.md
238
- ✅ Re-reading specs/configuration.md
239
- ✅ Re-reading .env.example
240
-
241
- ✅ Context fully loaded and updated!
242
-
243
- 🎉 Now generating final 5 documents:
244
-
245
- 1. docs/components-guide.md - Component architecture and patterns
246
- 2. docs/state-management.md - State management strategy
247
- 3. docs/contributing.md - Contribution guidelines
248
- 4. .gitignore - Ignore patterns for your tech stack
249
- 5. AGENT.md - Universal AI configuration (master index)
250
- 6. README.md - Project overview (consolidates all phases)
251
-
252
- Generating...
253
- ```
254
-
255
- ### 8.3.1: Generate docs/components-guide.md
256
-
257
- - **Template:** `.ai-flow/templates/docs/components-guide.template.md`
258
- - **Content from:** Phase 2 (UI structure) + Phase 5 (code standards)
259
- - **Requirements:**
260
- - List component hierarchy from Phase 2
261
- - Document component patterns (container/presentational, atomic design, etc.)
262
- - Include props conventions
263
- - Add styling approach
264
- - Link to component library (if using one)
265
-
266
- **📝 Action:** Write the complete file to `docs/components-guide.md`
267
-
268
- ```
269
- ✅ Generated: docs/components-guide.md
270
- ```
271
-
272
- ### 8.3.2: Generate docs/state-management.md
273
-
274
- - **Template:** `.ai-flow/templates/docs/state-management.template.md`
275
- - **Content from:** Phase 3 (state management strategy)
276
- - **Requirements:**
277
- - Document chosen state solution (Redux, Zustand, Context, etc.)
278
- - Define state structure
279
- - Include action/reducer patterns
280
- - Document async state handling
281
- - Add caching strategy
282
-
283
- **📝 Action:** Write the complete file to `docs/state-management.md`
284
-
285
- ```
286
- ✅ Generated: docs/state-management.md
287
- ```
288
-
289
- ### 8.3.3: Generate docs/contributing.md
290
-
291
- - **Template:** `.ai-flow/templates/docs/contributing.template.md`
292
- - **Content from:** Phase 5 (code standards) + Phase 7 (operations)
293
- - **Requirements:**
294
- - Git workflow from Phase 5
295
- - Commit message format
296
- - Code review process
297
- - Setup instructions from Phase 7
298
- - Testing requirements from Phase 6
299
-
300
- **📝 Action:** Write the complete file to `docs/contributing.md`
301
-
302
- ```
303
- ✅ Generated: docs/contributing.md
304
- ```
305
- ---
306
- ## 8.3.4: Generate .gitignore
307
-
308
- **IMPORTANT:** Generate a comprehensive `.gitignore` file based on the framework, bundler, and tools selected in previous phases.
309
-
310
- ```
311
- 📝 Generating .gitignore for your frontend stack...
312
- ```
313
-
314
- **Strategy:**
315
-
316
- 1. **Detect framework from Phase 3** (React, Vue, Angular, etc.)
317
- 2. **Detect bundler/meta-framework** (Vite, Next.js, Create React App, etc.)
318
- 3. **Detect package manager** (npm, yarn, pnpm)
319
- 4. **Combine relevant patterns**
320
-
321
- **Base patterns for JavaScript/TypeScript projects:**
322
-
323
- ```gitignore
324
- # Dependencies
325
- node_modules/
326
- npm-debug.log*
327
- yarn-debug.log*
328
- yarn-error.log*
329
- .pnpm-debug.log*
330
- .yarn/*
331
- !.yarn/patches
332
- !.yarn/plugins
333
- !.yarn/releases
334
- !.yarn/sdks
335
- !.yarn/versions
336
-
337
- # Production builds
338
- dist/
339
- build/
340
- .next/
341
- out/
342
- .nuxt/
343
- .output/
344
- .vite/
345
- *.local
346
-
347
- # Environment variables
348
- .env
349
- .env*.local
350
- .env.production
351
-
352
- # IDE
353
- .vscode/
354
- !.vscode/extensions.json
355
- .idea/
356
- *.swp
357
- *.swo
358
- *~
359
- .DS_Store
360
-
361
- # OS
362
- .DS_Store
363
- Thumbs.db
364
-
365
- # Testing
366
- coverage/
367
- .nyc_output/
368
- *.lcov
369
-
370
- # TypeScript
371
- *.tsbuildinfo
372
- .tsbuildinfo
373
-
374
- # Logs
375
- logs/
376
- *.log
377
- npm-debug.log*
378
-
379
- # Cache
380
- .cache/
381
- .parcel-cache/
382
- .turbo/
383
- .eslintcache
384
- .stylelintcache
385
-
386
- # Storybook
387
- storybook-static/
388
- ```
389
-
390
- **Framework-specific additions:**
391
-
392
- **Next.js:**
393
-
394
- ```gitignore
395
- # Next.js
396
- .next/
397
- out/
398
- next-env.d.ts
399
- ```
400
-
401
- **Vite:**
402
-
403
- ```gitignore
404
- # Vite
405
- dist/
406
- .vite/
407
- ```
408
-
409
- **Angular:**
410
-
411
- ```gitignore
412
- # Angular
413
- /dist/
414
- /tmp/
415
- /out-tsc/
416
- /bazel-out/
417
- .angular/
418
- ```
419
-
420
- **Vue (with Vite):**
421
-
422
- ```gitignore
423
- # Vue
424
- dist/
425
- .vite/
426
- ```
427
-
428
- **Nuxt:**
429
-
430
- ```gitignore
431
- # Nuxt
432
- .nuxt/
433
- .output/
434
- .nitro/
435
- .cache/
436
- ```
437
-
438
- **📝 Action:** Generate and write `.gitignore` to project root.
439
-
440
- **Selection logic:**
441
-
442
- - If React + Vite → Base + Vite patterns
443
- - If Next.js → Base + Next.js patterns
444
- - If Angular → Base + Angular patterns
445
- - If Vue + Vite → Base + Vite patterns
446
- - If Nuxt → Base + Nuxt patterns
447
-
448
- ```
449
- ✅ Generated: .gitignore
450
- Patterns included: [Framework] + [Bundler] + Base JavaScript patterns
451
- ```
452
- ---
453
- ## 8.4: Generate AGENT.md (Master Index)
454
-
455
- - **Template:** `.ai-flow/templates/AGENT.template.md`
456
- - **Content from:** ALL phases (this is the aggregator)
457
- - **Requirements:**
458
- - **CRITICAL:** Re-read ALL previously generated documents before filling
459
- - List all documents with descriptions
460
- - Provide quick reference to tech stack
461
- - Include critical architecture rules
462
- - Link to all specs and docs
463
- - Summarize key decisions from each phase
464
- - Include common commands
465
-
466
- **Structure:**
467
-
468
- ```markdown
469
- # 🤖 AGENT.md - Universal AI Assistant Configuration
470
-
471
- ## 📚 Documentation Index
472
-
473
- ### Core Documents
474
-
475
- 1. **project-brief.md** - [1-sentence description]
476
- 2. **ai-instructions.md** - [1-sentence description]
477
-
478
- ### Documentation
479
-
480
- 3. **docs/ui-structure.md** - [1-sentence description]
481
- 4. **docs/architecture.md** - [1-sentence description]
482
- 5. **docs/components-guide.md** - [1-sentence description]
483
- 6. **docs/state-management.md** - [1-sentence description]
484
- 7. **docs/code-standards.md** - [1-sentence description]
485
- 8. **docs/testing.md** - [1-sentence description]
486
- 9. **docs/performance.md** - [1-sentence description]
487
- 10. **docs/operations.md** - [1-sentence description]
488
- 11. **docs/contributing.md** - [1-sentence description]
489
-
490
- ### Specifications
491
-
492
- 12. **specs/configuration.md** - [1-sentence description]
493
- 13. **.env.example** - Environment variables template
494
- 14. **README.md** - Project overview and setup
495
-
496
- ## 🎯 Quick Reference
497
-
498
- ### Tech Stack
499
-
500
- [List from Phase 3]
501
-
502
- ### Critical Rules
503
-
504
- [Key rules from code-standards.md and ai-instructions.md]
505
-
506
- ### Common Commands
507
-
508
- [From operations.md and contributing.md]
509
- ```
510
-
511
- **📝 Action:**
512
-
513
- ```
514
- 🔄 Re-reading all generated documents for AGENT.md generation...
515
-
516
- ✅ Reading .ai-flow/project-brief.md
517
- ✅ Reading .ai-flow/ai-instructions.md
518
- ✅ Reading docs/ui-structure.md
519
- ✅ Reading docs/architecture.md
520
- ✅ Reading docs/components-guide.md
521
- ✅ Reading docs/state-management.md
522
- ✅ Reading docs/code-standards.md
523
- ✅ Reading docs/testing.md
524
- ✅ Reading docs/performance.md
525
- ✅ Reading docs/operations.md
526
- ✅ Reading specs/configuration.md
527
- ✅ Reading docs/contributing.md
528
-
529
- ✅ All context loaded!
530
- ```
531
-
532
- **📝 Action:** Write the complete file to `.ai-flow/AGENT.md`
533
-
534
- ```
535
- ✅ Generated: .ai-flow/AGENT.md (Master Index)
536
- ```
537
- ---
538
- ## 8.5: Generate README.md (Intelligent Merge)
539
-
540
- - **Template:** `.ai-flow/templates/README.template.md`
541
- - **Content from:** ALL phases (most comprehensive document)
542
- - **Requirements:**
543
- - **CRITICAL:** Re-read ALL documents before generating
544
- - Include project overview from Phase 1
545
- - List features from Phase 1
546
- - Show tech stack from Phase 3
547
- - Include quick start from Phase 7
548
- - Link to all documentation
549
- - Include deployment info from Phase 7
550
-
551
- **Merge Strategy (if framework README exists):**
552
-
553
- 1. **Read framework's README.md** (if exists from step 8.2)
554
- 2. **Extract valuable sections:**
555
- - Installation commands specific to framework
556
- - Framework-specific setup instructions
557
- - Dev server commands
558
- 3. **Use AI Flow template as base structure:**
559
- - Project name and description (from Phase 1)
560
- - Features (from Phase 1)
561
- - Tech stack (from Phase 3)
562
- - Architecture overview (link to docs/architecture.md)
563
- - Getting started (merge with framework's instructions)
564
- - Testing (link to docs/testing.md)
565
- - Deployment (from Phase 7)
566
- - Contributing (link to docs/contributing.md)
567
- 4. **Insert framework-specific content** in "Getting Started" section
568
- 5. **Ensure no duplication**
569
- 6. **Validate all links** work correctly
570
-
571
- **📝 Action:** Write the complete file to `.ai-flow/README.md`
572
-
573
- ```
574
- ✅ Generated: .ai-flow/README.md
575
- [If merged] Merged with framework's setup instructions
576
- ```
577
- ---
578
- ## 8.6: Create Tool-Specific Configs
579
-
580
- **Based on AI tool selection from Phase 3:**
581
-
582
- ### If Claude selected:
583
-
584
- **Create `.clauderules`:**
585
-
586
- ```markdown
587
- # Claude AI Configuration
588
-
589
- This project uses AI Flow documentation structure.
590
-
591
- ## Primary Reference
592
-
593
- Read `.ai-flow/AGENT.md` first for complete documentation index.
594
-
595
- ## Key Documents
596
-
597
- - Project overview: `.ai-flow/project-brief.md`
598
- - AI instructions: `.ai-flow/ai-instructions.md`
599
- - Architecture: `docs/architecture.md`
600
- - UI Structure: `docs/ui-structure.md`
601
- - Components: `docs/components-guide.md`
602
- - State: `docs/state-management.md`
603
- - Code standards: `docs/code-standards.md`
604
-
605
- ## Working Instructions
606
-
607
- When writing code:
608
-
609
- 1. Follow patterns in `docs/code-standards.md`
610
- 2. Reference component structure in `docs/ui-structure.md`
611
- 3. Follow state management patterns from `docs/state-management.md`
612
- 4. Write tests per `docs/testing.md`
613
-
614
- ## Critical Rules
615
-
616
- [Extract top 5-10 rules from ai-instructions.md]
617
- ```
618
-
619
- ### If Cursor selected:
620
-
621
- **Create `.cursorrules`:**
622
-
623
- ```markdown
624
- # Cursor AI Configuration
625
-
626
- Project uses AI Flow documentation in `.ai-flow/` directory.
627
-
628
- ## Documentation Index
629
-
630
- See `.ai-flow/AGENT.md` for complete document list.
631
-
632
- ## Quick Reference
633
-
634
- - Tech Stack: [from Phase 3]
635
- - Architecture: `docs/architecture.md`
636
- - Components: `docs/components-guide.md`
637
- - Code Standards: `docs/code-standards.md`
638
-
639
- ## Code Generation Rules
640
-
641
- [Extract key rules from ai-instructions.md]
642
- ```
643
-
644
- ### If GitHub Copilot selected:
645
-
646
- **Create `.github/copilot-instructions.md`:**
647
-
648
- ```markdown
649
- # GitHub Copilot Instructions
650
-
651
- ## Project Context
652
-
653
- [Project description from Phase 1]
654
-
655
- ## Documentation Structure
656
-
657
- This project uses AI Flow. All documentation is in `.ai-flow/` directory.
658
-
659
- Master index: `.ai-flow/AGENT.md`
660
-
661
- ## Key References
662
-
663
- - Architecture: `docs/architecture.md`
664
- - UI Structure: `docs/ui-structure.md`
665
- - Components: `docs/components-guide.md`
666
- - State: `docs/state-management.md`
667
- - Code Standards: `docs/code-standards.md`
668
- - Testing: `docs/testing.md`
669
-
670
- ## Code Generation Guidelines
671
-
672
- [Extract guidelines from ai-instructions.md and code-standards.md]
673
-
674
- ## Tech Stack
675
-
676
- [From Phase 3]
677
- ```
678
-
679
- **📝 Action:** Generate the tool-specific config files based on selection:
680
-
681
- - If Claude → Write `.clauderules`
682
- - If Cursor → Write `.cursorrules`
683
- - If Copilot → Write `.github/copilot-instructions.md`
684
- - If "All" → Write all three files
685
-
686
- ```
687
- ✅ Generated tool-specific configs:
688
- [List generated files based on selection]
689
- ```
690
- ---
691
- ## 8.7: Final Validation & Success Message
692
-
693
- ```
694
- 🔍 Validating all generated files...
695
-
696
- ✅ Checking for placeholder text...
697
- ✅ Validating file references...
698
- ✅ Ensuring all links work...
699
- ✅ Verifying template completeness...
700
-
701
- All validations passed!
702
- ```
703
-
704
- **Show complete summary:**
705
-
706
- ```
707
- 🎉 AI Flow Complete!
708
-
709
- Generated 15 documents successfully:
710
-
711
- Phase 1:
712
- ✅ project-brief.md
713
-
714
- Phase 2:
715
- ✅ docs/ui-structure.md
716
-
717
- Phase 3:
718
- ✅ docs/architecture.md
719
- ✅ ai-instructions.md
720
-
721
- Phase 5:
722
- ✅ docs/code-standards.md
723
-
724
- Phase 6:
725
- ✅ docs/testing.md
726
-
727
- Phase 7:
728
- ✅ docs/performance.md
729
- ✅ docs/operations.md
730
- ✅ specs/configuration.md
731
- ✅ .env.example
732
-
733
- Phase 8:
734
- ✅ docs/components-guide.md
735
- ✅ docs/state-management.md
736
- ✅ docs/contributing.md
737
- ✅ .gitignore
738
- ✅ README.md
739
- ✅ AGENT.md
740
-
741
- [If framework initialized:]
742
- ✅ [FRAMEWORK_NAME] project initialized
743
-
744
- [If README merged:]
745
- ✅ README.md merged with framework's setup instructions
746
-
747
- Tool-specific configs:
748
- ✅ [List generated configs]
749
- ---
750
- 📁 Project Structure:
751
-
752
- your-project/
753
- ├── .ai-flow/ # AI Flow documentation
754
- │ ├── AGENT.md ⭐ Start here!
755
- │ ├── project-brief.md
756
- │ ├── ai-instructions.md
757
- │ ├── docs/
758
- │ │ ├── ui-structure.md
759
- │ │ ├── architecture.md
760
- │ │ ├── components-guide.md
761
- │ │ ├── state-management.md
762
- │ │ ├── code-standards.md
763
- │ │ ├── testing.md
764
- │ │ ├── performance.md
765
- │ │ ├── operations.md
766
- │ │ └── contributing.md
767
- │ ├── specs/
768
- │ │ └── configuration.md
769
- │ └── templates/ # Original templates
770
- ├── [framework files] # If initialized
771
- ├── README.md
772
- ├── .env.example
773
- ├── .gitignore
774
- └── [tool configs] # .clauderules, .cursorrules, etc.
775
- ---
776
- Next steps:
777
-
778
- 1. ⭐ **Read `.ai-flow/AGENT.md`** - Master index of all documentation
779
- 2. 📖 **Review generated documents** - Customize as needed
780
- 3. 🔧 **Set up environment** - Copy `.env.example` to `.env` and configure
781
- [If NOT initialized:]
782
- 4. 🚀 **Initialize framework** - Run: `[show command from Phase 3]`
783
- [If initialized:]
784
- 4. 🚀 **Install dependencies** - Run: `npm install` / `yarn install`
785
- 5. 💾 **Initialize git** (if not done) - `git init && git add . && git commit -m "Initial commit with AI Flow docs"`
786
- 6. 🧪 **Start developing!** - Your AI assistant now has complete project context
787
- ---
788
- 💡 **Remember:**
789
- - Documents are **living artifacts** - update them as project evolves
790
- - All AI assistants will reference these docs for future work
791
- - AGENT.md is the **single source of truth** for AI context
792
-
793
- 🤖 **AI Assistant Usage:**
794
- Your AI assistant (Claude, Cursor, Copilot) will now:
795
- - ✅ Understand complete project context
796
- - ✅ Follow your architecture patterns
797
- - ✅ Generate code matching your standards
798
- - ✅ Reference your component structure
799
- - ✅ Apply your state management patterns
800
- - ✅ Write tests per your guidelines
801
-
802
- Happy building! 🎉
803
- ```
804
- ---
805
- ## EXECUTION CHECKLIST FOR AI ASSISTANT
806
-
807
- When executing Phase 8:
808
-
809
- **8.1 Project State Detection:**
810
-
811
- - [ ] Scan for source directories (src/, app/, components/, pages/)
812
- - [ ] Check for framework files (package.json, angular.json, next.config.js, etc.)
813
- - [ ] Check for package managers
814
- - [ ] Check for existing README.md
815
- - [ ] Classify project: New / Initialized / Existing
816
- - [ ] Present detection results
817
-
818
- **8.2 Framework Initialization (if new project):**
819
-
820
- - [ ] Ask user if they want to initialize
821
- - [ ] If yes:
822
- - [ ] Backup .ai-flow/ docs
823
- - [ ] Execute framework CLI command
824
- - [ ] Restore .ai-flow/ docs
825
- - [ ] Handle README.md conflict
826
- - [ ] If no: Show manual command and continue
827
-
828
- **8.3 Generate Final Documentation:**
829
-
830
- - [ ] Re-read ALL previously generated documents
831
- - [ ] Generate docs/components-guide.md
832
- - [ ] Generate docs/state-management.md
833
- - [ ] Generate docs/contributing.md
834
-
835
- **8.4 Generate AGENT.md:**
836
-
837
- - [ ] Re-read ALL documents again
838
- - [ ] Create master index
839
- - [ ] Include quick reference
840
- - [ ] Validate all links
841
-
842
- **8.5 Generate README.md:**
843
-
844
- - [ ] Re-read ALL documents
845
- - [ ] If framework README exists: merge intelligently
846
- - [ ] If no framework README: create from template
847
- - [ ] Validate all internal links
848
-
849
- **8.6 Create Tool-Specific Configs:**
850
-
851
- - [ ] Create configs based on AI tool selection
852
-
853
- **8.7 Final Validation:**
854
-
855
- - [ ] Check for placeholders
856
- - [ ] Validate file references
857
- - [ ] Show success message
858
-
859
- **ESTIMATED TIME:** 10-15 minutes
860
- ---
861
- **Next Phase:** Phase 9 - Project Roadmap (Post-Documentation)
862
-
863
- Read: `.ai-flow/prompts/frontend/flow-build-phase-9.md`
864
-
865
- ---
866
-
867
- **Last Updated:** 2025-12-21
868
- **Version:** 2.1.9
869
-
870
-
871
-
872
-
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** (components, performance, operations)
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/`, `components/`, `pages/`, etc.)
34
+ - [ ] Check for framework files (`package.json`, `angular.json`, `vite.config.ts`, `next.config.js`, etc.)
35
+ - [ ] Check for package managers (`package.json`, `yarn.lock`, `pnpm-lock.yaml`)
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
+ - Package manager: [npm/yarn/pnpm or none]
55
+ - README.md: [exists: yes/no]
56
+
57
+ Recommendation: [Next action based on state]
58
+ ```
59
+ ---
60
+ ## 8.2: Framework Initialization (Optional)
61
+
62
+ **Only if:** Project state = "New Project"
63
+
64
+ ### 8.2.1: Ask User Preference
65
+
66
+ ```
67
+ 🎯 Your project appears to be new.
68
+
69
+ Would you like me to initialize the [FRAMEWORK_NAME] project structure now?
70
+
71
+ Options:
72
+ A) ✅ Yes, initialize [FRAMEWORK_NAME] (recommended)
73
+ B) ⏭️ Skip for now (manual setup later)
74
+
75
+ → Your choice:
76
+ ```
77
+
78
+ **If user chooses A (initialize):**
79
+
80
+ ### 8.2.2: Pre-initialization Backup
81
+
82
+ ```
83
+ 📦 Preparing for framework initialization...
84
+
85
+ Creating backup of AI Flow documentation:
86
+ → Moving .ai-flow/ docs to .ai-flow/temp-backup/
87
+
88
+ Files to backup:
89
+ ✅ project-brief.md
90
+ ✅ docs/ui-structure.md
91
+ ✅ docs/architecture.md
92
+ ✅ ai-instructions.md
93
+ ✅ docs/code-standards.md
94
+ ✅ docs/testing.md
95
+ ✅ docs/performance.md
96
+ ✅ docs/operations.md
97
+ ✅ specs/configuration.md
98
+ ✅ .env.example
99
+
100
+ Backup complete! Safe to initialize framework.
101
+ ```
102
+
103
+ ### 8.2.3: Execute Framework CLI
104
+
105
+ **Based on framework detected in Phase 3:**
106
+
107
+ **React:**
108
+
109
+ ```bash
110
+ # Create React App (traditional)
111
+ npx create-react-app . --template typescript
112
+
113
+ # Vite + React (recommended)
114
+ npm create vite@latest . -- --template react-ts
115
+
116
+ # Next.js (full-stack)
117
+ npx create-next-app@latest . --typescript --eslint --tailwind --app --src-dir --import-alias "@/*"
118
+ ```
119
+
120
+ **Vue:**
121
+
122
+ ```bash
123
+ # Vue CLI
124
+ vue create .
125
+
126
+ # Vite + Vue (recommended)
127
+ npm create vite@latest . -- --template vue-ts
128
+
129
+ # Nuxt.js (full-stack)
130
+ npx nuxi@latest init .
131
+ ```
132
+
133
+ **Angular:**
134
+
135
+ ```bash
136
+ # Angular CLI
137
+ ng new . --routing --style=scss --skip-git
138
+
139
+ # Angular with standalone components
140
+ ng new . --standalone --routing --style=scss --skip-git
141
+ ```
142
+
143
+ **Svelte:**
144
+
145
+ ```bash
146
+ # SvelteKit
147
+ npm create svelte@latest .
148
+
149
+ # Vite + Svelte
150
+ npm create vite@latest . -- --template svelte-ts
151
+ ```
152
+
153
+ **Other frameworks:**
154
+
155
+ ```bash
156
+ # Solid.js
157
+ npx degit solidjs/templates/ts .
158
+
159
+ # Preact
160
+ npx preact-cli create default .
161
+
162
+ # Remix
163
+ npx create-remix@latest .
164
+
165
+ # Astro
166
+ npm create astro@latest .
167
+ ```
168
+
169
+ **Show progress:**
170
+
171
+ ```
172
+ 🚀 Initializing [FRAMEWORK_NAME]...
173
+
174
+ [Framework CLI output]
175
+
176
+ ✅ Framework initialized successfully!
177
+ ```
178
+
179
+ ### 8.2.4: Restore AI Flow Documentation
180
+
181
+ ```
182
+ 📥 Restoring AI Flow documentation...
183
+
184
+ Moving files from .ai-flow/temp-backup/ back to .ai-flow/
185
+
186
+ ✅ All AI Flow docs restored!
187
+ ```
188
+
189
+ ### 8.2.5: Handle README.md Conflict
190
+
191
+ **If framework created README.md:**
192
+
193
+ ```
194
+ ⚠️ Framework generated its own README.md
195
+
196
+ I'll merge it with AI Flow's comprehensive README:
197
+
198
+ Strategy:
199
+ 1. Keep framework's quick start section (if valuable)
200
+ 2. Replace with AI Flow's comprehensive content
201
+ 3. Preserve any framework-specific setup instructions
202
+
203
+ Merging...
204
+ ```
205
+
206
+ **Merge Logic:**
207
+
208
+ - Extract framework's "Getting Started" or "Installation" section
209
+ - Use AI Flow's README template as base
210
+ - Insert framework's quick start in appropriate section
211
+ - Ensure no duplication
212
+ - Keep AI Flow's structure (overview, features, tech stack, etc.)
213
+
214
+ **If user chooses B (skip):**
215
+
216
+ ```
217
+ ⏭️ Skipping framework initialization.
218
+
219
+ You can initialize manually later with:
220
+ [Show appropriate CLI command]
221
+
222
+ Proceeding to documentation generation...
223
+ ```
224
+ ---
225
+ ## 8.3: Generate Final Documentation
226
+
227
+ ```
228
+ 📖 Re-reading all generated documents to ensure accuracy...
229
+
230
+ ✅ Re-reading project-brief.md
231
+ ✅ Re-reading docs/ui-structure.md
232
+ ✅ Re-reading docs/architecture.md
233
+ ✅ Re-reading ai-instructions.md
234
+ ✅ Re-reading docs/code-standards.md
235
+ ✅ Re-reading docs/testing.md
236
+ ✅ Re-reading docs/performance.md
237
+ ✅ Re-reading docs/operations.md
238
+ ✅ Re-reading specs/configuration.md
239
+ ✅ Re-reading .env.example
240
+
241
+ ✅ Context fully loaded and updated!
242
+
243
+ 🎉 Now generating final 5 documents:
244
+
245
+ 1. docs/components-guide.md - Component architecture and patterns
246
+ 2. docs/state-management.md - State management strategy
247
+ 3. docs/contributing.md - Contribution guidelines
248
+ 4. .gitignore - Ignore patterns for your tech stack
249
+ 5. AGENT.md - Universal AI configuration (master index)
250
+ 6. README.md - Project overview (consolidates all phases)
251
+
252
+ Generating...
253
+ ```
254
+
255
+ ### 8.3.1: Generate docs/components-guide.md
256
+
257
+ - **Template:** `.ai-flow/templates/docs/components-guide.template.md`
258
+ - **Content from:** Phase 2 (UI structure) + Phase 5 (code standards)
259
+ - **Requirements:**
260
+ - List component hierarchy from Phase 2
261
+ - Document component patterns (container/presentational, atomic design, etc.)
262
+ - Include props conventions
263
+ - Add styling approach
264
+ - Link to component library (if using one)
265
+
266
+ **📝 Action:** Write the complete file to `docs/components-guide.md`
267
+
268
+ ```
269
+ ✅ Generated: docs/components-guide.md
270
+ ```
271
+
272
+ ### 8.3.2: Generate docs/state-management.md
273
+
274
+ - **Template:** `.ai-flow/templates/docs/state-management.template.md`
275
+ - **Content from:** Phase 3 (state management strategy)
276
+ - **Requirements:**
277
+ - Document chosen state solution (Redux, Zustand, Context, etc.)
278
+ - Define state structure
279
+ - Include action/reducer patterns
280
+ - Document async state handling
281
+ - Add caching strategy
282
+
283
+ **📝 Action:** Write the complete file to `docs/state-management.md`
284
+
285
+ ```
286
+ ✅ Generated: docs/state-management.md
287
+ ```
288
+
289
+ ### 8.3.3: Generate docs/contributing.md
290
+
291
+ - **Template:** `.ai-flow/templates/docs/contributing.template.md`
292
+ - **Content from:** Phase 5 (code standards) + Phase 7 (operations)
293
+ - **Requirements:**
294
+ - Git workflow from Phase 5
295
+ - Commit message format
296
+ - Code review process
297
+ - Setup instructions from Phase 7
298
+ - Testing requirements from Phase 6
299
+
300
+ **📝 Action:** Write the complete file to `docs/contributing.md`
301
+
302
+ ```
303
+ ✅ Generated: docs/contributing.md
304
+ ```
305
+ ---
306
+ ## 8.3.4: Generate .gitignore
307
+
308
+ **IMPORTANT:** Generate a comprehensive `.gitignore` file based on the framework, bundler, and tools selected in previous phases.
309
+
310
+ ```
311
+ 📝 Generating .gitignore for your frontend stack...
312
+ ```
313
+
314
+ **Strategy:**
315
+
316
+ 1. **Detect framework from Phase 3** (React, Vue, Angular, etc.)
317
+ 2. **Detect bundler/meta-framework** (Vite, Next.js, Create React App, etc.)
318
+ 3. **Detect package manager** (npm, yarn, pnpm)
319
+ 4. **Combine relevant patterns**
320
+
321
+ **Base patterns for JavaScript/TypeScript projects:**
322
+
323
+ ```gitignore
324
+ # Dependencies
325
+ node_modules/
326
+ npm-debug.log*
327
+ yarn-debug.log*
328
+ yarn-error.log*
329
+ .pnpm-debug.log*
330
+ .yarn/*
331
+ !.yarn/patches
332
+ !.yarn/plugins
333
+ !.yarn/releases
334
+ !.yarn/sdks
335
+ !.yarn/versions
336
+
337
+ # Production builds
338
+ dist/
339
+ build/
340
+ .next/
341
+ out/
342
+ .nuxt/
343
+ .output/
344
+ .vite/
345
+ *.local
346
+
347
+ # Environment variables
348
+ .env
349
+ .env*.local
350
+ .env.production
351
+
352
+ # IDE
353
+ .vscode/
354
+ !.vscode/extensions.json
355
+ .idea/
356
+ *.swp
357
+ *.swo
358
+ *~
359
+ .DS_Store
360
+
361
+ # OS
362
+ .DS_Store
363
+ Thumbs.db
364
+
365
+ # Testing
366
+ coverage/
367
+ .nyc_output/
368
+ *.lcov
369
+
370
+ # TypeScript
371
+ *.tsbuildinfo
372
+ .tsbuildinfo
373
+
374
+ # Logs
375
+ logs/
376
+ *.log
377
+ npm-debug.log*
378
+
379
+ # Cache
380
+ .cache/
381
+ .parcel-cache/
382
+ .turbo/
383
+ .eslintcache
384
+ .stylelintcache
385
+
386
+ # Storybook
387
+ storybook-static/
388
+ ```
389
+
390
+ **Framework-specific additions:**
391
+
392
+ **Next.js:**
393
+
394
+ ```gitignore
395
+ # Next.js
396
+ .next/
397
+ out/
398
+ next-env.d.ts
399
+ ```
400
+
401
+ **Vite:**
402
+
403
+ ```gitignore
404
+ # Vite
405
+ dist/
406
+ .vite/
407
+ ```
408
+
409
+ **Angular:**
410
+
411
+ ```gitignore
412
+ # Angular
413
+ /dist/
414
+ /tmp/
415
+ /out-tsc/
416
+ /bazel-out/
417
+ .angular/
418
+ ```
419
+
420
+ **Vue (with Vite):**
421
+
422
+ ```gitignore
423
+ # Vue
424
+ dist/
425
+ .vite/
426
+ ```
427
+
428
+ **Nuxt:**
429
+
430
+ ```gitignore
431
+ # Nuxt
432
+ .nuxt/
433
+ .output/
434
+ .nitro/
435
+ .cache/
436
+ ```
437
+
438
+ **📝 Action:** Generate and write `.gitignore` to project root.
439
+
440
+ **Selection logic:**
441
+
442
+ - If React + Vite → Base + Vite patterns
443
+ - If Next.js → Base + Next.js patterns
444
+ - If Angular → Base + Angular patterns
445
+ - If Vue + Vite → Base + Vite patterns
446
+ - If Nuxt → Base + Nuxt patterns
447
+
448
+ ```
449
+ ✅ Generated: .gitignore
450
+ Patterns included: [Framework] + [Bundler] + Base JavaScript patterns
451
+ ```
452
+ ---
453
+ ## 8.4: Generate AGENT.md (Master Index)
454
+
455
+ - **Template:** `.ai-flow/templates/AGENT.template.md`
456
+ - **Content from:** ALL phases (this is the aggregator)
457
+ - **Requirements:**
458
+ - **CRITICAL:** Re-read ALL previously generated documents before filling
459
+ - List all documents with descriptions
460
+ - Provide quick reference to tech stack
461
+ - Include critical architecture rules
462
+ - Link to all specs and docs
463
+ - Summarize key decisions from each phase
464
+ - Include common commands
465
+
466
+ **Structure:**
467
+
468
+ ```markdown
469
+ # 🤖 AGENT.md - Universal AI Assistant Configuration
470
+
471
+ ## 📚 Documentation Index
472
+
473
+ ### Core Documents
474
+
475
+ 1. **project-brief.md** - [1-sentence description]
476
+ 2. **ai-instructions.md** - [1-sentence description]
477
+
478
+ ### Documentation
479
+
480
+ 3. **docs/ui-structure.md** - [1-sentence description]
481
+ 4. **docs/architecture.md** - [1-sentence description]
482
+ 5. **docs/components-guide.md** - [1-sentence description]
483
+ 6. **docs/state-management.md** - [1-sentence description]
484
+ 7. **docs/code-standards.md** - [1-sentence description]
485
+ 8. **docs/testing.md** - [1-sentence description]
486
+ 9. **docs/performance.md** - [1-sentence description]
487
+ 10. **docs/operations.md** - [1-sentence description]
488
+ 11. **docs/contributing.md** - [1-sentence description]
489
+
490
+ ### Specifications
491
+
492
+ 12. **specs/configuration.md** - [1-sentence description]
493
+ 13. **.env.example** - Environment variables template
494
+ 14. **README.md** - Project overview and setup
495
+
496
+ ## 🎯 Quick Reference
497
+
498
+ ### Tech Stack
499
+
500
+ [List from Phase 3]
501
+
502
+ ### Critical Rules
503
+
504
+ [Key rules from code-standards.md and ai-instructions.md]
505
+
506
+ ### Common Commands
507
+
508
+ [From operations.md and contributing.md]
509
+ ```
510
+
511
+ **📝 Action:**
512
+
513
+ ```
514
+ 🔄 Re-reading all generated documents for AGENT.md generation...
515
+
516
+ ✅ Reading .ai-flow/project-brief.md
517
+ ✅ Reading .ai-flow/ai-instructions.md
518
+ ✅ Reading docs/ui-structure.md
519
+ ✅ Reading docs/architecture.md
520
+ ✅ Reading docs/components-guide.md
521
+ ✅ Reading docs/state-management.md
522
+ ✅ Reading docs/code-standards.md
523
+ ✅ Reading docs/testing.md
524
+ ✅ Reading docs/performance.md
525
+ ✅ Reading docs/operations.md
526
+ ✅ Reading specs/configuration.md
527
+ ✅ Reading docs/contributing.md
528
+
529
+ ✅ All context loaded!
530
+ ```
531
+
532
+ **📝 Action:** Write the complete file to `.ai-flow/AGENT.md`
533
+
534
+ ```
535
+ ✅ Generated: .ai-flow/AGENT.md (Master Index)
536
+ ```
537
+ ---
538
+ ## 8.5: Generate README.md (Intelligent Merge)
539
+
540
+ - **Template:** `.ai-flow/templates/README.template.md`
541
+ - **Content from:** ALL phases (most comprehensive document)
542
+ - **Requirements:**
543
+ - **CRITICAL:** Re-read ALL documents before generating
544
+ - Include project overview from Phase 1
545
+ - List features from Phase 1
546
+ - Show tech stack from Phase 3
547
+ - Include quick start from Phase 7
548
+ - Link to all documentation
549
+ - Include deployment info from Phase 7
550
+
551
+ **Merge Strategy (if framework README exists):**
552
+
553
+ 1. **Read framework's README.md** (if exists from step 8.2)
554
+ 2. **Extract valuable sections:**
555
+ - Installation commands specific to framework
556
+ - Framework-specific setup instructions
557
+ - Dev server commands
558
+ 3. **Use AI Flow template as base structure:**
559
+ - Project name and description (from Phase 1)
560
+ - Features (from Phase 1)
561
+ - Tech stack (from Phase 3)
562
+ - Architecture overview (link to docs/architecture.md)
563
+ - Getting started (merge with framework's instructions)
564
+ - Testing (link to docs/testing.md)
565
+ - Deployment (from Phase 7)
566
+ - Contributing (link to docs/contributing.md)
567
+ 4. **Insert framework-specific content** in "Getting Started" section
568
+ 5. **Ensure no duplication**
569
+ 6. **Validate all links** work correctly
570
+
571
+ **📝 Action:** Write the complete file to `.ai-flow/README.md`
572
+
573
+ ```
574
+ ✅ Generated: .ai-flow/README.md
575
+ [If merged] Merged with framework's setup instructions
576
+ ```
577
+ ---
578
+ ## 8.6: Create Tool-Specific Configs
579
+
580
+ **Based on AI tool selection from Phase 3:**
581
+
582
+ ### If Claude selected:
583
+
584
+ **Create `.clauderules`:**
585
+
586
+ ```markdown
587
+ # Claude AI Configuration
588
+
589
+ This project uses AI Flow documentation structure.
590
+
591
+ ## Primary Reference
592
+
593
+ Read `.ai-flow/AGENT.md` first for complete documentation index.
594
+
595
+ ## Key Documents
596
+
597
+ - Project overview: `.ai-flow/project-brief.md`
598
+ - AI instructions: `.ai-flow/ai-instructions.md`
599
+ - Architecture: `docs/architecture.md`
600
+ - UI Structure: `docs/ui-structure.md`
601
+ - Components: `docs/components-guide.md`
602
+ - State: `docs/state-management.md`
603
+ - Code standards: `docs/code-standards.md`
604
+
605
+ ## Working Instructions
606
+
607
+ When writing code:
608
+
609
+ 1. Follow patterns in `docs/code-standards.md`
610
+ 2. Reference component structure in `docs/ui-structure.md`
611
+ 3. Follow state management patterns from `docs/state-management.md`
612
+ 4. Write tests per `docs/testing.md`
613
+
614
+ ## Critical Rules
615
+
616
+ [Extract top 5-10 rules from ai-instructions.md]
617
+ ```
618
+
619
+ ### If Cursor selected:
620
+
621
+ **Create `.cursorrules`:**
622
+
623
+ ```markdown
624
+ # Cursor AI Configuration
625
+
626
+ Project uses AI Flow documentation in `.ai-flow/` directory.
627
+
628
+ ## Documentation Index
629
+
630
+ See `.ai-flow/AGENT.md` for complete document list.
631
+
632
+ ## Quick Reference
633
+
634
+ - Tech Stack: [from Phase 3]
635
+ - Architecture: `docs/architecture.md`
636
+ - Components: `docs/components-guide.md`
637
+ - Code Standards: `docs/code-standards.md`
638
+
639
+ ## Code Generation Rules
640
+
641
+ [Extract key rules from ai-instructions.md]
642
+ ```
643
+
644
+ ### If GitHub Copilot selected:
645
+
646
+ **Create `.github/copilot-instructions.md`:**
647
+
648
+ ```markdown
649
+ # GitHub Copilot Instructions
650
+
651
+ ## Project Context
652
+
653
+ [Project description from Phase 1]
654
+
655
+ ## Documentation Structure
656
+
657
+ This project uses AI Flow. All documentation is in `.ai-flow/` directory.
658
+
659
+ Master index: `.ai-flow/AGENT.md`
660
+
661
+ ## Key References
662
+
663
+ - Architecture: `docs/architecture.md`
664
+ - UI Structure: `docs/ui-structure.md`
665
+ - Components: `docs/components-guide.md`
666
+ - State: `docs/state-management.md`
667
+ - Code Standards: `docs/code-standards.md`
668
+ - Testing: `docs/testing.md`
669
+
670
+ ## Code Generation Guidelines
671
+
672
+ [Extract guidelines from ai-instructions.md and code-standards.md]
673
+
674
+ ## Tech Stack
675
+
676
+ [From Phase 3]
677
+ ```
678
+
679
+ **📝 Action:** Generate the tool-specific config files based on selection:
680
+
681
+ - If Claude → Write `.clauderules`
682
+ - If Cursor → Write `.cursorrules`
683
+ - If Copilot → Write `.github/copilot-instructions.md`
684
+ - If "All" → Write all three files
685
+
686
+ ```
687
+ ✅ Generated tool-specific configs:
688
+ [List generated files based on selection]
689
+ ```
690
+ ---
691
+ ## 8.7: Final Validation & Success Message
692
+
693
+ ```
694
+ 🔍 Validating all generated files...
695
+
696
+ ✅ Checking for placeholder text...
697
+ ✅ Validating file references...
698
+ ✅ Ensuring all links work...
699
+ ✅ Verifying template completeness...
700
+
701
+ All validations passed!
702
+ ```
703
+
704
+ **Show complete summary:**
705
+
706
+ ```
707
+ 🎉 AI Flow Complete!
708
+
709
+ Generated 15 documents successfully:
710
+
711
+ Phase 1:
712
+ ✅ project-brief.md
713
+
714
+ Phase 2:
715
+ ✅ docs/ui-structure.md
716
+
717
+ Phase 3:
718
+ ✅ docs/architecture.md
719
+ ✅ ai-instructions.md
720
+
721
+ Phase 5:
722
+ ✅ docs/code-standards.md
723
+
724
+ Phase 6:
725
+ ✅ docs/testing.md
726
+
727
+ Phase 7:
728
+ ✅ docs/performance.md
729
+ ✅ docs/operations.md
730
+ ✅ specs/configuration.md
731
+ ✅ .env.example
732
+
733
+ Phase 8:
734
+ ✅ docs/components-guide.md
735
+ ✅ docs/state-management.md
736
+ ✅ docs/contributing.md
737
+ ✅ .gitignore
738
+ ✅ README.md
739
+ ✅ AGENT.md
740
+
741
+ [If framework initialized:]
742
+ ✅ [FRAMEWORK_NAME] project initialized
743
+
744
+ [If README merged:]
745
+ ✅ README.md merged with framework's setup instructions
746
+
747
+ Tool-specific configs:
748
+ ✅ [List generated configs]
749
+ ---
750
+ 📁 Project Structure:
751
+
752
+ your-project/
753
+ ├── .ai-flow/ # AI Flow documentation
754
+ │ ├── AGENT.md ⭐ Start here!
755
+ │ ├── project-brief.md
756
+ │ ├── ai-instructions.md
757
+ │ ├── docs/
758
+ │ │ ├── ui-structure.md
759
+ │ │ ├── architecture.md
760
+ │ │ ├── components-guide.md
761
+ │ │ ├── state-management.md
762
+ │ │ ├── code-standards.md
763
+ │ │ ├── testing.md
764
+ │ │ ├── performance.md
765
+ │ │ ├── operations.md
766
+ │ │ └── contributing.md
767
+ │ ├── specs/
768
+ │ │ └── configuration.md
769
+ │ └── templates/ # Original templates
770
+ ├── [framework files] # If initialized
771
+ ├── README.md
772
+ ├── .env.example
773
+ ├── .gitignore
774
+ └── [tool configs] # .clauderules, .cursorrules, etc.
775
+ ---
776
+ Next steps:
777
+
778
+ 1. ⭐ **Read `.ai-flow/AGENT.md`** - Master index of all documentation
779
+ 2. 📖 **Review generated documents** - Customize as needed
780
+ 3. 🔧 **Set up environment** - Copy `.env.example` to `.env` and configure
781
+ [If NOT initialized:]
782
+ 4. 🚀 **Initialize framework** - Run: `[show command from Phase 3]`
783
+ [If initialized:]
784
+ 4. 🚀 **Install dependencies** - Run: `npm install` / `yarn install`
785
+ 5. 💾 **Initialize git** (if not done) - `git init && git add . && git commit -m "Initial commit with AI Flow docs"`
786
+ 6. 🧪 **Start developing!** - Your AI assistant now has complete project context
787
+ ---
788
+ 💡 **Remember:**
789
+ - Documents are **living artifacts** - update them as project evolves
790
+ - All AI assistants will reference these docs for future work
791
+ - AGENT.md is the **single source of truth** for AI context
792
+
793
+ 🤖 **AI Assistant Usage:**
794
+ Your AI assistant (Claude, Cursor, Copilot) will now:
795
+ - ✅ Understand complete project context
796
+ - ✅ Follow your architecture patterns
797
+ - ✅ Generate code matching your standards
798
+ - ✅ Reference your component structure
799
+ - ✅ Apply your state management patterns
800
+ - ✅ Write tests per your guidelines
801
+
802
+ Happy building! 🎉
803
+ ```
804
+ ---
805
+ ## EXECUTION CHECKLIST FOR AI ASSISTANT
806
+
807
+ When executing Phase 8:
808
+
809
+ **8.1 Project State Detection:**
810
+
811
+ - [ ] Scan for source directories (src/, app/, components/, pages/)
812
+ - [ ] Check for framework files (package.json, angular.json, next.config.js, etc.)
813
+ - [ ] Check for package managers
814
+ - [ ] Check for existing README.md
815
+ - [ ] Classify project: New / Initialized / Existing
816
+ - [ ] Present detection results
817
+
818
+ **8.2 Framework Initialization (if new project):**
819
+
820
+ - [ ] Ask user if they want to initialize
821
+ - [ ] If yes:
822
+ - [ ] Backup .ai-flow/ docs
823
+ - [ ] Execute framework CLI command
824
+ - [ ] Restore .ai-flow/ docs
825
+ - [ ] Handle README.md conflict
826
+ - [ ] If no: Show manual command and continue
827
+
828
+ **8.3 Generate Final Documentation:**
829
+
830
+ - [ ] Re-read ALL previously generated documents
831
+ - [ ] Generate docs/components-guide.md
832
+ - [ ] Generate docs/state-management.md
833
+ - [ ] Generate docs/contributing.md
834
+
835
+ **8.4 Generate AGENT.md:**
836
+
837
+ - [ ] Re-read ALL documents again
838
+ - [ ] Create master index
839
+ - [ ] Include quick reference
840
+ - [ ] Validate all links
841
+
842
+ **8.5 Generate README.md:**
843
+
844
+ - [ ] Re-read ALL documents
845
+ - [ ] If framework README exists: merge intelligently
846
+ - [ ] If no framework README: create from template
847
+ - [ ] Validate all internal links
848
+
849
+ **8.6 Create Tool-Specific Configs:**
850
+
851
+ - [ ] Create configs based on AI tool selection
852
+
853
+ **8.7 Final Validation:**
854
+
855
+ - [ ] Check for placeholders
856
+ - [ ] Validate file references
857
+ - [ ] Show success message
858
+
859
+ **ESTIMATED TIME:** 10-15 minutes
860
+ ---
861
+ **Next Phase:** Phase 9 - Project Roadmap (Post-Documentation)
862
+
863
+ Read: `.ai-flow/prompts/frontend/flow-build-phase-9.md`
864
+
865
+ ---
866
+
867
+ **Last Updated:** 2025-12-21
868
+ **Version:** 2.1.9
869
+
870
+
871
+
872
+