ai-first-cli 1.1.3 → 1.1.5

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 (263) hide show
  1. package/ANALISIS_MEJORAS.md +327 -0
  2. package/BUGS.md +455 -0
  3. package/CHANGELOG.md +100 -225
  4. package/TEST_RESULTS.md +198 -0
  5. package/TEST_RESULTS_COMPARATIVE.md +159 -0
  6. package/TEST_RESULTS_COMPLETE.md +127 -0
  7. package/TEST_RESULTS_COMPREHENSIVE.md +208 -0
  8. package/ai/ai_context.md +17 -10
  9. package/ai/ai_rules.md +5 -3
  10. package/ai/architecture.md +28 -7
  11. package/ai/cache.json +832 -52
  12. package/ai/context/features/commands.json +18 -0
  13. package/ai/context/features/src.json +61 -0
  14. package/ai/context/features/test-projects.json +56 -0
  15. package/ai/context/flows/account.json +9 -0
  16. package/ai/context/flows/add_.json +9 -0
  17. package/ai/context/flows/ai-first.json +9 -0
  18. package/ai/context/flows/auth..json +10 -0
  19. package/ai/context/flows/auth.json +12 -0
  20. package/ai/context/flows/dashboard.json +9 -0
  21. package/ai/context/flows/doctor.json +9 -0
  22. package/ai/context/flows/explore.json +9 -0
  23. package/ai/context/flows/list_.json +9 -0
  24. package/ai/context/flows/login.json +9 -0
  25. package/ai/context/flows/opportunity.json +9 -0
  26. package/ai/context/flows/remove_.json +9 -0
  27. package/ai/context/flows/user.json +14 -0
  28. package/ai/context/flows/users..json +10 -0
  29. package/ai/context/flows/users.json +9 -0
  30. package/ai/conventions.md +3 -2
  31. package/ai/dependencies.json +429 -251
  32. package/ai/entrypoints.md +10 -0
  33. package/ai/files.json +822 -46
  34. package/ai/git/commit-activity.json +126 -39
  35. package/ai/git/recent-features.json +3 -1
  36. package/ai/git/recent-files.json +6 -6
  37. package/ai/git/recent-flows.json +3 -1
  38. package/ai/graph/knowledge-graph.json +954 -182
  39. package/ai/graph/module-graph.json +270 -0
  40. package/ai/graph/symbol-graph.json +48991 -16523
  41. package/ai/graph/symbol-references.json +953 -56
  42. package/ai/hierarchy.json +3 -24
  43. package/ai/index-state.json +1261 -253
  44. package/ai/index.db +0 -0
  45. package/ai/modules.json +226 -0
  46. package/ai/project.json +29 -0
  47. package/ai/repo-map.json +2284 -250
  48. package/ai/repo_map.json +2731 -231
  49. package/ai/repo_map.md +559 -2
  50. package/ai/schema.json +5 -0
  51. package/ai/summary.md +16 -7
  52. package/ai/tech_stack.md +4 -1
  53. package/ai/tools.json +10 -0
  54. package/dist/analyzers/dependencies.d.ts.map +1 -1
  55. package/dist/analyzers/dependencies.js +8 -16
  56. package/dist/analyzers/dependencies.js.map +1 -1
  57. package/dist/analyzers/symbols.d.ts.map +1 -1
  58. package/dist/analyzers/symbols.js +60 -0
  59. package/dist/analyzers/symbols.js.map +1 -1
  60. package/dist/commands/ai-first.d.ts.map +1 -1
  61. package/dist/commands/ai-first.js +28 -6
  62. package/dist/commands/ai-first.js.map +1 -1
  63. package/dist/core/semanticContexts.d.ts.map +1 -1
  64. package/dist/core/semanticContexts.js +48 -26
  65. package/dist/core/semanticContexts.js.map +1 -1
  66. package/dist/core/symbolGraph.d.ts.map +1 -1
  67. package/dist/core/symbolGraph.js +14 -2
  68. package/dist/core/symbolGraph.js.map +1 -1
  69. package/dist/utils/fileUtils.d.ts.map +1 -1
  70. package/dist/utils/fileUtils.js +5 -0
  71. package/dist/utils/fileUtils.js.map +1 -1
  72. package/package.json +2 -2
  73. package/src/analyzers/dependencies.ts +10 -20
  74. package/src/analyzers/symbols.ts +64 -0
  75. package/src/commands/ai-first.ts +31 -8
  76. package/src/core/semanticContexts.ts +54 -29
  77. package/src/core/symbolGraph.ts +16 -2
  78. package/src/utils/fileUtils.ts +5 -0
  79. package/test-projects/express-api/ai/ai_context.md +112 -0
  80. package/test-projects/express-api/ai/ai_rules.md +50 -0
  81. package/test-projects/express-api/ai/architecture.md +62 -0
  82. package/test-projects/express-api/ai/cache.json +125 -0
  83. package/test-projects/express-api/ai/context/features/controllers.json +13 -0
  84. package/test-projects/express-api/ai/context/features/services.json +13 -0
  85. package/test-projects/express-api/ai/context/flows/auth.json +12 -0
  86. package/test-projects/express-api/ai/context/flows/user.json +13 -0
  87. package/test-projects/express-api/ai/conventions.md +51 -0
  88. package/test-projects/express-api/ai/dependencies.json +54 -0
  89. package/test-projects/express-api/ai/entrypoints.md +17 -0
  90. package/test-projects/express-api/ai/files.json +169 -0
  91. package/test-projects/express-api/ai/graph/knowledge-graph.json +98 -0
  92. package/test-projects/express-api/ai/graph/module-graph.json +44 -0
  93. package/test-projects/express-api/ai/graph/symbol-graph.json +882 -0
  94. package/test-projects/express-api/ai/graph/symbol-references.json +51 -0
  95. package/test-projects/express-api/ai/index-state.json +238 -0
  96. package/test-projects/express-api/ai/index.db +0 -0
  97. package/test-projects/express-api/ai/modules.json +30 -0
  98. package/test-projects/express-api/ai/project.json +15 -0
  99. package/test-projects/express-api/ai/repo-map.json +291 -0
  100. package/test-projects/express-api/ai/repo_map.json +100 -0
  101. package/test-projects/express-api/ai/repo_map.md +36 -0
  102. package/test-projects/express-api/ai/schema.json +5 -0
  103. package/test-projects/express-api/ai/summary.md +14 -0
  104. package/test-projects/express-api/ai/symbols.json +1174 -0
  105. package/test-projects/express-api/ai/tech_stack.md +38 -0
  106. package/test-projects/express-api/ai/tools.json +10 -0
  107. package/test-projects/express-api/controllers/authController.js +32 -0
  108. package/test-projects/express-api/controllers/userController.js +51 -0
  109. package/test-projects/express-api/index.js +21 -0
  110. package/test-projects/express-api/middleware/authMiddleware.js +30 -0
  111. package/test-projects/express-api/models/userRepository.js +25 -0
  112. package/test-projects/express-api/package.json +18 -0
  113. package/test-projects/express-api/services/authService.js +17 -0
  114. package/test-projects/express-api/services/userService.js +28 -0
  115. package/test-projects/nestjs-backend/ai/ai_context.md +110 -0
  116. package/test-projects/nestjs-backend/ai/ai_rules.md +52 -0
  117. package/test-projects/nestjs-backend/ai/architecture.md +43 -0
  118. package/test-projects/nestjs-backend/ai/cache.json +137 -0
  119. package/test-projects/nestjs-backend/ai/context/features/src.json +23 -0
  120. package/test-projects/nestjs-backend/ai/context/flows/auth..json +10 -0
  121. package/test-projects/nestjs-backend/ai/context/flows/users..json +10 -0
  122. package/test-projects/nestjs-backend/ai/conventions.md +52 -0
  123. package/test-projects/nestjs-backend/ai/dependencies.json +152 -0
  124. package/test-projects/nestjs-backend/ai/entrypoints.md +18 -0
  125. package/test-projects/nestjs-backend/ai/files.json +184 -0
  126. package/test-projects/nestjs-backend/ai/graph/knowledge-graph.json +74 -0
  127. package/test-projects/nestjs-backend/ai/graph/module-graph.json +29 -0
  128. package/test-projects/nestjs-backend/ai/graph/symbol-graph.json +304 -0
  129. package/test-projects/nestjs-backend/ai/graph/symbol-references.json +5 -0
  130. package/test-projects/nestjs-backend/ai/index-state.json +259 -0
  131. package/test-projects/nestjs-backend/ai/index.db +0 -0
  132. package/test-projects/nestjs-backend/ai/modules.json +19 -0
  133. package/test-projects/nestjs-backend/ai/project.json +14 -0
  134. package/test-projects/nestjs-backend/ai/repo-map.json +323 -0
  135. package/test-projects/nestjs-backend/ai/repo_map.json +141 -0
  136. package/test-projects/nestjs-backend/ai/repo_map.md +39 -0
  137. package/test-projects/nestjs-backend/ai/schema.json +5 -0
  138. package/test-projects/nestjs-backend/ai/summary.md +11 -0
  139. package/test-projects/nestjs-backend/ai/symbols.json +527 -0
  140. package/test-projects/nestjs-backend/ai/tech_stack.md +37 -0
  141. package/test-projects/nestjs-backend/ai/tools.json +10 -0
  142. package/test-projects/nestjs-backend/package.json +22 -0
  143. package/test-projects/nestjs-backend/src/app.module.ts +8 -0
  144. package/test-projects/nestjs-backend/src/auth/auth.controller.ts +22 -0
  145. package/test-projects/nestjs-backend/src/auth/auth.module.ts +11 -0
  146. package/test-projects/nestjs-backend/src/auth/auth.service.ts +28 -0
  147. package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +4 -0
  148. package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +18 -0
  149. package/test-projects/nestjs-backend/src/main.ts +9 -0
  150. package/test-projects/nestjs-backend/src/users/users.controller.ts +32 -0
  151. package/test-projects/nestjs-backend/src/users/users.module.ts +10 -0
  152. package/test-projects/nestjs-backend/src/users/users.service.ts +42 -0
  153. package/test-projects/nestjs-backend/tsconfig.json +21 -0
  154. package/test-projects/python-cli/__init__.py +1 -0
  155. package/test-projects/python-cli/ai/ai_context.md +94 -0
  156. package/test-projects/python-cli/ai/ai_rules.md +47 -0
  157. package/test-projects/python-cli/ai/architecture.md +49 -0
  158. package/test-projects/python-cli/ai/cache.json +129 -0
  159. package/test-projects/python-cli/ai/context/features/cli.json +16 -0
  160. package/test-projects/python-cli/ai/context/flows/add_.json +9 -0
  161. package/test-projects/python-cli/ai/context/flows/list_.json +9 -0
  162. package/test-projects/python-cli/ai/context/flows/remove_.json +9 -0
  163. package/test-projects/python-cli/ai/conventions.md +51 -0
  164. package/test-projects/python-cli/ai/dependencies.json +66 -0
  165. package/test-projects/python-cli/ai/entrypoints.md +4 -0
  166. package/test-projects/python-cli/ai/files.json +174 -0
  167. package/test-projects/python-cli/ai/graph/knowledge-graph.json +83 -0
  168. package/test-projects/python-cli/ai/graph/module-graph.json +31 -0
  169. package/test-projects/python-cli/ai/graph/symbol-graph.json +358 -0
  170. package/test-projects/python-cli/ai/graph/symbol-references.json +11 -0
  171. package/test-projects/python-cli/ai/index-state.json +245 -0
  172. package/test-projects/python-cli/ai/index.db +0 -0
  173. package/test-projects/python-cli/ai/modules.json +21 -0
  174. package/test-projects/python-cli/ai/project.json +15 -0
  175. package/test-projects/python-cli/ai/repo-map.json +290 -0
  176. package/test-projects/python-cli/ai/repo_map.json +99 -0
  177. package/test-projects/python-cli/ai/repo_map.md +32 -0
  178. package/test-projects/python-cli/ai/schema.json +5 -0
  179. package/test-projects/python-cli/ai/summary.md +11 -0
  180. package/test-projects/python-cli/ai/symbols.json +475 -0
  181. package/test-projects/python-cli/ai/tech_stack.md +30 -0
  182. package/test-projects/python-cli/ai/tools.json +10 -0
  183. package/test-projects/python-cli/cli/__init__.py +1 -0
  184. package/test-projects/python-cli/cli/add_command.py +6 -0
  185. package/test-projects/python-cli/cli/list_command.py +7 -0
  186. package/test-projects/python-cli/cli/remove_command.py +6 -0
  187. package/test-projects/python-cli/main.py +34 -0
  188. package/test-projects/python-cli/models/__init__.py +2 -0
  189. package/test-projects/python-cli/models/task.py +19 -0
  190. package/test-projects/python-cli/models/task_repository.py +44 -0
  191. package/test-projects/react-app/ai/ai_context.md +95 -0
  192. package/test-projects/react-app/ai/ai_rules.md +49 -0
  193. package/test-projects/react-app/ai/architecture.md +33 -0
  194. package/test-projects/react-app/ai/cache.json +129 -0
  195. package/test-projects/react-app/ai/context/features/src.json +18 -0
  196. package/test-projects/react-app/ai/context/flows/dashboard.json +9 -0
  197. package/test-projects/react-app/ai/context/flows/login.json +9 -0
  198. package/test-projects/react-app/ai/context/flows/users.json +9 -0
  199. package/test-projects/react-app/ai/conventions.md +52 -0
  200. package/test-projects/react-app/ai/dependencies.json +128 -0
  201. package/test-projects/react-app/ai/entrypoints.md +4 -0
  202. package/test-projects/react-app/ai/files.json +174 -0
  203. package/test-projects/react-app/ai/graph/knowledge-graph.json +83 -0
  204. package/test-projects/react-app/ai/graph/module-graph.json +31 -0
  205. package/test-projects/react-app/ai/graph/symbol-graph.json +868 -0
  206. package/test-projects/react-app/ai/graph/symbol-references.json +31 -0
  207. package/test-projects/react-app/ai/index-state.json +245 -0
  208. package/test-projects/react-app/ai/index.db +0 -0
  209. package/test-projects/react-app/ai/modules.json +17 -0
  210. package/test-projects/react-app/ai/project.json +15 -0
  211. package/test-projects/react-app/ai/repo-map.json +305 -0
  212. package/test-projects/react-app/ai/repo_map.json +114 -0
  213. package/test-projects/react-app/ai/repo_map.md +31 -0
  214. package/test-projects/react-app/ai/schema.json +5 -0
  215. package/test-projects/react-app/ai/summary.md +11 -0
  216. package/test-projects/react-app/ai/symbols.json +985 -0
  217. package/test-projects/react-app/ai/tech_stack.md +38 -0
  218. package/test-projects/react-app/ai/tools.json +10 -0
  219. package/test-projects/react-app/package.json +16 -0
  220. package/test-projects/react-app/src/App.tsx +21 -0
  221. package/test-projects/react-app/src/context/AuthContext.tsx +41 -0
  222. package/test-projects/react-app/src/hooks/useAuth.ts +10 -0
  223. package/test-projects/react-app/src/main.tsx +10 -0
  224. package/test-projects/react-app/src/pages/DashboardPage.tsx +17 -0
  225. package/test-projects/react-app/src/pages/LoginPage.tsx +41 -0
  226. package/test-projects/react-app/src/pages/UsersPage.tsx +36 -0
  227. package/test-projects/react-app/src/services/userService.ts +37 -0
  228. package/test-projects/salesforce-cli/.forceignore +27 -0
  229. package/test-projects/salesforce-cli/ai/ai_context.md +88 -0
  230. package/test-projects/salesforce-cli/ai/ai_rules.md +47 -0
  231. package/test-projects/salesforce-cli/ai/architecture.md +33 -0
  232. package/test-projects/salesforce-cli/ai/cache.json +105 -0
  233. package/test-projects/salesforce-cli/ai/context/features/force-app.json +14 -0
  234. package/test-projects/salesforce-cli/ai/context/flows/account.json +9 -0
  235. package/test-projects/salesforce-cli/ai/context/flows/opportunity.json +9 -0
  236. package/test-projects/salesforce-cli/ai/conventions.md +51 -0
  237. package/test-projects/salesforce-cli/ai/dependencies.json +6 -0
  238. package/test-projects/salesforce-cli/ai/entrypoints.md +4 -0
  239. package/test-projects/salesforce-cli/ai/files.json +144 -0
  240. package/test-projects/salesforce-cli/ai/graph/knowledge-graph.json +64 -0
  241. package/test-projects/salesforce-cli/ai/graph/module-graph.json +13 -0
  242. package/test-projects/salesforce-cli/ai/graph/symbol-graph.json +148 -0
  243. package/test-projects/salesforce-cli/ai/graph/symbol-references.json +1 -0
  244. package/test-projects/salesforce-cli/ai/index-state.json +203 -0
  245. package/test-projects/salesforce-cli/ai/index.db +0 -0
  246. package/test-projects/salesforce-cli/ai/modules.json +12 -0
  247. package/test-projects/salesforce-cli/ai/project.json +14 -0
  248. package/test-projects/salesforce-cli/ai/repo-map.json +251 -0
  249. package/test-projects/salesforce-cli/ai/repo_map.json +69 -0
  250. package/test-projects/salesforce-cli/ai/repo_map.md +21 -0
  251. package/test-projects/salesforce-cli/ai/schema.json +5 -0
  252. package/test-projects/salesforce-cli/ai/summary.md +11 -0
  253. package/test-projects/salesforce-cli/ai/symbols.json +245 -0
  254. package/test-projects/salesforce-cli/ai/tech_stack.md +30 -0
  255. package/test-projects/salesforce-cli/ai/tools.json +10 -0
  256. package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +24 -0
  257. package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +25 -0
  258. package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +45 -0
  259. package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +33 -0
  260. package/test-projects/salesforce-cli/sfdx-project.json +11 -0
  261. package/tests/e2e/README.md +85 -0
  262. package/tests/e2e/run-e2e.sh +88 -0
  263. package/tests/semanticContexts.test.ts +23 -25
