awc-zns-mtd 2.6.2 → 2.7.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "awc-zns-mtd",
4
- "version": "2.6.2",
4
+ "version": "2.7.1",
5
5
  "description": "AWC ZNS-MTD Method - Metodología de Transformación Digital Zen, Neutro y Sistemático",
6
6
  "keywords": [
7
7
  "awc",
@@ -24,7 +24,6 @@
24
24
  "author": "AWC Team",
25
25
  "main": "tools/cli/awc-cli.js",
26
26
  "bin": {
27
- "awc": "tools/cli/awc-cli.js",
28
27
  "zns": "tools/cli/awc-cli.js"
29
28
  },
30
29
  "scripts": {
@@ -4,7 +4,7 @@
4
4
 
5
5
  module_name: "AWC ZNS-MTD Method"
6
6
  module_code: "awc-zns-mtd"
7
- version: "2.6.2"
7
+ version: "2.7.1"
8
8
  author: "AWC Team"
9
9
  description: "Metodología de Transformación Digital - Zen, Neutro, Sistemático"
10
10
 
@@ -21,8 +21,8 @@ async function initCommand(options = {}) {
21
21
 
22
22
  // Verificar que existe .awc
23
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`));
24
+ console.log(chalk.red('❌ Este directorio no es un proyecto ZNS.'));
25
+ console.log(chalk.yellow(`\n💡 Ejecuta primero ${chalk.green('zns new <proyecto>')}\n`));
26
26
  return;
27
27
  }
28
28
 
@@ -169,14 +169,12 @@ async function newProjectCommand(projectName, options = {}) {
169
169
  await createVSCodeConfig(projectPath, projectName);
170
170
  spinner.text = 'Configuración VS Code creada';
171
171
 
172
- // 11. Copiar copilot-instructions.md
172
+ // 11. Generar copilot-instructions.md con agentes embebidos
173
173
  const githubDir = path.join(projectPath, '.github');
174
174
  await fs.ensureDir(githubDir);
175
- const templateCopilotPath = path.join(__dirname, '../../../templates/.github/copilot-instructions.md');
176
- if (await fs.pathExists(templateCopilotPath)) {
177
- await fs.copy(templateCopilotPath, path.join(githubDir, 'copilot-instructions.md'));
178
- spinner.text = 'GitHub Copilot instructions creadas';
179
- }
175
+ const copilotInstructions = await generateCopilotInstructions(projectPath);
176
+ await fs.writeFile(path.join(githubDir, 'copilot-instructions.md'), copilotInstructions);
177
+ spinner.text = 'GitHub Copilot instructions creadas';
180
178
 
181
179
  // 12. Crear archivo NEXT_STEPS.md
182
180
  const nextSteps = createNextStepsContent(projectName);
@@ -214,10 +212,10 @@ async function newProjectCommand(projectName, options = {}) {
214
212
  // Próximos pasos
215
213
  console.log(chalk.cyan('📚 Próximos Pasos:\n'));
216
214
  console.log(` ${chalk.green('1.')} cd ${projectName}`);
217
- console.log(` ${chalk.green('2.')} awc init ${chalk.gray('# Inicializar tipo de proyecto')}`);
215
+ console.log(` ${chalk.green('2.')} zns init ${chalk.gray('# Inicializar tipo de proyecto')}`);
218
216
  console.log(` ${chalk.green('3.')} Leer ${chalk.yellow('NEXT_STEPS.md')} para más detalles\n`);
219
217
 
220
- console.log(chalk.yellow('⚠️ La estructura de fases se creará al ejecutar') + chalk.green(' awc init\n'));
218
+ console.log(chalk.yellow('⚠️ La estructura de fases se creará al ejecutar') + chalk.green(' zns init\n'));
221
219
 
222
220
  } catch (error) {
223
221
  spinner.fail(chalk.red('❌ Error creando proyecto'));
@@ -247,10 +245,10 @@ Este proyecto ha sido creado con la estructura base de AWC ZNS-MTD.
247
245
  ### 1. Inicializar Tipo de Proyecto
248
246
 
249
247
  \`\`\`bash
250
- awc init
248
+ zns init
251
249
  \`\`\`
252
250
 
253
- El comando \`awc init\` te preguntará:
251
+ El comando \`zns init\` te preguntará:
254
252
  - Tipo de proyecto (auditoría, desarrollo nuevo, migración, etc.)
255
253
  - Tecnologías a utilizar
256
254
  - Tipo de workflow (quick, standard, enterprise)
@@ -278,16 +276,16 @@ El directorio \`.awc/\` contiene:
278
276
 
279
277
  \`\`\`bash
280
278
  # Inicializar proyecto (siguiente paso)
281
- awc init
279
+ zns init
282
280
 
283
281
  # Ver estado del proyecto
284
- awc status
282
+ zns status
285
283
 
286
284
  # Validar estructura
287
- awc validate
285
+ zns validate
288
286
 
289
287
  # Ver configuración
290
- awc config
288
+ zns config
291
289
  \`\`\`
292
290
 
293
291
  ---
@@ -370,12 +368,12 @@ Tu proyecto ha sido creado con la **estructura base** de AWC ZNS-MTD.
370
368
  Ejecuta el comando de inicialización:
371
369
 
372
370
  \`\`\`bash
373
- awc init
371
+ zns init
374
372
  \`\`\`
375
373
 
376
- ### 🔍 ¿Qué hace \`awc init\`?
374
+ ### 🔍 ¿Qué hace \`zns init\`?
377
375
 
378
- El comando \`awc init\` te preguntará:
376
+ El comando \`zns init\` te preguntará:
379
377
 
380
378
  #### 1️⃣ Tipo de Proyecto
381
379
  - **🔍 Auditoría de Código Existente**: Evaluar sistema legacy
@@ -396,7 +394,7 @@ El comando \`awc init\` te preguntará:
396
394
  - Frontend: React, Angular, Vue
397
395
  - Base de datos: SQL, NoSQL
398
396
 
399
- ### ✅ Resultado de \`awc init\`
397
+ ### ✅ Resultado de \`zns init\`
400
398
 
401
399
  Basado en tus respuestas, creará automáticamente:
402
400
 
@@ -447,16 +445,16 @@ proyecto/
447
445
 
448
446
  \`\`\`bash
449
447
  # Inicializar proyecto
450
- awc init
448
+ zns init
451
449
 
452
450
  # Ver estado actual
453
- awc status
451
+ zns status
454
452
 
455
453
  # Validar estructura
456
- awc validate
454
+ zns validate
457
455
 
458
456
  # Ver configuración
459
- awc config
457
+ zns config
460
458
  \`\`\`
461
459
 
462
460
  ### 📚 Más Información
@@ -554,4 +552,108 @@ async function createVSCodeConfig(projectPath, projectName) {
554
552
  );
555
553
  }
556
554
 
555
+ /**
556
+ * Genera copilot-instructions.md con agentes embebidos
557
+ */
558
+ async function generateCopilotInstructions(projectPath) {
559
+ const yaml = require('js-yaml');
560
+ const agentsPath = path.join(projectPath, '.awc/agents');
561
+
562
+ let content = `# GitHub Copilot - AWC ZNS-MTD Method
563
+
564
+ > **Instrucciones para GitHub Copilot**: Este proyecto utiliza el método AWC ZNS-MTD con agentes especializados.
565
+
566
+ ## 🎯 Agentes Disponibles
567
+
568
+ Los siguientes agentes están disponibles en este proyecto. Cada agente tiene un rol específico y expertise técnica.
569
+
570
+ `;
571
+
572
+ // Leer agentes base
573
+ const baseAgents = await fs.readdir(agentsPath);
574
+ for (const agentFile of baseAgents.filter(f => f.endsWith('.agent.yaml'))) {
575
+ try {
576
+ const agentPath = path.join(agentsPath, agentFile);
577
+ const agentContent = await fs.readFile(agentPath, 'utf8');
578
+ const agentData = yaml.load(agentContent);
579
+
580
+ if (agentData && agentData.agent) {
581
+ const meta = agentData.agent.metadata || {};
582
+ const persona = agentData.agent.persona || {};
583
+
584
+ content += `### ${meta.icon || '🤖'} ${meta.name || agentFile}
585
+
586
+ **ID**: \`${meta.id || 'unknown'}\`
587
+ **Cuándo usar**: ${meta.whenToUse || 'No especificado'}
588
+
589
+ `;
590
+
591
+ if (persona.role) {
592
+ content += `**Rol**: ${persona.role}\n\n`;
593
+ }
594
+
595
+ if (persona.identity) {
596
+ content += `**Identidad**: ${persona.identity}\n\n`;
597
+ }
598
+
599
+ content += `---\n\n`;
600
+ }
601
+ } catch (error) {
602
+ console.error(`Error leyendo agente ${agentFile}:`, error.message);
603
+ }
604
+ }
605
+
606
+ // Leer agentes especializados si existen
607
+ const specializedPath = path.join(agentsPath, 'specialized');
608
+ if (await fs.pathExists(specializedPath)) {
609
+ content += `## 🔧 Agentes Especializados
610
+
611
+ `;
612
+ const specializedAgents = await fs.readdir(specializedPath);
613
+ for (const agentFile of specializedAgents.filter(f => f.endsWith('.agent.yaml'))) {
614
+ try {
615
+ const agentPath = path.join(specializedPath, agentFile);
616
+ const agentContent = await fs.readFile(agentPath, 'utf8');
617
+ const agentData = yaml.load(agentContent);
618
+
619
+ if (agentData && agentData.agent) {
620
+ const meta = agentData.agent.metadata || {};
621
+
622
+ content += `- **${meta.icon || '🔧'} ${meta.name || agentFile}** (\`${meta.id || 'unknown'}\`): ${meta.whenToUse || 'Agente especializado'}\n`;
623
+ }
624
+ } catch (error) {
625
+ console.error(`Error leyendo agente especializado ${agentFile}:`, error.message);
626
+ }
627
+ }
628
+ }
629
+
630
+ content += `
631
+
632
+ ## 📋 Instrucciones Generales
633
+
634
+ Al trabajar en este proyecto:
635
+
636
+ 1. **Consulta el agente apropiado** según la tarea (ver lista arriba)
637
+ 2. **Sigue la metodología ZNS-MTD**: Zen (claro), Neutro (objetivo), Sistemático (documentado)
638
+ 3. **Usa los templates** disponibles en \`.awc/templates/\`
639
+ 4. **Documenta decisiones** arquitectónicas importantes
640
+ 5. **Mantén trazabilidad** de cambios y motivaciones
641
+
642
+ ## 🚀 Comandos Disponibles
643
+
644
+ \`\`\`bash
645
+ zns init # Inicializar tipo de proyecto
646
+ zns status # Ver estado del proyecto
647
+ zns validate # Validar estructura
648
+ zns config # Configurar preferencias
649
+ \`\`\`
650
+
651
+ ---
652
+
653
+ *Generado automáticamente por AWC ZNS-MTD*
654
+ `;
655
+
656
+ return content;
657
+ }
658
+
557
659
  module.exports = { newProjectCommand };
