ai-flow-dev 2.1.8 → 2.2.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.
@@ -14,19 +14,20 @@ Your mission is to guide the user through creating **comprehensive, production-r
14
14
 
15
15
  ### Detectar Argumento de Fase
16
16
 
17
+ // turbo
17
18
  Buscar en el mensaje del usuario patrones como:
18
19
 
19
- - "fase 0", "fase 1", "fase 2", ..., "fase 9"
20
+ - "fase 0", "fase 1", "fase 2", ..., "fase 10"
20
21
  - "phase 0", "phase 1", etc.
21
22
  - "ejecutar fase N"
22
23
  - "run phase N"
23
24
 
24
25
  ### Comportamiento
25
26
 
26
- **Si se detecta "fase N" (donde N = 0-9):**
27
+ **Si se detecta "fase N" (donde N = 0-10):**
27
28
 
28
29
  1. **Validar que la fase existe para backend:**
29
- - Fase 0: Context Discovery (opcional, solo proyectos existentes)
30
+ - Fase 0: Context Discovery
30
31
  - Fase 1: Discovery & Business
31
32
  - Fase 2: Data Architecture
32
33
  - Fase 3: System Architecture
@@ -35,851 +36,100 @@ Buscar en el mensaje del usuario patrones como:
35
36
  - Fase 6: Testing Strategy
36
37
  - Fase 7: Operations & Deployment
37
38
  - Fase 8: Project Setup & Final Documentation
38
- - Fase 9: Implementation Roadmap (opcional)
39
+ - Fase 9: Implementation Roadmap
40
+ - Fase 10: User Stories Generation
39
41
 
40
42
  2. **Si la fase es válida:**
41
43
  - Leer el archivo: `.ai-flow/prompts/backend/flow-build-phase-N.md`
42
- - Ejecutar SOLO esa fase
43
- - NO continuar con otras fases
44
- - Al finalizar, informar al usuario que puede continuar con la siguiente fase usando `/flow-build fase N+1`
44
+ - Ejecutar SOLO esa fase y seguir sus instrucciones internas.
45
+ - Al finalizar, informar que puede continuar con la siguiente fase usando `/flow-build fase N+1`.
45
46
 
46
47
  3. **Si la fase es inválida:**
47
- - Mostrar mensaje de error amigable
48
- - Listar las fases válidas (0-9) con descripción de una línea
48
+ - Listar las fases válidas (0-10) con descripción de una línea.
49
49
 
50
50
  **Si NO se detecta "fase N":**
51
-
52
- - Ejecutar el flujo completo normal (todas las fases en orden)
53
- - Comenzar con Mode Selection (Interactive vs Smart Auto-Suggest)
54
- - Continuar con Scope Selection (MVP/Production-Ready/Enterprise)
55
- - Ejecutar Phases 0-9 según corresponda
56
-
57
- ### Ejemplo de Lista de Fases Válidas
58
-
59
- Si el usuario especifica una fase inválida, mostrar:
60
-
61
- ```
62
- ❌ Fase inválida. Las fases válidas para backend son:
63
- ---
64
- 📋 Fases Disponibles - Backend
65
- ---
66
- /flow-build fase 0 - Context Discovery (solo proyectos existentes)
67
- /flow-build fase 1 - Discovery & Business (problema, usuarios, objetivos)
68
- /flow-build fase 2 - Data Architecture (entidades, relaciones, database)
69
- /flow-build fase 3 - System Architecture (tech stack, patrones, APIs)
70
- /flow-build fase 4 - Security & Authentication (auth, autorización, compliance)
71
- /flow-build fase 5 - Code Standards (convenciones, formato, git workflow)
72
- /flow-build fase 6 - Testing Strategy (tipos de tests, coverage, CI)
73
- /flow-build fase 7 - Operations & Deployment (deployment, monitoreo, logging)
74
- /flow-build fase 8 - Project Setup & Final Documentation (inicializar proyecto)
75
- /flow-build fase 9 - Implementation Roadmap (plan con Story Points - opcional)
76
- ---
77
- 💡 Tip: Usa /flow-build sin argumentos para ejecutar todas las fases en orden.
78
- ```
51
+ - Ejecutar el flujo completo comenzando por la Selección de Modo (A/B).
79
52
  ---
80
53
  ## Important Instructions
81
54
 