@@ -0,0 +1,327 @@
1
+ # 📋 ANÁLISIS COMPLETO DE MEJORAS - ai-first-cli
2
+ ## Fecha: 2026-03-17
3
+ ## Versión analizada: 1.1.5
4
+
5
+ ---
6
+
7
+ ## ✅ PUNTO 1 COMPLETADO: Release v1.1.5
8
+
9
+ - ✅ Versión actualizada a 1.1.5
10
+ - ✅ CHANGELOG.md actualizado
11
+ - ✅ BUGS.md actualizado con nuevos issues
12
+ - ✅ Build exitoso
13
+ - ✅ Commit realizado (f983ba8)
14
+ - ✅ Push a GitHub completado
15
+ - ⏳ NPM publish (pendiente de confirmación del usuario)
16
+
17
+ **Commit:** https://github.com/julianperezpesce/ai-first/commit/f983ba8
18
+
19
+ ---
20
+
21
+ ## 🔍 ANÁLISIS DE PROBLEMAS Y MEJORAS IDENTIFICADAS
22
+
23
+ ### 1. COBERTURA DE TESTING (Alta Prioridad)
24
+
25
+ **Estado actual:**
26
+ - ✅ 5 proyectos de test funcionando (Express, NestJS, Python CLI, React, Salesforce)
27
+ - ❌ 11+ frameworks sin testing
28
+
29
+ **Frameworks soportados pero NO testeados:**
30
+ | Framework | Tipo | Prioridad |
31
+ |-----------|------|-----------|
32
+ | Laravel | PHP Web | Alta |
33
+ | Django | Python Web | Alta |
34
+ | Flask/FastAPI | Python API | Alta |
35
+ | Rails | Ruby Web | Media |
36
+ | Spring Boot | Java Enterprise | Media |
37
+ | ASP.NET Core | C# Web | Media |
38
+ | Blazor | .NET Frontend | Baja |
39
+ | Phoenix | Elixir Web | Baja |
40
+ | FastAPI | Python API | Alta |
41
+ | Ruby | Ruby general | Baja |
42
+
43
+ **Impacto:** Los usuarios de estos frameworks pueden encontrar errores no detectados.
44
+
45
+ **Solución recomendada:**
46
+ 1. Crear un test project para cada framework soportado
47
+ 2. Implementar test automatizados que validen:
48
+ - Generación correcta de símbolos
49
+ - Detección de entrypoints
50
+ - Extracción de dependencias
51
+ - Generación de features/flows
52
+ 3. Ejecutar tests en CI/CD antes de cada release
53
+
54
+ ---
55
+
56
+ ### 2. ARCHIVOS DUPLICADOS (Media Prioridad)
57
+
58
+ **Problema detectado:**
59
+ En `ai/` se generan archivos duplicados con diferentes convenciones:
60
+
61
+ ```
62
+ ai/
63
+ ├── repo-map.json ← kebab-case
64
+ ├── repo_map.json ← snake_case
65
+ ├── repo_map.md ← snake_case
66
+ ├── module-graph.json ← kebab-case
67
+ ├── symbol-graph.json ← kebab-case
68
+ └── ...
69
+ ```
70
+
71
+ **Archivos duplicados encontrados:**
72
+ 1. `repo-map.json` vs `repo_map.json`
73
+ 2. Posiblemente otros casos similares
74
+
75
+ **Impacto:**
76
+ - Confusión para usuarios (¿cuál usar?)
77
+ - Doble espacio en disco
78
+ - Inconsistencia percibida
79
+
80
+ **Solución recomendada:**
81
+ 1. Elegir UNA convención (recomendado: snake_case)
82
+ 2. Mantener solo `repo_map.json`
83
+ 3. Eliminar `repo-map.json` o marcarlo como deprecated
84
+ 4. Actualizar toda la documentación
85
+
86
+ **Archivos a modificar:**
87
+ - `src/commands/ai-first.ts` (líneas que generan repo-map)
88
+ - `src/core/aiContextGenerator.ts`
89
+ - `src/core/ccp.ts`
90
+
91
+ ---
92
+
93
+ ### 3. INCONSISTENCIAS DE NOMENCLATURA (Media Prioridad)
94
+
95
+ **Problema detectado:**
96
+ Mezcla de convenciones en archivos generados:
97
+
98
+ | Archivo | Convención Actual | Convención Recomendada |
99
+ |---------|-------------------|------------------------|
100
+ | `repo-map.json` | kebab-case | `repo_map.json` |
101
+ | `module-graph.json` | kebab-case | `module_graph.json` |
102
+ | `symbol-graph.json` | kebab-case | `symbol_graph.json` |
103
+ | `knowledge-graph.json` | kebab-case | `knowledge_graph.json` |
104
+ | `symbol-references.json` | kebab-case | `symbol_references.json` |
105
+ | `ai_context.md` | snake_case | ✅ Correcto |
106
+ | `tech_stack.md` | snake_case | ✅ Correcto |
107
+ | `repo_map.md` | snake_case | ✅ Correcto |
108
+
109
+ **Impacto:**
110
+ - Difícil de recordar nombres
111
+ - Inconsistencia visual
112
+ - No sigue estándares de Node.js (que usa snake_case o camelCase)
113
+
114
+ **Solución recomendada:**
115
+ 1. Estandarizar TODO a snake_case
116
+ 2. Crear función helper `toSnakeCase()` para consistencia
117
+ 3. Actualizar todos los generadores de archivos
118
+ 4. Agregar test que valide convenciones
119
+
120
+ **Ejemplo de cambio:**
121
+ ```typescript
122
+ // Antes
123
+ const outputFile = path.join(outputPath, 'module-graph.json');
124
+
125
+ // Después
126
+ const outputFile = path.join(outputPath, 'module_graph.json');
127
+ ```
128
+
129
+ ---
130
+
131
+ ### 4. ORGANIZACIÓN DE CARPETA ai/ (Alta Prioridad)
132
+
133
+ **Problema detectado:**
134
+ La carpeta `ai/` en el repositorio contiene archivos que NO son generados por el CLI:
135
+
136
+ ```
137
+ ai/ (en el repo, no generado)
138
+ ├── ai_context.md ← Generado por CLI ✅
139
+ ├── ai_rules.md ← Generado por CLI ✅
140
+ ├── cache.json ← Cache (temporal) ⚠️
141
+ ├── embeddings.json ← Muy grande (706KB) ⚠️
142
+ ├── git/ ← Datos git temporales ⚠️
143
+ ├── hierarchy.json ← Temporal ⚠️
144
+ ├── index-state.json ← Estado interno ⚠️
145
+ └── ...
146
+ ```
147
+
148
+ **Problemas:**
149
+ 1. Los usuarios no saben qué archivos versionar
150
+ 2. Archivos temporales/cache ocupan espacio
151
+ 3. Mezcla de archivos de ejemplo con archivos reales
152
+ 4. Los test projects tienen archivos `ai/` versionados
153
+
154
+ **Solución recomendada:**
155
+
156
+ #### Opción A: Estructura limpia (Recomendada)
157
+ ```
158
+ ai/
159
+ ├── ai_context.md ← ✅ Mantener (principal)
160
+ ├── ai_rules.md ← ✅ Mantener (reglas)
161
+ ├── architecture.md ← ✅ Mantener
162
+ ├── conventions.md ← ✅ Mantener
163
+ ├── dependencies.json ← ✅ Mantener
164
+ ├── entrypoints.md ← ✅ Mantener
165
+ ├── repo_map.md ← ✅ Mantener
166
+ ├── symbols.json ← ✅ Mantener
167
+ ├── tech_stack.md ← ✅ Mantener
168
+ ├── context/ ← ✅ Mantener (features, flows)
169
+ ├── graph/ ← ✅ Mantener (graphs estáticos)
170
+ ├── .cache/ ← 🆕 Nuevo (archivos temporales)
171
+ │ ├── cache.json
172
+ │ ├── index-state.json
173
+ │ └── embeddings.json
174
+ └── .git/ ← 🆕 Mover desde raíz
175
+ └── ...
176
+ ```
177
+
178
+ #### Opción B: Separación completa
179
+ ```
180
+ repo/
181
+ ├── ai/ ← Solo archivos esenciales
182
+ │ ├── ai_context.md
183
+ │ ├── symbols.json
184
+ │ └── ...
185
+ ├── .ai-cache/ ← Temporales (en .gitignore)
186
+ │ └── ...
187
+ └── .ai-git/ ← Datos git (en .gitignore)
188
+ └── ...
189
+ ```
190
+
191
+ **Archivos a modificar:**
192
+ - `.gitignore` (agregar `ai/.cache/`, `ai/.git/`)
193
+ - `src/commands/ai-first.ts` (cambiar rutas de salida)
194
+ - `src/core/indexer.ts` (cambiar ruta de index.db)
195
+ - Documentación
196
+
197
+ ---
198
+
199
+ ### 5. MANEJO DE ERRORES GIT (Baja Prioridad)
200
+
201
+ **Problema actual:**
202
+ ```bash
203
+ $ ai-first git --root test-projects/express-api
204
+ ❌ Not a git repository
205
+ EXIT_CODE: 1
206
+ ```
207
+
208
+ **Mejora recomendada:**
209
+ ```bash
210
+ $ ai-first git --root test-projects/express-api
211
+ ⚠️ No git repository found in test-projects/express-api
212
+
213
+ 💡 To enable git analysis:
214
+ 1. cd test-projects/express-api
215
+ 2. git init
216
+ 3. git add .
217
+ 4. git commit -m "Initial commit"
218
+
219
+ 📚 Learn more: https://ai-first-cli.netlify.app/docs/git-command
220
+ ```
221
+
222
+ **Beneficios:**
223
+ - Mejor UX para nuevos usuarios
224
+ - Reduce tickets de soporte
225
+ - Educación inline
226
+
227
+ ---
228
+
229
+ ### 6. MEJORAS ADICIONALES IDENTIFICADAS
230
+
231
+ #### 6.1 Validación de archivos generados
232
+ **Problema:** No hay validación automática de que los archivos generados sean válidos.
233
+
234
+ **Solución:** Agregar validación:
235
+ ```typescript
236
+ // Después de generar JSON
237
+ const validateJson = (content: string) => {
238
+ try {
239
+ JSON.parse(content);
240
+ return true;
241
+ } catch {
242
+ return false;
243
+ }
244
+ };
245
+ ```
246
+
247
+ #### 6.2 Tamaño de archivos
248
+ **Problema:** `embeddings.json` puede ser muy grande (706KB en ejemplo).
249
+
250
+ **Solución:**
251
+ - Agregar compresión opcional
252
+ - O dividir en chunks
253
+ - O guardar en SQLite en lugar de JSON
254
+
255
+ #### 6.3 Documentación de archivos generados
256
+ **Falta:** Tabla clara que explique cada archivo generado.
257
+
258
+ **Solución:** Crear `docs/generated-files.md`:
259
+ | Archivo | Propósito | ¿Versionar? | Tamaño típico |
260
+ |---------|-----------|-------------|---------------|
261
+ | ai_context.md | Contexto principal para AI | Sí | ~2KB |
262
+ | symbols.json | Símbolos del proyecto | Sí | ~30KB |
263
+ | index.db | Base de datos SQLite | Opcional | ~45KB |
264
+ | cache.json | Cache temporal | No | Variable |
265
+
266
+ #### 6.4 Cleanup automático
267
+ **Problema:** Archivos viejos no se limpian automáticamente.
268
+
269
+ **Solución:** Agregar `ai-first clean`:
270
+ ```bash
271
+ ai-first clean # Limpiar cache
272
+ ai-first clean --all # Limpiar todo excepto esenciales
273
+ ai-first clean --cache # Solo cache
274
+ ```
275
+
276
+ #### 6.5 Configuración global
277
+ **Falta:** Archivo de configuración para defaults.
278
+
279
+ **Solución:** Soportar `ai-first.config.json`:
280
+ ```json
281
+ {
282
+ "outputDir": "./ai",
283
+ "exclude": ["*.test.js", "node_modules"],
284
+ "cacheEnabled": true,
285
+ "maxFileSize": "1MB"
286
+ }
287
+ ```
288
+
289
+ ---
290
+
291
+ ## 📊 RESUMEN DE PRIORIDADES
292
+
293
+ | # | Issue | Prioridad | Esfuerzo | Impacto |
294
+ |---|-------|-----------|----------|---------|
295
+ | 1 | Testing de frameworks | 🔴 Alta | Alto | Alto |
296
+ | 2 | Organización de ai/ | 🔴 Alta | Medio | Alto |
297
+ | 3 | Archivos duplicados | 🟡 Media | Bajo | Medio |
298
+ | 4 | Inconsistencias de nombres | 🟡 Media | Medio | Medio |
299
+ | 5 | Manejo de errores git | 🟢 Baja | Bajo | Bajo |
300
+ | 6 | Validación de archivos | 🟡 Media | Medio | Medio |
301
+ | 7 | Documentación de archivos | 🟢 Baja | Bajo | Medio |
302
+ | 8 | Cleanup automático | 🟢 Baja | Medio | Bajo |
303
+ | 9 | Configuración global | 🟢 Baja | Medio | Medio |
304
+
305
+ ---
306
+
307
+ ## 🎯 RECOMENDACIONES INMEDIATAS
308
+
309
+ ### Para v1.1.6 (Próximo release):
310
+ 1. ✅ Testing completo de Laravel y Django
311
+ 2. ✅ Documentar estructura de ai/ claramente
312
+ 3. ✅ Agregar mensaje amigable para error de git
313
+
314
+ ### Para v1.2.0 (Release mayor):
315
+ 1. Reorganizar estructura de ai/ (breaking change)
316
+ 2. Consolidar archivos duplicados (breaking change)
317
+ 3. Estandarizar nomenclatura (breaking change)
318
+
319
+ ### Para v2.0.0 (Futuro):
320
+ 1. Sistema de plugins
321
+ 2. Configuración global
322
+ 3. UI web para visualizar graphs
323
+
324
+ ---
325
+
326
+ *Análisis completado: 2026-03-17*
327
+ *Issues registrados en: BUGS.md (sección "Nuevos Issues Identificados")*