@@ -21,7 +21,7 @@ async function statusCommand(options = {}) {
21
21
  // Verificar si está instalado
22
22
  if (!(await fs.pathExists(awcDir))) {
23
23
  console.log(chalk.red('❌ AWC ZNS-MTD no está instalado en este proyecto.'));
24
- console.log(chalk.yellow(`\n💡 Ejecuta ${chalk.green('awc install')} para comenzar.\n`));
24
+ console.log(chalk.yellow(`\n💡 Ejecuta ${chalk.green('zns install')} para comenzar.\n`));
25
25
  return;
26
26
  }
27
27
 
@@ -113,16 +113,16 @@ async function statusCommand(options = {}) {
113
113
  console.log(chalk.green(' ✅ Sistema AWC ZNS-MTD funcionando correctamente'));
114
114
  } else {
115
115
  console.log(chalk.yellow(' ⚠️ Algunos componentes están faltando'));
116
- console.log(chalk.gray(` Ejecuta ${chalk.green('awc install --force')} para reparar`));
116
+ console.log(chalk.gray(` Ejecuta ${chalk.green('zns install --force')} para reparar`));
117
117
  }
118
118
 
119
119
  console.log(chalk.gray('─'.repeat(60)));
120
120
 
121
121
  // Comandos sugeridos
122
122
  console.log(chalk.cyan('\n💡 Comandos útiles:\n'));
123
- console.log(` ${chalk.green('awc init')} - Analizar proyecto y recomendar workflow`);
124
- console.log(` ${chalk.green('awc config')} - Configurar preferencias`);
125
- console.log(` ${chalk.green('awc validate')} - Validar estructura del proyecto\n`);
123
+ console.log(` ${chalk.green('zns init')} - Analizar proyecto y recomendar workflow`);
124
+ console.log(` ${chalk.green('zns config')} - Configurar preferencias`);
125
+ console.log(` ${chalk.green('zns validate')} - Validar estructura del proyecto\n`);
126
126
  }
