ai-flow-dev 1.3.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +97 -30
  2. package/dist/cli.js +94 -110
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +6 -2
  5. package/prompts/backend/{flow-bootstrap-phase-0.md → flow-build-phase-0.md} +5 -3
  6. package/prompts/backend/{flow-bootstrap-phase-1.md → flow-build-phase-1.md} +36 -41
  7. package/prompts/backend/{flow-bootstrap-phase-2.md → flow-build-phase-2.md} +80 -68
  8. package/prompts/backend/{flow-bootstrap-phase-3.md → flow-build-phase-3.md} +82 -61
  9. package/prompts/backend/{flow-bootstrap-phase-5.md → flow-build-phase-5.md} +10 -9
  10. package/prompts/backend/{flow-bootstrap-phase-6.md → flow-build-phase-6.md} +8 -7
  11. package/prompts/backend/{flow-bootstrap-phase-7.md → flow-build-phase-7.md} +5 -3
  12. package/prompts/backend/{flow-bootstrap-phase-8.md → flow-build-phase-8.md} +410 -543
  13. package/prompts/backend/{flow-bootstrap-phase-9.md → flow-build-phase-9.md} +472 -91
  14. package/prompts/backend/{flow-bootstrap.md → flow-build.md} +212 -140
  15. package/prompts/backend/flow-dev-feature.md +447 -68
  16. package/prompts/backend/flow-dev-fix.md +81 -8
  17. package/prompts/backend/flow-docs-sync.md +2 -1
  18. package/prompts/frontend/{flow-bootstrap-phase-0.md → flow-build-phase-0.md} +3 -2
  19. package/prompts/frontend/{flow-bootstrap-phase-1.md → flow-build-phase-1.md} +2 -1
  20. package/prompts/frontend/{flow-bootstrap-phase-2.md → flow-build-phase-2.md} +2 -1
  21. package/prompts/frontend/{flow-bootstrap-phase-3.md → flow-build-phase-3.md} +2 -1
  22. package/prompts/frontend/{flow-bootstrap-phase-4.md → flow-build-phase-4.md} +4 -2
  23. package/prompts/frontend/{flow-bootstrap-phase-5.md → flow-build-phase-5.md} +2 -1
  24. package/prompts/frontend/{flow-bootstrap-phase-6.md → flow-build-phase-6.md} +2 -1
  25. package/prompts/frontend/{flow-bootstrap-phase-8.md → flow-build-phase-8.md} +238 -22
  26. package/prompts/frontend/{flow-bootstrap.md → flow-build.md} +108 -25
  27. package/prompts/frontend/flow-docs-sync.md +3 -2
  28. package/prompts/mobile/{flow-bootstrap-phase-0.md → flow-build-phase-0.md} +3 -2
  29. package/prompts/mobile/{flow-bootstrap-phase-1.md → flow-build-phase-1.md} +2 -1
  30. package/prompts/mobile/{flow-bootstrap-phase-2.md → flow-build-phase-2.md} +2 -1
  31. package/prompts/mobile/{flow-bootstrap-phase-3.md → flow-build-phase-3.md} +2 -1
  32. package/prompts/mobile/{flow-bootstrap-phase-4.md → flow-build-phase-4.md} +2 -1
  33. package/prompts/mobile/{flow-bootstrap-phase-5.md → flow-build-phase-5.md} +2 -1
  34. package/prompts/mobile/{flow-bootstrap-phase-6.md → flow-build-phase-6.md} +2 -1
  35. package/prompts/mobile/{flow-bootstrap-phase-8.md → flow-build-phase-8.md} +249 -23
  36. package/prompts/mobile/{flow-bootstrap.md → flow-build.md} +107 -26
  37. package/prompts/mobile/flow-docs-sync.md +3 -2
  38. package/templates/{mobile/AGENT.template.md → AGENT.template.md} +2 -17
  39. package/templates/backend/.clauderules.template +1 -1
  40. package/templates/backend/.cursorrules.template +1 -1
  41. package/templates/shared/AGENT.template.md +0 -252
  42. /package/prompts/backend/{flow-bootstrap-phase-4.md → flow-build-phase-4.md} +0 -0
  43. /package/prompts/frontend/{flow-bootstrap-phase-7.md → flow-build-phase-7.md} +0 -0
  44. /package/prompts/mobile/{flow-bootstrap-phase-7.md → flow-build-phase-7.md} +0 -0
@@ -84,7 +84,7 @@ B) ⏭️ Skip for now (manual setup later)
84
84
  📦 Preparing for framework initialization...
85
85
 
86
86
  Creating backup of AI Flow documentation:
87
- → Moving .ai-flow/ docs to .ai-flow/temp-backup/
87
+ → Moving project root docs to .ai-flow/temp-backup/
88
88
 
89
89
  Files to backup:
90
90
  ✅ project-brief.md
@@ -103,69 +103,97 @@ Backup complete! Safe to initialize framework.
103
103
 
104
104
  ### 8.2.3: Execute Framework CLI
105
105
 
106
- **Based on framework detected in Phase 3:**
106
+ **IMPORTANT:** Use Bash tool to execute the framework's official CLI command. This ensures the project gets the latest stable versions and official project structure.
107
107
 
108
- **Node.js frameworks:**
108
+ **Based on framework detected in Phase 3, execute ONE of these commands:**
109
+
110
+ **NestJS:**
109
111
 
110
112
  ```bash
111
- # NestJS
112
113
  npx @nestjs/cli new . --skip-git --package-manager npm
114
+ ```
115
+
116
+ **Express:**
113
117
 
114
- # Express (using express-generator)
115
- npx express-generator . --no-view --git
118
+ ```bash
119
+ # Initialize package.json
120
+ npm init -y
121
+
122
+ # Install core dependencies with latest versions
123
+ npm install express cors helmet dotenv
116
124
 
117
- # Fastify
118
- npm init fastify
125
+ # Install dev dependencies
126
+ npm install -D typescript @types/node @types/express ts-node nodemon
119
127
 
120
- # Next.js
121
- npx create-next-app@latest . --typescript --eslint --tailwind --app --src-dir --import-alias "@/*"
128
+ # Create src/app.ts from template (see section 8.2.6.4)
122
129
  ```
123
130
 
