awc-zns-mtd 2.7.0 → 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
|
@@ -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.
|
|
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
|
|
176
|
-
|
|
177
|
-
|
|
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);
|
|
@@ -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 };
|