82
- 1. **Ask for Questionnaire Mode FIRST** - Before anything else, ask the user to select: Interactive Mode or Smart Auto-Suggest Mode (see "Mode Selection" section below)
83
- 2. **Ask for Project Scope SECOND** - After mode selection, ask the user to select: MVP, Production-Ready, or Enterprise
84
- 3. **Adapt questions based on mode and scope** - Skip or simplify questions according to the selected mode and scope level
85
- 4. **Execute ALL applicable phases in order** - Do not skip phases, but adjust depth based on scope
86
- 5. **Ask questions ONE BY ONE** - Do not present multiple questions at once. Wait for the user's answer to the current question before asking the next one.
87
- 6. **Show progress indicator before EVERY question** - Use this format:
88
- ```
89
- ---
90
- 📋 Phase [N]: [Phase Name] | Question [X]/[Total] | Phase Progress: [%]%
91
- ---
92
- ```
93
- Example for Phase 1, Question 3 of 8:
94
- ```
95
- ---
96
- 📋 Phase 1: Discovery & Business | Question 3/8 | Phase Progress: 37%
97
- ---
98
- ```
99
- 7. **Provide recommendations** using these markers:
100
- - ⭐ **Recommended** - Best choice for most projects
101
- - 🔥 **Popular** - Widely used in industry
102
- - ⚡ **Modern** - Cutting-edge, newer approach
103
- - 🏆 **Enterprise** - Best for large-scale projects
104
- 8. **Use multiple choice when possible** - Give 3-4 options (A, B, C, D)
105
- 9. **Validate completeness** - Ensure all critical information is gathered
106
- 10. **Generate documents incrementally** - After each phase, generate corresponding documents with validation
107
- 11. **Show summary at the end** - Present both a quick summary (1 paragraph) and an extended report
55
+ 1. **Ask for Questionnaire Mode FIRST** (Interactive vs Smart Auto-Suggest).
56
+ 2. **Ask for Project Scope SECOND** (MVP, Production-Ready, or Enterprise).
57
+ 3. **Execute ALL applicable phases in order**, adjusting depth based on scope.
58
+ 4. **Ask questions ONE BY ONE**. Wait for the user's answer.
59
+ 5. **Show progress indicator before EVERY question**.
60
+ 6. **Provide recommendations** using markers: **Recommended**, 🔥 **Popular**, **Modern**, 🏆 **Enterprise**.
61
+ 7. **Generate documents incrementally** after each phase.
108
62
  ---
109
63
  ## 🚀 Mode Selection
110
64
 
111
65
  **BEFORE STARTING ANY PHASE**, ask the user to select the questionnaire mode:
112
66
 
113
- ```
114
- ---
115
- 🚀 Welcome to AI Flow!
116
- ---
117
- Let's create comprehensive documentation for your backend project.
118
-
119
- **How would you like to proceed?**
120
-
121
67
  A) ⭐ **Interactive Mode (Recommended)**
122
- You answer each question step-by-step
123
- • Full control over every decision
124
- • Takes 90-120 min for new projects, 35-70 min for existing
125
- • Best for: Custom requirements, specific needs
68
+ Full control, step-by-step questions. (90-120 min)
126
69
 
127
70
  B) ⚡ **Smart Auto-Suggest Mode**
128
- • AI suggests best practices for most questions
129
- • You only answer 6 critical business questions
130
- • Takes 15-25 minutes
131
- • Best for: MVPs, standard projects, quick setup
71
+ • AI suggests best practices, you answer 6 critical questions. (15-25 min)
132
72
 
133
73
  Your choice (A/B): __
134
- ```
135
74
 
136
75
  **Based on the selection:**
76
+ - **Mode A (Interactive):** Proceed with normal sequential flow (Phases 0-10).
77
+ - **Mode B (Smart Auto-Suggest):** Ask the following 6 critical questions one by one, then auto-generate all suggestions based on industry standards and the system type:
137
78
 