124
- **Python frameworks:**
131
+ **Django:**
125
132
 
126
133
  ```bash
127
- # Django
128
134
  django-admin startproject config .
135
+ ```
129
136
 
130
- # FastAPI
131
- # Create main.py, requirements.txt, project structure
132
- mkdir -p app/api app/models app/schemas app/services
133
- touch main.py requirements.txt
134
- # Generate starter files
137
+ **FastAPI:**
135
138
 
136
- # Flask
137
- flask init
139
+ ```bash
140
+ # Install FastAPI with latest stable
141
+ pip install "fastapi[standard]" uvicorn[standard]
142
+
143
+ # Create app/main.py from template (see section 8.2.6.4)
138
144
  ```
139
145
 
140
- **Other frameworks:**
146
+ **Spring Boot:**
147
+
148
+ ```bash
149
+ spring init --dependencies=web,data-jpa --build=maven --name=[ProjectName] .
150
+ ```
151
+
152
+ **Laravel:**
153
+
154
+ ```bash
155
+ composer create-project laravel/laravel .
156
+ ```
157
+
158
+ **Go (Gin):**
141
159
 
142
160
  ```bash
143
- # Go
144
161
  go mod init [module-name]
162
+ go get -u github.com/gin-gonic/gin
163
+ ```
145
164
 
146
- # .NET
147
- dotnet new webapi -n [ProjectName]
165
+ **Ruby on Rails:**
148
166
 
149
- # Ruby on Rails
150
- rails new . --api --skip-git
167
+ ```bash
168
+ rails new . --api --skip-git --database=postgresql
169
+ ```
151
170
 
152
- # PHP Laravel
153
- composer create-project laravel/laravel .
171
+ **.NET Core:**
154
172
 
155
- # Java Spring Boot
156
- spring init --dependencies=web,data-jpa --build=maven .
173
+ ```bash
174
+ dotnet new webapi -n [ProjectName] -o .
157
175
  ```
158
176
 
159
- **Show progress:**
177
+ **Show progress as command executes:**
160
178
 
161
179
  ```
162
- 🚀 Initializing [FRAMEWORK_NAME]...
180
+ 🚀 Executing: npx @nestjs/cli new . --skip-git
163
181
 
164
- [Framework CLI output]
182
+ [Real CLI output from Bash tool]
165
183
 
166
184
  ✅ Framework initialized successfully!
167
185
  ```
168
186
 
187
+ **Result:** Framework CLI creates:
188
+
189
+ - ✅ package.json / requirements.txt / pom.xml (with latest versions)
190
+ - ✅ tsconfig.json / pyproject.toml (optimized configs)
191
+ - ✅ Basic src/ structure
192
+ - ✅ Test setup
193
+ - ✅ Linting/formatting configs
194
+
195
+ **Next:** Only add what framework doesn't include (see 8.2.6)
196
+
169
197
  ### 8.2.4: Restore AI Flow Documentation
170
198
 
171
199
  ```
@@ -212,613 +240,391 @@ You can initialize manually later with:
212
240
  Proceeding to documentation generation...
213
241
  ```
214
242
 
215
- ### 8.2.6: Complete Project Structure Setup
243
+ ### 8.2.6: Minimal Post-Init Enhancements
216
244
 
217
- **Set up complete development environment based on framework from Phase 3:**
245
+ **IMPORTANT:** Only add what the framework CLI doesn't include. **DO NOT** create business logic, entity modules, or complete features.
218
246
 
219
247
  ```
220
- 🔧 Setting up complete development environment...
248
+ 📦 Adding minimal enhancements...
221
249
 
222
- Framework detected: [FRAMEWORK_NAME]
223
- Creating additional configurations according to documentation:
250
+ Framework base created by CLI ✅
251
+ Now adding only essential files that framework doesn't include...
224
252
  ```
225
253
 
226
- **Based on the selected framework and ORM/database from previous phases:**
254
+ **Based on selected framework and database from previous phases:**
227
255
 
228
- **Install latest stable NestJS dependencies:**
229
-
230
- ```bash
231
- # Install NestJS CLI globally (latest stable)
232
- npm install -g @nestjs/cli
233
-
234
- # Initialize with latest stable dependencies
235
- npm install @nestjs/common @nestjs/core @nestjs/platform-express
236
- npm install @nestjs/config @nestjs/jwt @nestjs/passport @nestjs/swagger
237
- npm install @prisma/client bcrypt class-transformer class-validator
238
- npm install passport passport-jwt passport-local reflect-metadata rxjs swagger-ui-express
239
-
240
- # Install development dependencies (latest stable)
241
- npm install -D @nestjs/cli @nestjs/schematics @nestjs/testing
242
- npm install -D @types/bcrypt @types/express @types/jest @types/node
243
- npm install -D @types/passport-jwt @types/passport-local @types/supertest
244
- npm install -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
245
- npm install -D eslint eslint-config-prettier eslint-plugin-prettier
246
- npm install -D jest prettier prisma source-map-support supertest
247
- npm install -D ts-jest ts-loader ts-node tsconfig-paths typescript
248
- ```
256
+ ### 8.2.6.1: Environment Variables Template
249
257
 
250
- **Update package.json scripts:**
258
+ **Copy `.env.example` template to project root:**
251
259
 
