ai-flow-dev 2.1.3 → 2.1.4

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 (96) hide show
  1. package/README.md +25 -38
  2. package/dist/cli.js +68 -46
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +5 -5
  5. package/prompts/backend/flow-build-phase-0.md +31 -63
  6. package/prompts/backend/flow-build-phase-1.md +9 -17
  7. package/prompts/backend/flow-build-phase-10.md +199 -585
  8. package/prompts/backend/flow-build-phase-2.md +152 -86
  9. package/prompts/backend/flow-build-phase-3.md +108 -68
  10. package/prompts/backend/flow-build-phase-4.md +5 -8
  11. package/prompts/backend/flow-build-phase-5.md +39 -12
  12. package/prompts/backend/flow-build-phase-6.md +29 -8
  13. package/prompts/backend/flow-build-phase-7.md +120 -40
  14. package/prompts/backend/flow-build-phase-8.md +28 -65
  15. package/prompts/backend/flow-build-phase-9.md +267 -1298
  16. package/prompts/backend/flow-build.md +881 -957
  17. package/prompts/backend/flow-dev-commit.md +27 -50
  18. package/prompts/backend/flow-dev-feature.md +1929 -2017
  19. package/prompts/backend/flow-dev-fix.md +936 -964
  20. package/prompts/backend/flow-dev-refactor.md +672 -701
  21. package/prompts/backend/flow-dev-review.md +356 -389
  22. package/prompts/backend/flow-dev-work.md +1066 -1118
  23. package/prompts/backend/flow-docs-sync.md +20 -196
  24. package/prompts/frontend/flow-build-phase-0.md +503 -484
  25. package/prompts/frontend/flow-build-phase-1.md +445 -433
  26. package/prompts/frontend/flow-build-phase-2.md +910 -957
  27. package/prompts/frontend/flow-build-phase-3.md +692 -664
  28. package/prompts/frontend/flow-build-phase-4.md +478 -463
  29. package/prompts/frontend/flow-build-phase-5.md +488 -467
  30. package/prompts/frontend/flow-build-phase-6.md +571 -550
  31. package/prompts/frontend/flow-build-phase-7.md +560 -592
  32. package/prompts/frontend/flow-build-phase-8.md +17 -42
  33. package/prompts/frontend/flow-build.md +457 -503
  34. package/prompts/frontend/flow-docs-sync.md +14 -35
  35. package/prompts/mobile/flow-build-phase-0.md +104 -97
  36. package/prompts/mobile/flow-build-phase-1.md +137 -122
  37. package/prompts/mobile/flow-build-phase-2.md +123 -130
  38. package/prompts/mobile/flow-build-phase-3.md +144 -149
  39. package/prompts/mobile/flow-build-phase-4.md +140 -132
  40. package/prompts/mobile/flow-build-phase-5.md +70 -70
  41. package/prompts/mobile/flow-build-phase-6.md +136 -134
  42. package/prompts/mobile/flow-build-phase-7.md +24 -58
  43. package/prompts/mobile/flow-build-phase-8.md +17 -42
  44. package/prompts/mobile/flow-build.md +47 -97
  45. package/prompts/mobile/flow-docs-sync.md +13 -32
  46. package/prompts/shared/mermaid-guidelines.md +106 -0
  47. package/prompts/shared/scope-levels.md +126 -0
  48. package/prompts/shared/story-points.md +65 -0
  49. package/prompts/shared/task-format.md +86 -0
  50. package/templates/AGENT.template.md +194 -15
  51. package/templates/backend/README.template.md +2 -32
  52. package/templates/backend/ai-instructions.template.md +2 -32
  53. package/templates/backend/copilot-instructions.template.md +2 -22
  54. package/templates/backend/docs/api.template.md +89 -20
  55. package/templates/backend/docs/architecture.template.md +165 -53
  56. package/templates/backend/docs/business-flows.template.md +7 -14
  57. package/templates/backend/docs/code-standards.template.md +2 -38
  58. package/templates/backend/docs/contributing.template.md +2 -16
  59. package/templates/backend/docs/data-model.template.md +125 -21
  60. package/templates/backend/docs/operations.template.md +179 -50
  61. package/templates/backend/docs/testing.template.md +2 -42
  62. package/templates/backend/project-brief.template.md +2 -28
  63. package/templates/backend/specs/configuration.template.md +2 -14
  64. package/templates/backend/specs/security.template.md +2 -32
  65. package/templates/frontend/README.template.md +2 -18
  66. package/templates/frontend/ai-instructions.template.md +2 -20
  67. package/templates/frontend/docs/api-integration.template.md +12 -30
  68. package/templates/frontend/docs/components.template.md +2 -28
  69. package/templates/frontend/docs/error-handling.template.md +11 -27
  70. package/templates/frontend/docs/operations.template.md +8 -18
  71. package/templates/frontend/docs/performance.template.md +8 -18
  72. package/templates/frontend/docs/pwa.template.md +8 -18
  73. package/templates/frontend/docs/state-management.template.md +2 -28
  74. package/templates/frontend/docs/styling.template.md +2 -26
  75. package/templates/frontend/docs/testing.template.md +2 -28
  76. package/templates/frontend/project-brief.template.md +2 -16
  77. package/templates/frontend/specs/accessibility.template.md +8 -18
  78. package/templates/frontend/specs/configuration.template.md +2 -24
  79. package/templates/frontend/specs/security.template.md +10 -24
  80. package/templates/fullstack/README.template.md +17 -47
  81. package/templates/fullstack/ai-instructions.template.md +17 -45
  82. package/templates/fullstack/project-brief.template.md +16 -42
  83. package/templates/fullstack/specs/configuration.template.md +16 -42
  84. package/templates/mobile/README.template.md +11 -29
  85. package/templates/mobile/ai-instructions.template.md +11 -27
  86. package/templates/mobile/docs/app-store.template.md +11 -29
  87. package/templates/mobile/docs/architecture.template.md +14 -38
  88. package/templates/mobile/docs/native-features.template.md +16 -44
  89. package/templates/mobile/docs/navigation.template.md +9 -23
  90. package/templates/mobile/docs/offline-strategy.template.md +10 -26
  91. package/templates/mobile/docs/permissions.template.md +9 -23
  92. package/templates/mobile/docs/state-management.template.md +12 -32
  93. package/templates/mobile/docs/testing.template.md +14 -38
  94. package/templates/mobile/project-brief.template.md +12 -30
  95. package/templates/mobile/specs/build-configuration.template.md +10 -26
  96. package/templates/mobile/specs/deployment.template.md +9 -23