138
- - **Mode A (Interactive):** Proceed with normal flow - execute all phases, ask all questions one by one
139
- - **Mode B (Smart Auto-Suggest):** Execute "Smart Auto-Suggest Flow" (see section below)
140
- ---
141
- ## Smart Auto-Suggest Flow (Mode B)
142
-
143
- **This flow only asks 6 critical business questions and auto-suggests the rest based on best practices.**
144
-
145
- ### Step 1: Ask Critical Questions Only
146
-
147
- Ask these 6 questions one by one with progress indicator:
148
-
149
- ```
150
- ---
151
- ⚡ Smart Auto-Suggest Mode | Question 1/6 | Progress: 17%
152
- ---
153
- ```
154
-
155
- **Critical Questions:**
156
-
157
- 1. **Project Name & Description** (if new project - skip if Phase 0 detected)
158
- - What is the project name?
159
- - Provide a short description (1 sentence)
160
-
161
- 2. **Project Overview**
162
- - What problem does this backend system solve? (2-3 sentences)
163
-
164
- 3. **Business Objectives**
165
- - What are the top 3 measurable objectives for this project?
166
-
167
- 4. **System Type** (Critical for auto-suggestions)
168
- - What type of system are you building?
169
-
170
- **Options:**
171
- - A) E-commerce (Product catalog, cart, checkout)
172
- - B) SaaS (Multi-tenant, subscriptions, RBAC)
173
- - C) CRM (Contacts, leads, sales pipeline)
174
- - D) Social Network (Users, posts, feeds, messaging)
175
- - E) Content Management (Articles, media, publishing)
176
- - F) Project Management (Projects, tasks, boards)
177
- - G) API Platform (API keys, rate limiting, webhooks)
178
- - H) Marketplace (Buyers, sellers, listings)
179
- - I) IoT Platform (Devices, sensors, commands)
180
- - J) Other (will use generic defaults)
181
-
182
- 5. **Core Data Entities** (if new project - skip if Phase 0 detected)
183
- - List the main entities/models your system needs (e.g., User, Product, Order)
184
-
185
- 6. **Backend Framework** (if new project - skip if Phase 0 detected)
186
- - Which backend framework will you use? (NestJS/FastAPI/Spring Boot/etc.)
187
-
188
- ### Step 2: Auto-Generate Intelligent Suggestions
189
-
190
- Based on the 6 critical answers, automatically generate comprehensive suggestions using AI reasoning.
191
-
192
- **Suggestion Logic:**
193
-
194
- For each phase, suggest defaults based on:
195
-
196
- - **System Type** - E-commerce needs cart/checkout, SaaS needs multi-tenancy, etc.
197
- - **Framework** - NestJS → Prisma, FastAPI → SQLAlchemy, Django → Django ORM
198
- - **Scope** - MVP → simple setup, Production → robust setup, Enterprise → full observability
199
-
200
- **What Gets Auto-Generated:**
201
-
202
- **Phase 1 (Business):**
203
-
204
- - ✅ Target users based on system type
205
- - ✅ Core features typical for the system type
206
- - ✅ Success metrics appropriate for the domain
207
-
208
- **Phase 2 (Data):**
209
-
210
- - ✅ Database: PostgreSQL (most common)
211
- - ✅ ORM: Match framework idiomatically
212
- - ✅ Caching: Redis for Production/Enterprise
213
- - ✅ Search: Elasticsearch only for Enterprise
214
-
215
- **Phase 3 (Architecture):**
216
-
217
- - ✅ Pattern: Monolith (MVP) → Clean Architecture (Production) → Microservices (Enterprise)
218
- - ✅ API: REST only (MVP) → REST + GraphQL (Production) → + gRPC (Enterprise)
219
- - ✅ Scaling strategy based on scope
220
-
221
- **Phase 4 (Security):**
222
-
223
- - ✅ Auth: JWT for MVP/Production, OAuth2 + SSO for Enterprise
224
- - ✅ Authorization: RBAC standard, ABAC for Enterprise
225
- - ✅ Password policies per scope
226
- - ✅ Rate limiting and CORS enabled
227
-
228
- **Phase 5 (Code Standards):**
229
-
230
- - ✅ Formatter/Linter matching framework (Prettier+ESLint, Black+pylint, etc.)
231
- - ✅ Git workflow: GitHub Flow (MVP), Git Flow (Production)
232
- - ✅ Conventional Commits
233
-
234
- **Phase 6 (Testing):**
235
-
236
- - ✅ Framework matching tech stack
237
- - ✅ Coverage: 20% (MVP), 70% (Production), 85% (Enterprise)
238
- - ✅ Test types distribution
239
-
240
- **Phase 7 (Operations):**
241
-
242
- - ✅ Deployment: PaaS (MVP), Cloud (Production), Multi-region (Enterprise)
243
- - ✅ CI/CD: GitHub Actions
244
- - ✅ Monitoring: Basic (MVP), APM (Production), Full observability (Enterprise)
245
-
246
- ### Step 3: Present Summary for Review
247
-
248
- After auto-generating all suggestions, present a clear summary:
249
-
250
- #### **Quick Summary (1 paragraph)**
251
-
252
- ```
253
- ---
254
- ✅ Configuration Complete - Quick Summary
255
- ---
256
- Your [System Type] backend will use [Framework] with [Database], following
257
- [Architecture Pattern] with [X] entities ([entity names]). Security includes
258
- [Auth Method] with [Authorization], [Password Policy]. Code follows
259
- [Formatter] + [Linter], targeting [Coverage Target] test coverage. Deployment
260
- to [Deployment Platform] with [Monitoring] for production readiness.
261
- ---
262
- ```
263
-
264
- **Example (E-commerce + NestJS + Production):**
265
-
266
- ```
267
- Your E-commerce backend will use NestJS with PostgreSQL, following Clean
268
- Architecture with 8 entities (User, Product, Category, Cart, Order, Payment,
269
- Address, Review). Security includes JWT + Refresh Tokens with RBAC,
270
- 12+ characters bcrypt 12 rounds. Code follows Prettier + ESLint +
271
- @typescript-eslint, targeting 70% test coverage. Deployment to Cloud
272
- (AWS/GCP/Azure) with APM (Datadog/New Relic) + Sentry for production
273
- readiness.
274
- ```
275
-
276
- #### **Extended Report (Organized by Phase)**
277
-
278
- ```
279
- ---
280
- 📋 Extended Configuration Report
281
- ---
282
- **Phase 1: Business & Discovery**
283
- • System Type: [From user input]
284
- • Target Users: [AI-suggested based on system type]
285
- • Core Features: [AI-suggested based on system type]
286
- • Success Metrics: [AI-suggested based on system type]
287
-
288
- **Phase 2: Data Architecture**
289
- • Database: [AI-suggested from scope]
290
- • ORM: [AI-suggested from framework]
291
- • Caching: [AI-suggested from scope]
292
- • Core Entities: [From user input]
293
-
294
- **Phase 3: System Architecture**
295
- • Framework: [From user input]
296
- • Pattern: [AI-suggested from scope]
297
- • API Style: [AI-suggested from scope]
298
- • Scaling: [AI-suggested from scope]
299
-
300
- **Phase 4: Security**
301
- • Authentication: [AI-suggested from scope]
302
- • Authorization: [AI-suggested from scope]
303
- • Password Policy: [AI-suggested from scope]
304
-
305
- **Phase 5: Code Standards**
306
- • Formatter: [AI-suggested from framework]
307
- • Linter: [AI-suggested from framework]
308
- • Git Workflow: [AI-suggested from scope]
309
-
310
- **Phase 6: Testing**
311
- • Coverage Target: [AI-suggested from scope]
312
- • Framework: [AI-suggested from framework]
313
-
314
- **Phase 7: Operations**
315
- • Deployment: [AI-suggested from scope]
316
- • Monitoring: [AI-suggested from scope]
317
- ---
318
- 💡 These suggestions can be customized during document review.
319
- ---
320
- ```
321
-
322
- ### Step 4: Confirmation & Override Option
323
-
324
- ```
325
- Would you like to:
326
-
327
- A) ✅ **Accept all suggestions** (Generate documentation now - 2 minutes)
328
- B) 📝 **Review & customize specific sections** (Show which phase to modify)
329
- C) ❌ **Cancel and switch to Interactive Mode** (Full control)
330
-
331
- Your choice (A/B/C): __
332
- ```
333
-
334
- **If user selects B:**
335
-
336
- - Show list of phases
337
- - Ask which phase they want to customize
338
- - Show that phase's suggested values
339
- - Allow modifications
340
- - Return to confirmation
341
-
342
- **If user selects A:**
343
-
344
- - Proceed directly to document generation with all suggested values
345
-
346
- **If user selects C:**
347
-
348
- - Restart with Interactive Mode (Mode A)
349
-
350
- ### Step 5: Generate Documentation
351
-
352
- Generate all 17 documents using the confirmed values (either AI-suggested or user-customized).
353
- ---
354
- ## 📚 How to Use This Guide
355
-
356
- This documentation is **modularized** for better maintainability and performance. Each phase is in a separate file.
357
-
358
- ### For Complete Build (All Phases)
359
-
360
- Execute phases sequentially by reading each file in order:
361
-
362
- 1. **Phase 0 (Optional - Existing Projects Only):** Read `.ai-flow/prompts/backend/flow-build-phase-0-context.md`
363
- 2. **Phase 1 (Discovery & Business):** Read `.ai-flow/prompts/backend/flow-build-phase-1-business.md`
364
- 3. **Phase 2 (Data Architecture):** Read `.ai-flow/prompts/backend/flow-build-phase-2-data.md`
365
- 4. **Phase 3 (System Architecture):** Read `.ai-flow/prompts/backend/flow-build-phase-3-architecture.md`
366
- 5. **Phase 4 (Security & Authentication):** Read `.ai-flow/prompts/backend/flow-build-phase-4-security.md`
367
- 6. **Phase 5 (Code Standards):** Read `.ai-flow/prompts/backend/flow-build-phase-5-standards.md`
368
- 7. **Phase 6 (Testing Strategy):** Read `.ai-flow/prompts/backend/flow-build-phase-6-testing.md`
369
- 8. **Phase 7 (Operations & Deployment):** Read `.ai-flow/prompts/backend/flow-build-phase-7-operations.md`
370
- 9. **Phase 8 (Project Setup & Final Documentation):** Read `.ai-flow/prompts/backend/flow-build-phase-8.md`
371
-
372
- ### For Individual Phases
373
-
374
- You can execute any phase independently by reading its file. For example:
375
-
376
- ```
377
- Read .ai-flow/prompts/backend/flow-build-phase-4-security.md and execute only Phase 4
378
- ```
379
- ---
380
- ## 🎯 Phase Overview
381
-
382
- ### Phase 0: Context Discovery (Optional)
383
-
384
- **File:** `backend/flow-build-phase-0-context.md`
385
- **For:** Existing projects with code/documentation
386
- **Duration:** 1-5 minutes (automated analysis)
387
- **Output:** Pre-populated answers, project analysis
388
-
389
- **What it does:**
390
-
391
- - **Layer 0:** Checks cache (0-2 seconds)
392
- - **Layer 1:** Fast metadata scan (10-20 seconds) - Detects language, framework, ORM
393
- - **Layer 2:** Structural analysis (30-90 seconds) - Analyzes directory structure, entities
394
- - **Layer 3:** Selective deep analysis (optional) - Extracts endpoints, relationships, security patterns
395
-
396
- **Supports:** 12 languages, 60+ frameworks, 35+ ORMs (98% market coverage)
397
-
398
- **Skip if:** Starting a completely new project from scratch
399
- ---
400
- ### Phase 1: Discovery & Business
401
-
402
- **File:** `backend/flow-build-phase-1-business.md`
403
- **Duration:** 15-20 minutes
404
- **Key Questions:**
405
-
406
- - What problem are you solving?
407
- - Who are your target users?
408
- - What are your business objectives?
409
- - What is your project scope?
410
-
411
- **Generates:**
412
-
413
- - `project-brief.md`
414
- - Parts of `AGENT.md`
415
- ---
416
- ### Phase 2: Data Architecture
417
-
418
- **File:** `backend/flow-build-phase-2-data.md`
419
- **Duration:** 15-20 minutes
420
- **Key Questions:**
421
-
422
- - What entities/models do you need?
423
- - How are they related?
424
- - What database will you use?
425
- - What are the data ownership rules?
426
-
427
- **Generates:**
428
-
429
- - `docs/data-model.md`
430
- - Parts of `ai-instructions.md`
431
- ---
432
- ### Phase 3: System Architecture
433
-
434
- **File:** `backend/flow-build-phase-3-architecture.md`
435
- **Duration:** 15-20 minutes
436
- **Key Questions:**
437
-
438
- - What tech stack will you use?
439
- - How will you structure your code?
440
- - What external services do you need?
441
- - How will you handle caching and background jobs?
442
-
443
- **Generates:**
444
-
445
- - `docs/architecture.md`
446
- - `docs/business-flows.md`
447
- - `docs/api.md`
448
- - Parts of `ai-instructions.md`
449
- ---
450
- ### Phase 4: Security & Authentication
451
-
452
- **File:** `backend/flow-build-phase-4-security.md`
453
- **Duration:** 15-20 minutes
454
- **Key Questions:**
79
+ 1. **Project Name & Description** (Skip if Phase 0 detected context)
80
+ 2. **Project Overview:** What problem does this system solve?
81
+ 3. **Business Objectives:** Top 3 measurable objectives.
82
+ 4. **System Type:** E-commerce, SaaS, CRM, Social, CMS, API Platform, etc.
83
+ 5. **Core Data Entities:** Main models (User, Product, Order, etc.).
84
+ 6. **Backend Framework:** NestJS, FastAPI, Spring Boot, Go, etc.
455
85
 