252
- ```json
253
- {
254
- "scripts": {
255
- "build": "nest build",
256
- "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
257
- "start": "nest start",
258
- "start:dev": "nest start --watch",
259
- "start:debug": "nest start --debug --watch",
260
- "start:prod": "node dist/main",
261
- "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
262
- "test": "jest",
263
- "test:watch": "jest --watch",
264
- "test:cov": "jest --coverage",
265
- "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
266
- "test:e2e": "jest --config ./test/jest-e2e.json",
267
- "db:generate": "prisma generate",
268
- "db:push": "prisma db push",
269
- "db:migrate": "prisma migrate dev",
270
- "db:studio": "prisma studio"
271
- }
272
- }
260
+ ```bash
261
+ # Copy from .ai-flow/templates/.env.example.template to .env.example
273
262
  ```
274
263
 
275
- **Create enhanced tsconfig.json:**
264
+ **Template content (adapt based on framework and database):**
276
265
 
277
- ```json
278
- {
279
- "compilerOptions": {
280
- "module": "commonjs",
281
- "declaration": true,
282
- "removeComments": true,
283
- "emitDecoratorMetadata": true,
284
- "experimentalDecorators": true,
285
- "allowSyntheticDefaultImports": true,
286
- "target": "ES2021",
287
- "sourceMap": true,
288
- "outDir": "./dist",
289
- "baseUrl": "./",
290
- "incremental": true,
291
- "skipLibCheck": true,
292
- "strictNullChecks": true,
293
- "noImplicitAny": true,
294
- "strictBindCallApply": true,
295
- "forceConsistentCasingInFileNames": true,
296
- "noFallthroughCasesInSwitch": true,
297
- "paths": {
298
- "@/*": ["src/*"],
299
- "@/common/*": ["src/common/*"],
300
- "@/config/*": ["src/config/*"]
301
- }
302
- }
303
- }
304
- ```
266
+ ```env
267
+ # Database
268
+ DATABASE_URL="postgresql://postgres:password@localhost:5432/{{PROJECT_NAME}}_dev?schema=public"
305
269
 
306
- **Create complete Prisma configuration:**
270
+ # JWT Authentication
271
+ JWT_SECRET="your-secret-key-here-change-in-production"
272
+ JWT_EXPIRES_IN="24h"
307
273
 
308
- ```prisma
309
- // prisma/schema.prisma
310
- generator client {
311
- provider = "prisma-client-js"
312
- }
274
+ # Application
275
+ NODE_ENV="development"
276
+ PORT=3000
277
+ API_PREFIX="/api"
313
278
 
314
- datasource db {
315
- provider = "postgresql"
316
- url = env("DATABASE_URL")
317
- }
279
+ # CORS
280
+ CORS_ORIGIN="http://localhost:3000"
318
281
 
319
- // Basic User model (additional entities will be added in development phases)
320
- model User {
321
- id Int @id @default(autoincrement())
322
- email String @unique
323
- name String?
324
- createdAt DateTime @default(now())
325
- updatedAt DateTime @updatedAt
282
+ # Redis (if using)
283
+ REDIS_HOST="localhost"
284
+ REDIS_PORT=6379
326
285
 
327
- @@map("users")
328
- }
286
+ # Email (if using)
287
+ SMTP_HOST=""
288
+ SMTP_PORT=587
289
+ SMTP_USER=""
290
+ SMTP_PASS=""
329
291
  ```
330
292
 
331
- **Create .env file:**
293
+ **User must copy to `.env` manually:**
332
294
 
333
- ```env
334
- # Database
335
- DATABASE_URL="postgresql://postgres:password@localhost:5432/myapp_dev?schema=public"
295
+ ```
296
+ 📝 Created .env.example template
297
+ ⚠️ User must copy to .env and configure: cp .env.example .env
298
+ ```
336
299
 
337
- # JWT
338
- JWT_SECRET="your-super-secret-jwt-key-change-in-production"
339
- JWT_EXPIRES_IN="24h"
300
+ ### 8.2.6.2: Docker Compose (Optional)
340
301
 
341
- # App
342
- NODE_ENV="development"
343
- PORT=3000
302
+ **Only if user selected Docker in Phase 7.**
344
303
 
345
- # Cors
346
- CORS_ORIGIN="http://localhost:3000"
347
- ```
304
+ **Copy appropriate docker-compose template based on database:**
348
305
 
349
- **Create docker-compose.yml for PostgreSQL:**
306
+ **PostgreSQL:**
350
307
 
351
308
  ```yaml
309
+ # Copy from templates/docker-compose/postgres.template.yml
352
310
  version: "3.8"
311
+
353
312
  services:
354
313
  postgres:
355
314
  image: postgres:15-alpine
356
- restart: always
315
+ restart: unless-stopped
357
316
  environment:
358
- POSTGRES_DB: myapp_dev
359
- POSTGRES_USER: postgres
360
- POSTGRES_PASSWORD: password
317
+ POSTGRES_DB: ${DB_NAME:-myapp_dev}
318
+ POSTGRES_USER: ${DB_USER:-postgres}
319
+ POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
361
320
  ports:
362
- - "5432:5432"
321
+ - "${DB_PORT:-5432}:5432"
363
322
  volumes:
364
323
  - postgres_data:/var/lib/postgresql/data
324
+ healthcheck:
325
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
326
+ interval: 10s
327
+ timeout: 5s
328
+ retries: 5
365
329
 
366
330
  volumes:
367
331
  postgres_data:
368
332
  ```
369
333
 
370
- **Create complete ESLint + Prettier configuration:**
334
+ **MySQL:**
371
335
 
