ai-first-cli 1.2.1 → 1.2.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.
Files changed (45) hide show
  1. package/ANALISIS_COMPLETO.md +424 -0
  2. package/ANALISIS_MEJORAS.md +327 -0
  3. package/README.es.md +104 -82
  4. package/README.md +116 -113
  5. package/TEST_RESULTS.md +198 -0
  6. package/TEST_RESULTS_COMPARATIVE.md +159 -0
  7. package/TEST_RESULTS_COMPLETE.md +127 -0
  8. package/TEST_RESULTS_COMPREHENSIVE.md +208 -0
  9. package/ai/dependencies.json +15 -0
  10. package/ai/graph/knowledge-graph.json +4 -2
  11. package/ai-context/ai_context.md +7 -7
  12. package/ai-context/ai_rules.md +2 -2
  13. package/ai-context/architecture.md +17 -17
  14. package/ai-context/dependencies.json +34 -2
  15. package/ai-context/entrypoints.md +1 -1
  16. package/ai-context/graph/knowledge-graph.json +14 -199
  17. package/ai-context/index-state.json +386 -22
  18. package/ai-context/modules.json +685 -284
  19. package/ai-context/project.json +1 -1
  20. package/ai-context/repo_map.json +5317 -2019
  21. package/ai-context/repo_map.md +751 -17
  22. package/ai-context/schema.json +1 -1
  23. package/ai-context/summary.md +13 -8
  24. package/ai-context/symbols.json +65349 -5
  25. package/ai-context/tech_stack.md +4 -3
  26. package/dist/analyzers/symbols.js +9 -9
  27. package/dist/analyzers/symbols.js.map +1 -1
  28. package/dist/commands/ai-first.js +17 -0
  29. package/dist/commands/ai-first.js.map +1 -1
  30. package/dist/core/adapters/baseAdapter.d.ts +1 -1
  31. package/dist/core/adapters/baseAdapter.d.ts.map +1 -1
  32. package/dist/core/adapters/baseAdapter.js +50 -12
  33. package/dist/core/adapters/baseAdapter.js.map +1 -1
  34. package/dist/core/semanticContexts.d.ts.map +1 -1
  35. package/dist/core/semanticContexts.js +22 -60
  36. package/dist/core/semanticContexts.js.map +1 -1
  37. package/homebrew/af.rb +18 -0
  38. package/install.sh +188 -0
  39. package/package.json +2 -2
  40. package/src/analyzers/symbols.ts +9 -9
  41. package/src/commands/ai-first.ts +19 -1
  42. package/src/core/adapters/baseAdapter.ts +61 -12
  43. package/src/core/semanticContexts.ts +24 -66
  44. package/tests/knowledgeGraph.test.ts +1 -1
  45. package/tests/phase2-fixes.test.ts +4 -4