456
- - How will users authenticate?
457
- - What authorization model will you use?
458
- - What compliance requirements do you have?
459
- - How will you handle sensitive data?
460
-
461
- **Generates:**
462
-
463
- - `specs/security.md`
464
- - Parts of `ai-instructions.md`
465
- ---
466
- ### Phase 5: Code Standards
467
-
468
- **File:** `backend/flow-build-phase-5-standards.md`
469
- **Duration:** 15-20 minutes
470
- **Key Questions:**
471
-
472
- - What naming conventions will you use?
473
- - How will you handle errors?
474
- - What logging strategy will you use?
475
- - What validation approach will you use?
476
-
477
- **Generates:**
478
-
479
- - `docs/code-standards.md`
480
- - Parts of `ai-instructions.md`
481
- ---
482
- ### Phase 6: Testing Strategy
483
-
484
- **File:** `backend/flow-build-phase-6-testing.md`
485
- **Duration:** 15-25 minutes
486
- **Key Questions:**
487
-
488
- - What types of tests will you write?
489
- - What coverage targets do you have?
490
- - How will you structure your tests?
491
- - What testing tools will you use?
492
-
493
- **Generates:**
494
-
495
- - `docs/testing.md`
496
- - Parts of `ai-instructions.md`
497
- ---
498
- ### Phase 7: Operations & Deployment
499
-
500
- **File:** `backend/flow-build-phase-7-operations.md`
501
- **Duration:** 10 minutes
502
- **Key Questions:**
503
-
504
- - Where will you deploy?
505
- - How will you handle environments?
506
- - What monitoring will you use?
507
- - How will you handle logging and errors?
508
-
509
- **Generates:**
510
-
511
- - `docs/operations.md`
512
- - `specs/configuration.md`
513
- - `.env.example`
514
-
515
- **Next:** Transitions to Phase 8 for project setup and final documentation
516
- ---
517
- ### Phase 8: Project Setup & Final Documentation
518
-
519
- **File:** `backend/flow-build-phase-8.md`
520
- **Duration:** 10-15 minutes
521
- **Key Steps:**
522
-
523
- - Detect project state (new vs existing)
524
- - Initialize framework (optional, for new projects)
525
- - Generate final documentation
526
- - Create master index (AGENT.md)
527
- - Generate README.md with intelligent merge
528
-
529
- **Generates:**
530
-
531
- - `docs/business-flows.md`
532
- - `docs/api.md`
533
- - `docs/contributing.md`
534
- - `AGENT.md` (master index)
535
- - `README.md`
536
- - Tool-specific configs (`.clauderules`, `.cursorrules`, `.github/copilot-instructions.md`)
537
-
538
- **Next:** Offers optional Phase 9 for implementation roadmap generation
539
- ---
540
- ### Phase 9: Implementation Roadmap (Optional)
541
-
542
- **File:** `backend/flow-build-phase-9.md`
543
- **Duration:** 15-30 minutes
544
- **Key Steps:**
545
-
546
- - Analyze all generated documentation
547
- - Define Epics by domain
548
- - Break down Features with Story Points (Fibonacci scale)
549
- - Generate dependency graph and execution order
550
- - Identify parallelization opportunities
551
- - Create production readiness checklist
552
-
553
- **Generates:**
554
-
555
- - `docs/roadmap.md` (complete implementation plan)
556
-
557
- **Output includes:**
558
-
559
- - Epics organized by priority
560
- - Features with Story Point estimations
561
- - Task breakdown with acceptance criteria
562
- - Ready-to-execute `/feature` commands
563
- - Dependency graph (Mermaid)
564
- - Time estimates (1 dev, 2 devs, 3 devs)
565
-
566
- **Skip if:** You prefer to start coding immediately without a detailed roadmap
86
+ **AI Logic for Auto-Suggest:**
87
+ - Generate comprehensive suggestions for all phases (1-10).
88
+ - Use idiomatic tools for the selected framework (e.g., NestJS -> Prisma).
89
+ - Adjust complexity based on scope (MVP vs Enterprise).
90
+ - Present a summary for confirmation before generating documentation.
567
91
  ---