372
- ```json
373
- // .eslintrc.js
374
- module.exports = {
375
- parser: '@typescript-eslint/parser',
376
- parserOptions: {
377
- project: 'tsconfig.json',
378
- tsconfigRootDir: __dirname,
379
- sourceType: 'module',
380
- },
381
- plugins: ['@typescript-eslint/eslint-plugin'],
382
- extends: [
383
- '@nestjs',
384
- 'plugin:@typescript-eslint/recommended',
385
- 'plugin:prettier/recommended',
386
- ],
387
- root: true,
388
- env: {
389
- node: true,
390
- jest: true,
391
- },
392
- ignorePatterns: ['.eslintrc.js'],
393
- rules: {
394
- '@typescript-eslint/interface-name-prefix': 'off',
395
- '@typescript-eslint/explicit-function-return-type': 'off',
396
- '@typescript-eslint/explicit-module-boundary-types': 'off',
397
- '@typescript-eslint/no-explicit-any': 'off',
398
- },
399
- };
400
- ```
336
+ ```yaml
337
+ # Copy from templates/docker-compose/mysql.template.yml
338
+ version: "3.8"
401
339
 
402
- ```json
403
- // .prettierrc
404
- {
405
- "singleQuote": true,
406
- "trailingComma": "all",
407
- "tabWidth": 2,
408
- "semi": true,
409
- "printWidth": 80
410
- }
411
- ```
340
+ services:
341
+ mysql:
342
+ image: mysql:8-oracle
343
+ restart: unless-stopped
344
+ environment:
345
+ MYSQL_DATABASE: ${DB_NAME:-myapp_dev}
346
+ MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-password}
347
+ ports:
348
+ - "${DB_PORT:-3306}:3306"
349
+ volumes:
350
+ - mysql_data:/var/lib/mysql
412
351
 
413
- **Update main.ts with complete configuration:**
414
-
415
- ```typescript
416
- import { NestFactory } from "@nestjs/core";
417
- import { ValidationPipe } from "@nestjs/common";
418
- import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
419
- import { AppModule } from "./app.module";
420
-
421
- async function bootstrap() {
422
- const app = await NestFactory.create(AppModule);
423
-
424
- // Global validation pipe
425
- app.useGlobalPipes(
426
- new ValidationPipe({
427
- whitelist: true,
428
- forbidNonWhitelisted: true,
429
- transform: true,
430
- })
431
- );
432
-
433
- // CORS
434
- app.enableCors({
435
- origin: process.env.CORS_ORIGIN || "http://localhost:3000",
436
- credentials: true,
437
- });
438
-
439
- // Swagger API Documentation
440
- const config = new DocumentBuilder()
441
- .setTitle("API Documentation")
442
- .setDescription("The API description")
443
- .setVersion("1.0")
444
- .addBearerAuth()
445
- .build();
446
- const document = SwaggerModule.createDocument(app, config);
447
- SwaggerModule.setup("api/docs", app, document);
448
-
449
- const port = process.env.PORT || 3000;
450
- await app.listen(port);
451
- console.log(`🚀 Application is running on: http://localhost:${port}`);
452
- console.log(`📚 Swagger documentation: http://localhost:${port}/api/docs`);
453
- }
454
- bootstrap();
352
+ volumes:
353
+ mysql_data:
455
354
  ```
456
355
 
457
- **Create basic folder structure:**
356
+ **MongoDB:**
458
357
 
459
- ```
460
- src/
461
- ├── common/
462
- │ ├── decorators/
463
- │ ├── filters/
464
- │ ├── guards/
465
- │ ├── interceptors/
466
- │ └── pipes/
467
- ├── config/
468
- │ ├── database.config.ts
469
- │ └── jwt.config.ts
470
- └── health/
471
- ├── health.controller.ts
472
- └── health.module.ts
473
- ```
474
-
475
- **IMPORTANT: Do NOT create entity-specific modules** (User, Product, Order, etc.)
476
- **Only create the basic NestJS structure with configurations**
358
+ ```yaml
359
+ # Copy from templates/docker-compose/mongodb.template.yml
360
+ version: "3.8"
477
361
 
478
- ```
479
- ✅ Complete NestJS development environment ready!
480
- PostgreSQL configured with Docker Compose
481
- Prisma ORM configured with basic User model
482
- ✅ ESLint + Prettier configured
483
- JWT authentication structure ready
484
- Swagger API documentation enabled
485
- All development scripts configured
362
+ services:
363
+ mongodb:
364
+ image: mongo:7
365
+ restart: unless-stopped
366
+ environment:
367
+ MONGO_INITDB_DATABASE: ${DB_NAME:-myapp_dev}
368
+ MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-root}
369
+ MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD:-password}
370
+ ports:
371
+ - "${DB_PORT:-27017}:27017"
372
+ volumes:
373
+ - mongodb_data:/data/db
486
374
 
487
- 🎯 Project is ready for development - entity modules should be created during development phases
375
+ volumes:
376
+ mongodb_data:
488
377
  ```
489
378
 
490
- **Install dependencies:**
491
-
492
- ```bash
493
- npm install
494
-
495
- # Generate Prisma client
496
- npx prisma generate
379
+ ### 8.2.6.3: ORM Setup (If Framework Doesn't Include)
497
380
 
498
- # Start database
499
- docker-compose up -d
381
+ **Only for frameworks that don't auto-configure ORM:**
500
382
 
501
- # Run migrations (creates User table)
502
- npx prisma db push
503
- ```
383
+ **NestJS + Prisma:**
504
384
 
385
+ ```bash
386
+ npx prisma init
387
+ # Creates prisma/schema.prisma automatically with DATABASE_URL from .env
505
388
  ```
506
- 🔄 Installing dependencies...
507
- 📦 Generating Prisma client...
508
- 🐘 Starting PostgreSQL container...
509
- 🗄️ Creating database tables...
510
389
 
511
- All configurations applied successfully!
390
+ **Express + Prisma:**
512
391
 
513
- Next steps for development:
514
- 1. Start development server: npm run start:dev
515
- 2. Open API docs: http://localhost:3000/api/docs
516
- 3. Access database: npx prisma studio
517
- 4. Create entity modules as needed during development
392
+ ```bash
393
+ npm install prisma @prisma/client
394
+ npx prisma init
518
395
  ```
519
396
 
520
- #### **FastAPI (Python) Complete Setup:**
521
-
522
- **Install latest stable dependencies:**
397
+ **FastAPI + SQLAlchemy:**
523
398
 
524
399
  ```bash
525
- # Install latest stable FastAPI and dependencies
526
- pip install fastapi uvicorn[standard] sqlalchemy alembic psycopg2-binary
527
- pip install python-jose[cryptography] passlib[bcrypt] python-multipart
528
- pip install pydantic pydantic-settings
529
-
530
- # Install development dependencies (latest stable)
531
- pip install pytest pytest-asyncio black flake8 mypy
400
+ # SQLAlchemy setup (create app/core/database.py)
401
+ # Follow FastAPI documentation: https://fastapi.tiangolo.com/tutorial/sql-databases/
532
402
  ```
533
403
 
534
- **Create requirements.txt (use after installation to lock versions):**
404
+ **Django:**
535
405
 
536
406
  ```bash
537
- pip freeze > requirements.txt
407
+ # ORM already configured by django-admin startproject
408
+ # Just configure DATABASE settings in config/settings/base.py
538
409
  ```
539
410
 
540
- **Create complete project structure:**
411
+ **Result:**
541
412
 
542
413
  ```
543
- app/
544
- ├── __init__.py
545
- ├── main.py
546
- ├── core/
547
- │ ├── __init__.py
548
- │ ├── config.py
549
- │ ├── security.py
550
- │ └── database.py
551
- ├── api/
552
- │ ├── __init__.py
553
- │ └── deps.py
554
- ├── models/
555
- │ ├── __init__.py
556
- │ └── user.py
557
- └── schemas/
558
- ├── __init__.py
559
- └── user.py
414
+ ✅ ORM initialized
415
+ schema.prisma created (or equivalent)
416
+ Migrations ready to run
560
417
  ```
