ai-flow-dev 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/cli.js +17 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/prompts/backend/flow-build-phase-0.md +67 -23
- package/prompts/backend/flow-build-phase-1.md +51 -57
- package/prompts/backend/flow-build-phase-10.md +709 -0
- package/prompts/backend/flow-build-phase-2.md +48 -50
- package/prompts/backend/flow-build-phase-3.md +12 -13
- package/prompts/backend/flow-build-phase-4.md +12 -13
- package/prompts/backend/flow-build-phase-5.md +12 -12
- package/prompts/backend/flow-build-phase-6.md +12 -14
- package/prompts/backend/flow-build-phase-7.md +14 -15
- package/prompts/backend/flow-build-phase-8.md +47 -46
- package/prompts/backend/flow-build-phase-9.md +21 -28
- package/prompts/backend/flow-build.md +3 -3
- package/prompts/backend/flow-dev-commit.md +76 -14
- package/prompts/backend/flow-dev-feature.md +366 -31
- package/prompts/backend/flow-docs-sync.md +25 -28
- package/prompts/frontend/flow-docs-sync.md +10 -10
- package/prompts/mobile/flow-docs-sync.md +10 -10
- package/templates/AGENT.template.md +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
### 🎯 Objective
|
|
7
7
|
|
|
8
8
|
Efficiently analyze existing projects using a **layered, incremental approach** that:
|
|
9
|
+
|
|
9
10
|
- ✅ Minimizes context usage (50-75% reduction)
|
|
10
11
|
- ✅ Supports ALL major backend languages and frameworks
|
|
11
12
|
- ✅ Provides smart caching for instant re-runs
|
|
@@ -36,7 +37,7 @@ Result Synthesis & Pre-population
|
|
|
36
37
|
|
|
37
38
|
**Actions:**
|
|
38
39
|
|
|
39
|
-
1. Check if `.ai-flow/analysis.json` exists
|
|
40
|
+
1. Check if `.ai-flow/cache/docs-analysis.json` exists
|
|
40
41
|
2. If exists:
|
|
41
42
|
- Read `analyzedAt` timestamp
|
|
42
43
|
- Read `filesAnalyzed` with their timestamps
|
|
@@ -448,6 +449,7 @@ This scans directory organization and file counts without reading code.
|
|
|
448
449
|
**Language-specific directory patterns:**
|
|
449
450
|
|
|
450
451
|
**Node.js/TypeScript:**
|
|
452
|
+
|
|
451
453
|
```
|
|
452
454
|
Scanning directories:
|
|
453
455
|
• src/**/* or app/**/* or lib/**/*
|
|
@@ -465,6 +467,7 @@ Counting files by pattern:
|
|
|
465
467
|
```
|
|
466
468
|
|
|
467
469
|
**Python:**
|
|
470
|
+
|
|
468
471
|
```
|
|
469
472
|
Scanning directories:
|
|
470
473
|
• app/**/*.py or src/**/*.py
|
|
@@ -479,6 +482,7 @@ Counting files by pattern:
|
|
|
479
482
|
```
|
|
480
483
|
|
|
481
484
|
**PHP:**
|
|
485
|
+
|
|
482
486
|
```
|
|
483
487
|
Scanning directories:
|
|
484
488
|
• app/**/*.php or src/**/*.php
|
|
@@ -492,6 +496,7 @@ Counting files by pattern:
|
|
|
492
496
|
```
|
|
493
497
|
|
|
494
498
|
**Java:**
|
|
499
|
+
|
|
495
500
|
```
|
|
496
501
|
Scanning directories:
|
|
497
502
|
• src/main/java/**/*.java
|
|
@@ -506,6 +511,7 @@ Counting files by pattern:
|
|
|
506
511
|
```
|
|
507
512
|
|
|
508
513
|
**C#/.NET:**
|
|
514
|
+
|
|
509
515
|
```
|
|
510
516
|
Scanning directories:
|
|
511
517
|
• **/*.cs (excluding obj/, bin/)
|
|
@@ -520,6 +526,7 @@ Counting files by pattern:
|
|
|
520
526
|
```
|
|
521
527
|
|
|
522
528
|
**Go:**
|
|
529
|
+
|
|
523
530
|
```
|
|
524
531
|
Scanning directories:
|
|
525
532
|
• **/*.go (excluding vendor/)
|
|
@@ -533,6 +540,7 @@ Counting files by pattern:
|
|
|
533
540
|
```
|
|
534
541
|
|
|
535
542
|
**Ruby:**
|
|
543
|
+
|
|
536
544
|
```
|
|
537
545
|
Scanning directories:
|
|
538
546
|
• app/**/*.rb
|
|
@@ -559,56 +567,68 @@ Counting files by pattern:
|
|
|
559
567
|
**Based on detected ORM:**
|
|
560
568
|
|
|
561
569
|
**Prisma:**
|
|
570
|
+
|
|
562
571
|
- Read `prisma/schema.prisma`
|
|
563
572
|
- Extract model names only (regex: `model (\w+)`)
|
|
564
573
|
- Count total models
|
|
565
574
|
- Count relationships (count occurrences of `@relation`)
|
|
566
575
|
|
|
567
576
|
**TypeORM:**
|
|
577
|
+
|
|
568
578
|
- Glob `*.entity.{ts,js}`
|
|
569
579
|
- Extract entity names from `@Entity()` decorator (regex, no full parsing)
|
|
570
580
|
- Count entities
|
|
571
581
|
|
|
572
582
|
**Sequelize:**
|
|
583
|
+
|
|
573
584
|
- Glob `models/**/*.{ts,js}`
|
|
574
585
|
- Count model files
|
|
575
586
|
|
|
576
587
|
**Mongoose:**
|
|
588
|
+
|
|
577
589
|
- Glob `*.schema.{ts,js}` or `models/**/*.{ts,js}`
|
|
578
590
|
- Search for `new Schema(` pattern
|
|
579
591
|
- Count schemas
|
|
580
592
|
|
|
581
593
|
**Django:**
|
|
594
|
+
|
|
582
595
|
- Read `*/models.py` files
|
|
583
596
|
- Extract class names inheriting from `models.Model` (regex)
|
|
584
597
|
- Count models
|
|
585
598
|
|
|
586
599
|
**SQLAlchemy:**
|
|
600
|
+
|
|
587
601
|
- Read `**/models.py` or `**/*_model.py`
|
|
588
602
|
- Extract classes with `Base` or `db.Model` (regex)
|
|
589
603
|
- Count models
|
|
590
604
|
|
|
591
605
|
**Eloquent (Laravel):**
|
|
606
|
+
|
|
592
607
|
- Glob `app/Models/**/*.php`
|
|
593
608
|
- Count model files
|
|
594
609
|
|
|
595
610
|
**Doctrine (Symfony/PHP):**
|
|
611
|
+
|
|
596
612
|
- Glob `src/Entity/**/*.php`
|
|
597
613
|
- Count entity files
|
|
598
614
|
|
|
599
615
|
**Hibernate/JPA (Java):**
|
|
616
|
+
|
|
600
617
|
- Glob `**/*Entity.java`
|
|
601
618
|
- Count entity files
|
|
602
619
|
|
|
603
620
|
**Entity Framework (.NET):**
|
|
621
|
+
|
|
604
622
|
- Glob `**/Models/**/*.cs` or `**/Entities/**/*.cs`
|
|
605
623
|
- Count entity files
|
|
606
624
|
|
|
607
625
|
**GORM (Go):**
|
|
626
|
+
|
|
608
627
|
- Search for `type.*struct` in `models/**/*.go`
|
|
609
628
|
- Count structs
|
|
610
629
|
|
|
611
630
|
**ActiveRecord (Ruby):**
|
|
631
|
+
|
|
612
632
|
- Glob `app/models/**/*.rb`
|
|
613
633
|
- Count model files
|
|
614
634
|
|
|
@@ -639,6 +659,7 @@ Checking docs/ directory...
|
|
|
639
659
|
```
|
|
640
660
|
|
|
641
661
|
**Maturity Level:**
|
|
662
|
+
|
|
642
663
|
- 🌱 **Minimal:** 0-1 docs → Suggest **MVP or Production-Ready scope**
|
|
643
664
|
- 🌿 **Basic:** 2-4 docs → Suggest **Production-Ready scope**
|
|
644
665
|
- 🌳 **Comprehensive:** 5-7 docs → Suggest **Production-Ready or Enterprise scope**
|
|
@@ -781,11 +802,11 @@ function selectFilesToAnalyze(files: string[], category: string, maxFiles: numbe
|
|
|
781
802
|
services: 9,
|
|
782
803
|
entities: 10,
|
|
783
804
|
repositories: 8,
|
|
784
|
-
dto: 7
|
|
805
|
+
dto: 7,
|
|
785
806
|
};
|
|
786
807
|
|
|
787
808
|
// Group by module/feature
|
|
788
|
-
const byModule = groupBy(files, file => file.split('/')[1]);
|
|
809
|
+
const byModule = groupBy(files, (file) => file.split('/')[1]);
|
|
789
810
|
|
|
790
811
|
// Sample proportionally from each module
|
|
791
812
|
const samples = [];
|
|
@@ -851,6 +872,7 @@ Your choice: __
|
|
|
851
872
|
**Node.js/TypeScript:**
|
|
852
873
|
|
|
853
874
|
**API Endpoints (NestJS):**
|
|
875
|
+
|
|
854
876
|
```typescript
|
|
855
877
|
// Sample up to 30 controller files
|
|
856
878
|
const controllerFiles = glob('**/*.controller.{ts,js}').slice(0, 30);
|
|
@@ -867,7 +889,7 @@ for (const file of controllerFiles) {
|
|
|
867
889
|
...content.matchAll(/@Post\(['"](.+?)['"]\)\s+(\w+)/g),
|
|
868
890
|
...content.matchAll(/@Put\(['"](.+?)['"]\)\s+(\w+)/g),
|
|
869
891
|
...content.matchAll(/@Delete\(['"](.+?)['"]\)\s+(\w+)/g),
|
|
870
|
-
...content.matchAll(/@Patch\(['"](.+?)['"]\)\s+(\w+)/g)
|
|
892
|
+
...content.matchAll(/@Patch\(['"](.+?)['"]\)\s+(\w+)/g),
|
|
871
893
|
];
|
|
872
894
|
|
|
873
895
|
for (const [fullMatch, path, handlerName, method] of routes) {
|
|
@@ -875,13 +897,14 @@ for (const file of controllerFiles) {
|
|
|
875
897
|
method: method,
|
|
876
898
|
path: `${basePath}/${path}`,
|
|
877
899
|
handler: handlerName,
|
|
878
|
-
file: file
|
|
900
|
+
file: file,
|
|
879
901
|
});
|
|
880
902
|
}
|
|
881
903
|
}
|
|
882
904
|
```
|
|
883
905
|
|
|
884
906
|
**API Endpoints (Express):**
|
|
907
|
+
|
|
885
908
|
```typescript
|
|
886
909
|
const routeFiles = glob('**/routes/**/*.{ts,js}').slice(0, 20);
|
|
887
910
|
|
|
@@ -890,16 +913,17 @@ for (const file of routeFiles) {
|
|
|
890
913
|
|
|
891
914
|
const routes = [
|
|
892
915
|
...content.matchAll(/router\.(get|post|put|delete|patch)\(['"](.+?)['"],\s*(\w+)/g),
|
|
893
|
-
...content.matchAll(/app\.(get|post|put|delete|patch)\(['"](.+?)['"],\s*(\w+)/g)
|
|
916
|
+
...content.matchAll(/app\.(get|post|put|delete|patch)\(['"](.+?)['"],\s*(\w+)/g),
|
|
894
917
|
];
|
|
895
918
|
|
|
896
919
|
for (const [, method, path, handler] of routes) {
|
|
897
|
-
endpoints.push({method: method.toUpperCase(), path, handler, file});
|
|
920
|
+
endpoints.push({ method: method.toUpperCase(), path, handler, file });
|
|
898
921
|
}
|
|
899
922
|
}
|
|
900
923
|
```
|
|
901
924
|
|
|
902
925
|
**Entities (Prisma):**
|
|
926
|
+
|
|
903
927
|
```typescript
|
|
904
928
|
// Read prisma/schema.prisma
|
|
905
929
|
const schema = readFile('prisma/schema.prisma');
|
|
@@ -915,9 +939,9 @@ for (const [, modelName, body] of models) {
|
|
|
915
939
|
fields: fields.map(([, name, type, decorator]) => ({
|
|
916
940
|
name,
|
|
917
941
|
type,
|
|
918
|
-
decorator
|
|
942
|
+
decorator,
|
|
919
943
|
})),
|
|
920
|
-
relationships: [...body.matchAll(/@relation\(([^)]+)\)/g)].map(m => m[1])
|
|
944
|
+
relationships: [...body.matchAll(/@relation\(([^)]+)\)/g)].map((m) => m[1]),
|
|
921
945
|
};
|
|
922
946
|
|
|
923
947
|
entities.push(entity);
|
|
@@ -927,6 +951,7 @@ for (const [, modelName, body] of models) {
|
|
|
927
951
|
**Python:**
|
|
928
952
|
|
|
929
953
|
**API Endpoints (FastAPI):**
|
|
954
|
+
|
|
930
955
|
```python
|
|
931
956
|
# Sample router files
|
|
932
957
|
routerFiles = glob('**/*routes.py', '**/*router.py')[:20]
|
|
@@ -947,6 +972,7 @@ for file in routerFiles:
|
|
|
947
972
|
```
|
|
948
973
|
|
|
949
974
|
**Entities (Django):**
|
|
975
|
+
|
|
950
976
|
```python
|
|
951
977
|
# Read models.py files
|
|
952
978
|
modelFiles = glob('**/models.py')[:15]
|
|
@@ -970,6 +996,7 @@ for file in modelFiles:
|
|
|
970
996
|
**PHP:**
|
|
971
997
|
|
|
972
998
|
**API Endpoints (Laravel):**
|
|
999
|
+
|
|
973
1000
|
```php
|
|
974
1001
|
// Read routes/api.php and routes/web.php
|
|
975
1002
|
$routeFiles = ['routes/api.php', 'routes/web.php'];
|
|
@@ -992,6 +1019,7 @@ foreach ($routeFiles as $file) {
|
|
|
992
1019
|
```
|
|
993
1020
|
|
|
994
1021
|
**Entities (Eloquent):**
|
|
1022
|
+
|
|
995
1023
|
```php
|
|
996
1024
|
// Glob app/Models/*.php
|
|
997
1025
|
$modelFiles = glob('app/Models/*.php');
|
|
@@ -1014,6 +1042,7 @@ foreach ($modelFiles as $file) {
|
|
|
1014
1042
|
**Java:**
|
|
1015
1043
|
|
|
1016
1044
|
**API Endpoints (Spring Boot):**
|
|
1045
|
+
|
|
1017
1046
|
```java
|
|
1018
1047
|
// Glob **/*Controller.java (sample 25)
|
|
1019
1048
|
List<String> controllerFiles = glob("**/*Controller.java").subList(0, 25);
|
|
@@ -1040,6 +1069,7 @@ for (String file : controllerFiles) {
|
|
|
1040
1069
|
```
|
|
1041
1070
|
|
|
1042
1071
|
**Entities (JPA/Hibernate):**
|
|
1072
|
+
|
|
1043
1073
|
```java
|
|
1044
1074
|
// Glob **/*Entity.java
|
|
1045
1075
|
List<String> entityFiles = glob("**/*Entity.java").subList(0, 30);
|
|
@@ -1069,6 +1099,7 @@ for (String file : entityFiles) {
|
|
|
1069
1099
|
**C#/.NET:**
|
|
1070
1100
|
|
|
1071
1101
|
**API Endpoints (ASP.NET Core):**
|
|
1102
|
+
|
|
1072
1103
|
```csharp
|
|
1073
1104
|
// Glob **/*Controller.cs
|
|
1074
1105
|
var controllerFiles = Directory.GetFiles(".", "*Controller.cs", SearchOption.AllDirectories).Take(25);
|
|
@@ -1095,6 +1126,7 @@ foreach (var file in controllerFiles) {
|
|
|
1095
1126
|
```
|
|
1096
1127
|
|
|
1097
1128
|
**Entities (Entity Framework):**
|
|
1129
|
+
|
|
1098
1130
|
```csharp
|
|
1099
1131
|
// Glob **/Models/**/*.cs or **/Entities/**/*.cs
|
|
1100
1132
|
var entityFiles = Directory.GetFiles(".", "*.cs", SearchOption.AllDirectories)
|
|
@@ -1125,6 +1157,7 @@ foreach (var file in entityFiles) {
|
|
|
1125
1157
|
**Go:**
|
|
1126
1158
|
|
|
1127
1159
|
**API Endpoints (Gin):**
|
|
1160
|
+
|
|
1128
1161
|
```go
|
|
1129
1162
|
// Read handler files
|
|
1130
1163
|
handlerFiles := filepath.Glob("**/handlers/**/*.go")[:20]
|
|
@@ -1148,6 +1181,7 @@ for _, file := range handlerFiles {
|
|
|
1148
1181
|
```
|
|
1149
1182
|
|
|
1150
1183
|
**Entities (GORM):**
|
|
1184
|
+
|
|
1151
1185
|
```go
|
|
1152
1186
|
// Read model files
|
|
1153
1187
|
modelFiles := filepath.Glob("**/models/**/*.go")[:20]
|
|
@@ -1180,6 +1214,7 @@ for _, file := range modelFiles {
|
|
|
1180
1214
|
**Ruby:**
|
|
1181
1215
|
|
|
1182
1216
|
**API Endpoints (Rails):**
|
|
1217
|
+
|
|
1183
1218
|
```ruby
|
|
1184
1219
|
# Read routes.rb
|
|
1185
1220
|
routes_file = 'config/routes.rb'
|
|
@@ -1214,6 +1249,7 @@ end
|
|
|
1214
1249
|
```
|
|
1215
1250
|
|
|
1216
1251
|
**Entities (ActiveRecord):**
|
|
1252
|
+
|
|
1217
1253
|
```ruby
|
|
1218
1254
|
# Glob app/models/*.rb
|
|
1219
1255
|
model_files = Dir.glob('app/models/**/*.rb')[0..20]
|
|
@@ -1242,6 +1278,7 @@ end
|
|
|
1242
1278
|
**Rust:**
|
|
1243
1279
|
|
|
1244
1280
|
**API Endpoints (Actix):**
|
|
1281
|
+
|
|
1245
1282
|
```rust
|
|
1246
1283
|
// Read handler files
|
|
1247
1284
|
let handler_files: Vec<_> = glob("**/handlers/**/*.rs").unwrap().take(15).collect();
|
|
@@ -1264,6 +1301,7 @@ for file in handler_files {
|
|
|
1264
1301
|
```
|
|
1265
1302
|
|
|
1266
1303
|
**Entities (Diesel):**
|
|
1304
|
+
|
|
1267
1305
|
```rust
|
|
1268
1306
|
// Read schema.rs and models.rs
|
|
1269
1307
|
let schema = fs::read_to_string("src/schema.rs").ok();
|
|
@@ -1287,12 +1325,14 @@ if let Some(schema_content) = schema {
|
|
|
1287
1325
|
**Scan for security patterns across all languages:**
|
|
1288
1326
|
|
|
1289
1327
|
**Authentication:**
|
|
1328
|
+
|
|
1290
1329
|
- JWT libraries: `jsonwebtoken`, `@nestjs/jwt`, `pyjwt`, `jjwt`, etc.
|
|
1291
1330
|
- Session libraries: `express-session`, `django.contrib.sessions`
|
|
1292
1331
|
- OAuth libraries: `passport`, `authlib`, `spring-security-oauth2`
|
|
1293
1332
|
- Password hashing: `bcrypt`, `argon2`, `password_hash` (PHP)
|
|
1294
1333
|
|
|
1295
1334
|
**Validation:**
|
|
1335
|
+
|
|
1296
1336
|
- `class-validator`, `joi`, `zod` (Node.js)
|
|
1297
1337
|
- `pydantic`, `marshmallow` (Python)
|
|
1298
1338
|
- Laravel validation rules (PHP)
|
|
@@ -1300,16 +1340,19 @@ if let Some(schema_content) = schema {
|
|
|
1300
1340
|
- Data Annotations (.NET)
|
|
1301
1341
|
|
|
1302
1342
|
**Rate Limiting:**
|
|
1343
|
+
|
|
1303
1344
|
- `express-rate-limit`, `@nestjs/throttler`
|
|
1304
1345
|
- `django-ratelimit`, `slowapi`
|
|
1305
1346
|
- Bucket4j (Java)
|
|
1306
1347
|
|
|
1307
1348
|
**CORS:**
|
|
1349
|
+
|
|
1308
1350
|
- `cors` package (Node.js)
|
|
1309
1351
|
- `django-cors-headers` (Python)
|
|
1310
1352
|
- Spring CORS configuration (Java)
|
|
1311
1353
|
|
|
1312
1354
|
**Security Headers:**
|
|
1355
|
+
|
|
1313
1356
|
- `helmet` (Node.js)
|
|
1314
1357
|
- `django-csp`
|
|
1315
1358
|
- OWASP Java Encoder
|
|
@@ -1395,7 +1438,7 @@ Sample Endpoints:
|
|
|
1395
1438
|
• GET /api/users/:id → UsersController.findOne
|
|
1396
1439
|
• POST /api/products → ProductsController.create
|
|
1397
1440
|
• PUT /api/orders/:id → OrdersController.update
|
|
1398
|
-
[View full list in analysis.json]
|
|
1441
|
+
[View full list in docs-analysis.json]
|
|
1399
1442
|
|
|
1400
1443
|
🗄️ Database Entities: [18 detected]
|
|
1401
1444
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -1407,7 +1450,7 @@ Core Entities:
|
|
|
1407
1450
|
• Order (10 fields, 4 relationships)
|
|
1408
1451
|
- Relationships: ManyToOne → User, OneToMany → OrderItems, etc.
|
|
1409
1452
|
|
|
1410
|
-
[+15 more entities - see analysis.json for full schema]
|
|
1453
|
+
[+15 more entities - see docs-analysis.json for full schema]
|
|
1411
1454
|
|
|
1412
1455
|
🔒 Security Patterns:
|
|
1413
1456
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -1492,13 +1535,16 @@ Your choice: __
|
|
|
1492
1535
|
```
|
|
1493
1536
|
|
|
1494
1537
|
**If user selects A:**
|
|
1538
|
+
|
|
1495
1539
|
- Mark suggestions to be addressed in relevant phases
|
|
1496
1540
|
- When reaching those phases, reference: "Earlier analysis detected X, let's configure it now"
|
|
1497
1541
|
|
|
1498
1542
|
**If user selects B:**
|
|
1543
|
+
|
|
1499
1544
|
- Create `suggestions.md` with all recommendations formatted for reference
|
|
1500
1545
|
|
|
1501
1546
|
**If user selects C:**
|
|
1547
|
+
|
|
1502
1548
|
- Continue without suggestions
|
|
1503
1549
|
|
|
1504
1550
|
---
|
|
@@ -1508,7 +1554,7 @@ Your choice: __
|
|
|
1508
1554
|
```
|
|
1509
1555
|
💾 Export Analysis to JSON?
|
|
1510
1556
|
|
|
1511
|
-
This creates .ai-flow/analysis.json with all detected information:
|
|
1557
|
+
This creates .ai-flow/cache/docs-analysis.json with all detected information:
|
|
1512
1558
|
• Project metadata and tech stack
|
|
1513
1559
|
• Complete endpoint list with methods, paths, handlers
|
|
1514
1560
|
• Full entity schemas with relationships
|
|
@@ -1592,13 +1638,13 @@ Your choice: __
|
|
|
1592
1638
|
"source": "prisma",
|
|
1593
1639
|
"file": "prisma/schema.prisma",
|
|
1594
1640
|
"fields": [
|
|
1595
|
-
{"name": "id", "type": "String", "required": true, "primary": true},
|
|
1596
|
-
{"name": "email", "type": "String", "required": true, "unique": true},
|
|
1597
|
-
{"name": "password", "type": "String", "required": true}
|
|
1641
|
+
{ "name": "id", "type": "String", "required": true, "primary": true },
|
|
1642
|
+
{ "name": "email", "type": "String", "required": true, "unique": true },
|
|
1643
|
+
{ "name": "password", "type": "String", "required": true }
|
|
1598
1644
|
],
|
|
1599
1645
|
"relationships": [
|
|
1600
|
-
{"type": "OneToMany", "target": "Order", "field": "orders"},
|
|
1601
|
-
{"type": "OneToMany", "target": "Review", "field": "reviews"}
|
|
1646
|
+
{ "type": "OneToMany", "target": "Order", "field": "orders" },
|
|
1647
|
+
{ "type": "OneToMany", "target": "Review", "field": "reviews" }
|
|
1602
1648
|
]
|
|
1603
1649
|
}
|
|
1604
1650
|
// ... 17 more
|
|
@@ -1638,7 +1684,7 @@ Your choice: __
|
|
|
1638
1684
|
"count": 87,
|
|
1639
1685
|
"paths": [
|
|
1640
1686
|
"src/users/users.controller.ts",
|
|
1641
|
-
"src/products/products.controller.ts"
|
|
1687
|
+
"src/products/products.controller.ts"
|
|
1642
1688
|
// ... all analyzed files
|
|
1643
1689
|
],
|
|
1644
1690
|
"timestamps": {
|
|
@@ -1651,7 +1697,7 @@ Your choice: __
|
|
|
1651
1697
|
```
|
|
1652
1698
|
|
|
1653
1699
|
```
|
|
1654
|
-
✅ Analysis exported to .ai-flow/analysis.json
|
|
1700
|
+
✅ Analysis exported to .ai-flow/cache/docs-analysis.json
|
|
1655
1701
|
|
|
1656
1702
|
File size: 142 KB
|
|
1657
1703
|
Contains:
|
|
@@ -1813,7 +1859,7 @@ Analysis Results:
|
|
|
1813
1859
|
✅ 18 database entities with 45 relationships
|
|
1814
1860
|
✅ Security patterns analyzed
|
|
1815
1861
|
✅ 7 improvement suggestions generated
|
|
1816
|
-
✅ Analysis exported to .ai-flow/analysis.json
|
|
1862
|
+
✅ Analysis exported to .ai-flow/cache/docs-analysis.json
|
|
1817
1863
|
|
|
1818
1864
|
Pre-population Status:
|
|
1819
1865
|
• 45% of questionnaire answers populated
|
|
@@ -1836,7 +1882,5 @@ Press Enter to continue to Project Scope Selection...
|
|
|
1836
1882
|
**After Phase 0 completes, ALWAYS proceed to Project Scope Selection before Phase 1.**
|
|
1837
1883
|
|
|
1838
1884
|
---
|
|
1839
|
-
## PHASE 1: Discovery & Business (15-20 min)
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
1885
|
|
|
1886
|
+
## PHASE 1: Discovery & Business (15-20 min)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
## PHASE 1: Discovery & Business (15-20 min)
|
|
2
2
|
|
|
3
3
|
> **Order for this phase:** 1.1 → 1.2 → 1.3 → 1.4 → 1.5 → 1.6 → 1.7 → 1.8 → 1.9 → 1.10
|
|
4
4
|
|
|
@@ -92,37 +92,37 @@ What are the main functionalities your system needs?
|
|
|
92
92
|
Think about what your users will be able to do with your system. You can list them freely, or select from common features suggested below based on your system type.
|
|
93
93
|
|
|
94
94
|
🛒 E-commerce common features:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
1) User authentication (register/login)
|
|
96
|
+
2) Product catalog with search/filters
|
|
97
|
+
3) Shopping cart
|
|
98
|
+
4) Checkout and payment processing
|
|
99
|
+
5) Order management
|
|
100
|
+
6) Inventory tracking
|
|
101
|
+
7) Admin dashboard
|
|
102
102
|
📱 SaaS common features:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
1) User authentication with SSO
|
|
104
|
+
2) Multi-tenant organization/workspace management
|
|
105
|
+
3) Role-based access control (RBAC)
|
|
106
|
+
4) Subscription and billing
|
|
107
|
+
5) Dashboard and analytics
|
|
108
|
+
6) API access
|
|
109
|
+
7) Admin panel
|
|
110
110
|
📊 CRM/Business Tool common features:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
1) User/team management
|
|
112
|
+
2) Contact/customer database
|
|
113
|
+
3) Activity tracking and logging
|
|
114
|
+
4) Reporting and analytics
|
|
115
|
+
5) Integrations (email, calendar, etc.)
|
|
116
|
+
6) Search and filters
|
|
117
|
+
7) Export functionality
|
|
118
118
|
🎮 Social/Community common features:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
1) User profiles
|
|
120
|
+
2) Posts/content creation
|
|
121
|
+
3) Feed/timeline
|
|
122
|
+
4) Comments and reactions
|
|
123
|
+
5) Follow/friend system
|
|
124
|
+
6) Notifications
|
|
125
|
+
7) Moderation tools
|
|
126
126
|
⭐ Your specific features (add any custom functionalities):
|
|
127
127
|
-
|
|
128
128
|
-
|
|
@@ -147,13 +147,13 @@ This helps us focus the documentation on what you're building now, while noting
|
|
|
147
147
|
⏭️ What will you leave for future versions? (What you're NOT building now)
|
|
148
148
|
|
|
149
149
|
Common things to defer:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
1) Mobile native apps (building web/API first)
|
|
151
|
+
2) Advanced analytics/ML features
|
|
152
|
+
3) Third-party integrations (v2)
|
|
153
|
+
4) White-label/multi-branding
|
|
154
|
+
5) Internationalization (i18n)
|
|
155
|
+
6) Advanced automation/workflows
|
|
156
|
+
7) Video/live streaming features
|
|
157
157
|
⭐ Other features to defer (add your own):
|
|
158
158
|
-
|
|
159
159
|
-
|
|
@@ -214,7 +214,7 @@ How will you measure success?
|
|
|
214
214
|
|
|
215
215
|
> Note: If you omit any common flow or functionality, the AI will suggest and document typical processes relevant to your system type, based on best practices and common use cases.
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
`````
|
|
218
218
|
List the main business flows of the system (e.g., sales, inventory update, invoicing, user registration).
|
|
219
219
|
|
|
220
220
|
For each flow, you can add a brief description (optional).
|
|
@@ -289,7 +289,8 @@ flowchart TD
|
|
|
289
289
|
style End2 fill:#e1ffe1
|
|
290
290
|
style ProcessPayment fill:#fff4e1
|
|
291
291
|
style Confirm fill:#d4edda
|
|
292
|
-
|
|
292
|
+
`````
|
|
293
|
+
|
|
293
294
|
````
|
|
294
295
|
|
|
295
296
|
**Flowchart Syntax:**
|
|
@@ -390,41 +391,34 @@ If corrections needed, specify which section.
|
|
|
390
391
|
|
|
391
392
|
### 📄 Generate Phase 1 Documents
|
|
392
393
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
**1. `project-brief.md`**
|
|
394
|
+
**Generate `project-brief.md` automatically:**
|
|
396
395
|
|
|
397
396
|
- Use template: `.ai-flow/templates/project-brief.template.md`
|
|
398
397
|
- Fill with all Phase 1 information
|
|
399
|
-
- Write to project root
|
|
398
|
+
- Write to project root: `project-brief.md`
|
|
400
399
|
|
|
401
400
|
```
|
|
402
401
|
✅ Generated: project-brief.md
|
|
403
402
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
A) ✅ Looks perfect, continue to Phase 2
|
|
407
|
-
B) 📝 I'll edit it now (I'll wait)
|
|
408
|
-
C) 🔄 Regenerate with changes (tell me what to modify)
|
|
409
|
-
```
|
|
403
|
+
The document has been created with all the information from Phase 1.
|
|
410
404
|
|
|
411
|
-
|
|
405
|
+
📝 Would you like to make any corrections before continuing?
|
|
412
406
|
|
|
407
|
+
→ If yes: Edit project-brief.md and type "ready" when done. I'll re-read it.
|
|
408
|
+
→ If no: Type "continue" to proceed to Phase 2.
|
|
413
409
|
```
|
|
414
|
-
Perfect. Please edit project-brief.md and type "ready" when you're done.
|
|
415
|
-
I'll re-read the file to update my context before continuing.
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
Then execute: `read_file('project-brief.md')` to refresh context.
|
|
419
410
|
|
|
420
|
-
**If user
|
|
421
|
-
|
|
411
|
+
**If user edits the file:**
|
|
412
|
+
Execute `read_file('project-brief.md')` to refresh context before continuing.
|
|
422
413
|
|
|
423
414
|
---
|
|
424
415
|
|
|
425
|
-
**Proceed to Phase 2
|
|
416
|
+
**Proceed to Phase 2 after document is generated and optionally reviewed.**
|
|
417
|
+
|
|
418
|
+
> ⚠️ **CRITICAL:** DO NOT generate README.md in Phase 1. README.md is ONLY generated in Phase 8 (step 8.5) after framework initialization.
|
|
426
419
|
|
|
427
420
|
---
|
|
428
421
|
|
|
429
422
|
## PHASE 2: Data Architecture (15-20 min)
|
|
430
423
|
|
|
424
|
+
````
|