568
- ## 🚀 Quick Start Guide
569
92
 
570
- ### For New Projects
93
+ ## 📚 Flow Overview & Modular Phases
571
94
 
572
- ```
573
- 1. Skip Phase 0
574
- 2. Start with Phase 1 (Discovery & Business)
575
- 3. Continue through Phases 2-7 sequentially
576
- 4. Review and refine generated documentation
577
- ```
95
+ Each phase is modularized for better maintainability and reduced context usage.
578
96
 
579
- **Command:**
97
+ | Phase | Description | File |
98
+ |-------|-------------|------|
99
+ | **Phase 0** | Context Discovery | `backend/flow-build-phase-0.md` |
100
+ | **Phase 1** | Business & Discovery | `backend/flow-build-phase-1.md` |
101
+ | **Phase 2** | Data Architecture | `backend/flow-build-phase-2.md` |
102
+ | **Phase 3** | System Architecture | `backend/flow-build-phase-3.md` |
103
+ | **Phase 4** | Security & Auth | `backend/flow-build-phase-4.md` |
104
+ | **Phase 5** | Code Standards | `backend/flow-build-phase-5.md` |
105
+ | **Phase 6** | Testing Strategy | `backend/flow-build-phase-6.md` |
106
+ | **Phase 7** | Operations & Deployment | `backend/flow-build-phase-7.md` |
107
+ | **Phase 8** | Setup & Final Docs | `backend/flow-build-phase-8.md` |
108
+ | **Phase 9** | Roadmap (Optional) | `backend/flow-build-phase-9.md` |
109
+ | **Phase 10** | User Stories (Optional) | `backend/flow-build-phase-10.md` |
580
110
 