561
418
 
562
- **Create docker-compose.yml:**
419
+ ### 8.2.6.4: Starter Files for Express/FastAPI (Optional)
563
420
 
564
- ```yaml
565
- version: "3.8"
566
- services:
567
- postgres:
568
- image: postgres:15-alpine
569
- environment:
570
- POSTGRES_DB: myapp_dev
571
- POSTGRES_USER: postgres
572
- POSTGRES_PASSWORD: password
573
- ports:
574
- - "5432:5432"
575
- volumes:
576
- - postgres_data:/var/lib/postgresql/data
421
+ **Only if user needs a basic starting point. Otherwise, skip and let them follow official docs.**
577
422
 
578
- volumes:
579
- postgres_data:
580
- ```
423
+ **Express:**
581
424
 
582
- #### **Express.js (Node.js) Complete Setup:**
425
+ - Create `src/app.ts` with basic Express setup (middleware, health endpoint)
426
+ - Reference: https://expressjs.com/en/starter/hello-world.html
583
427
 
584
- **Install latest stable dependencies:**
428
+ **FastAPI:**
585
429
 
586
- ```bash
587
- # Install production dependencies (latest stable)
588
- npm install express cors helmet express-rate-limit jsonwebtoken bcrypt @prisma/client dotenv
430
+ - Create `app/main.py` with basic FastAPI setup (CORS, health endpoint)
431
+ - Reference: https://fastapi.tiangolo.com/tutorial/first-steps/
589
432
 
590
- # Install development dependencies (latest stable)
591
- npm install -D @types/express @types/cors @types/bcrypt @types/jsonwebtoken
592
- npm install -D typescript nodemon ts-node jest @types/jest prisma
433
+ **Docker Compose (if needed):**
593
434
 
594
- # Update package.json scripts
595
- ```
435
+ - Reference official Docker Hub documentation:
436
+ - PostgreSQL: https://hub.docker.com/_/postgres
437
+ - MySQL: https://hub.docker.com/_/mysql
438
+ - MongoDB: https://hub.docker.com/_/mongo
596
439
 
597
- **Configure package.json scripts:**
440
+ ### 8.2.6.5: Generate .gitignore
598
441
 
599
- ```json
600
- {
601
- "scripts": {
602
- "dev": "nodemon src/app.ts",
603
- "build": "tsc",
604
- "start": "node dist/app.js",
605
- "lint": "eslint src/**/*.ts",
606
- "test": "jest",
607
- "db:generate": "prisma generate",
608
- "db:migrate": "prisma migrate dev"
609
- }
610
- }
442
+ **IMPORTANT:** Generate a comprehensive `.gitignore` file based on the framework, language, and tools selected in previous phases.
443
+
444
+ ```
445
+ 📝 Generating .gitignore for your tech stack...
611
446
  ```
612
447
 
613
- #### **Django (Python) Complete Setup:**
448
+ **Strategy:**
614
449
 
615
- **Install latest stable dependencies:**
450
+ 1. **Detect framework from Phase 3** (NestJS, Express, Django, FastAPI, etc.)
451
+ 2. **Detect language** (Node.js, Python, Go, etc.)
452
+ 3. **Detect tools from Phase 7** (Docker, Prisma, etc.)
453
+ 4. **Combine relevant patterns**
616
454
 
617
- ```bash
618
- # Install Django and DRF (latest stable)
619
- pip install Django djangorestframework django-cors-headers
620
- pip install celery redis psycopg2-binary python-decouple
621
- pip install djangorestframework-simplejwt django-filter
455
+ **Base patterns by technology:**
622
456
 
623
- # Create requirements.txt after installation
624
- pip freeze > requirements.txt
625
- ```
457
+ **Node.js projects (NestJS, Express):**
626
458
 
627
- **Create settings structure:**
459
+ ```gitignore
460
+ # Dependencies
461
+ node_modules/
462
+ npm-debug.log*
463
+ yarn-debug.log*
464
+ yarn-error.log*
465
+ .pnpm-debug.log*
628
466
 
629
- ```
630
- config/
631
- ├── __init__.py
632
- ├── settings/
633
- │ ├── __init__.py
634
- │ ├── base.py
635
- │ ├── development.py
636
- │ └── production.py
637
- ├── urls.py
638
- └── wsgi.py
639
- ```
467
+ # Build outputs
468
+ dist/
469
+ build/
470
+ *.tsbuildinfo
640
471
 
641
- #### **Spring Boot (Java) Complete Setup:**
472
+ # Environment variables
473
+ .env
474
+ .env.local
475
+ .env.*.local
642
476
 
643
- **Create Spring Boot project with latest stable dependencies:**
477
+ # IDE
478
+ .vscode/
479
+ .idea/
480
+ *.swp
481
+ *.swo
482
+ *~
644
483
 
645
- ```bash
646
- # Use Spring Initializr or Spring Boot CLI for latest stable versions
647
- spring init --dependencies=web,data-jpa,security,postgresql --build=maven .
648
-
649
- # Or add dependencies manually (latest stable versions)
650
- ```
651
-
652
- **Add JWT dependency to pom.xml:**
653
-
654
- ```xml
655
- <dependencies>
656
- <!-- Spring Boot starters (managed versions) -->
657
- <dependency>
658
- <groupId>org.springframework.boot</groupId>
659
- <artifactId>spring-boot-starter-web</artifactId>
660
- </dependency>
661
- <dependency>
662
- <groupId>org.springframework.boot</groupId>
663
- <artifactId>spring-boot-starter-data-jpa</artifactId>
664
- </dependency>
665
- <dependency>
666
- <groupId>org.springframework.boot</groupId>
667
- <artifactId>spring-boot-starter-security</artifactId>
668
- </dependency>
669
- <dependency>
670
- <groupId>org.postgresql</groupId>
671
- <artifactId>postgresql</artifactId>
672
- </dependency>
673
- <!-- Use latest stable JWT library -->
674
- <dependency>
675
- <groupId>io.jsonwebtoken</groupId>
676
- <artifactId>jjwt-api</artifactId>
677
- </dependency>
678
- <dependency>
679
- <groupId>io.jsonwebtoken</groupId>
680
- <artifactId>jjwt-impl</artifactId>
681
- <scope>runtime</scope>
682
- </dependency>
683
- <dependency>
684
- <groupId>io.jsonwebtoken</groupId>
685
- <artifactId>jjwt-jackson</artifactId>
686
- <scope>runtime</scope>
687
- </dependency>
688
- </dependencies>
689
- ```
690
-
691
- #### **Laravel (PHP) Complete Setup:**
692
-
693
- **Install Laravel with latest stable version:**
484
+ # OS
485
+ .DS_Store
486
+ Thumbs.db
694
487
 