@@ -0,0 +1,424 @@
1
+ # 📊 ANÁLISIS COMPLETO DE PROBLEMAS Y MEJORAS - ai-first-cli v1.1.5
2
+ ## Fecha: 2026-03-17
3
+ ## Análisis realizado después del release v1.1.5
4
+
5
+ ---
6
+
7
+ ## ✅ PUNTO 1: RELEASE v1.1.5 COMPLETADO
8
+
9
+ ### Acciones Realizadas:
10
+ - ✅ Versión actualizada a 1.1.5
11
+ - ✅ CHANGELOG.md actualizado (ENG)
12
+ - ✅ BUGS.md actualizado con 7 nuevos issues identificados
13
+ - ✅ Build TypeScript exitoso
14
+ - ✅ Commit: f983ba8
15
+ - ✅ Push a GitHub: https://github.com/julianperezpesce/ai-first/commit/f983ba8
16
+ - ✅ Publicado en NPM: https://www.npmjs.com/package/ai-first-cli/v/1.1.5
17
+
18
+ ### Notas sobre documentación:
19
+ - El CHANGELOG.md está en inglés (no existe versión en español actualmente)
20
+ - El README.md tiene versión en español (README.es.md) pero no está sincronizada con los últimos cambios
21
+ - Se recomienda crear un CHANGELOG.es.md para mantener consistencia
22
+
23
+ ---
24
+
25
+ ## 🔍 PUNTO 2: SOPORTE PARA DIVERSOS TIPOS DE PROYECTOS - TESTING GAPS
26
+
27
+ ### Adaptadores Soportados (16 total):
28
+
29
+ | Framework | Tipo | ¿Testeado? | Prioridad |
30
+ |-----------|------|:----------:|:---------:|
31
+ | **JavaScript/TypeScript** | Lenguaje base | ✅ Express, React | Alta |
32
+ | **NestJS** | Node.js Framework | ✅ SÍ | Alta |
33
+ | **Rails** | Ruby Framework | ❌ NO | Media |
34
+ | **Ruby** | Lenguaje | ❌ NO | Baja |
35
+ | **Django** | Python Framework | ❌ NO | Alta |
36
+ | **Flask** | Python Micro-framework | ❌ NO | Media |
37
+ | **Python** | Lenguaje | ✅ CLI | Alta |
38
+ | **FastAPI** | Python Framework | ❌ NO | Alta |
39
+ | **Laravel** | PHP Framework | ❌ NO | Media |
40
+ | **Phoenix** | Elixir Framework | ❌ NO | Baja |
41
+ | **Spring Boot** | Java Framework | ❌ NO | Media |
42
+ | **SFDX** | Salesforce CLI | ❌ NO | Media |
43
+ | **Salesforce** | CRM Platform | ✅ SÍ | Media |
44
+ | **Blazor** | .NET Frontend | ❌ NO | Baja |
45
+ | **ASP.NET Core** | C# Framework | ❌ NO | Media |
46
+ | **.NET** | Plataforma | ❌ NO | Baja |
47
+
48
+ ### Estadísticas:
49
+ - **Total adaptadores:** 16
50
+ - **Con tests:** 5 (31%)
51
+ - **Sin tests:** 11 (69%)
52
+
53
+ ### Test Projects Existentes:
54
+ ```
55
+ test-projects/
56
+ ├── express-api/ ← JavaScript/TypeScript ✅
57
+ ├── nestjs-backend/ ← NestJS ✅
58
+ ├── python-cli/ ← Python ✅
59
+ ├── react-app/ ← React ✅
60
+ └── salesforce-cli/ ← Salesforce ✅
61
+ ```
62
+
63
+ ### Test Projects Faltantes (Recomendados):
64
+ ```
65
+ test-projects/
66
+ ├── laravel-app/ ← PHP Laravel (Alta prioridad)
67
+ ├── django-app/ ← Python Django (Alta prioridad)
68
+ ├── fastapi-app/ ← Python FastAPI (Alta prioridad)
69
+ ├── rails-app/ ← Ruby on Rails (Media prioridad)
70
+ ├── spring-boot-app/ ← Java Spring Boot (Media prioridad)
71
+ ├── flask-app/ ← Python Flask (Media prioridad)
72
+ └── aspnet-core-app/ ← C# ASP.NET Core (Baja prioridad)
73
+ ```
74
+
75
+ ### Impacto de no tener tests:
76
+ 1. **Riesgo de regressions:** Cambios pueden romper frameworks no testeados
77
+ 2. **Calidad incierta:** No se garantiza que funcionen correctamente
78
+ 3. **Soporte limitado:** Difícil identificar problemas específicos de frameworks
79
+ 4. **Documentación incompleta:** No hay ejemplos reales para usuarios
80
+
81
+ ---
82
+
83
+ ## 🔍 PUNTO 3: ARCHIVOS DUPLICADOS
84
+
85
+ ### Problema Identificado:
86
+
87
+ Se generan múltiples archivos con el mismo propósito pero diferentes nombres:
88
+
89
+ ```
90
+ ai/
91
+ ├── repo-map.json ← kebab-case
92
+ ├── repo_map.json ← snake_case (DUPLICADO!)
93
+ ├── repo_map.md ← snake_case
94
+ ```
95
+
96
+ ### Ubicaciones en el código donde se generan:
97
+
98
+ **Archivo 1: repo_map.json (snake_case)**
99
+ - Ubicación: `src/commands/ai-first.ts` líneas 81-87
100
+ - Función: `runAIFirst()`
101
+
102
+ **Archivo 2: repo-map.json (kebab-case)**
103
+ - Ubicación: `src/commands/ai-first.ts` línea 1122
104
+ - Función: `generateMap()` en comando `map`
105
+
106
+ **Archivo 3: repo_map.md (snake_case)**
107
+ - Ubicación: `src/commands/ai-first.ts` líneas 72-79
108
+ - Función: `runAIFirst()`
109
+
110
+ ### Contenido comparado:
111
+
112
+ **repo_map.json** (generado por init):
113
+ ```json
114
+ {
115
+ "folders": ["controllers", "middleware", "models", "services"],
116
+ "files": ["controllers/authController.js", "index.js"],
117
+ "structure": { ... }
118
+ }
119
+ ```
120
+
121
+ **repo-map.json** (generado por map):
122
+ ```json
123
+ {
124
+ "root": ".",
125
+ "modules": ["controllers", "services"],
126
+ "dependencies": [ ... ]
127
+ }
128
+ ```
129
+
130
+ **⚠️ PROBLEMA:** Aunque tienen nombres similares, contienen datos DIFERENTES:
131
+ - `repo_map.json`: Estructura de carpetas/archivos (legible)
132
+ - `repo-map.json`: Módulos y dependencias (máquina)
133
+ - `repo_map.md`: Documentación en Markdown
134
+
135
+ ### Solución Recomendada:
136
+
137
+ **Opción A: Consolidar nombres (Recomendada)**
138
+ ```
139
+ ai/
140
+ ├── repo_structure.json ← Antes: repo_map.json
141
+ ├── repo_structure.md ← Antes: repo_map.md
142
+ └── repo_modules.json ← Antes: repo-map.json
143
+ ```
144
+
145
+ **Opción B: Eliminar duplicado**
146
+ - Mantener solo `repo_map.json` y eliminar `repo-map.json`
147
+ - Mover la funcionalidad de `repo-map.json` a `repo_map.json`
148
+
149
+ ---
150
+
151
+ ## 🔍 PUNTO 4: INCONSISTENCIAS DE NOMENCLATURA
152
+
153
+ ### Convenciones Actuales (Mixtas):
154
+
155
+ | Archivo | Convención | Consistencia |
156
+ |---------|------------|:------------:|
157
+ | `ai_context.md` | snake_case | ✅ Correcto |
158
+ | `tech_stack.md` | snake_case | ✅ Correcto |
159
+ | `repo_map.md` | snake_case | ✅ Correcto |
160
+ | `repo_map.json` | snake_case | ✅ Correcto |
161
+ | `repo-map.json` | kebab-case | ❌ Inconsistente |
162
+ | `module-graph.json` | kebab-case | ❌ Inconsistente |
163
+ | `symbol-graph.json` | kebab-case | ❌ Inconsistente |
164
+ | `knowledge-graph.json` | kebab-case | ❌ Inconsistente |
165
+ | `symbol-references.json` | kebab-case | ❌ Inconsistente |
166
+ | `index-state.json` | kebab-case | ❌ Inconsistente |
167
+
168
+ ### Archivos que deberían cambiar a snake_case:
169
+
170
+ ```
171
+ Antes: Después:
172
+ repo-map.json → repo_map.json (o repo_modules.json)
173
+ module-graph.json → module_graph.json
174
+ symbol-graph.json → symbol_graph.json
175
+ knowledge-graph.json → knowledge_graph.json
176
+ symbol-references.json → symbol_references.json
177
+ index-state.json → index_state.json
178
+ ```
179
+
180
+ ### En el código fuente:
181
+
182
+ **Ubicaciones donde se definen los nombres:**
183
+
184
+ 1. **src/commands/ai-first.ts**
185
+ - Línea 1122: `repo-map.json`
186
+ - Línea 1150: `module-graph.json`
187
+ - Línea 1177: `symbol-graph.json`
188
+ - Línea 1178: `symbol-references.json`
189
+ - Línea 1275: `knowledge-graph.json`
190
+ - Línea 1311: `index-state.json`
191
+
192
+ 2. **src/core/indexer.ts**
193
+ - Posiblemente genera `index-state.json`
194
+
195
+ ### Convenciones detectadas en convenciones.ts:
196
+
197
+ El analizador detecta automáticamente:
198
+ - `camelCase` para variables
199
+ - `kebab-case` o `snake_case` para archivos
200
+ - `PascalCase` para clases
201
+
202
+ **⚠️ IRONÍA:** El propio CLI tiene inconsistencias en sus convenciones de archivos.
203
+
204
+ ---
205
+
206
+ ## 🔍 PUNTO 5: ORGANIZACIÓN DE CARPETA ai/
207
+
208
+ ### Problema Actual:
209
+
210
+ La carpeta `ai/` mezcla:
211
+ 1. ✅ Archivos esenciales generados
212
+ 2. ⚠️ Archivos temporales/cache
213
+ 3. ❌ Archivos que deberían estar en subcarpetas
214
+
215
+ ### Estructura Actual (Problemas):
216
+
217
+ ```
218
+ ai/
219
+ ├── ai_context.md ← ✅ Esencial
220
+ ├── ai_rules.md ← ✅ Esencial
221
+ ├── architecture.md ← ✅ Esencial
222
+ ├── conventions.md ← ✅ Esencial
223
+ ├── dependencies.json ← ✅ Esencial
224
+ ├── entrypoints.md ← ✅ Esencial
225
+ ├── symbols.json ← ✅ Esencial
226
+ ├── tech_stack.md ← ✅ Esencial
227
+ ├── cache.json ← ⚠️ Temporal (37KB)
228
+ ├── embeddings.json ← ⚠️ Temporal (706KB!)
229
+ ├── index-state.json ← ⚠️ Temporal (69KB)
230
+ ├── hierarchy.json ← ⚠️ Temporal
231
+ ├── files.json ← ⚠️ Podría ser temporal
232
+ ├── modules.json ← ⚠️ Podría ser temporal
233
+ ├── project.json ← ⚠️ Podría ser temporal
234
+ ├── schema.json ← ⚠️ Podría ser temporal
235
+ ├── tools.json ← ⚠️ Podría ser temporal
236
+ ├── index.db ← ✅ Base de datos SQLite
237
+ ├── repo_map.json ← ✅ Esencial
238
+ ├── repo_map.md ← ✅ Esencial
239
+ ├── repo-map.json ← ❌ Duplicado (ver punto 3)
240
+ ├── summary.md ← ✅ Esencial
241
+ ├── context/ ← ✅ Subcarpeta correcta
242
+ │ ├── features/
243
+ │ └── flows/
244
+ ├── graph/ ← ✅ Subcarpeta correcta
245
+ │ ├── knowledge-graph.json
246
+ │ ├── module-graph.json
247
+ │ └── symbol-graph.json
248
+ └── git/ ← ⚠️ Debería ser .ai-git/ o similar
249
+ ├── commit-activity.json
250
+ ├── recent-features.json
251
+ ├── recent-files.json
252
+ └── recent-flows.json
253
+ ```
254
+
255
+ ### Solución Recomendada - Estructura Limpia:
256
+
257
+ ```
258
+ ai/ ← Solo archivos esenciales
259
+ ├── ai_context.md ← Contexto principal
260
+ ├── ai_rules.md ← Reglas del proyecto
261
+ ├── architecture.md ← Arquitectura
262
+ ├── conventions.md ← Convenciones
263
+ ├── dependencies.json ← Dependencias
264
+ ├── entrypoints.md ← Entrypoints
265
+ ├── repo_structure.json ← Estructura (repo_map.json)
266
+ ├── repo_structure.md ← Estructura legible
267
+ ├── symbols.json ← Símbolos
268
+ ├── tech_stack.md ← Stack tecnológico
269
+ ├── index.db ← Base de datos SQLite
270
+ ├── context/ ← Contextos
271
+ │ ├── features/
272
+ │ └── flows/
273
+ └── graph/ ← Grafos
274
+ ├── knowledge_graph.json
275
+ ├── module_graph.json
276
+ └── symbol_graph.json
277
+
278
+ .ai-cache/ ← Nueva carpeta (en .gitignore)
279
+ ├── cache.json
280
+ ├── embeddings.json
281
+ ├── index_state.json
282
+ ├── files.json
283
+ ├── modules.json
284
+ ├── project.json
285
+ ├── schema.json
286
+ └── tools.json
287
+
288
+ .ai-git/ ← Nueva carpeta (en .gitignore)
289
+ ├── commit-activity.json
290
+ ├── recent-features.json
291
+ ├── recent-files.json
292
+ └── recent-flows.json
293
+ ```
294
+
295
+ ### Archivos que deberían estar en .gitignore:
296
+
297
+ ```gitignore
298
+ # AI-First CLI cache and temporary files
299
+ .ai-cache/
300
+ .ai-git/
301
+ ai/.cache/
302
+ ai/*.json~ # Backup files
303
+ ai/*.tmp
304
+ ```
305
+
306
+ ---
307
+
308
+ ## 🔍 PROBLEMAS ADICIONALES DESCUBIERTOS
309
+
310
+ ### 6. TAMAÑO DE EMBEDDINGS.JSON
311
+
312
+ **Problema:** `embeddings.json` es extremadamente grande (706KB en el ejemplo).
313
+
314
+ **Impacto:**
315
+ - Lentitud al leer/escribir
316
+ - Ocupación innecesaria de disco
317
+ - Problemas de rendimiento en repos grandes
318
+
319
+ **Solución:**
320
+ 1. Mover a SQLite en lugar de JSON
321
+ 2. O usar compresión
322
+ 3. O dividir en chunks
323
+
324
+ ### 7. NOMENCLATURA DE FLOWS INCONSISTENTE
325
+
326
+ **Problema:** Algunos flows tienen nombres con puntos o guiones bajos raros:
327
+ ```
328
+ ai/context/flows/
329
+ ├── auth..json ← Doble punto
330
+ ├── users..json ← Doble punto
331
+ ├── add_.json ← Guion bajo al final
332
+ ├── list_.json ← Guion bajo al final
333
+ ├── remove_.json ← Guion bajo al final
334
+ ```
335
+
336
+ **Causa:** Probablemente la función que genera nombres de archivos no sanitiza correctamente.
337
+
338
+ **Ubicación:** `src/core/semanticContexts.ts`
339
+
340
+ ### 8. SÍMBOLOS VACÍOS
341
+
342
+ **Problema:** `ai/symbols.json` tiene 2 bytes (vacío).
343
+
344
+ **Ubicación:** En el repositorio principal (no en test-projects).
345
+
346
+ **Causa:** Probablemente se generó en el directorio incorrecto o con errores.
347
+
348
+ ### 9. DUPLICACIÓN DE CARPETAS CONTEXT
349
+
350
+ **Problema:** Hay dos carpetas context:
351
+ ```
352
+ ai/
353
+ ├── context/ ← Generada por CLI
354
+ │ ├── features/
355
+ │ └── flows/
356
+ └── ccp/ ← Context Control Packs
357
+ └── jira-123/
358
+ └── context.json
359
+ ```
360
+
361
+ **Confusión:** Los usuarios no saben cuál usar.
362
+
363
+ **Solución:** Consolidar o documentar claramente la diferencia.
364
+
365
+ ### 10. DOCUMENTACIÓN DESACTUALIZADA
366
+
367
+ **README.es.md:**
368
+ - Probablemente no está sincronizado con README.md
369
+ - No menciona los nuevos comandos (update, graph, git)
370
+ - No menciona los bugs corregidos
371
+
372
+ **CHANGELOG:**
373
+ - Solo existe en inglés
374
+ - Debería tener versión en español
375
+
376
+ ### 11. CONSOLA MUESTRA MENSAJES DUPLICADOS
377
+
378
+ **Problema:** Al ejecutar `init`, se muestra:
379
+ ```
380
+ ✨ Done! Created the following files:
381
+ ✨ Done! Created the following files:
382
+ ✨ Done! Created the following files:
383
+ ```
384
+
385
+ **Causa:** Probablemente el console.log está en un loop o se llama múltiples veces.
386
+
387
+ **Ubicación:** `src/commands/ai-first.ts`
388
+
389
+ ---
390
+
391
+ ## 📋 RESUMEN DE PRIORIDADES
392
+
393
+ ### 🔴 CRÍTICO (Para v1.1.6)
394
+ 1. Crear test projects para Django y Laravel (frameworks populares sin test)
395
+ 2. Corregir mensajes duplicados en consola
396
+ 3. Sanitizar nombres de archivos de flows
397
+
398
+ ### 🟠 ALTA (Para v1.2.0)
399
+ 4. Reorganizar estructura de ai/ (mover temporales a .ai-cache/)
400
+ 5. Consolidar archivos duplicados (repo-map vs repo_map)
401
+ 6. Estandarizar nomenclatura a snake_case
402
+
403
+ ### 🟡 MEDIA (Para v1.2.x)
404
+ 7. Optimizar embeddings.json (mover a SQLite)
405
+ 8. Crear test projects para Rails, Flask, Spring Boot
406
+ 9. Mejorar manejo de errores en comando git
407
+
408
+ ### 🟢 BAJA (Para v1.3.0)
409
+ 10. Crear CHANGELOG.es.md
410
+ 11. Sincronizar README.es.md
411
+ 12. Consolidar carpetas context/ vs ccp/
412
+
413
+ ---
414
+
415
+ ## 📁 ARCHIVOS CREADOS EN ESTE ANÁLISIS
416
+
417
+ 1. **BUGS.md** - Actualizado con 7 issues nuevos
418
+ 2. **ANALISIS_MEJORAS.md** - Análisis detallado completo
419
+ 3. **TEST_RESULTS_*.md** - Resultados de pruebas exhaustivas
420
+
421
+ ---
422
+
423
+ *Análisis completado: 2026-03-17*
424
+ *Versión analizada: 1.1.5*