awc-zns-mtd 2.9.0 → 2.10.0

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 (38) hide show
  1. package/.github/workflows/ci.yml +148 -0
  2. package/.husky/pre-commit +2 -0
  3. package/.prettierignore +31 -0
  4. package/.prettierrc +13 -0
  5. package/IMPLEMENTATION_SUMMARY.md +410 -0
  6. package/PHASE_2_SUMMARY.md +289 -0
  7. package/README.md +114 -47
  8. package/SECURITY.md +58 -0
  9. package/eslint.config.js +70 -0
  10. package/jest.config.js +49 -0
  11. package/package.json +40 -14
  12. package/src/modules/custom-agents/cli/awc-agent.js +505 -372
  13. package/test/integration/cli/cli-commands.integration.test.js +101 -0
  14. package/test/setup.js +22 -0
  15. package/test/unit/commands/version.test.js +39 -0
  16. package/test/unit/config/config-manager.test.js +147 -0
  17. package/test/unit/utils/file-utils.test.js +177 -0
  18. package/test/unit/utils/validators.test.js +57 -0
  19. package/tools/cli/commands/init.js +556 -513
  20. package/tools/cli/commands/new-project.js +680 -659
  21. package/tools/cli/commands/validate.js +13 -13
  22. package/tools/cli/commands/version.js +5 -3
  23. package/tools/cli/utils/console-logger.js +39 -15
  24. package/tools/cli/utils/logger.js +176 -0
  25. package/tools/cli/utils/project-analyzer.js +33 -16
  26. package/tools/cli/utils/validators.js +144 -0
  27. package/tools/cli/utils/version.js +6 -2
  28. package/tools/config/config-manager.js +243 -0
  29. package/tools/version/changelog-manager.js +301 -288
  30. package/tools/version/update-checker.js +32 -32
  31. package/tools/version/version-bump.js +89 -90
  32. package/tools/version/version-manager.js +17 -7
  33. package/tsconfig.json +47 -0
  34. package/types/index.d.ts +206 -0
  35. package/tools/cli/commands/init-old.js +0 -147
  36. package/tools/cli/commands/new-project-broken.js +0 -1302
  37. package/tools/cli/commands/new-project-old.js +0 -1302
  38. package/tools/cli/commands/new-project.js.backup +0 -1302