695
- ```bash
696
- # Create Laravel project with latest stable version
697
- composer create-project laravel/laravel .
488
+ # Testing
489
+ coverage/
490
+ .nyc_output/
698
491
 
699
- # Install additional packages (latest stable)
700
- composer require laravel/sanctum
701
- composer require --dev laravel/pint
492
+ # Logs
493
+ logs/
494
+ *.log
495
+
496
+ # Prisma (if using)
497
+ prisma/migrations/dev.db
498
+ prisma/*.db
499
+
500
+ # TypeScript
501
+ *.tsbuildinfo
702
502
  ```
703
503
 
704
- **Create .env configuration:**
504
+ **Python projects (Django, FastAPI):**
705
505
 
706
- ```env
707
- DB_CONNECTION=pgsql
708
- DB_HOST=127.0.0.1
709
- DB_PORT=5432
710
- DB_DATABASE=myapp_dev
711
- DB_USERNAME=postgres
712
- DB_PASSWORD=password
506
+ ```gitignore
507
+ # Python
508
+ __pycache__/
509
+ *.py[cod]
510
+ *$py.class
511
+ *.so
512
+ .Python
713
513
 
714
- SANCTUM_STATEFUL_DOMAINS=localhost:3000
715
- SESSION_DOMAIN=localhost
716
- ```
514
+ # Virtual environments
515
+ venv/
516
+ env/
517
+ ENV/
518
+ .venv
717
519
 
718
- #### **Go (Gin Framework) Complete Setup:**
520
+ # Django
521
+ *.log
522
+ db.sqlite3
523
+ db.sqlite3-journal
524
+ media/
525
+ staticfiles/
719
526
 
720
- **Initialize Go module and install dependencies:**
527
+ # FastAPI
528
+ .pytest_cache/
721
529
 
722
- ```bash
723
- # Initialize Go module
724
- go mod init myapp
530
+ # Environment
531
+ .env
532
+ .env.local
725
533
 
726
- # Install latest stable dependencies
727
- go get github.com/gin-gonic/gin
728
- go get github.com/golang-jwt/jwt/v5
729
- go get gorm.io/gorm
730
- go get gorm.io/driver/postgres
731
- go get github.com/golang-migrate/migrate/v4
732
- go get github.com/go-playground/validator/v10
534
+ # IDE
535
+ .vscode/
536
+ .idea/
537
+ *.swp
733
538
 
734
- # Tidy dependencies
735
- go mod tidy
539
+ # OS
540
+ .DS_Store
736
541
  ```
737
542
 
738
- **Generated go.mod will use latest compatible versions**
543
+ **Go projects:**
739
544
 
740
- **Create basic structure:**
545
+ ```gitignore
546
+ # Binaries
547
+ *.exe
548
+ *.exe~
549
+ *.dll
550
+ *.so
551
+ *.dylib
552
+ bin/
741
553
 
742
- ```
743
- cmd/
744
- ├── server/
745
- │ └── main.go
746
- internal/
747
- ├── config/
748
- ├── handlers/
749
- ├── middleware/
750
- ├── models/
751
- └── services/
752
- pkg/
753
- └── database/
754
- ```
554
+ # Test binary
555
+ *.test
755
556
 
756
- #### **Ruby on Rails Complete Setup:**
557
+ # Output
558
+ *.out
757
559
 
758
- **Create new Rails project and install dependencies:**
560
+ # Go workspace
561
+ go.work
759
562
 
760
- ```bash
761
- # Create new Rails API project
762
- rails new myapp --api --skip-git --database=postgresql
563
+ # Environment
564
+ .env
763
565
 
764
- # Navigate to project
765
- cd myapp
566
+ # IDE
567
+ .vscode/
568
+ .idea/
569
+ ```
766
570
 
767
- # Install latest stable gems
768
- bundle add jwt
769
- bundle add bcrypt
770
- bundle add rack-cors
771
- bundle add rspec-rails --group development,test
772
- bundle add factory_bot_rails --group development,test
773
- bundle add byebug --group development,test
571
+ **Docker additions (if Docker selected in Phase 7):**
774
572
 
775
- # Install all dependencies
776
- bundle install
573
+ ```gitignore
574
+ # Docker
575
+ docker-compose.override.yml
576
+ .docker/
777
577
  ```
778
578
 
779
- **Generated Gemfile will use latest compatible versions**
579
+ **📝 Action:** Generate and write `.gitignore` to project root.
780
580
 
781
- #### **.NET Core Complete Setup:**
581
+ **Selection logic:**
782
582
 
783
- **Create project and install latest stable packages:**
583
+ - If NestJS/Express Use Node.js patterns
584
+ - If Django/FastAPI → Use Python patterns
585
+ - If Go/Gin → Use Go patterns
586
+ - If Prisma detected in Phase 3 → Add Prisma patterns
587
+ - If Docker selected in Phase 7 → Add Docker patterns
784
588
 
785
- ```bash
786
- # Create new Web API project
787
- dotnet new webapi -n MyApp
788
- cd MyApp
589
+ ```
590
+ Generated: .gitignore
591
+ Patterns included: [Node.js | Python | Go] + [Prisma] + [Docker]
592
+ ```
789
593
 
790
- # Install latest stable Entity Framework packages
791
- dotnet add package Microsoft.EntityFrameworkCore.Design
792
- dotnet add package Microsoft.EntityFrameworkCore.Tools
793
- dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
594
+ ---
794
595
 
795
- # Install latest authentication packages
796
- dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
596
+ ### 8.2.6.6: Final Summary
797
597
 
798
- # Restore packages
799
- dotnet restore
800
598
  ```