@@ -26,9 +26,7 @@ Layer 3: Selective Deep Analysis (1-5 minutes, ~5,000-25,000 tokens, OPTIONAL)
26
26
 
27
27
  Result Synthesis & Pre-population
28
28
  ```
29
-
30
- ---
31
-
29
+ ---
32
30
  ## 0.0 Check for Existing Analysis (Layer 0)
33
31
 
34
32
  ```
@@ -102,9 +100,7 @@ Your choice: __
102
100
 
103
101
  Proceeding to Layer 1...
104
102
  ```
105
-
106
- ---
107
-
103
+ ---
108
104
  ## 0.1 Layer 1: Fast Metadata Scan (10-20 seconds)
109
105
 
110
106
  ```
@@ -403,13 +399,12 @@ Checking for Swift project...
403
399
  ✅ Layer 1 Complete (15 seconds)
404
400
 
405
401
  📦 Project Detected:
406
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
402
+ ---
407
403
  Name: [from package.json/composer.json/etc.]
408
404
  Language: [TypeScript/Python/PHP/Java/etc.]
409
405
  Version: [language version]
410
406
  Package Manager: [npm/composer/maven/etc.]
411
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
412
-
407
+ ---
413
408
  🚀 Framework: [Name] v[version]
414
409
  🗄️ ORM/Database: [Name] v[version]
415
410
 
@@ -420,9 +415,7 @@ Checking for Swift project...
420
415
 
421
416
  💾 Context Used: ~1,200 tokens
422
417
  ⏱️ Time Elapsed: 15s
423
-
424
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
425
-
418
+ ---
426
419
  Continue to Layer 2? (Structural analysis - no code reading yet)
427
420
 
428
421
  A) ✅ Yes - Continue (Recommended)
@@ -433,9 +426,7 @@ Your choice: __ (Auto-continue in 3s)
433
426
  ```
434
427
 
435
428
  **Context Usage:** ~1,000-1,500 tokens
436
-
437
- ---
438
-
429
+ ---
439
430
  ## 0.2 Layer 2: Structural Analysis (30-90 seconds)
440
431
 
441
432
  ```
@@ -673,7 +664,7 @@ Checking docs/ directory...
673
664
  🏛️ Architecture Pattern: [Feature-based/Layer-based/Modular/Hybrid]
674
665
 
675
666
  📊 Code Structure:
676
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
667
+ ---
677
668
  [Language-specific breakdown, e.g., for Node.js:]
678
669
 
679
670
  Controllers: [X files]
@@ -691,8 +682,7 @@ Checking docs/ directory...
691
682
  Tests: [X files] → Coverage estimate: [Low/Medium/High]
692
683
 
693
684
  [etc., adapt to detected language]
694
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695
-
685
+ ---
696
686
  📂 Organization:
697
687
  [Example for Feature-based:]
698
688
  ✓ src/users/ (3 controllers, 5 services, 2 entities)
@@ -712,9 +702,7 @@ Checking docs/ directory...
712
702
 