581
- ```
582
- Read .ai-flow/prompts/backend/flow-build-phase-1-business.md and execute Phase 1
583
- ```
584
111
  ---
585
- ### For Existing Projects
586
-
587
- ```
588
- 1. START with Phase 0 (Context Discovery)
589
- - AI will analyze your code and pre-populate answers
590
- - Saves 40-60% of time
112
+ ## 📋 Scope Selection (MVP / Production / Enterprise)
591
113
 
592
- 2. Continue with Phases 1-7
593
- - Skip questions already answered in Phase 0
594
- - Only fill gaps in documentation
114
+ Before starting Phase 1, ask the user to select the Project Scope.
115
+ > 📎 **Reference:** See [shared/scope-levels.md](../shared/scope-levels.md)
595
116
 
596
- 3. Review and refine generated documentation
597
- ```
598
-
599
- **Command:**
600
-
601
- ```
602
- Read .ai-flow/prompts/backend/flow-build-phase-0-context.md and execute Phase 0
603
- ```
604
117
  ---
605
- ## 📋 Scope Selection
606
-
607
- Before starting Phase 1, you'll select a scope level:
608
-
609
- > 📎 **Reference:** See [prompts/shared/scope-levels.md](../shared/scope-levels.md) for detailed scope definitions (MVP, Production-Ready, Enterprise).
118
+ ## 🔄 Documentation Sync
610
119
 
611
- ### A) MVP / Prototype
120
+ As your project grows, use the following to keep docs updated:
121
+ **Command:** `/flow-docs-sync`
122
+ **Logic:** Read `.ai-flow/prompts/backend/flow-docs-sync.md`.
612
123
 
613
- **Focus:** Core functionality + basic tests. Best for POCs and internal tools.
614
-
615
- ### B) 🚀 Production-Ready
616
-
617
- **Focus:** Production-grade with best practices. Best for SaaS and customer-facing APIs.
618
-
619
- ### C) 🏢 Enterprise / Mission-Critical
620
-
621
- **Focus:** Enterprise governance, compliance, and high scalability.
622
124
  ---
623
- ## 📊 Benefits of Modular Structure
624
-
625
- ✅ **Faster Loading** - Load only the phase you need (~8-50 KB vs 140 KB)
626
- ✅ **Better Maintainability** - Changes to one phase don't affect others
627
- ✅ **Independent Execution** - Run individual phases without loading entire file
628
- ✅ **Reduced Context Usage** - AI assistants use 50-70% less context
629
- ✅ **Clearer Git Diffs** - Changes are isolated to specific phase files
630
- ✅ **Easier Collaboration** - Multiple people can work on different phases
631
- ✅ **Better Performance** - Smaller files process faster in AI tools
632
- ---
633
- ## 🎓 Best Practices
634
-
635
- ### Before Starting
125
+ ## 🎯 After Completion
636
126
 