599
+ ✅ Minimal enhancements complete!
801
600
 
802
- **IMPORTANT FOR ALL FRAMEWORKS:**
601
+ Files created (3-4 max):
602
+ ✅ .env.example (environment template)
603
+ ✅ .gitignore (ignore patterns for your stack)
604
+ ✅ docker-compose.yml (if Docker selected)
605
+ ✅ prisma/schema.prisma (if Prisma ORM)
803
606
 
804
- - **DO NOT create entity-specific controllers/routes** (users, products, orders, etc.)
805
- - **Only create basic project structure with configurations**
806
- - **Authentication structure ready but no specific endpoints**
807
- - **Database configured with basic table (if ORM used)**
808
- - **All development tools configured (linting, testing, etc.)**
607
+ 🎯 Total: 3-4 files (vs 40-60 files in old approach)
608
+ 📚 For Express/FastAPI starter code, refer to official documentation
809
609
 
610
+ Next steps:
611
+ 1. Copy .env.example to .env and configure
612
+ 2. Start database: docker-compose up -d (if applicable)
613
+ 3. Run migrations: npm run db:migrate or equivalent
614
+ 4. Start dev server: npm run start:dev or equivalent
615
+ 5. Create features with /feature command
810
616
  ```
811
- ✅ Complete [FRAMEWORK] development environment ready!
812
- ✅ Database configured with Docker Compose
813
- ✅ ORM/Database layer configured
814
- ✅ Authentication structure ready
815
- ✅ API documentation configured (where applicable)
816
- ✅ Linting and formatting configured
817
- ✅ Testing framework configured
818
- ✅ All development scripts configured
819
617
 
820
- 🎯 Project ready for development - entity-specific modules/controllers should be created during development phases
821
- ```
618
+ **CRITICAL RULES:**
619
+
620
+ - ❌ **DO NOT** create entity modules (User, Product, Order, etc.)
621
+ - ❌ **DO NOT** create controllers/routes for business logic
622
+ - ❌ **DO NOT** create authentication endpoints
623
+ - ❌ **DO NOT** create complete folder structures
624
+ - ❌ **DO NOT** install 40+ packages manually
625
+ - ✅ **ONLY** create .env.example, .gitignore, docker-compose (optional), ORM init
626
+ - ✅ **LET** framework CLI handle structure, configs, dependencies
627
+ - ✅ **REFER** to official docs for starter code when needed
822
628
 
823
629
  ---
824
630
 
@@ -883,6 +689,14 @@ Generating...
883
689
  [Generate mermaid sequence diagram]
884
690
  ```
885
691
 
692
+ **📝 Action:** Write the complete file to `docs/business-flows.md`
693
+
694
+ ```
695
+ ✅ Generated: docs/business-flows.md
696
+ ```
697
+
698
+ ---
699
+
886
700
  ### 8.3.2: Generate docs/api.md
887
701
 
888
702
  - **Template:** `.ai-flow/templates/docs/api.template.md`
@@ -959,6 +773,12 @@ We use [workflow from Phase 5]
959
773
  [Format from Phase 5.2]
960
774
  ````
961
775
 
776
+ **📝 Action:** Write the complete file to `docs/contributing.md`
777
+
778
+ ```
779
+ ✅ Generated: docs/contributing.md
780
+ ```
781
+
962
782
  ---
963
783
 
964
784
  ## 8.4: Generate AGENT.md (Master Index)
@@ -1110,16 +930,51 @@ The API will be available at `http://localhost:3000`
1110
930
 
1111
931
  ````
1112
932
 
1113
- **Success message:**
933
+ **📝 Action:** Write the complete file to `.ai-flow/README.md`
1114
934
 
1115
935
  ```
1116
- ✅ README.md generated!
936
+ Generated: .ai-flow/README.md
1117
937
  [If merged] Merged with framework's setup instructions
1118
938
  ```
1119
939
 
1120
940
  ---
1121
941
 
1122
- ## 8.6: Create Tool-Specific Configs
942
+ ## 8.6: Generate AGENT.md (Master Index)
943
+
944
+ **CRITICAL:** Before generating AGENT.md, re-read ALL previously generated documents to have complete context.
945
+
946
+ **📝 Action:**
947
+
948
+ ```
949
+ 🔄 Re-reading all generated documents for AGENT.md generation...
950
+
951
+ ✅ Reading project-brief.md
952
+ ✅ Reading ai-instructions.md
953
+ ✅ Reading docs/data-model.md
954
+ ✅ Reading docs/architecture.md
955
+ ✅ Reading docs/code-standards.md
956
+ ✅ Reading docs/testing.md
957
+ ✅ Reading docs/operations.md
958
+ ✅ Reading specs/security.md
959
+ ✅ Reading specs/configuration.md
960
+ ✅ Reading docs/business-flows.md
961
+ ✅ Reading docs/api.md
962
+ ✅ Reading docs/contributing.md
963
+
964
+ ✅ All context loaded!
965
+ ```
966
+
967
+ Now generate AGENT.md with complete information from all documents.
968
+
969
+ **📝 Action:** Write the complete file to `.ai-flow/AGENT.md`
970
+
971
+ ```
972
+ ✅ Generated: .ai-flow/AGENT.md (Master Index)
973
+ ```
974
+
975
+ ---
976
+
977
+ ## 8.7: Create Tool-Specific Configs
1123
978
 
1124
979
  **Based on AI tool selection from Phase 3 (question 3.8):**
1125
980
 
@@ -1140,18 +995,18 @@ Read `.ai-flow/AGENT.md` first for complete documentation index.
1140
995
 
1141
996
  - Project overview: `.ai-flow/project-brief.md`
1142
997
  - AI instructions: `.ai-flow/ai-instructions.md`
1143
- - Architecture: `.ai-flow/docs/architecture.md`
1144
- - API reference: `.ai-flow/docs/api.md`
1145
- - Code standards: `.ai-flow/docs/code-standards.md`
998
+ - Architecture: `docs/architecture.md`
999
+ - API reference: `docs/api.md`
1000
+ - Code standards: `docs/code-standards.md`
1146
1001
 
