awc-zns-mtd 2.5.0 → 2.6.1

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.
@@ -1,147 +1,513 @@
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 };
1
+ /**
2
+ * Comando: init
3
+ * Inicializa el tipo de proyecto y crea estructura específica según necesidades
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 inquirer = require('inquirer');
11
+ const { displayLogo } = require('../utils/console-logger');
12
+ const { loadConfig, updateConfig } = require('../utils/file-utils');
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 AWC ZNS-MTD\n'));
21
+
22
+ // Verificar que existe .awc
23
+ if (!(await fs.pathExists(awcDir))) {
24
+ console.log(chalk.red('❌ Este directorio no es un proyecto AWC.'));
25
+ console.log(chalk.yellow(`\n💡 Ejecuta primero ${chalk.green('awc new <proyecto>')}\n`));
26
+ return;
27
+ }
28
+
29
+ // Cargar configuración
30
+ const config = await loadConfig(awcDir);
31
+
32
+ if (config.initialized) {
33
+ console.log(chalk.yellow('⚠️ Este proyecto ya fue inicializado.'));
34
+ const { reinit } = await inquirer.prompt([
35
+ {
36
+ type: 'confirm',
37
+ name: 'reinit',
38
+ message: '¿Deseas reinicializar? (Se mantendrán archivos existentes)',
39
+ default: false
40
+ }
41
+ ]);
42
+ if (!reinit) return;
43
+ }
44
+
45
+ // Preguntas de inicialización
46
+ const answers = await inquirer.prompt([
47
+ {
48
+ type: 'list',
49
+ name: 'projectType',
50
+ message: '📋 ¿Qué tipo de proyecto es?',
51
+ choices: [
52
+ { name: '🔍 Auditoría de Código Existente', value: 'code-audit' },
53
+ { name: '🆕 Desarrollo Desde Cero', value: 'greenfield' },
54
+ { name: '🔄 Migración/Modernización', value: 'migration' },
55
+ { name: '🛠️ Mantenimiento/Soporte', value: 'maintenance' },
56
+ { name: '📱 Aplicación Móvil', value: 'mobile' },
57
+ { name: '🌐 API/Microservicios', value: 'api' },
58
+ { name: '🏢 Sistema Empresarial', value: 'enterprise' }
59
+ ]
60
+ },
61
+ {
62
+ type: 'list',
63
+ name: 'workflow',
64
+ message: '⚡ ¿Qué workflow deseas usar?',
65
+ choices: [
66
+ { name: '⚡ Quick (1-2 semanas)', value: 'quick' },
67
+ { name: '📊 Standard (1-3 meses)', value: 'standard' },
68
+ { name: '🏢 Enterprise (3+ meses)', value: 'enterprise' }
69
+ ]
70
+ },
71
+ {
72
+ type: 'checkbox',
73
+ name: 'technologies',
74
+ message: '🛠️ Selecciona las tecnologías del proyecto (usa espacio para seleccionar):',
75
+ choices: [
76
+ { name: 'Java', value: 'java' },
77
+ { name: '.NET Core', value: 'dotnet' },
78
+ { name: 'Python', value: 'python' },
79
+ { name: 'PHP', value: 'php' },
80
+ { name: 'Node.js', value: 'nodejs' },
81
+ { name: 'React', value: 'react' },
82
+ { name: 'Angular', value: 'angular' },
83
+ { name: 'Vue', value: 'vue' },
84
+ { name: 'React Native', value: 'react-native' },
85
+ { name: 'SQL Database', value: 'sql' },
86
+ { name: 'NoSQL Database', value: 'nosql' }
87
+ ]
88
+ }
89
+ ]);
90
+
91
+ const spinner = ora('Creando estructura del proyecto...').start();
92
+
93
+ try {
94
+ // Crear estructura según tipo de proyecto
95
+ const structure = getProjectStructure(answers.projectType);
96
+
97
+ for (const dir of structure.directories) {
98
+ await fs.ensureDir(path.join(cwd, dir));
99
+ }
100
+ spinner.text = 'Estructura de directorios creada';
101
+
102
+ // Crear guías START_HERE.md para fases activas
103
+ await createPhaseGuides(cwd, structure.phases);
104
+ spinner.text = 'Guías de fase creadas';
105
+
106
+ // Crear README de client-docs para fases activas
107
+ await createClientDocsReadmes(cwd, structure.phases);
108
+ spinner.text = 'README de client-docs creados';
109
+
110
+ // Actualizar configuración
111
+ config.initialized = true;
112
+ config.projectType = answers.projectType;
113
+ config.workflow = answers.workflow;
114
+ config.technologies = answers.technologies;
115
+ config.structure = structure;
116
+ config.workflows.current_phase = structure.startPhase;
117
+
118
+ await updateConfig(awcDir, config);
119
+ spinner.text = 'Configuración actualizada';
120
+
121
+ spinner.succeed(chalk.green('✅ Proyecto inicializado exitosamente'));
122
+
123
+ // Mostrar resumen
124
+ console.log(chalk.cyan('\n' + '═'.repeat(60)));
125
+ console.log(chalk.cyan('📊 Resumen de Inicialización'));
126
+ console.log(chalk.cyan('═'.repeat(60) + '\n'));
127
+
128
+ console.log(`${chalk.gray('Tipo de Proyecto:')} ${chalk.green(getProjectTypeName(answers.projectType))}`);
129
+ console.log(`${chalk.gray('Workflow:')} ${chalk.yellow(answers.workflow.toUpperCase())}`);
130
+ console.log(`${chalk.gray('Tecnologías:')} ${chalk.blue(answers.technologies.join(', ') || 'Ninguna')}`);
131
+ console.log(`${chalk.gray('Fases creadas:')} ${chalk.yellow(structure.phases.length)}\n`);
132
+
133
+ // Mostrar fases creadas
134
+ console.log(chalk.cyan('📂 Estructura Creada:\n'));
135
+ structure.phases.forEach((phase, index) => {
136
+ const icon = phase === structure.startPhase ? '👉' : ' ';
137
+ console.log(` ${icon} ${chalk.green(phase)} ${phase === structure.startPhase ? chalk.yellow('← INICIAR AQUÍ') : ''}`);
138
+ });
139
+
140
+ // Próximos pasos
141
+ console.log(chalk.cyan('\n📚 Próximos Pasos:\n'));
142
+ console.log(` ${chalk.green('1.')} Ir a ${chalk.yellow(structure.startPhase + '/')}`);
143
+ console.log(` ${chalk.green('2.')} Leer ${chalk.yellow('START_HERE.md')}`);
144
+ console.log(` ${chalk.green('3.')} Colocar documentación del cliente en ${chalk.yellow('docs/client-docs/')}`);
145
+ console.log(` ${chalk.green('4.')} Comenzar a trabajar con los agentes especializados\n`);
146
+
147
+ // Mostrar agentes recomendados
148
+ const recommendedAgents = getRecommendedAgents(answers.projectType, answers.technologies);
149
+ console.log(chalk.cyan('🤖 Agentes Recomendados para este Proyecto:\n'));
150
+ recommendedAgents.forEach(agent => {
151
+ console.log(` ${chalk.green('→')} ${agent}`);
152
+ });
153
+ console.log();
154
+
155
+ } catch (error) {
156
+ spinner.fail(chalk.red('❌ Error inicializando proyecto'));
157
+ throw error;
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Obtiene la estructura de directorios según tipo de proyecto
163
+ */
164
+ function getProjectStructure(projectType) {
165
+ const structures = {
166
+ 'code-audit': {
167
+ phases: ['01-comercial', '03-analysis', '04-planning', '08-support'],
168
+ startPhase: '01-comercial',
169
+ directories: [
170
+ // Comercial
171
+ '01-comercial/01-prospection',
172
+ '01-comercial/02-technical-proposal',
173
+ '01-comercial/03-quotation',
174
+ '01-comercial/04-contract',
175
+ '01-comercial/docs/client-docs/requerimientos',
176
+ '01-comercial/docs/client-docs/presentaciones',
177
+ '01-comercial/docs/client-docs/contratos',
178
+
179
+ // Analysis (PRINCIPAL para auditoría)
180
+ '03-analysis/01-code-audit',
181
+ '03-analysis/02-architecture-review',
182
+ '03-analysis/03-technical-debt',
183
+ '03-analysis/04-recommendations',
184
+ '03-analysis/docs/client-docs/arquitectura',
185
+ '03-analysis/docs/client-docs/databases',
186
+ '03-analysis/docs/client-docs/codigo-fuente',
187
+ '03-analysis/reports',
188
+
189
+ // Planning (plan de mejoras)
190
+ '04-planning/01-improvement-plan',
191
+ '04-planning/02-priorities',
192
+ '04-planning/docs/client-docs/estimaciones',
193
+
194
+ // Support (recomendaciones)
195
+ '08-support/recommendations',
196
+ '08-support/docs/client-docs/seguimiento'
197
+ ]
198
+ },
199
+
200
+ 'greenfield': {
201
+ phases: ['01-comercial', '02-inception', '04-planning', '05-development', '06-qa', '07-deployment', '08-support'],
202
+ startPhase: '01-comercial',
203
+ directories: [
204
+ // Comercial
205
+ '01-comercial/01-prospection',
206
+ '01-comercial/02-technical-proposal',
207
+ '01-comercial/03-quotation',
208
+ '01-comercial/04-contract',
209
+ '01-comercial/docs/client-docs/requerimientos',
210
+ '01-comercial/docs/client-docs/presentaciones',
211
+
212
+ // Inception (PRINCIPAL)
213
+ '02-inception/01-kickoff',
214
+ '02-inception/02-prd',
215
+ '02-inception/03-backlog',
216
+ '02-inception/04-release-planning',
217
+ '02-inception/docs/client-docs/procesos',
218
+ '02-inception/docs/client-docs/manuales',
219
+ '02-inception/docs/client-docs/imagenes',
220
+
221
+ // Planning
222
+ '04-planning/01-sprint-planning',
223
+ '04-planning/02-backlog-refinement',
224
+ '04-planning/docs/client-docs/historias',
225
+
226
+ // Development (PRINCIPAL)
227
+ '05-development/src',
228
+ '05-development/tests',
229
+ '05-development/docs',
230
+ '05-development/docs/client-docs/recursos',
231
+
232
+ // QA
233
+ '06-qa/test-plans',
234
+ '06-qa/test-cases',
235
+ '06-qa/test-results',
236
+ '06-qa/docs/client-docs/criterios-aceptacion',
237
+
238
+ // Deployment
239
+ '07-deployment/environments',
240
+ '07-deployment/scripts',
241
+ '07-deployment/docs/client-docs/infraestructura',
242
+
243
+ // Support
244
+ '08-support/incidents',
245
+ '08-support/maintenance',
246
+ '08-support/docs/client-docs/incidentes'
247
+ ]
248
+ },
249
+
250
+ 'migration': {
251
+ phases: ['01-comercial', '03-analysis', '04-planning', '05-development', '07-deployment'],
252
+ startPhase: '01-comercial',
253
+ directories: [
254
+ // Comercial
255
+ '01-comercial/01-prospection',
256
+ '01-comercial/02-technical-proposal',
257
+ '01-comercial/03-quotation',
258
+ '01-comercial/docs/client-docs/requerimientos',
259
+
260
+ // Analysis (PRINCIPAL - analizar sistema legacy)
261
+ '03-analysis/01-legacy-assessment',
262
+ '03-analysis/02-migration-plan',
263
+ '03-analysis/03-risk-assessment',
264
+ '03-analysis/docs/client-docs/arquitectura',
265
+ '03-analysis/docs/client-docs/databases',
266
+ '03-analysis/docs/client-docs/codigo-existente',
267
+
268
+ // Planning (plan de migración)
269
+ '04-planning/01-migration-phases',
270
+ '04-planning/02-data-migration',
271
+ '04-planning/03-rollback-plan',
272
+ '04-planning/docs/client-docs/cronograma',
273
+
274
+ // Development (nuevo sistema)
275
+ '05-development/src',
276
+ '05-development/migration-scripts',
277
+ '05-development/tests',
278
+ '05-development/docs/client-docs/apis',
279
+
280
+ // Deployment (ejecución de migración)
281
+ '07-deployment/pre-migration',
282
+ '07-deployment/migration',
283
+ '07-deployment/post-migration',
284
+ '07-deployment/docs/client-docs/infraestructura',
285
+ '07-deployment/docs/client-docs/accesos'
286
+ ]
287
+ },
288
+
289
+ 'maintenance': {
290
+ phases: ['01-comercial', '03-analysis', '08-support'],
291
+ startPhase: '08-support',
292
+ directories: [
293
+ // Comercial (contrato de mantenimiento)
294
+ '01-comercial/01-contract',
295
+ '01-comercial/02-sla',
296
+ '01-comercial/docs/client-docs/contratos',
297
+
298
+ // Analysis (entender sistema)
299
+ '03-analysis/01-system-documentation',
300
+ '03-analysis/docs/client-docs/arquitectura',
301
+ '03-analysis/docs/client-docs/codigo',
302
+
303
+ // Support (PRINCIPAL)
304
+ '08-support/incidents',
305
+ '08-support/bug-fixes',
306
+ '08-support/maintenance',
307
+ '08-support/change-requests',
308
+ '08-support/docs/client-docs/incidentes',
309
+ '08-support/docs/client-docs/cambios'
310
+ ]
311
+ },
312
+
313
+ 'mobile': {
314
+ phases: ['01-comercial', '02-inception', '04-planning', '05-development', '06-qa', '07-deployment'],
315
+ startPhase: '02-inception',
316
+ directories: [
317
+ // Comercial
318
+ '01-comercial/01-prospection',
319
+ '01-comercial/docs/client-docs/requerimientos',
320
+
321
+ // Inception (PRINCIPAL - diseño UX/UI)
322
+ '02-inception/01-ux-design',
323
+ '02-inception/02-ui-design',
324
+ '02-inception/03-prototypes',
325
+ '02-inception/04-backlog',
326
+ '02-inception/docs/client-docs/mockups',
327
+ '02-inception/docs/client-docs/branding',
328
+
329
+ // Planning
330
+ '04-planning/01-sprint-planning',
331
+
332
+ // Development
333
+ '05-development/src/ios',
334
+ '05-development/src/android',
335
+ '05-development/src/shared',
336
+ '05-development/tests',
337
+ '05-development/docs/client-docs/assets',
338
+
339
+ // QA
340
+ '06-qa/device-testing',
341
+ '06-qa/automation',
342
+
343
+ // Deployment
344
+ '07-deployment/app-store',
345
+ '07-deployment/play-store'
346
+ ]
347
+ },
348
+
349
+ 'api': {
350
+ phases: ['01-comercial', '02-inception', '05-development', '06-qa', '07-deployment'],
351
+ startPhase: '02-inception',
352
+ directories: [
353
+ // Comercial
354
+ '01-comercial/01-prospection',
355
+
356
+ // Inception (diseño API)
357
+ '02-inception/01-api-design',
358
+ '02-inception/02-swagger',
359
+ '02-inception/docs/client-docs/integraciones',
360
+
361
+ // Development (PRINCIPAL)
362
+ '05-development/src/controllers',
363
+ '05-development/src/services',
364
+ '05-development/src/models',
365
+ '05-development/tests/integration',
366
+ '05-development/tests/unit',
367
+ '05-development/docs/api',
368
+
369
+ // QA
370
+ '06-qa/api-testing',
371
+ '06-qa/performance',
372
+
373
+ // Deployment
374
+ '07-deployment/kubernetes',
375
+ '07-deployment/docker'
376
+ ]
377
+ },
378
+
379
+ 'enterprise': {
380
+ phases: ['01-comercial', '02-inception', '03-analysis', '04-planning', '05-development', '06-qa', '07-deployment', '08-support'],
381
+ startPhase: '01-comercial',
382
+ directories: [
383
+ // Todas las fases con estructura completa
384
+ '01-comercial/01-prospection',
385
+ '01-comercial/02-technical-proposal',
386
+ '01-comercial/03-quotation',
387
+ '01-comercial/04-contract',
388
+ '01-comercial/docs/client-docs/requerimientos',
389
+ '01-comercial/docs/client-docs/presentaciones',
390
+ '01-comercial/docs/client-docs/contratos',
391
+
392
+ '02-inception/01-kickoff',
393
+ '02-inception/02-prd',
394
+ '02-inception/03-backlog',
395
+ '02-inception/04-release-planning',
396
+ '02-inception/docs/client-docs/procesos',
397
+ '02-inception/docs/client-docs/manuales',
398
+
399
+ '03-analysis/01-code-audit',
400
+ '03-analysis/02-architecture-review',
401
+ '03-analysis/docs/client-docs/arquitectura',
402
+ '03-analysis/docs/client-docs/databases',
403
+
404
+ '04-planning/01-sprint-planning',
405
+ '04-planning/02-backlog-refinement',
406
+ '04-planning/03-release-planning',
407
+ '04-planning/docs/client-docs/historias',
408
+
409
+ '05-development/src',
410
+ '05-development/tests',
411
+ '05-development/docs',
412
+ '05-development/docs/client-docs/apis',
413
+ '05-development/docs/client-docs/integraciones',
414
+
415
+ '06-qa/test-plans',
416
+ '06-qa/test-cases',
417
+ '06-qa/automation',
418
+ '06-qa/docs/client-docs/criterios-aceptacion',
419
+
420
+ '07-deployment/environments',
421
+ '07-deployment/scripts',
422
+ '07-deployment/docs/client-docs/infraestructura',
423
+ '07-deployment/docs/client-docs/accesos',
424
+
425
+ '08-support/incidents',
426
+ '08-support/maintenance',
427
+ '08-support/docs/client-docs/incidentes'
428
+ ]
429
+ }
430
+ };
431
+
432
+ return structures[projectType] || structures.greenfield;
433
+ }
434
+
435
+ /**
436
+ * Crea guías START_HERE.md para las fases activas
437
+ */
438
+ async function createPhaseGuides(projectPath, phases) {
439
+ // TODO: Crear START_HERE.md específicos para cada fase
440
+ // según el tipo de proyecto
441
+ console.log('Creando guías para:', phases);
442
+ }
443
+
444
+ /**
445
+ * Crea README en client-docs para las fases activas
446
+ */
447
+ async function createClientDocsReadmes(projectPath, phases) {
448
+ // TODO: Crear README.md en client-docs/ de cada fase
449
+ console.log('Creando client-docs README para:', phases);
450
+ }
451
+
452
+ /**
453
+ * Obtiene nombre del tipo de proyecto
454
+ */
455
+ function getProjectTypeName(projectType) {
456
+ const names = {
457
+ 'code-audit': 'Auditoría de Código Existente',
458
+ 'greenfield': 'Desarrollo Desde Cero',
459
+ 'migration': 'Migración/Modernización',
460
+ 'maintenance': 'Mantenimiento/Soporte',
461
+ 'mobile': 'Aplicación Móvil',
462
+ 'api': 'API/Microservicios',
463
+ 'enterprise': 'Sistema Empresarial'
464
+ };
465
+ return names[projectType] || projectType;
466
+ }
467
+
468
+ /**
469
+ * Obtiene agentes recomendados según tipo de proyecto y tecnologías
470
+ */
471
+ function getRecommendedAgents(projectType, technologies) {
472
+ const baseAgents = [];
473
+
474
+ // Agentes según tipo de proyecto
475
+ if (projectType === 'code-audit') {
476
+ baseAgents.push('backend-audit-master', 'frontend-audit-master', 'obsolescence-analyst-senior');
477
+ } else if (projectType === 'greenfield') {
478
+ baseAgents.push('product-owner-business-analyst', 'solution-architect-senior', 'technical-stories-architect');
479
+ } else if (projectType === 'migration') {
480
+ baseAgents.push('backend-audit-master', 'solution-architect-senior', 'database-engineer-senior');
481
+ } else if (projectType === 'mobile') {
482
+ baseAgents.push('react-native-senior', 'frontend-react-senior');
483
+ } else if (projectType === 'api') {
484
+ baseAgents.push('solution-architect-senior', 'database-engineer-senior');
485
+ }
486
+
487
+ // Agentes según tecnología
488
+ if (technologies.includes('java')) {
489
+ baseAgents.push('backend-java-senior');
490
+ }
491
+ if (technologies.includes('dotnet')) {
492
+ baseAgents.push('dotnet-core-senior', 'aspnet-core-architect-senior');
493
+ }
494
+ if (technologies.includes('python')) {
495
+ baseAgents.push('python-senior');
496
+ }
497
+ if (technologies.includes('react')) {
498
+ baseAgents.push('frontend-react-senior');
499
+ }
500
+ if (technologies.includes('sql') || technologies.includes('nosql')) {
501
+ baseAgents.push('database-engineer-senior');
502
+ }
503
+
504
+ // Agregar agentes base si aún no hay
505
+ if (baseAgents.length === 0) {
506
+ baseAgents.push('zen-master', 'architect-senior', 'developer-pro');
507
+ }
508
+
509
+ // Remover duplicados
510
+ return [...new Set(baseAgents)];
511
+ }
512
+
513
+ module.exports = { initCommand };