637
- 1. Have a clear problem statement
638
- 2. Know your approximate tech stack (or let Phase 0 detect it)
639
- 3. Understand your target users
640
- 4. Choose your scope (MVP/Production-Ready/Enterprise)
641
- 5. Set aside appropriate time based on scope
127
+ ALWAYS present a final summary:
128
+ 1. **Quick Summary:** 1 paragraph overview.
129
+ 2. **Extended Report:** Key decisions by phase.
130
+ 3. **Scaffolding:** Offer to initialize or commit changes.
642
131
 
643
- ### During Execution
644
-
645
- 1. Take your time with each question
646
- 2. Use recommendations (⭐🔥⚡🏆) as guides
647
- 3. Be specific - more detail = better docs
648
- 4. Confirm each phase before proceeding
649
- 5. Review generated docs after each phase
650
-
651
- ### After Completion
652
-
653
- 1. Review all generated documents
654
- 2. Customize as needed for your specific project
655
- 3. Share `AGENT.md` with your team
656
- 4. Update documents as your project evolves
657
- 5. Use `/flow-build-phase-[N]` commands to regenerate individual sections
658
132
  ---
659
- ## 💡 Tips
660
-
661
- - **Use cache:** If you run Phase 0, it saves results for instant re-runs
662
- - **Start selective:** For quick updates, run only the phases you need
663
- - **Iterate:** You can re-run phases to refine documentation
664
- - **Universal support:** Works with 12 languages, 60+ frameworks, 35+ ORMs
665
- - **AI-agnostic:** Works with Claude, Copilot, Cursor, Gemini, any AI tool
666
- ---
667
- ## 🔄 Maintaining Documentation
668
-
669
- As your project evolves, your documentation may become out of sync with your code. Use the `/flow-docs-sync` command to keep documentation synchronized.
670
-
671
- ### Command: `/flow-docs-sync`
672
-
673
- **Purpose:** Detect code changes and automatically update affected documentation files.
674
-
675
- **How it works:**
676
-
677
- 1. Compares current code state with last documented state (`.ai-flow/cache/docs-analysis.json`)
678
- 2. Detects changes in endpoints, entities, dependencies, architecture, configuration
679
- 3. Shows report of documents that need updating
680
- 4. Asks for confirmation to update all detected documents
681
- 5. Updates documents incrementally (only changed sections)
682
- 6. Updates `docs-analysis.json` with new state
683
-
684
- **When to use:**
685
-
686
- - After adding new API endpoints
687
- - After modifying database entities
688
- - After adding new dependencies
689
- - After changing project structure
690
- - After adding new environment variables
691
- - Periodically to ensure documentation stays current
692
-
693
- **Usage:**
694
-
695
- ```
696
- /flow-docs-sync
697
- ```
698
-
699
- **For detailed instructions:** Read `.ai-flow/prompts/backend/flow-docs-sync.md`
700
- ---
701
- ## 📞 Need Help?
702
-
703
- - **Issues:** [GitHub Issues](https://github.com/victorvelazquez/ai-flow/issues)
704
- - **Documentation:** [README.md](../../README.md)
705
- - **Contributing:** [CONTRIBUTING.md](../../CONTRIBUTING.md)
706
- - **Maintaining Docs:** Use `/flow-docs-sync` command (see AI Flow README for details)
707
- ---
708
- **Ready to start?** Choose your path:
709
-
710
- 1. **First:** Ask user to select Mode (A: Interactive or B: Smart Auto-Suggest)
711
- 2. **Then:**
712
- - 🆕 **New Project + Mode A:** Execute all phases sequentially, ask all questions
713
- - 🆕 **New Project + Mode B:** Ask 6 critical questions, auto-suggest the rest, show summary
714
- - 📁 **Existing Project + Mode A:** Read `flow-build-phase-0-context.md` first, then proceed with all phases
715
- - 📁 **Existing Project + Mode B:** Read `flow-build-phase-0-context.md` first, then ask remaining critical questions
716
- - 🔄 **Update Docs:** Use `/flow-docs-sync` command
717
- ---
718
- ## 📊 Final Summary (After Completion)
719
-
720
- **CRITICAL:** After generating all documentation, ALWAYS present a two-tier summary:
721
-
722
- ### **Tier 1: Quick Summary (1 paragraph max)**
723
-
724
- Present a concise overview in 1-2 sentences covering:
725
-
726
- - System type and framework
727
- - Database and main entities (count + examples)
728
- - Key architectural decisions
729
- - Security approach
730
- - Deployment platform
731
-
732
- **Format:**
733
-
734
- ```
735
- ---
736
- ✅ Configuration Complete - Quick Summary
737
- ---
738
- Your [System Type] backend will use [Framework] with [Database], following [Architecture] with [X] entities ([list 2-3 main ones]). Security includes [Auth Method] with [Authorization], and deployment to [Platform] with [Monitoring].
739
- ---
740
- ```
741
-
742
- ### **Tier 2: Extended Report (Organized, Not Too Long)**
743
-
744
- Present a structured report covering each phase's key decisions (3-5 bullets per phase max):
745
-
746
- ```
747
- ---
748
- 📋 Extended Configuration Report
749
- ---
750
- **Phase 1: Business**
751
- • System Type: [Type]
752
- • Target Users: [Who]
753
- • Core Features: [3-5 main features]
754
- • Success Metrics: [Key goals]
755
-
756
- **Phase 2: Data Architecture**
757
- • Database: [Type + Version]
758
- • ORM: [Tool]
759
- • Entities: [List main entities]
760
- • Relationships: [Key patterns]
761
-
762
- **Phase 3: System Architecture**
763
- • Framework: [Name + Version]
764
- • Language: [Name + Version]
765
- • API Style: [REST/GraphQL/etc.]
766
- • Architecture: [Pattern]
767
- • External Services: [List]
768
-
769
- **Phase 4: Security**
770
- • Auth: [Method + token config]
771
- • Authorization: [Model + roles]
772
- • Password: [Policy]
773
- • Rate Limiting: [Strategy]
774
-
775
- **Phase 5: Code Standards**
776
- • Formatter: [Tool + config]
777
- • Naming: [Conventions]
778
- • Structure: [Pattern]
779
- • Git Workflow: [Strategy]
780
-
781
- **Phase 6: Testing**
782
- • Framework: [Tool]
783
- • Coverage: [Target %]
784
- • Types: [Unit/Integration/E2E split]
785
- • CI: [Platform]
786
-
787
- **Phase 7: Operations**
788
- • Platform: [Deployment]
789
- • Containerization: [Docker/etc.]
790
- • Environments: [Dev/Staging/Prod]
791
- • Monitoring: [Tools]
792
- ---
793
- ✅ **Documentation Generated Successfully!**
794
-
795
- Created 17 professional documents in your project:
796
- • AGENT.md, ai-instructions.md, project-brief.md, README.md
797
- • 9 technical docs (architecture, data-model, api, etc.)
798
- • 2 specs (security, configuration)
799
- • .env.example
800
- ---
801
- Ready to commit the documentation?
802
-
803
- A) ✅ Yes, create initial commit now
804
- B) No, I'll review first and commit manually later
805
-
806
- Your choice (A): __
807
- ```
808
-
809
- **If choice A (recommended):**
810
-
811
- ```bash
812
- # Initialize git repository (if not already initialized)
813
- git init
814
-
815
- # Stage all generated documentation
816
- git add .ai-flow/
817
-
818
- # Create initial commit with documentation metadata
819
- git commit -m "docs: initial project documentation
820
-
821
- Generated by AI Flow /flow-build command:
822
- - 17 documentation files (backend)
823
- - Architecture: {{ARCHITECTURE_PATTERN}}
824
- - Tech stack: {{FRAMEWORK}}, {{DATABASE}}, {{ORM}}
825
- - Testing strategy: {{TEST_STRATEGY}}
826
- - Deployment: {{DEPLOYMENT_PLATFORM}}
827
-
828
- Ready for project scaffold with /project-scaffold"
829
- ```
830
-
831
- ```
832
- ✅ Initial commit created
833
-
834
- Commit hash: {{COMMIT_HASH}}
835
- Files tracked: 17 documentation files
836
- ---
837
- 🎯 Next Step: Initialize Project & Optional Roadmap
838
- ---
839
- Your documentation is ready! Now let's initialize your project.
840
-
841
- Continue with Phase 8?
842
-
843
- A) ✅ Yes, continue to Phase 8 (recommended) - 10-15 min
844
- → Initialize project + Generate final docs
845
- → Then option to continue to Phase 9 (roadmap)
846
-
847
- B) No, I'll review documentation first
848
-
849
- Your choice (A): __
850
- ```
851
-
852
- **If choice A:** Automatically transitions to Phase 8
853
-
854
- - Phase 8 will detect project state and offer framework initialization
855
- - Generates final documentation (business-flows, api, contributing)
856
- - Creates AGENT.md and README.md
857
- - Sets up AI tool configs
858
-
859
- **If choice B:** Show manual workflow:
860
-
861
- ```
862
- **Manual Workflow (resume anytime):**
863
-
864
- 1. Review documentation in .ai-flow/templates/
865
- 2. When ready, run Phase 8:
866
- → Read .ai-flow/prompts/backend/flow-build-phase-8.md
867
- → Detects project state, initializes framework (optional), generates final docs
868
- 3. (Optional) Continue to Phase 9: Implementation Roadmap (15-30 min)
869
- → Generates complete implementation plan with Story Points
870
- → Includes Epics, Features, Tasks, and execution order
871
- 4. Start implementing: /feature <feature-name>
872
- → Implements features following your architecture
873
-
874
- 💡 Tip: All phases are independent and re-executable.
875
- ---
876
- ```
877
- ---
878
- _Version: 4.0 (Phase 9 integrated - Implementation Roadmap with Story Points)_
879
- _Last Updated: 2025-12-09_
880
- _Version: 3.0 (Unified workflow: Phase 8 integrates project setup + final docs generation)_
133
+ _Version: 4.2 (v2.1.9) (Antigravity Optimized - Modularized & Turbo-Enabled)_
134
+ _Last Updated: 2025-12-21_
881
135
  _AI Flow - Transform your idea into production-ready code in minutes_
882
-
883
-
884
-
885
-