713
703
  💾 Context Used: ~3,500 tokens (total: ~4,700)
714
704
  ⏱️ Time Elapsed: 1m 15s
715
-
716
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
717
-
705
+ ---
718
706
  💡 Recommended Scope: [MVP / Production-Ready / Enterprise]
719
707
  (Based on detected maturity level and code complexity)
720
708
 
@@ -728,9 +716,7 @@ Your choice: __
728
716
  ```
729
717
 
730
718
  **Context Usage:** ~2,000-5,000 tokens (cumulative: ~3,000-6,500)
731
-
732
- ---
733
-
719
+ ---
734
720
  ## 0.3 Layer 3: Selective Deep Analysis (1-5 minutes, OPTIONAL)
735
721
 
736
722
  ```
@@ -774,8 +760,7 @@ Select areas (use arrow keys, space to select, enter to confirm):
774
760
  ⏱️ Estimated time: 90-120 seconds
775
761
  💾 Context cost: ~8,000-15,000 tokens
776
762
  ⚠️ HIGH CONTEXT USAGE
777
-
778
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
763
+ ---
779
764
  Total estimated: ~2-3 minutes, ~9,000-18,000 tokens
780
765
 
781
766
  Or:
@@ -1406,8 +1391,7 @@ Security Headers:
1406
1391
  ℹ️ Remaining checks deferred
1407
1392
  ⏱️ Elapsed: 20s
1408
1393
  💾 Tokens: 1,800
1409
-
1410
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1394
+ ---
1411
1395
  Total: 2m 20s | 14,500 tokens used
1412
1396
  Remaining context: 155,500 tokens
1413
1397
  ```
@@ -1418,7 +1402,7 @@ Remaining context: 155,500 tokens
1418
1402
  ✅ Layer 3 Complete (2m 30s)
1419
1403
 
1420
1404
  📡 API Endpoints: [127 detected]
1421
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1405
+ ---
1422
1406
  By Method:
1423
1407
  GET: 58 endpoints
1424
1408
  POST: 32 endpoints
@@ -1441,7 +1425,7 @@ Sample Endpoints:
1441
1425
  [View full list in docs-analysis.json]
1442
1426
 
1443
1427
  🗄️ Database Entities: [18 detected]
1444
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1428
+ ---
1445
1429
  Core Entities:
1446
1430
  • User (8 fields, 3 relationships)
1447
1431
  - Relationships: OneToMany → Orders, OneToMany → Reviews
@@ -1453,7 +1437,7 @@ Core Entities:
1453
1437
  [+15 more entities - see docs-analysis.json for full schema]
1454
1438
 
1455
1439
  🔒 Security Patterns:
1456
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1440
+ ---
1457
1441
  ✅ Authentication: JWT with bcrypt
1458
1442
  ✅ Validation: class-validator + DTOs
1459
1443
  ⚠️ Rate Limiting: Not detected
@@ -1462,14 +1446,11 @@ Core Entities:
1462
1446
 
1463
1447
  💾 Context Used: ~14,500 tokens (total: ~18,700)
1464
1448
  ⏱️ Time Elapsed: 3m 45s
1465
-
1466
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1449
+ ---
1467
1450
  ```
1468
1451
 
1469
1452
  **Context Usage:** ~5,000-25,000 tokens (cumulative: ~8,000-31,500)
1470
-
1471
- ---
1472
-
1453
+ ---
1473
1454
  ## 0.4 Proactive Improvement Suggestions
1474
1455
 
1475
1456
  ```
@@ -1517,9 +1498,7 @@ Based on my analysis, I found opportunities for improvement:
1517
1498
  Action: Implement cursor-based or offset pagination
1518
1499
  Impact: Better performance with large datasets
1519
1500
  Estimated effort: 2-3 hours
1520
-
1521
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1522
-
1501
+ ---
1523
1502
  Would you like to:
1524
1503
 
1525
1504
  A) ✅ Address these during build (I'll integrate into relevant phases)
@@ -1546,9 +1525,7 @@ Your choice: __
1546
1525
  **If user selects C:**
1547
1526
 
1548
1527
  - Continue without suggestions
1549
-
1550
- ---
1551
-
1528
+ ---
1552
1529
  ## 0.5 Export Analysis Results
1553
1530
 
1554
1531
  ```
@@ -1708,9 +1685,7 @@ Contains:
1708
1685
 
1709
1686
  You can view/edit this file anytime or share with your team.
