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
|
@@ -59,7 +59,6 @@ Extracting structured information...
|
|
|
59
59
|
**Extract and analyze:**
|
|
60
60
|
|
|
61
61
|
1. **Business Context** (from `project-brief.md`):
|
|
62
|
-
|
|
63
62
|
- Primary objectives
|
|
64
63
|
- Target users
|
|
65
64
|
- Success metrics
|
|
@@ -67,48 +66,41 @@ Extracting structured information...
|
|
|
67
66
|
- Timeline (if specified)
|
|
68
67
|
|
|
69
68
|
2. **Technical Stack** (from `ai-instructions.md`):
|
|
70
|
-
|
|
71
69
|
- Language and version
|
|
72
70
|
- Framework and version
|
|
73
71
|
- Database and ORM
|
|
74
72
|
- Key libraries
|
|
75
73
|
|
|
76
74
|
3. **System Architecture** (from `docs/architecture.md`):
|
|
77
|
-
|
|
78
75
|
- Architecture pattern (Clean, Hexagonal, Layered, MVC)
|
|
79
76
|
- Layers/modules structure
|
|
80
77
|
- Integration points
|
|
81
78
|
- External services
|
|
82
79
|
|
|
83
80
|
4. **Data Model** (from `docs/data-model.md`):
|
|
84
|
-
|
|
85
81
|
- All entities/models
|
|
86
82
|
- Relationships (1:1, 1:N, N:M)
|
|
87
83
|
- Key fields per entity
|
|
88
84
|
- Validation rules
|
|
89
85
|
|
|
90
86
|
5. **API Endpoints** (from `docs/api.md`):
|
|
91
|
-
|
|
92
87
|
- All routes
|
|
93
88
|
- HTTP methods
|
|
94
89
|
- Authentication requirements
|
|
95
90
|
- Request/response schemas
|
|
96
91
|
|
|
97
92
|
6. **Business Flows** (from `docs/business-flows.md`):
|
|
98
|
-
|
|
99
93
|
- User journeys
|
|
100
94
|
- Critical workflows
|
|
101
95
|
- State transitions
|
|
102
96
|
|
|
103
97
|
7. **Security Requirements** (from `specs/security.md`):
|
|
104
|
-
|
|
105
98
|
- Authentication method
|
|
106
99
|
- Authorization strategy (RBAC, ABAC, etc.)
|
|
107
100
|
- Compliance requirements
|
|
108
101
|
- Security features
|
|
109
102
|
|
|
110
103
|
8. **Testing Strategy** (from `docs/testing.md`):
|
|
111
|
-
|
|
112
104
|
- Unit test coverage target
|
|
113
105
|
- Integration test scope
|
|
114
106
|
- E2E test scenarios
|
|
@@ -796,14 +788,14 @@ With 3 developers: ~9 weeks (47% time savings)
|
|
|
796
788
|
|
|
797
789
|
### Step 9.5: Generate Roadmap Document (2-5 minutes - automatic)
|
|
798
790
|
|
|
799
|
-
**Generate `roadmap.md` with complete implementation plan:**
|
|
791
|
+
**Generate `docs/roadmap.md` with complete implementation plan:**
|
|
800
792
|
|
|
801
793
|
```
|
|
802
794
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
803
795
|
📝 Step 9.5/6: Generating Roadmap Document
|
|
804
796
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
805
797
|
|
|
806
|
-
Writing to roadmap.md...
|
|
798
|
+
Writing to docs/roadmap.md...
|
|
807
799
|
```
|
|
808
800
|
|
|
809
801
|
**Roadmap Document Structure:**
|
|
@@ -1167,7 +1159,7 @@ Update this roadmap as you complete features:
|
|
|
1167
1159
|
|
|
1168
1160
|
```
|
|
1169
1161
|
✅ Roadmap document generated
|
|
1170
|
-
✅ Location: roadmap.md
|
|
1162
|
+
✅ Location: docs/roadmap.md
|
|
1171
1163
|
✅ Total: {{TOTAL_EPICS}} Epics, {{TOTAL_FEATURES}} Features, {{TOTAL_TASKS}} Tasks
|
|
1172
1164
|
✅ Estimated: {{TOTAL_SP}} Story Points (~{{TOTAL_WEEKS}} weeks)
|
|
1173
1165
|
```
|
|
@@ -1192,7 +1184,7 @@ Update this roadmap as you complete features:
|
|
|
1192
1184
|
✅ Estimated time: {{SOLO_WEEKS}} weeks (1 dev) | {{TWO_DEV_WEEKS}} weeks (2 devs)
|
|
1193
1185
|
✅ Dependency graph: Generated
|
|
1194
1186
|
✅ Execution order: Optimized for parallelization
|
|
1195
|
-
✅ Roadmap document: roadmap.md
|
|
1187
|
+
✅ Roadmap document: docs/roadmap.md
|
|
1196
1188
|
|
|
1197
1189
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1198
1190
|
🎯 What This Roadmap Guarantees
|
|
@@ -1221,14 +1213,14 @@ Update this roadmap as you complete features:
|
|
|
1221
1213
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1222
1214
|
|
|
1223
1215
|
1. **Open the roadmap**
|
|
1224
|
-
└─ Open roadmap.md in your editor
|
|
1216
|
+
└─ Open docs/roadmap.md in your editor
|
|
1225
1217
|
|
|
1226
1218
|
2. **Review and adjust priorities**
|
|
1227
1219
|
└─ Decide which features are MVP vs future phases
|
|
1228
1220
|
└─ Adjust P0/P1/P2/P3 priorities if needed
|
|
1229
1221
|
|
|
1230
1222
|
3. **Commit the roadmap**
|
|
1231
|
-
└─ git add roadmap.md
|
|
1223
|
+
└─ git add docs/roadmap.md
|
|
1232
1224
|
└─ git commit -m "docs: add implementation roadmap with Story Points"
|
|
1233
1225
|
|
|
1234
1226
|
4. **Start implementation**
|
|
@@ -1266,7 +1258,7 @@ Update this roadmap as you complete features:
|
|
|
1266
1258
|
|
|
1267
1259
|
Ready to start building? 🚀
|
|
1268
1260
|
|
|
1269
|
-
Open roadmap.md and let's ship this! 💪
|
|
1261
|
+
Open docs/roadmap.md and let's ship this! 💪
|
|
1270
1262
|
|
|
1271
1263
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1272
1264
|
```
|
|
@@ -1276,16 +1268,20 @@ Open roadmap.md and let's ship this! 💪
|
|
|
1276
1268
|
```
|
|
1277
1269
|
Would you like to:
|
|
1278
1270
|
|
|
1279
|
-
A)
|
|
1280
|
-
→
|
|
1271
|
+
A) 📖 Continue to Phase 10: User Stories (RECOMMENDED)
|
|
1272
|
+
→ Generate detailed User Stories with acceptance criteria
|
|
1273
|
+
→ Will execute: /flow-build fase 10
|
|
1274
|
+
|
|
1275
|
+
B) ✅ Start implementing from roadmap directly
|
|
1276
|
+
→ Will execute: /flow-dev-feature {{FIRST_FEATURE_ID}}
|
|
1281
1277
|
|
|
1282
|
-
|
|
1283
|
-
→ Will open roadmap.md
|
|
1278
|
+
C) 📋 Review roadmap first
|
|
1279
|
+
→ Will open docs/roadmap.md
|
|
1284
1280
|
|
|
1285
|
-
|
|
1286
|
-
→ Will open roadmap.md for editing
|
|
1281
|
+
D) ✏️ Customize roadmap
|
|
1282
|
+
→ Will open docs/roadmap.md for editing
|
|
1287
1283
|
|
|
1288
|
-
Your choice (A/B/C): __
|
|
1284
|
+
Your choice (A/B/C/D): __
|
|
1289
1285
|
```
|
|
1290
1286
|
|
|
1291
1287
|
---
|
|
@@ -1297,7 +1293,6 @@ Your choice (A/B/C): __
|
|
|
1297
1293
|
The Story Point estimates are based on:
|
|
1298
1294
|
|
|
1299
1295
|
1. **Complexity factors:**
|
|
1300
|
-
|
|
1301
1296
|
- Number of entities involved
|
|
1302
1297
|
- Business logic complexity
|
|
1303
1298
|
- Integration complexity
|
|
@@ -1305,7 +1300,6 @@ The Story Point estimates are based on:
|
|
|
1305
1300
|
- Security requirements
|
|
1306
1301
|
|
|
1307
1302
|
2. **Historical data:**
|
|
1308
|
-
|
|
1309
1303
|
- Simple CRUD: 3-5 SP
|
|
1310
1304
|
- Auth systems: 13-21 SP
|
|
1311
1305
|
- Payment integrations: 13-21 SP
|
|
@@ -1402,7 +1396,7 @@ Please fix documentation and re-run Phase 9
|
|
|
1402
1396
|
|
|
1403
1397
|
**9.5 Generate Roadmap Document:**
|
|
1404
1398
|
|
|
1405
|
-
- [ ] Create `roadmap.md`
|
|
1399
|
+
- [ ] Create `docs/roadmap.md`
|
|
1406
1400
|
- [ ] Include project overview
|
|
1407
1401
|
- [ ] Include Story Points reference table
|
|
1408
1402
|
- [ ] Include Epic overview table
|
|
@@ -1445,7 +1439,6 @@ Please fix documentation and re-run Phase 9
|
|
|
1445
1439
|
|
|
1446
1440
|
---
|
|
1447
1441
|
|
|
1448
|
-
**CONTINUE TO:**
|
|
1449
|
-
|
|
1450
|
-
**SUCCESS:** Complete implementation roadmap with Story Points generated! Ready to start building! 🚀
|
|
1442
|
+
**CONTINUE TO:** Phase 10 (User Stories) - OPTIONAL
|
|
1451
1443
|
|
|
1444
|
+
**SUCCESS:** Complete implementation roadmap with Story Points generated! Ready to start building or continue to Phase 10 for detailed User Stories! 🚀
|
|
@@ -587,7 +587,7 @@ Read .ai-flow/prompts/backend/flow-build-phase-4-security.md and execute only Ph
|
|
|
587
587
|
|
|
588
588
|
**Generates:**
|
|
589
589
|
|
|
590
|
-
-
|
|
590
|
+
- `docs/roadmap.md` (complete implementation plan)
|
|
591
591
|
|
|
592
592
|
**Output includes:**
|
|
593
593
|
|
|
@@ -733,12 +733,12 @@ As your project evolves, your documentation may become out of sync with your cod
|
|
|
733
733
|
|
|
734
734
|
**How it works:**
|
|
735
735
|
|
|
736
|
-
1. Compares current code state with last documented state (`.ai-flow/analysis.json`)
|
|
736
|
+
1. Compares current code state with last documented state (`.ai-flow/cache/docs-analysis.json`)
|
|
737
737
|
2. Detects changes in endpoints, entities, dependencies, architecture, configuration
|
|
738
738
|
3. Shows report of documents that need updating
|
|
739
739
|
4. Asks for confirmation to update all detected documents
|
|
740
740
|
5. Updates documents incrementally (only changed sections)
|
|
741
|
-
6. Updates `analysis.json` with new state
|
|
741
|
+
6. Updates `docs-analysis.json` with new state
|
|
742
742
|
|
|
743
743
|
**When to use:**
|
|
744
744
|
|
|
@@ -36,17 +36,30 @@ Automate commit creation with:
|
|
|
36
36
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
**CRITICAL: Execute ALL detection methods in parallel to catch:**
|
|
40
|
+
|
|
41
|
+
- Modified files (unstaged/staged)
|
|
42
|
+
- **NEW untracked files** (not detected by get_changed_files)
|
|
43
|
+
- Deleted files
|
|
44
|
+
|
|
39
45
|
**Execute these tools automatically in parallel (NO user confirmation):**
|
|
40
46
|
|
|
41
47
|
```typescript
|
|
42
|
-
//
|
|
48
|
+
// 1. Standard Git Changes (modified/staged files)
|
|
43
49
|
await Promise.all([
|
|
44
50
|
get_changed_files({ sourceControlState: ['unstaged'] }),
|
|
45
51
|
get_changed_files({ sourceControlState: ['staged'] }),
|
|
46
52
|
get_changed_files({}), // All states
|
|
47
53
|
]);
|
|
48
54
|
|
|
49
|
-
//
|
|
55
|
+
// 2. CRITICAL: Detect untracked files (new files never added to git)
|
|
56
|
+
await run_in_terminal({
|
|
57
|
+
command: 'git status --porcelain',
|
|
58
|
+
explanation: 'Detect untracked files (??), modified (M), added (A), deleted (D)',
|
|
59
|
+
isBackground: false,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// 3. Search for modified files by extension (backup detection)
|
|
50
63
|
await Promise.all([
|
|
51
64
|
file_search({ query: '**/*.{ts,js,tsx,jsx}', maxResults: 200 }),
|
|
52
65
|
file_search({ query: '**/*.{cs,fs,vb}', maxResults: 200 }),
|
|
@@ -54,7 +67,7 @@ await Promise.all([
|
|
|
54
67
|
file_search({ query: '**/*.{md,json,yaml,yml}', maxResults: 100 }),
|
|
55
68
|
]);
|
|
56
69
|
|
|
57
|
-
// Detect code patterns
|
|
70
|
+
// 4. Detect code patterns (helps with grouping)
|
|
58
71
|
await Promise.all([
|
|
59
72
|
grep_search({
|
|
60
73
|
query: 'class|interface|type|struct|enum',
|
|
@@ -69,6 +82,41 @@ await Promise.all([
|
|
|
69
82
|
]);
|
|
70
83
|
```
|
|
71
84
|
|
|
85
|
+
**Parse `git status --porcelain` output:**
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// Output format:
|
|
89
|
+
// ?? file.ts → Untracked (new file)
|
|
90
|
+
// M file.ts → Modified (staged)
|
|
91
|
+
// M file.ts → Modified (unstaged)
|
|
92
|
+
// A file.ts → Added (staged)
|
|
93
|
+
// D file.ts → Deleted (staged)
|
|
94
|
+
// ?? src/ → Untracked directory
|
|
95
|
+
|
|
96
|
+
// Parse logic:
|
|
97
|
+
const parseGitStatus = (output: string) => {
|
|
98
|
+
const lines = output.split('\n').filter(Boolean);
|
|
99
|
+
const files = {
|
|
100
|
+
untracked: [],
|
|
101
|
+
modified: [],
|
|
102
|
+
added: [],
|
|
103
|
+
deleted: [],
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
lines.forEach((line) => {
|
|
107
|
+
const status = line.slice(0, 2);
|
|
108
|
+
const filePath = line.slice(3);
|
|
109
|
+
|
|
110
|
+
if (status === '??') files.untracked.push(filePath);
|
|
111
|
+
else if (status.includes('M')) files.modified.push(filePath);
|
|
112
|
+
else if (status.includes('A')) files.added.push(filePath);
|
|
113
|
+
else if (status.includes('D')) files.deleted.push(filePath);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
return files;
|
|
117
|
+
};
|
|
118
|
+
```
|
|
119
|
+
|
|
72
120
|
**If NO changes detected:**
|
|
73
121
|
|
|
74
122
|
```
|
|
@@ -84,16 +132,26 @@ Working directory is clean.
|
|
|
84
132
|
```
|
|
85
133
|
✅ Changes detected:
|
|
86
134
|
|
|
87
|
-
|
|
88
|
-
|
|
135
|
+
Untracked: [N] files (new files never added to git)
|
|
136
|
+
Unstaged: [N] files (modified files not staged)
|
|
137
|
+
Staged: [N] files (files ready to commit)
|
|
138
|
+
Deleted: [N] files
|
|
89
139
|
|
|
90
140
|
File types:
|
|
91
141
|
- Source code: [N] files
|
|
92
142
|
- Tests: [N] files
|
|
93
143
|
- Documentation: [N] files
|
|
94
144
|
- Configuration: [N] files
|
|
145
|
+
|
|
146
|
+
Examples:
|
|
147
|
+
?? .gitignore (untracked)
|
|
148
|
+
?? src/ (untracked directory)
|
|
149
|
+
M README.md (modified, unstaged)
|
|
150
|
+
A package.json (added, staged)
|
|
95
151
|
```
|
|
96
152
|
|
|
153
|
+
**IMPORTANT:** Untracked files (`??`) are NEW files that must be detected with `git status --porcelain` because `get_changed_files()` does NOT see them.
|
|
154
|
+
|
|
97
155
|
---
|
|
98
156
|
|
|
99
157
|
### Step 2: Intelligent Grouping (Automatic)
|
|
@@ -503,12 +561,14 @@ Click "Allow" to execute →
|
|
|
503
561
|
|
|
504
562
|
Error: [error message]
|
|
505
563
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
564
|
+
| Step | Actions | User Interaction |
|
|
565
|
+
| ------ | -------------------------------------------------------------------------- | ---------------------- |
|
|
566
|
+
| Step 1 | `get_changed_files()`, `git status --porcelain`, `file_search()`, `grep_search()` | Automatic (read-only) |
|
|
567
|
+
| Step 2 | Analyze and group files | Automatic |
|
|
568
|
+
| Step 3 | `git add` + `git commit` (per group) | Click Allow per commit |
|
|
569
|
+
| Step 4 | `git log` (automatic) + `git push` (manual) | Auto log / Allow push |
|
|
511
570
|
|
|
571
|
+
**CRITICAL:** Always run `git status --porcelain` in Step 1 to detect untracked files (`??`) that `get_changed_files()` cannot see.
|
|
512
572
|
---
|
|
513
573
|
|
|
514
574
|
## 🎯 Execution Model
|
|
@@ -553,6 +613,7 @@ Universal patterns that work across languages/frameworks:
|
|
|
553
613
|
**Changes detected:**
|
|
554
614
|
|
|
555
615
|
```
|
|
616
|
+
|
|
556
617
|
src/modules/products/entities/product.entity.ts
|
|
557
618
|
src/modules/products/dto/create-product.dto.ts
|
|
558
619
|
src/modules/products/dto/update-product.dto.ts
|
|
@@ -560,16 +621,17 @@ src/modules/products/dto/product-response.dto.ts
|
|
|
560
621
|
src/modules/products/products.service.ts
|
|
561
622
|
src/modules/products/products.controller.ts
|
|
562
623
|
src/modules/products/products.module.ts
|
|
563
|
-
src/modules/products
|
|
564
|
-
src/modules/products
|
|
624
|
+
src/modules/products/**tests**/products.service.spec.ts
|
|
625
|
+
src/modules/products/**tests**/products.controller.spec.ts
|
|
565
626
|
docs/api.md (products section)
|
|
566
|
-
|
|
627
|
+
|
|
628
|
+
````
|
|
567
629
|
|
|
568
630
|
**Commits generated (1 commit):**
|
|
569
631
|
|
|
570
632
|
```bash
|
|
571
633
|
git add src/modules/products/entities/product.entity.ts src/modules/products/dto/create-product.dto.ts src/modules/products/dto/update-product.dto.ts src/modules/products/dto/product-response.dto.ts src/modules/products/products.service.ts src/modules/products/products.controller.ts src/modules/products/products.module.ts src/modules/products/__tests__/products.service.spec.ts src/modules/products/__tests__/products.controller.spec.ts docs/api.md && git commit -m "feat(products): implement product management with CRUD operations"
|
|
572
|
-
|
|
634
|
+
````
|
|
573
635
|
|
|
574
636
|
### Example 2: Refactoring Across Modules
|
|
575
637
|
|