@@ -1,147 +0,0 @@
1
- /**
2
- * Comando: init
3
- * Inicializa el proyecto con ZNS-MTD y analiza contexto
4
- */
5
-
6
- const fs = require('fs-extra');
7
- const path = require('path');
8
- const chalk = require('chalk');
9
- const ora = require('ora');
10
- const { analyzeProject } = require('../utils/project-analyzer');
11
- const { loadConfig, updateConfig } = require('../utils/file-utils');
12
- const { displayLogo } = require('../utils/console-logger');
13
-
14
- async function initCommand(options = {}) {
15
- const cwd = process.cwd();
16
- const awcDir = path.join(cwd, '.awc');
17
-
18
- displayLogo();
19
-
20
- console.log(chalk.cyan('\n🎯 Inicialización de Proyecto ZNS-MTD\n'));
21
-
22
- // Verificar instalación
23
- if (!(await fs.pathExists(awcDir))) {
24
- console.log(chalk.red('❌ AWC ZNS-MTD no está instalado.'));
25
- console.log(chalk.yellow(`\n💡 Ejecuta primero ${chalk.green('awc install')}\n`));
26
- return;
27
- }
28
-
29
- const spinner = ora('Analizando proyecto...').start();
30
-
31
- try {
32
- // Analizar proyecto
33
- const analysis = await analyzeProject(cwd);
34
-
35
- spinner.succeed(chalk.green('✅ Análisis completado'));
36
-
37
- // Mostrar resultados
38
- console.log(chalk.cyan('\n📊 Resultados del Análisis:\n'));
39
- console.log(chalk.gray('─'.repeat(60)));
40
-
41
- console.log(chalk.cyan('Tecnologías Detectadas:'));
42
- if (analysis.technologies.length > 0) {
43
- analysis.technologies.forEach(tech => {
44
- console.log(` ${chalk.green('✓')} ${tech}`);
45
- });
46
- } else {
47
- console.log(chalk.yellow(' No se detectaron tecnologías conocidas'));
48
- }
49
-
50
- console.log(chalk.cyan('\nEstructura del Proyecto:'));
51
- console.log(` Archivos totales: ${chalk.yellow(analysis.fileCount)}`);
52
- console.log(` Directorios: ${chalk.yellow(analysis.directoryCount)}`);
53
- console.log(` Lenguajes: ${chalk.yellow(analysis.languages.join(', ') || 'N/A')}`);
54
-
55
- console.log(chalk.cyan('\nComplejidad Estimada:'));
56
- console.log(` Nivel: ${getComplexityColor(analysis.complexity)}`);
57
- console.log(` Tamaño: ${getSizeColor(analysis.size)}`);
58
-
59
- console.log(chalk.gray('─'.repeat(60)));
60
-
61
- // Recomendación de workflow
62
- console.log(chalk.cyan('\n🎯 Workflow Recomendado:\n'));
63
-
64
- const recommendedWorkflow = getRecommendedWorkflow(analysis);
65
-
66
- console.log(` ${chalk.green('→')} ${chalk.bold(recommendedWorkflow.name)}`);
67
- console.log(` ${chalk.gray(recommendedWorkflow.description)}`);
68
- console.log(` ${chalk.gray('Duración estimada:')} ${chalk.yellow(recommendedWorkflow.duration)}\n`);
69
-
70
- // Guardar análisis en configuración
71
- const config = await loadConfig(awcDir);
72
- config.lastAnalysis = {
73
- date: new Date().toISOString(),
74
- ...analysis,
75
- recommendedWorkflow: recommendedWorkflow.id
76
- };
77
- await updateConfig(awcDir, config);
78
-
79
- // Próximos pasos
80
- console.log(chalk.cyan('📚 Próximos Pasos:\n'));
81
- console.log(` 1. Carga el agente ${chalk.green('ZEN MASTER')} en tu IDE`);
82
- console.log(` 2. Ejecuta ${chalk.green('*' + recommendedWorkflow.command)} para comenzar`);
83
- console.log(` 3. Sigue las recomendaciones del workflow\n`);
84
-
85
- } catch (error) {
86
- spinner.fail(chalk.red('❌ Error en el análisis'));
87
- throw error;
88
- }
89
- }
90
-
91
- /**
92
- * Determina el workflow recomendado basado en el análisis
93
- */
94
- function getRecommendedWorkflow(analysis) {
95
- const { complexity, size, fileCount } = analysis;
96
-
97
- // Enterprise Flow
98
- if (complexity === 'high' || size === 'large' || fileCount > 1000) {
99
- return {
100
- id: 'enterprise-flow',
101
- name: 'Enterprise Flow',
102
- command: 'zns-enterprise-flow',
103
- description: 'Para sistemas complejos con múltiples stakeholders',
104
- duration: '< 2 horas'
105
- };
106
- }
107
-
108
- // Quick Flow
109
- if (complexity === 'low' && size === 'small' && fileCount < 50) {
110
- return {
111
- id: 'quick-flow',
112
- name: 'Quick Flow',
113
- command: 'zns-quick-flow',
114
- description: 'Para cambios rápidos y bugs menores',
115
- duration: '< 10 minutos'
116
- };
117
- }
118
-
119
- // Standard Flow (default)
120
- return {
121
- id: 'standard-flow',
122
- name: 'Standard Flow',
123
- command: 'zns-standard-flow',
124
- description: 'Para features medias y refactorizaciones',
125
- duration: '< 30 minutos'
126
- };
127
- }
128
-
129
- function getComplexityColor(complexity) {
130
- const colors = {
131
- 'low': chalk.green('Baja'),
132
- 'medium': chalk.yellow('Media'),
133
- 'high': chalk.red('Alta')
134
- };
135
- return colors[complexity] || chalk.gray('Desconocida');
136
- }
137
-
138
- function getSizeColor(size) {
139
- const colors = {
140
- 'small': chalk.green('Pequeño'),
141
- 'medium': chalk.yellow('Mediano'),
142
- 'large': chalk.red('Grande')
143
- };
144
- return colors[size] || chalk.gray('Desconocido');
145
- }
146
-
147
- module.exports = { initCommand };