1710
1687
  ```
1711
-
1712
- ---
1713
-
1688
+ ---
1714
1689
  ## 0.6 Load Detected Context & Pre-populate Answers
1715
1690
 
1716
1691
  **If user selected "Use detected information":**
@@ -1771,9 +1746,7 @@ Phase 7 (Operations):
1771
1746
  ❓ Environment setup: [NEED TO ASK]
1772
1747
  ❓ Monitoring: [NEED TO ASK]
1773
1748
  ❓ Logging: [NEED TO ASK]
1774
-
1775
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1776
-
1749
+ ---
1777
1750
  📊 Analysis Summary:
1778
1751
  • Pre-populated: ~45% of answers
1779
1752
  • Need to ask: ~55% (gaps in documentation)
@@ -1783,9 +1756,7 @@ Ready to proceed to Project Scope Selection?
1783
1756
 
1784
1757
  Type 'yes' to continue: __
1785
1758
  ```
1786
-
1787
- ---
1788
-
1759
+ ---
1789
1760
  ## 0.7 Error Handling & Recovery
1790
1761
 
1791
1762
  **If any layer fails:**
@@ -1839,16 +1810,13 @@ Progress: 24 of 30 files analyzed (80% success rate)
1839
1810
  3. **Out of memory:** Reduce sample size, retry
1840
1811
  4. **Context limit:** Stop analysis, use partial results
1841
1812
  5. **Network timeout:** (if remote files) Retry with backoff
1842
-
1843
- ---
1844
-
1813
+ ---
1845
1814
  ## 🎯 Summary: Phase 0 Complete
1846
1815
 
1847
1816
  ```
1848
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1817
+ ---
1849
1818
  ✅ CONTEXT DISCOVERY COMPLETE
1850
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1851
-
1819
+ ---
1852
1820
  📊 Project: ecommerce-api
1853
1821
  🛠️ Stack: TypeScript 5.3 + NestJS 10.2 + Prisma 5.7 + PostgreSQL
1854
1822
  📈 Maturity: Basic documentation
@@ -1872,15 +1840,15 @@ Performance:
1872
1840
  📊 Remaining: 181,300 tokens for phases 1-7
1873
1841
 
1874
1842
  Next Step: Project Scope Selection
1875
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1876
-
1843
+ ---
1877
1844
  Press Enter to continue to Project Scope Selection...
1878
1845
  ```
1846
+ ---
1847
+ **After Phase 0 completes, ALWAYS proceed to Project Scope Selection before Phase 1.**
1848
+ ---
1849
+ ## PHASE 1: Discovery & Business (15-20 min)
1850
+
1879
1851
 
1880
- ---
1881
1852
 
1882
- **After Phase 0 completes, ALWAYS proceed to Project Scope Selection before Phase 1.**
1883
1853
 
1884
- ---
1885
1854
 
1886
- ## PHASE 1: Discovery & Business (15-20 min)
@@ -141,9 +141,7 @@ This helps us focus the documentation on what you're building now, while noting
141
141
  📋 What will you build in this first version? (Select from the features listed above)
142
142
 
143
143
  [Show features from question 1.6 and allow selection]
144
-
145
- ---
146
-
144
+ ---
147
145
  ⏭️ What will you leave for future versions? (What you're NOT building now)
148
146
 
149
147
  Common things to defer:
@@ -231,9 +229,7 @@ Example:
231
229
  - Invoicing: Invoice generation after purchase.
232
230
 
233
231
  The AI will automatically generate flow diagrams (mermaid) for each documented process.
234
-
235
- ---
236
-
232
+ ---
237
233
  #### 🎨 MERMAID BUSINESS FLOW DIAGRAM FORMAT - CRITICAL
238
234
 
239
235
  **Use this exact format** for business process flows:
@@ -360,8 +356,7 @@ flowchart TD
360
356
  - Customer Support Ticket Lifecycle
361
357
 
362
358
  **Validation:** Test at https://mermaid.live/ before saving
363
-
364
- ---
359
+ ---
365
360
  ```
366
361
 
367
362
  ### Phase 1 Output
@@ -386,9 +381,7 @@ Business Flows: [list of main flows]
386
381
  Is this correct? (Yes/No)
387
382
  If corrections needed, specify which section.
388
383
  ```
389
-
390
- ---
391
-
384
+ ---
392
385
  ### 📄 Generate Phase 1 Documents
393
386
 
394
387
  **Generate `project-brief.md` automatically:**
@@ -410,15 +403,14 @@ The document has been created with all the information from Phase 1.
410
403
 
411
404
  **If user edits the file:**
412
405
  Execute `read_file('project-brief.md')` to refresh context before continuing.
413
-
414
- ---
415
-
406
+ ---
416
407
  **Proceed to Phase 2 after document is generated and optionally reviewed.**
417
408
 
418
409
  > ⚠️ **CRITICAL:** DO NOT generate README.md in Phase 1. README.md is ONLY generated in Phase 8 (step 8.5) after framework initialization.
419
-
420
- ---
421
-
410
+ ---
422
411
  ## PHASE 2: Data Architecture (15-20 min)
423
412
 
424
413
  ````
414
+
415
+
416
+