awc-zns-mtd 2.0.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.
- package/.editorconfig +21 -0
- package/CHANGELOG.md +210 -0
- package/LICENSE +21 -0
- package/README.md +439 -0
- package/docs/examples/example-feature.md +94 -0
- package/docs/getting-started/quick-start.md +85 -0
- package/docs/guides/agent-guide.md +56 -0
- package/docs/guides/workflow-guide.md +49 -0
- package/docs/reference/commands-reference.md +93 -0
- package/docs/reference/methodology-design.md +193 -0
- package/package.json +66 -0
- package/src/modules/awc-zns-mtd/agents/architect-senior.agent.yaml +159 -0
- package/src/modules/awc-zns-mtd/agents/developer-pro.agent.yaml +197 -0
- package/src/modules/awc-zns-mtd/agents/qa-specialist.agent.yaml +225 -0
- package/src/modules/awc-zns-mtd/agents/zen-master.agent.yaml +142 -0
- package/src/modules/awc-zns-mtd/config.yaml +412 -0
- package/src/modules/awc-zns-mtd/templates/PRD-template.md +490 -0
- package/src/modules/awc-zns-mtd/templates/arquitectura-conceptual.md +431 -0
- package/src/modules/awc-zns-mtd/templates/cotizacion.md +333 -0
- package/src/modules/awc-zns-mtd/templates/discovery-notes.md +205 -0
- package/src/modules/awc-zns-mtd/templates/kickoff-agenda.md +297 -0
- package/src/modules/awc-zns-mtd/templates/oferta-comercial.md +279 -0
- package/src/modules/awc-zns-mtd/templates/viabilidad.md +281 -0
- package/src/modules/awc-zns-mtd/workflows/analisis-flow/workflow.yaml +500 -0
- package/src/modules/awc-zns-mtd/workflows/comercial-flow/workflow.yaml +444 -0
- package/src/modules/awc-zns-mtd/workflows/deployment-flow/workflow.yaml +395 -0
- package/src/modules/awc-zns-mtd/workflows/development-flow/workflow.yaml +321 -0
- package/src/modules/awc-zns-mtd/workflows/enterprise-flow/workflow.yaml +276 -0
- package/src/modules/awc-zns-mtd/workflows/inception-flow/workflow.yaml +588 -0
- package/src/modules/awc-zns-mtd/workflows/planificacion-flow/workflow.yaml +526 -0
- package/src/modules/awc-zns-mtd/workflows/qa-flow/workflow.yaml +291 -0
- package/src/modules/awc-zns-mtd/workflows/quick-flow/workflow.yaml +121 -0
- package/src/modules/awc-zns-mtd/workflows/standard-flow/workflow.yaml +181 -0
- package/src/modules/awc-zns-mtd/workflows/support-flow/workflow.yaml +438 -0
- package/src/modules/custom-agents/ARCHITECTURE.md +566 -0
- package/src/modules/custom-agents/CONVERSION_SUMMARY.md +315 -0
- package/src/modules/custom-agents/FINAL_SUMMARY.md +296 -0
- package/src/modules/custom-agents/README.md +628 -0
- package/src/modules/custom-agents/USAGE_GUIDE.md +306 -0
- package/src/modules/custom-agents/agents/aspnet-core-architect-senior.agent.yaml +368 -0
- package/src/modules/custom-agents/agents/backend-audit-master.agent.yaml +376 -0
- package/src/modules/custom-agents/agents/backend-java-senior.agent.yaml +606 -0
- package/src/modules/custom-agents/agents/c4-diagram-specialist.agent.yaml +345 -0
- package/src/modules/custom-agents/agents/consolidation-context-master.agent.yaml +318 -0
- package/src/modules/custom-agents/agents/cost-estimator-senior.agent.yaml +369 -0
- package/src/modules/custom-agents/agents/database-engineer-senior.agent.yaml +331 -0
- package/src/modules/custom-agents/agents/devsecops-onpremise-senior.agent.yaml +370 -0
- package/src/modules/custom-agents/agents/document-export-specialist.agent.yaml +355 -0
- package/src/modules/custom-agents/agents/dotnet-core-senior.agent.yaml +258 -0
- package/src/modules/custom-agents/agents/frontend-audit-master.agent.yaml +356 -0
- package/src/modules/custom-agents/agents/frontend-react-senior.agent.yaml +470 -0
- package/src/modules/custom-agents/agents/obsolescence-analyst-senior.agent.yaml +339 -0
- package/src/modules/custom-agents/agents/php-senior.agent.yaml +277 -0
- package/src/modules/custom-agents/agents/product-owner-business-analyst.agent.yaml +315 -0
- package/src/modules/custom-agents/agents/prompt-architect-senior.agent.yaml +398 -0
- package/src/modules/custom-agents/agents/prompt-engineer-senior.agent.yaml +431 -0
- package/src/modules/custom-agents/agents/python-senior.agent.yaml +347 -0
- package/src/modules/custom-agents/agents/react-native-senior.agent.yaml +292 -0
- package/src/modules/custom-agents/agents/solution-architect-senior.agent.yaml +496 -0
- package/src/modules/custom-agents/agents/technical-stories-architect.agent.yaml +402 -0
- package/src/modules/custom-agents/agents/validation-quality-master.agent.yaml +377 -0
- package/src/modules/custom-agents/cli/.awc-agents/aspnet-core-architect-senior.agent.yaml +368 -0
- package/src/modules/custom-agents/cli/.awc-agents/backend-audit-master.agent.yaml +376 -0
- package/src/modules/custom-agents/cli/.awc-agents/backend-java-senior.agent.yaml +606 -0
- package/src/modules/custom-agents/cli/.awc-agents/c4-diagram-specialist.agent.yaml +345 -0
- package/src/modules/custom-agents/cli/.awc-agents/consolidation-context-master.agent.yaml +318 -0
- package/src/modules/custom-agents/cli/.awc-agents/cost-estimator-senior.agent.yaml +369 -0
- package/src/modules/custom-agents/cli/.awc-agents/database-engineer-senior.agent.yaml +331 -0
- package/src/modules/custom-agents/cli/.awc-agents/devsecops-onpremise-senior.agent.yaml +370 -0
- package/src/modules/custom-agents/cli/.awc-agents/document-export-specialist.agent.yaml +355 -0
- package/src/modules/custom-agents/cli/.awc-agents/dotnet-core-senior.agent.yaml +258 -0
- package/src/modules/custom-agents/cli/.awc-agents/frontend-audit-master.agent.yaml +356 -0
- package/src/modules/custom-agents/cli/.awc-agents/frontend-react-senior.agent.yaml +470 -0
- package/src/modules/custom-agents/cli/.awc-agents/obsolescence-analyst-senior.agent.yaml +339 -0
- package/src/modules/custom-agents/cli/.awc-agents/php-senior.agent.yaml +277 -0
- package/src/modules/custom-agents/cli/.awc-agents/product-owner-business-analyst.agent.yaml +315 -0
- package/src/modules/custom-agents/cli/.awc-agents/prompt-architect-senior.agent.yaml +398 -0
- package/src/modules/custom-agents/cli/.awc-agents/prompt-engineer-senior.agent.yaml +431 -0
- package/src/modules/custom-agents/cli/.awc-agents/python-senior.agent.yaml +347 -0
- package/src/modules/custom-agents/cli/.awc-agents/react-native-senior.agent.yaml +292 -0
- package/src/modules/custom-agents/cli/.awc-agents/solution-architect-senior.agent.yaml +496 -0
- package/src/modules/custom-agents/cli/.awc-agents/technical-stories-architect.agent.yaml +402 -0
- package/src/modules/custom-agents/cli/.awc-agents/validation-quality-master.agent.yaml +377 -0
- package/src/modules/custom-agents/cli/CHANGELOG.md +77 -0
- package/src/modules/custom-agents/cli/LICENSE +21 -0
- package/src/modules/custom-agents/cli/PUBLISH.md +292 -0
- package/src/modules/custom-agents/cli/README.md +333 -0
- package/src/modules/custom-agents/cli/agents-data/aspnet-core-architect-senior.agent.yaml +368 -0
- package/src/modules/custom-agents/cli/agents-data/backend-audit-master.agent.yaml +376 -0
- package/src/modules/custom-agents/cli/agents-data/backend-java-senior.agent.yaml +606 -0
- package/src/modules/custom-agents/cli/agents-data/c4-diagram-specialist.agent.yaml +345 -0
- package/src/modules/custom-agents/cli/agents-data/consolidation-context-master.agent.yaml +318 -0
- package/src/modules/custom-agents/cli/agents-data/cost-estimator-senior.agent.yaml +369 -0
- package/src/modules/custom-agents/cli/agents-data/database-engineer-senior.agent.yaml +331 -0
- package/src/modules/custom-agents/cli/agents-data/devsecops-onpremise-senior.agent.yaml +370 -0
- package/src/modules/custom-agents/cli/agents-data/document-export-specialist.agent.yaml +355 -0
- package/src/modules/custom-agents/cli/agents-data/dotnet-core-senior.agent.yaml +258 -0
- package/src/modules/custom-agents/cli/agents-data/frontend-audit-master.agent.yaml +356 -0
- package/src/modules/custom-agents/cli/agents-data/frontend-react-senior.agent.yaml +470 -0
- package/src/modules/custom-agents/cli/agents-data/obsolescence-analyst-senior.agent.yaml +339 -0
- package/src/modules/custom-agents/cli/agents-data/php-senior.agent.yaml +277 -0
- package/src/modules/custom-agents/cli/agents-data/product-owner-business-analyst.agent.yaml +315 -0
- package/src/modules/custom-agents/cli/agents-data/prompt-architect-senior.agent.yaml +398 -0
- package/src/modules/custom-agents/cli/agents-data/prompt-engineer-senior.agent.yaml +431 -0
- package/src/modules/custom-agents/cli/agents-data/python-senior.agent.yaml +347 -0
- package/src/modules/custom-agents/cli/agents-data/react-native-senior.agent.yaml +292 -0
- package/src/modules/custom-agents/cli/agents-data/solution-architect-senior.agent.yaml +496 -0
- package/src/modules/custom-agents/cli/agents-data/technical-stories-architect.agent.yaml +402 -0
- package/src/modules/custom-agents/cli/agents-data/validation-quality-master.agent.yaml +377 -0
- package/src/modules/custom-agents/cli/awc-agent.js +372 -0
- package/src/modules/custom-agents/cli/config.yaml +478 -0
- package/src/modules/custom-agents/cli/package.json +63 -0
- package/src/modules/custom-agents/config.yaml +478 -0
- package/templates/.github/copilot-instructions.md +120 -0
- package/tools/cli/awc-cli.js +137 -0
- package/tools/cli/commands/config.js +148 -0
- package/tools/cli/commands/init.js +147 -0
- package/tools/cli/commands/install.js +188 -0
- package/tools/cli/commands/status.js +128 -0
- package/tools/cli/commands/validate.js +147 -0
- package/tools/cli/commands/version.js +49 -0
- package/tools/cli/utils/console-logger.js +153 -0
- package/tools/cli/utils/file-utils.js +178 -0
- package/tools/cli/utils/project-analyzer.js +280 -0
- package/tools/cli/utils/version.js +126 -0
- package/tools/version/README.md +272 -0
- package/tools/version/changelog-manager.js +288 -0
- package/tools/version/update-checker.js +234 -0
- package/tools/version/version-bump.js +90 -0
- package/tools/version/version-manager.js +224 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comando: status
|
|
3
|
+
* Muestra el estado actual del proyecto ZNS-MTD
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs-extra');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
const { loadConfig } = require('../utils/file-utils');
|
|
10
|
+
const { displayLogo } = require('../utils/console-logger');
|
|
11
|
+
|
|
12
|
+
async function statusCommand(options = {}) {
|
|
13
|
+
const cwd = process.cwd();
|
|
14
|
+
const awcDir = path.join(cwd, '.awc');
|
|
15
|
+
const verbose = options.verbose || false;
|
|
16
|
+
|
|
17
|
+
displayLogo();
|
|
18
|
+
|
|
19
|
+
console.log(chalk.cyan('\n📊 Estado del Proyecto AWC ZNS-MTD\n'));
|
|
20
|
+
|
|
21
|
+
// Verificar si está instalado
|
|
22
|
+
if (!(await fs.pathExists(awcDir))) {
|
|
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`));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Cargar configuración
|
|
29
|
+
const config = await loadConfig(awcDir);
|
|
30
|
+
|
|
31
|
+
if (!config) {
|
|
32
|
+
console.log(chalk.red('❌ Error al cargar configuración.'));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Información básica
|
|
37
|
+
console.log(chalk.cyan('🔧 Configuración:'));
|
|
38
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
39
|
+
console.log(` Versión instalada: ${chalk.yellow(config.version || 'N/A')}`);
|
|
40
|
+
console.log(` Instalado el: ${chalk.yellow(config.installedAt ? new Date(config.installedAt).toLocaleString('es-ES') : 'N/A')}`);
|
|
41
|
+
console.log(` Tipo de proyecto: ${chalk.yellow(config.projectType || 'N/A')}`);
|
|
42
|
+
console.log(` Tamaño de equipo: ${chalk.yellow(config.teamSize || 'N/A')}`);
|
|
43
|
+
console.log(` Nivel técnico: ${chalk.yellow(config.skillLevel || 'N/A')}`);
|
|
44
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
45
|
+
|
|
46
|
+
// Verificar estructura
|
|
47
|
+
console.log(chalk.cyan('\n📁 Estructura:'));
|
|
48
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
49
|
+
|
|
50
|
+
const agentsPath = path.join(awcDir, 'agents');
|
|
51
|
+
const workflowsPath = path.join(awcDir, 'workflows');
|
|
52
|
+
const docsPath = path.join(cwd, 'docs');
|
|
53
|
+
|
|
54
|
+
const agentsExist = await fs.pathExists(agentsPath);
|
|
55
|
+
const workflowsExist = await fs.pathExists(workflowsPath);
|
|
56
|
+
const docsExist = await fs.pathExists(docsPath);
|
|
57
|
+
|
|
58
|
+
console.log(` Agentes: ${agentsExist ? chalk.green('✓') : chalk.red('✗')} ${agentsPath}`);
|
|
59
|
+
console.log(` Workflows: ${workflowsExist ? chalk.green('✓') : chalk.red('✗')} ${workflowsPath}`);
|
|
60
|
+
console.log(` Docs: ${docsExist ? chalk.green('✓') : chalk.red('✗')} ${docsPath}`);
|
|
61
|
+
|
|
62
|
+
if (verbose) {
|
|
63
|
+
// Contar agentes
|
|
64
|
+
if (agentsExist) {
|
|
65
|
+
const agentFiles = await fs.readdir(agentsPath);
|
|
66
|
+
const yamlAgents = agentFiles.filter(f => f.endsWith('.yaml'));
|
|
67
|
+
console.log(chalk.gray(` → ${yamlAgents.length} agentes disponibles`));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Contar workflows
|
|
71
|
+
if (workflowsExist) {
|
|
72
|
+
const workflowDirs = await fs.readdir(workflowsPath);
|
|
73
|
+
console.log(chalk.gray(` → ${workflowDirs.length} workflows disponibles`));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
78
|
+
|
|
79
|
+
// Análisis de documentación
|
|
80
|
+
if (docsExist) {
|
|
81
|
+
console.log(chalk.cyan('\n📝 Documentación:'));
|
|
82
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
83
|
+
|
|
84
|
+
const adrPath = path.join(docsPath, 'adr');
|
|
85
|
+
const storiesPath = path.join(docsPath, 'stories');
|
|
86
|
+
const archPath = path.join(docsPath, 'architecture');
|
|
87
|
+
|
|
88
|
+
if (await fs.pathExists(adrPath)) {
|
|
89
|
+
const adrFiles = await fs.readdir(adrPath);
|
|
90
|
+
console.log(` ADRs: ${chalk.yellow(adrFiles.length)} documentos`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (await fs.pathExists(storiesPath)) {
|
|
94
|
+
const storyFiles = await fs.readdir(storiesPath);
|
|
95
|
+
console.log(` User Stories: ${chalk.yellow(storyFiles.length)} historias`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (await fs.pathExists(archPath)) {
|
|
99
|
+
const archFiles = await fs.readdir(archPath);
|
|
100
|
+
console.log(` Arquitectura: ${chalk.yellow(archFiles.length)} documentos`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Estado general
|
|
107
|
+
const allGood = agentsExist && workflowsExist && docsExist;
|
|
108
|
+
|
|
109
|
+
console.log(chalk.cyan('\n✨ Estado General:'));
|
|
110
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
111
|
+
|
|
112
|
+
if (allGood) {
|
|
113
|
+
console.log(chalk.green(' ✅ Sistema AWC ZNS-MTD funcionando correctamente'));
|
|
114
|
+
} else {
|
|
115
|
+
console.log(chalk.yellow(' ⚠️ Algunos componentes están faltando'));
|
|
116
|
+
console.log(chalk.gray(` Ejecuta ${chalk.green('awc install --force')} para reparar`));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
120
|
+
|
|
121
|
+
// Comandos sugeridos
|
|
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`);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
module.exports = { statusCommand };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comando: validate
|
|
3
|
+
* Valida la estructura y configuración del proyecto ZNS-MTD
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs-extra');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
const { loadConfig } = require('../utils/file-utils');
|
|
10
|
+
const { displayLogo } = require('../utils/console-logger');
|
|
11
|
+
|
|
12
|
+
async function validateCommand() {
|
|
13
|
+
const cwd = process.cwd();
|
|
14
|
+
const awcDir = path.join(cwd, '.awc');
|
|
15
|
+
|
|
16
|
+
displayLogo();
|
|
17
|
+
|
|
18
|
+
console.log(chalk.cyan('\n🔍 Validación del Proyecto ZNS-MTD\n'));
|
|
19
|
+
|
|
20
|
+
const errors = [];
|
|
21
|
+
const warnings = [];
|
|
22
|
+
let checksCount = 0;
|
|
23
|
+
let passedCount = 0;
|
|
24
|
+
|
|
25
|
+
// Check 1: Instalación
|
|
26
|
+
checksCount++;
|
|
27
|
+
if (await fs.pathExists(awcDir)) {
|
|
28
|
+
passedCount++;
|
|
29
|
+
console.log(chalk.green('✓') + ' Directorio .awc existe');
|
|
30
|
+
} else {
|
|
31
|
+
errors.push('Directorio .awc no encontrado');
|
|
32
|
+
console.log(chalk.red('✗') + ' Directorio .awc no encontrado');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Check 2: Configuración
|
|
36
|
+
checksCount++;
|
|
37
|
+
const config = await loadConfig(awcDir);
|
|
38
|
+
if (config) {
|
|
39
|
+
passedCount++;
|
|
40
|
+
console.log(chalk.green('✓') + ' Archivo de configuración válido');
|
|
41
|
+
} else {
|
|
42
|
+
errors.push('Archivo de configuración inválido o faltante');
|
|
43
|
+
console.log(chalk.red('✗') + ' Archivo de configuración inválido');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Check 3: Agentes
|
|
47
|
+
checksCount++;
|
|
48
|
+
const agentsPath = path.join(awcDir, 'agents');
|
|
49
|
+
if (await fs.pathExists(agentsPath)) {
|
|
50
|
+
const agentFiles = await fs.readdir(agentsPath);
|
|
51
|
+
const yamlAgents = agentFiles.filter(f => f.endsWith('.yaml'));
|
|
52
|
+
|
|
53
|
+
if (yamlAgents.length >= 4) {
|
|
54
|
+
passedCount++;
|
|
55
|
+
console.log(chalk.green('✓') + ` ${yamlAgents.length} agentes encontrados`);
|
|
56
|
+
} else {
|
|
57
|
+
warnings.push(`Solo ${yamlAgents.length} agentes encontrados (se esperan 4)`);
|
|
58
|
+
console.log(chalk.yellow('⚠') + ` Solo ${yamlAgents.length} agentes (se esperan 4)`);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
errors.push('Directorio de agentes no encontrado');
|
|
62
|
+
console.log(chalk.red('✗') + ' Directorio de agentes no encontrado');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Check 4: Workflows
|
|
66
|
+
checksCount++;
|
|
67
|
+
const workflowsPath = path.join(awcDir, 'workflows');
|
|
68
|
+
if (await fs.pathExists(workflowsPath)) {
|
|
69
|
+
const workflowDirs = await fs.readdir(workflowsPath);
|
|
70
|
+
|
|
71
|
+
if (workflowDirs.length >= 3) {
|
|
72
|
+
passedCount++;
|
|
73
|
+
console.log(chalk.green('✓') + ` ${workflowDirs.length} workflows encontrados`);
|
|
74
|
+
} else {
|
|
75
|
+
warnings.push(`Solo ${workflowDirs.length} workflows encontrados (se esperan 3)`);
|
|
76
|
+
console.log(chalk.yellow('⚠') + ` Solo ${workflowDirs.length} workflows (se esperan 3)`);
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
errors.push('Directorio de workflows no encontrado');
|
|
80
|
+
console.log(chalk.red('✗') + ' Directorio de workflows no encontrado');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Check 5: Documentación
|
|
84
|
+
checksCount++;
|
|
85
|
+
const docsPath = path.join(cwd, 'docs');
|
|
86
|
+
if (await fs.pathExists(docsPath)) {
|
|
87
|
+
passedCount++;
|
|
88
|
+
console.log(chalk.green('✓') + ' Directorio de documentación existe');
|
|
89
|
+
|
|
90
|
+
// Sub-checks de documentación
|
|
91
|
+
const adrPath = path.join(docsPath, 'adr');
|
|
92
|
+
const storiesPath = path.join(docsPath, 'stories');
|
|
93
|
+
const archPath = path.join(docsPath, 'architecture');
|
|
94
|
+
|
|
95
|
+
if (!(await fs.pathExists(adrPath))) {
|
|
96
|
+
warnings.push('Directorio de ADRs no encontrado');
|
|
97
|
+
}
|
|
98
|
+
if (!(await fs.pathExists(storiesPath))) {
|
|
99
|
+
warnings.push('Directorio de stories no encontrado');
|
|
100
|
+
}
|
|
101
|
+
if (!(await fs.pathExists(archPath))) {
|
|
102
|
+
warnings.push('Directorio de architecture no encontrado');
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
warnings.push('Directorio de documentación no encontrado');
|
|
106
|
+
console.log(chalk.yellow('⚠') + ' Directorio de documentación no encontrado');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Resumen
|
|
110
|
+
console.log(chalk.cyan('\n📊 Resumen de Validación:\n'));
|
|
111
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
112
|
+
console.log(` Total de checks: ${chalk.yellow(checksCount)}`);
|
|
113
|
+
console.log(` Pasados: ${chalk.green(passedCount)}`);
|
|
114
|
+
console.log(` Errores: ${chalk.red(errors.length)}`);
|
|
115
|
+
console.log(` Advertencias: ${chalk.yellow(warnings.length)}`);
|
|
116
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
117
|
+
|
|
118
|
+
// Errores
|
|
119
|
+
if (errors.length > 0) {
|
|
120
|
+
console.log(chalk.red('\n❌ Errores Encontrados:\n'));
|
|
121
|
+
errors.forEach((error, index) => {
|
|
122
|
+
console.log(` ${index + 1}. ${error}`);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Advertencias
|
|
127
|
+
if (warnings.length > 0) {
|
|
128
|
+
console.log(chalk.yellow('\n⚠️ Advertencias:\n'));
|
|
129
|
+
warnings.forEach((warning, index) => {
|
|
130
|
+
console.log(` ${index + 1}. ${warning}`);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Resultado final
|
|
135
|
+
console.log();
|
|
136
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
137
|
+
console.log(chalk.green('✅ ¡Proyecto AWC ZNS-MTD totalmente válido!\n'));
|
|
138
|
+
} else if (errors.length === 0) {
|
|
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`));
|
|
141
|
+
} else {
|
|
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`));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
module.exports = { validateCommand };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comando: version
|
|
3
|
+
* Verifica la versión instalada y actualizaciones disponibles
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
const semver = require('semver');
|
|
8
|
+
const { getVersion, checkForUpdates } = require('../utils/version');
|
|
9
|
+
const { displayLogo } = require('../utils/console-logger');
|
|
10
|
+
|
|
11
|
+
async function versionCommand() {
|
|
12
|
+
displayLogo();
|
|
13
|
+
|
|
14
|
+
console.log(chalk.cyan('\n🔍 Información de Versión\n'));
|
|
15
|
+
|
|
16
|
+
const currentVersion = getVersion();
|
|
17
|
+
|
|
18
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
19
|
+
console.log(` Versión actual: ${chalk.yellow(currentVersion)}`);
|
|
20
|
+
console.log(` Método: ${chalk.cyan('AWC ZNS-MTD')}`);
|
|
21
|
+
console.log(` Inspirado en: ${chalk.gray('BMAD Core V6')}`);
|
|
22
|
+
console.log(chalk.gray('─'.repeat(60)));
|
|
23
|
+
|
|
24
|
+
// Verificar actualizaciones
|
|
25
|
+
console.log(chalk.cyan('\n🔄 Verificando actualizaciones...'));
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const updateInfo = await checkForUpdates(currentVersion);
|
|
29
|
+
|
|
30
|
+
if (updateInfo.hasUpdate) {
|
|
31
|
+
console.log(chalk.yellow('\n⚠️ Nueva versión disponible!\n'));
|
|
32
|
+
console.log(` Actual: ${chalk.red(currentVersion)}`);
|
|
33
|
+
console.log(` Disponible: ${chalk.green(updateInfo.latestVersion)}`);
|
|
34
|
+
console.log(`\n💡 Actualiza con: ${chalk.green('npm install -g awc-zns-mtd@latest')}\n`);
|
|
35
|
+
} else {
|
|
36
|
+
console.log(chalk.green('\n✅ Estás usando la versión más reciente\n'));
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.log(chalk.gray('\n No se pudo verificar actualizaciones (sin conexión)\n'));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Información adicional
|
|
43
|
+
console.log(chalk.cyan('📚 Más información:\n'));
|
|
44
|
+
console.log(` Documentación: ${chalk.blue('https://github.com/awc/awc-zns-mtd')}`);
|
|
45
|
+
console.log(` Issues: ${chalk.blue('https://github.com/awc/awc-zns-mtd/issues')}`);
|
|
46
|
+
console.log(` Changelog: ${chalk.blue('https://github.com/awc/awc-zns-mtd/blob/main/CHANGELOG.md')}\n`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = { versionCommand };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console Logger
|
|
3
|
+
* Utilidades para mostrar mensajes formateados en consola
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Muestra el logo de AWC ZNS-MTD
|
|
10
|
+
*/
|
|
11
|
+
function displayLogo() {
|
|
12
|
+
console.log();
|
|
13
|
+
console.log(chalk.cyan('╔═══════════════════════════════════════════════════════════╗'));
|
|
14
|
+
console.log(chalk.cyan('║') + chalk.bold.white(' AWC ZNS-MTD ') + chalk.cyan('║'));
|
|
15
|
+
console.log(chalk.cyan('║') + chalk.gray(' Zen · Neutro · Sistemático Method ') + chalk.cyan('║'));
|
|
16
|
+
console.log(chalk.cyan('╚═══════════════════════════════════════════════════════════╝'));
|
|
17
|
+
console.log();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Muestra un mensaje de éxito
|
|
22
|
+
*/
|
|
23
|
+
function logSuccess(message) {
|
|
24
|
+
console.log(chalk.green('✓') + ' ' + message);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Muestra un mensaje de error
|
|
29
|
+
*/
|
|
30
|
+
function logError(message) {
|
|
31
|
+
console.log(chalk.red('✗') + ' ' + message);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Muestra un mensaje de advertencia
|
|
36
|
+
*/
|
|
37
|
+
function logWarning(message) {
|
|
38
|
+
console.log(chalk.yellow('⚠') + ' ' + message);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Muestra un mensaje informativo
|
|
43
|
+
*/
|
|
44
|
+
function logInfo(message) {
|
|
45
|
+
console.log(chalk.blue('ℹ') + ' ' + message);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Muestra un separador
|
|
50
|
+
*/
|
|
51
|
+
function logSeparator(length = 60) {
|
|
52
|
+
console.log(chalk.gray('─'.repeat(length)));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Muestra un título de sección
|
|
57
|
+
*/
|
|
58
|
+
function logSection(title) {
|
|
59
|
+
console.log();
|
|
60
|
+
console.log(chalk.cyan.bold(title));
|
|
61
|
+
logSeparator();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Muestra un mensaje de progreso
|
|
66
|
+
*/
|
|
67
|
+
function logProgress(current, total, message) {
|
|
68
|
+
const percentage = Math.round((current / total) * 100);
|
|
69
|
+
const bar = '█'.repeat(Math.floor(percentage / 5)) + '░'.repeat(20 - Math.floor(percentage / 5));
|
|
70
|
+
console.log(`[${chalk.cyan(bar)}] ${percentage}% ${message}`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Muestra una tabla simple
|
|
75
|
+
*/
|
|
76
|
+
function logTable(data) {
|
|
77
|
+
const maxKeyLength = Math.max(...data.map(item => item.key.length));
|
|
78
|
+
|
|
79
|
+
data.forEach(item => {
|
|
80
|
+
const paddedKey = item.key.padEnd(maxKeyLength + 2);
|
|
81
|
+
console.log(` ${chalk.gray(paddedKey)} ${chalk.yellow(item.value)}`);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Muestra un mensaje de bienvenida
|
|
87
|
+
*/
|
|
88
|
+
function displayWelcome(projectName) {
|
|
89
|
+
console.log();
|
|
90
|
+
console.log(chalk.cyan('╔═══════════════════════════════════════════════════════════╗'));
|
|
91
|
+
console.log(chalk.cyan('║') + chalk.bold.white(` Bienvenido a ${projectName}`.padEnd(58)) + chalk.cyan('║'));
|
|
92
|
+
console.log(chalk.cyan('╚═══════════════════════════════════════════════════════════╝'));
|
|
93
|
+
console.log();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Muestra comandos disponibles
|
|
98
|
+
*/
|
|
99
|
+
function displayCommands(commands) {
|
|
100
|
+
console.log(chalk.cyan('\n💡 Comandos disponibles:\n'));
|
|
101
|
+
|
|
102
|
+
commands.forEach(cmd => {
|
|
103
|
+
const command = chalk.green(cmd.command.padEnd(20));
|
|
104
|
+
const description = chalk.gray(cmd.description);
|
|
105
|
+
console.log(` ${command} ${description}`);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
console.log();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Muestra filosofía ZNS
|
|
113
|
+
*/
|
|
114
|
+
function displayZnsPhilosophy() {
|
|
115
|
+
console.log(chalk.cyan('\n📖 Filosofía ZNS-MTD:\n'));
|
|
116
|
+
console.log(chalk.yellow(' ZEN') + chalk.gray(' → Claridad, simplicidad deliberada, ruido mínimo'));
|
|
117
|
+
console.log(chalk.yellow(' NEUTRO') + chalk.gray(' → Objetividad, decisiones basadas en evidencia'));
|
|
118
|
+
console.log(chalk.yellow(' SISTEMÁTICO') + chalk.gray(' → Procesos repetibles, documentación rigurosa'));
|
|
119
|
+
console.log();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Muestra banner de finalización
|
|
124
|
+
*/
|
|
125
|
+
function displayCompletionBanner(success = true) {
|
|
126
|
+
console.log();
|
|
127
|
+
if (success) {
|
|
128
|
+
console.log(chalk.green('╔═══════════════════════════════════════════════════════════╗'));
|
|
129
|
+
console.log(chalk.green('║') + chalk.bold.white(' ✅ PROCESO COMPLETADO ') + chalk.green('║'));
|
|
130
|
+
console.log(chalk.green('╚═══════════════════════════════════════════════════════════╝'));
|
|
131
|
+
} else {
|
|
132
|
+
console.log(chalk.red('╔═══════════════════════════════════════════════════════════╗'));
|
|
133
|
+
console.log(chalk.red('║') + chalk.bold.white(' ❌ PROCESO FALLIDO ') + chalk.red('║'));
|
|
134
|
+
console.log(chalk.red('╚═══════════════════════════════════════════════════════════╝'));
|
|
135
|
+
}
|
|
136
|
+
console.log();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
module.exports = {
|
|
140
|
+
displayLogo,
|
|
141
|
+
logSuccess,
|
|
142
|
+
logError,
|
|
143
|
+
logWarning,
|
|
144
|
+
logInfo,
|
|
145
|
+
logSeparator,
|
|
146
|
+
logSection,
|
|
147
|
+
logProgress,
|
|
148
|
+
logTable,
|
|
149
|
+
displayWelcome,
|
|
150
|
+
displayCommands,
|
|
151
|
+
displayZnsPhilosophy,
|
|
152
|
+
displayCompletionBanner
|
|
153
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Utilities
|
|
3
|
+
* Utilidades para manejo de archivos y directorios
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs-extra');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const yaml = require('js-yaml');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copia agentes desde src hacia destino
|
|
12
|
+
*/
|
|
13
|
+
async function copyAgents(srcPath, destPath) {
|
|
14
|
+
await fs.ensureDir(destPath);
|
|
15
|
+
await fs.copy(srcPath, destPath, {
|
|
16
|
+
overwrite: true,
|
|
17
|
+
filter: (src) => {
|
|
18
|
+
return src.endsWith('.yaml') || fs.statSync(src).isDirectory();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Copia workflows desde src hacia destino
|
|
25
|
+
*/
|
|
26
|
+
async function copyWorkflows(srcPath, destPath) {
|
|
27
|
+
await fs.ensureDir(destPath);
|
|
28
|
+
await fs.copy(srcPath, destPath, {
|
|
29
|
+
overwrite: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Crea archivo de configuración en formato YAML
|
|
35
|
+
*/
|
|
36
|
+
async function createConfigFile(awcDir, config) {
|
|
37
|
+
const configPath = path.join(awcDir, 'config.yaml');
|
|
38
|
+
const yamlContent = yaml.dump(config, {
|
|
39
|
+
indent: 2,
|
|
40
|
+
lineWidth: 80,
|
|
41
|
+
noRefs: true
|
|
42
|
+
});
|
|
43
|
+
await fs.writeFile(configPath, yamlContent, 'utf8');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Carga configuración desde archivo YAML
|
|
48
|
+
*/
|
|
49
|
+
async function loadConfig(awcDir) {
|
|
50
|
+
const configPath = path.join(awcDir, 'config.yaml');
|
|
51
|
+
|
|
52
|
+
if (!(await fs.pathExists(configPath))) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const content = await fs.readFile(configPath, 'utf8');
|
|
58
|
+
return yaml.load(content);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error('Error al cargar configuración:', error.message);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Actualiza configuración existente
|
|
67
|
+
*/
|
|
68
|
+
async function updateConfig(awcDir, newConfig) {
|
|
69
|
+
await createConfigFile(awcDir, newConfig);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Lee un archivo YAML
|
|
74
|
+
*/
|
|
75
|
+
async function readYamlFile(filePath) {
|
|
76
|
+
try {
|
|
77
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
78
|
+
return yaml.load(content);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error(`Error al leer ${filePath}:`, error.message);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Escribe un archivo YAML
|
|
87
|
+
*/
|
|
88
|
+
async function writeYamlFile(filePath, data) {
|
|
89
|
+
const yamlContent = yaml.dump(data, {
|
|
90
|
+
indent: 2,
|
|
91
|
+
lineWidth: 80,
|
|
92
|
+
noRefs: true
|
|
93
|
+
});
|
|
94
|
+
await fs.writeFile(filePath, yamlContent, 'utf8');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Busca archivos recursivamente con un patrón
|
|
99
|
+
*/
|
|
100
|
+
async function findFiles(dir, pattern) {
|
|
101
|
+
const results = [];
|
|
102
|
+
|
|
103
|
+
if (!(await fs.pathExists(dir))) {
|
|
104
|
+
return results;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const items = await fs.readdir(dir, { withFileTypes: true });
|
|
108
|
+
|
|
109
|
+
for (const item of items) {
|
|
110
|
+
const fullPath = path.join(dir, item.name);
|
|
111
|
+
|
|
112
|
+
if (item.isDirectory()) {
|
|
113
|
+
const subResults = await findFiles(fullPath, pattern);
|
|
114
|
+
results.push(...subResults);
|
|
115
|
+
} else if (item.isFile() && item.name.match(pattern)) {
|
|
116
|
+
results.push(fullPath);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return results;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Cuenta archivos en un directorio recursivamente
|
|
125
|
+
*/
|
|
126
|
+
async function countFiles(dir, extensions = []) {
|
|
127
|
+
let count = 0;
|
|
128
|
+
|
|
129
|
+
if (!(await fs.pathExists(dir))) {
|
|
130
|
+
return count;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const items = await fs.readdir(dir, { withFileTypes: true });
|
|
134
|
+
|
|
135
|
+
for (const item of items) {
|
|
136
|
+
const fullPath = path.join(dir, item.name);
|
|
137
|
+
|
|
138
|
+
if (item.isDirectory()) {
|
|
139
|
+
count += await countFiles(fullPath, extensions);
|
|
140
|
+
} else if (item.isFile()) {
|
|
141
|
+
if (extensions.length === 0) {
|
|
142
|
+
count++;
|
|
143
|
+
} else {
|
|
144
|
+
const ext = path.extname(item.name);
|
|
145
|
+
if (extensions.includes(ext)) {
|
|
146
|
+
count++;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return count;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Verifica si un directorio está vacío
|
|
157
|
+
*/
|
|
158
|
+
async function isDirectoryEmpty(dir) {
|
|
159
|
+
if (!(await fs.pathExists(dir))) {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const items = await fs.readdir(dir);
|
|
164
|
+
return items.length === 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
module.exports = {
|
|
168
|
+
copyAgents,
|
|
169
|
+
copyWorkflows,
|
|
170
|
+
createConfigFile,
|
|
171
|
+
loadConfig,
|
|
172
|
+
updateConfig,
|
|
173
|
+
readYamlFile,
|
|
174
|
+
writeYamlFile,
|
|
175
|
+
findFiles,
|
|
176
|
+
countFiles,
|
|
177
|
+
isDirectoryEmpty
|
|
178
|
+
};
|