1147
1002
  ## Working Instructions
1148
1003
 
1149
1004
  When writing code:
1150
1005
 
1151
- 1. Follow patterns in `.ai-flow/docs/code-standards.md`
1152
- 2. Reference data model in `.ai-flow/docs/data-model.md`
1153
- 3. Implement security rules from `.ai-flow/specs/security.md`
1154
- 4. Write tests per `.ai-flow/docs/testing.md`
1006
+ 1. Follow patterns in `docs/code-standards.md`
1007
+ 2. Reference data model in `docs/data-model.md`
1008
+ 3. Implement security rules from `specs/security.md`
1009
+ 4. Write tests per `docs/testing.md`
1155
1010
 
1156
1011
  ## Critical Rules
1157
1012
 
@@ -1174,9 +1029,9 @@ See `.ai-flow/AGENT.md` for complete document list.
1174
1029
  ## Quick Reference
1175
1030
 
1176
1031
  - Tech Stack: [from Phase 3]
1177
- - Architecture: `.ai-flow/docs/architecture.md`
1178
- - Code Standards: `.ai-flow/docs/code-standards.md`
1179
- - API Conventions: `.ai-flow/docs/api.md`
1032
+ - Architecture: `docs/architecture.md`
1033
+ - Code Standards: `docs/code-standards.md`
1034
+ - API Conventions: `docs/api.md`
1180
1035
 
1181
1036
  ## Code Generation Rules
1182
1037
 
@@ -1206,11 +1061,11 @@ Master index: `.ai-flow/AGENT.md`
1206
1061
 
1207
1062
  ## Key References
1208
1063
 
1209
- - Architecture: `.ai-flow/docs/architecture.md`
1210
- - Data Model: `.ai-flow/docs/data-model.md`
1211
- - API: `.ai-flow/docs/api.md`
1212
- - Code Standards: `.ai-flow/docs/code-standards.md`
1213
- - Testing: `.ai-flow/docs/testing.md`
1064
+ - Architecture: `docs/architecture.md`
1065
+ - Data Model: `docs/data-model.md`
1066
+ - API: `docs/api.md`
1067
+ - Code Standards: `docs/code-standards.md`
1068
+ - Testing: `docs/testing.md`
1214
1069
 
1215
1070
  ## Code Generation Guidelines
1216
1071
 
@@ -1225,13 +1080,21 @@ Master index: `.ai-flow/AGENT.md`
1225
1080
  [Extract from code-standards.md]
1226
1081
  ```
1227
1082
 
1228
- ### If "All" selected:
1083
+ **📝 Action:** Generate the tool-specific config files based on selection:
1229
1084
 
1230
- Generate all three files above.
1085
+ - If Claude Write `.clauderules`
1086
+ - If Cursor → Write `.cursorrules`
1087
+ - If Copilot → Write `.github/copilot-instructions.md`
1088
+ - If "All" → Write all three files
1089
+
1090
+ ```
1091
+ ✅ Generated tool-specific configs:
1092
+ [List generated files based on selection]
1093
+ ```
1231
1094
 
1232
1095
  ---
1233
1096
 
1234
- ## 8.7: Final Validation & Success Message
1097
+ ## 8.8: Final Validation & Success Message
1235
1098
 
1236
1099
  ```
1237
1100
  🔍 Validating all generated files...
@@ -1249,7 +1112,7 @@ All validations passed!
1249
1112
  ```
1250
1113
  🎉 AI Flow Complete!
1251
1114
 
1252
- Generated 15 documents successfully:
1115
+ Generated 16 documents successfully:
1253
1116
 
1254
1117
  Phase 1:
1255
1118
  ✅ project-brief.md
@@ -1281,6 +1144,7 @@ Phase 8:
1281
1144
  ✅ docs/contributing.md
1282
1145
  ✅ README.md
1283
1146
  ✅ AGENT.md
1147
+ ✅ .gitignore
1284
1148
 
1285
1149
  [If framework initialized:]
1286
1150
  ✅ [FRAMEWORK_NAME] project initialized
@@ -1310,13 +1174,14 @@ your-project/
1310
1174
  │ │ ├── testing.md
1311
1175
  │ │ ├── operations.md
1312
1176
  │ │ └── contributing.md
1313
- ├── specs/
1314
- ├── security.md
1315
- └── configuration.md
1177
+ ├── specs/
1178
+ │ ├── security.md
1179
+ │ └── configuration.md
1316
1180
  │ └── templates/ # Original templates
1317
1181
  ├── [framework files] # If initialized
1318
1182
  ├── README.md
1319
1183
  ├── .env.example
1184
+ ├── .gitignore
1320
1185
  └── [tool configs] # .clauderules, .cursorrules, etc.
1321
1186
 
1322
1187
  ````
@@ -1388,11 +1253,12 @@ When executing Phase 8:
1388
1253
  - [ ] Generate docs/business-flows.md (from Phase 1)
1389
1254
  - [ ] Generate docs/api.md (from Phase 2 + Phase 3)
1390
1255
  - [ ] Generate docs/contributing.md (from Phase 5 + Phase 7)
1256
+ - [ ] Generate .gitignore (based on framework and tools)
1391
1257
 
1392
1258
  **8.4 Generate AGENT.md:**
1393
1259
 
1394
1260
  - [ ] Re-read ALL documents again to ensure accuracy
1395
- - [ ] Create master index listing all 15 documents
1261
+ - [ ] Create master index listing all 16 documents
1396
1262
  - [ ] Include quick reference (tech stack, rules, commands)
1397
1263
  - [ ] Validate all links
1398
1264
 
@@ -1487,7 +1353,7 @@ Your choice (A/B): \_\_
1487
1353
 
1488
1354
  ```
1489
1355
 
1490
- **If choice A:** Continue to Phase 9 (flow-bootstrap-phase-9.md)
1356
+ **If choice A:** Continue to Phase 9 (flow-build-phase-9.md)
1491
1357
 
1492
1358
  **If choice B:** Show completion message:
1493
1359
 
@@ -1516,3 +1382,4 @@ Happy coding! 🚀
1516
1382
 
1517
1383
  **SUCCESS:** Project fully documented and ready for development! 🚀
1518
1384
  ```
1385
+