127
127
 
128
128
  module.exports = { statusCommand };
@@ -137,10 +137,10 @@ async function validateCommand() {
137
137
  console.log(chalk.green('✅ ¡Proyecto AWC ZNS-MTD totalmente válido!\n'));
138
138
  } else if (errors.length === 0) {
139
139
  console.log(chalk.yellow('⚠️ Proyecto válido con algunas advertencias\n'));
140
- console.log(chalk.gray(` Ejecuta ${chalk.green('awc install --force')} para reparar\n`));
140
+ console.log(chalk.gray(` Ejecuta ${chalk.green('zns install --force')} para reparar\n`));
141
141
  } else {
142
142
  console.log(chalk.red('❌ Proyecto tiene errores que requieren atención\n'));
143
- console.log(chalk.gray(` Ejecuta ${chalk.green('awc install --force')} para reparar\n`));
143
+ console.log(chalk.gray(` Ejecuta ${chalk.green('zns install --force')} para reparar\n`));
144
144
  }
145
145
  }
146
146
 
@@ -47,7 +47,7 @@ async function createConfigFile(awcDir, config) {
47
47
  * Carga configuración desde archivo JSON o YAML
48
48
  */
49
49
  async function loadConfig(awcDir) {
50
- // Intentar primero JSON (usado por awc new)
50
+ // Intentar primero JSON (usado por zns new)
51
51
  const configJsonPath = path.join(awcDir, 'config.json');
52
52
  if (await fs.pathExists(configJsonPath)) {
53
53
  try {