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,372 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AWC Agent CLI - Gestión automática de agentes custom
|
|
5
|
+
* Framework: AWC-ZNS-MTD v1.0.0
|
|
6
|
+
* Uso: awc-agent <comando> [opciones]
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const yaml = require('js-yaml');
|
|
12
|
+
|
|
13
|
+
// Colores para terminal (expandidos)
|
|
14
|
+
const colors = {
|
|
15
|
+
reset: '\x1b[0m',
|
|
16
|
+
bright: '\x1b[1m',
|
|
17
|
+
dim: '\x1b[2m',
|
|
18
|
+
cyan: '\x1b[36m',
|
|
19
|
+
green: '\x1b[32m',
|
|
20
|
+
yellow: '\x1b[33m',
|
|
21
|
+
blue: '\x1b[34m',
|
|
22
|
+
magenta: '\x1b[35m',
|
|
23
|
+
red: '\x1b[31m',
|
|
24
|
+
white: '\x1b[37m',
|
|
25
|
+
bgCyan: '\x1b[46m',
|
|
26
|
+
bgGreen: '\x1b[42m',
|
|
27
|
+
bgBlue: '\x1b[44m'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Logo AWC
|
|
31
|
+
function displayLogo() {
|
|
32
|
+
console.log();
|
|
33
|
+
console.log(colors.cyan + colors.bright + ' █████╗ ██╗ ██╗ ██████╗');
|
|
34
|
+
console.log(' ██╔══██╗██║ ██║██╔════╝');
|
|
35
|
+
console.log(' ███████║██║ █╗ ██║██║ ');
|
|
36
|
+
console.log(' ██╔══██║██║███╗██║██║ ');
|
|
37
|
+
console.log(' ██║ ██║╚███╔███╔╝╚██████╗');
|
|
38
|
+
console.log(' ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═════╝' + colors.reset);
|
|
39
|
+
console.log();
|
|
40
|
+
console.log(colors.magenta + colors.bright + ' ╔═══════════════════════════════╗');
|
|
41
|
+
console.log(' ║ ' + colors.white + 'ZNS-MTD Agent Framework' + colors.magenta + ' ║');
|
|
42
|
+
console.log(' ║ ' + colors.dim + colors.white + 'Zen • Neutro • Sistemático' + colors.magenta + colors.bright + ' ║');
|
|
43
|
+
console.log(' ╚═══════════════════════════════╝' + colors.reset);
|
|
44
|
+
console.log();
|
|
45
|
+
console.log(colors.dim + ' 🚀 22 Agentes Especializados | 191 Workflows' + colors.reset);
|
|
46
|
+
console.log();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Detectar si está instalado globalmente desde NPM o local
|
|
50
|
+
const isGlobalInstall = !fs.existsSync(path.join(__dirname, '../agents'));
|
|
51
|
+
const AGENTS_DATA_DIR = isGlobalInstall
|
|
52
|
+
? path.join(__dirname, 'agents-data')
|
|
53
|
+
: path.join(__dirname, '../agents');
|
|
54
|
+
const CONFIG_FILE = isGlobalInstall
|
|
55
|
+
? path.join(__dirname, 'config.yaml')
|
|
56
|
+
: path.join(__dirname, '../config.yaml');
|
|
57
|
+
const WORKSPACE_AGENTS_DIR = path.join(process.cwd(), '.awc-agents');
|
|
58
|
+
|
|
59
|
+
// Cargar configuración
|
|
60
|
+
function loadConfig() {
|
|
61
|
+
const configContent = fs.readFileSync(CONFIG_FILE, 'utf8');
|
|
62
|
+
return yaml.load(configContent);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Listar todos los agentes
|
|
66
|
+
function listAgents() {
|
|
67
|
+
const config = loadConfig();
|
|
68
|
+
|
|
69
|
+
displayLogo();
|
|
70
|
+
console.log(`${colors.bright}${colors.bgCyan}${colors.white} 📋 AGENTES DISPONIBLES ${colors.reset} ${colors.dim}22 agentes • 191 workflows${colors.reset}\n`);
|
|
71
|
+
|
|
72
|
+
const categories = {
|
|
73
|
+
'Frontend': [],
|
|
74
|
+
'Backend': [],
|
|
75
|
+
'Infrastructure': [],
|
|
76
|
+
'Architecture': [],
|
|
77
|
+
'Quality': [],
|
|
78
|
+
'Business': [],
|
|
79
|
+
'AI': [],
|
|
80
|
+
'Documentation': []
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Organizar por categoría
|
|
84
|
+
config.module.agents.forEach((agent, index) => {
|
|
85
|
+
const cat = agent.category === 'development'
|
|
86
|
+
? (agent.subcategory === 'frontend' || agent.subcategory === 'mobile' ? 'Frontend' : 'Backend')
|
|
87
|
+
: agent.category === 'infrastructure' ? 'Infrastructure'
|
|
88
|
+
: agent.category === 'architecture' ? 'Architecture'
|
|
89
|
+
: agent.category === 'quality' ? 'Quality'
|
|
90
|
+
: agent.category === 'business' ? 'Business'
|
|
91
|
+
: agent.category === 'ai' ? 'AI'
|
|
92
|
+
: 'Documentation';
|
|
93
|
+
|
|
94
|
+
categories[cat].push({ ...agent, index: index + 1 });
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Mostrar por categoría con diseño mejorado
|
|
98
|
+
Object.entries(categories).forEach(([category, agents]) => {
|
|
99
|
+
if (agents.length === 0) return;
|
|
100
|
+
|
|
101
|
+
const icon = getCategoryIcon(category);
|
|
102
|
+
console.log(`${colors.bright}${colors.blue}╭─ ${icon} ${category.toUpperCase()}${colors.reset} ${colors.dim}(${agents.length} agentes)${colors.reset}`);
|
|
103
|
+
|
|
104
|
+
agents.forEach((agent, idx) => {
|
|
105
|
+
const isLast = idx === agents.length - 1;
|
|
106
|
+
const prefix = isLast ? '╰─' : '├─';
|
|
107
|
+
console.log(`${colors.blue}${prefix}${colors.reset} ${colors.bright}${colors.green}${agent.index.toString().padStart(2, '0')}${colors.reset} ${colors.dim}│${colors.reset} ${colors.cyan}${agent.id.padEnd(36)}${colors.reset} ${colors.dim}│${colors.reset} ${colors.yellow}${agent.workflows} workflows${colors.reset}`);
|
|
108
|
+
});
|
|
109
|
+
console.log('');
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
console.log(`${colors.bright}${colors.magenta}┌─────────────────────────────────────────────────────────┐${colors.reset}`);
|
|
113
|
+
console.log(`${colors.bright}${colors.magenta}│${colors.reset} ${colors.yellow}💡 Comandos rápidos:${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`);
|
|
114
|
+
console.log(`${colors.bright}${colors.magenta}│${colors.reset} ${colors.cyan}awc-agent load 1${colors.reset} ${colors.dim}→ Cargar agente #1${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`);
|
|
115
|
+
console.log(`${colors.bright}${colors.magenta}│${colors.reset} ${colors.cyan}awc-agent search java${colors.reset} ${colors.dim}→ Buscar por tecnología${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`);
|
|
116
|
+
console.log(`${colors.bright}${colors.magenta}└─────────────────────────────────────────────────────────┘${colors.reset}\n`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getCategoryIcon(category) {
|
|
120
|
+
const icons = {
|
|
121
|
+
'Frontend': '🎨',
|
|
122
|
+
'Backend': '☕',
|
|
123
|
+
'Infrastructure': '🛠️',
|
|
124
|
+
'Architecture': '🏗️',
|
|
125
|
+
'Quality': '🔍',
|
|
126
|
+
'Business': '📊',
|
|
127
|
+
'AI': '🤖',
|
|
128
|
+
'Documentation': '📄'
|
|
129
|
+
};
|
|
130
|
+
return icons[category] || '📦';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Inicializar agentes en workspace
|
|
134
|
+
function initWorkspace() {
|
|
135
|
+
console.log();
|
|
136
|
+
console.log(`${colors.bright}${colors.cyan}⚙️ Inicializando workspace AWC...${colors.reset}\n`);
|
|
137
|
+
|
|
138
|
+
// Crear carpeta .awc-agents en el workspace actual
|
|
139
|
+
if (!fs.existsSync(WORKSPACE_AGENTS_DIR)) {
|
|
140
|
+
fs.mkdirSync(WORKSPACE_AGENTS_DIR, { recursive: true });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Copiar todos los agentes YAML
|
|
144
|
+
const config = loadConfig();
|
|
145
|
+
let copiedCount = 0;
|
|
146
|
+
|
|
147
|
+
config.module.agents.forEach(agent => {
|
|
148
|
+
const sourceFile = path.join(AGENTS_DATA_DIR, path.basename(agent.file));
|
|
149
|
+
const destFile = path.join(WORKSPACE_AGENTS_DIR, path.basename(agent.file));
|
|
150
|
+
|
|
151
|
+
if (fs.existsSync(sourceFile)) {
|
|
152
|
+
fs.copyFileSync(sourceFile, destFile);
|
|
153
|
+
copiedCount++;
|
|
154
|
+
process.stdout.write(`${colors.dim} ✓ ${path.basename(agent.file)}${colors.reset}\r`);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
console.log('\n');
|
|
159
|
+
console.log(`${colors.bright}${colors.bgGreen}${colors.white} ✅ WORKSPACE INICIALIZADO ${colors.reset}\n`);
|
|
160
|
+
console.log(`${colors.dim}╭─────────────────────────────────────────────╮${colors.reset}`);
|
|
161
|
+
console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Carpeta:${colors.reset} ${WORKSPACE_AGENTS_DIR.substring(WORKSPACE_AGENTS_DIR.lastIndexOf(path.sep) + 1).padEnd(23)} ${colors.dim}│${colors.reset}`);
|
|
162
|
+
console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Agentes:${colors.reset} ${(copiedCount + '/22').padEnd(23)} ${colors.dim}│${colors.reset}`);
|
|
163
|
+
console.log(`${colors.dim}╰─────────────────────────────────────────────╯${colors.reset}\n`);
|
|
164
|
+
console.log(`${colors.yellow}💡 Siguiente paso:${colors.reset}`);
|
|
165
|
+
console.log(` ${colors.bright}${colors.green}awc-agent load 1${colors.reset} ${colors.dim}# Cargar tu primer agente${colors.reset}\n`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Cargar agente específico
|
|
169
|
+
function loadAgent(agentIdOrNumber) {
|
|
170
|
+
const config = loadConfig();
|
|
171
|
+
let agent;
|
|
172
|
+
|
|
173
|
+
// Buscar por número o ID
|
|
174
|
+
if (!isNaN(agentIdOrNumber)) {
|
|
175
|
+
const index = parseInt(agentIdOrNumber) - 1;
|
|
176
|
+
agent = config.module.agents[index];
|
|
177
|
+
} else {
|
|
178
|
+
agent = config.module.agents.find(a => a.id === agentIdOrNumber);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (!agent) {
|
|
182
|
+
console.log(`\n${colors.red}❌ Agente no encontrado: ${agentIdOrNumber}${colors.reset}`);
|
|
183
|
+
console.log(`${colors.yellow}💡 Usa ${colors.bright}awc-agent list${colors.reset}${colors.yellow} para ver agentes disponibles${colors.reset}\n`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Asegurar que el workspace esté inicializado
|
|
188
|
+
if (!fs.existsSync(WORKSPACE_AGENTS_DIR)) {
|
|
189
|
+
console.log(`\n${colors.yellow}⚠️ Inicializando workspace por primera vez...${colors.reset}\n`);
|
|
190
|
+
initWorkspace();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const agentFileName = path.basename(agent.file);
|
|
194
|
+
const workspaceAgentPath = path.join(WORKSPACE_AGENTS_DIR, agentFileName);
|
|
195
|
+
const sourceAgentPath = path.join(AGENTS_DATA_DIR, agentFileName);
|
|
196
|
+
|
|
197
|
+
// Copiar agente al workspace si no existe
|
|
198
|
+
if (!fs.existsSync(workspaceAgentPath) && fs.existsSync(sourceAgentPath)) {
|
|
199
|
+
fs.copyFileSync(sourceAgentPath, workspaceAgentPath);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const agentPath = fs.existsSync(workspaceAgentPath) ? workspaceAgentPath : sourceAgentPath;
|
|
203
|
+
const agentContent = fs.readFileSync(agentPath, 'utf8');
|
|
204
|
+
const agentData = yaml.load(agentContent);
|
|
205
|
+
|
|
206
|
+
console.log();
|
|
207
|
+
console.log(`${colors.bright}${colors.bgGreen}${colors.white} ✅ AGENTE CARGADO ${colors.reset}\n`);
|
|
208
|
+
console.log(`${colors.dim}╭──────────────────────────────────────────────────────────╮${colors.reset}`);
|
|
209
|
+
console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Nombre:${colors.reset} ${(agentData.agent.metadata.name).padEnd(42)} ${colors.dim}│${colors.reset}`);
|
|
210
|
+
console.log(`${colors.dim}│${colors.reset} ${colors.cyan}ID:${colors.reset} ${agent.id.padEnd(42)} ${colors.dim}│${colors.reset}`);
|
|
211
|
+
console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Stack:${colors.reset} ${agent.stack.slice(0, 3).join(', ').padEnd(42)} ${colors.dim}│${colors.reset}`);
|
|
212
|
+
console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Workflows:${colors.reset} ${(agent.workflows + ' disponibles').padEnd(42)} ${colors.dim}│${colors.reset}`);
|
|
213
|
+
console.log(`${colors.dim}╰──────────────────────────────────────────────────────────╯${colors.reset}\n`);
|
|
214
|
+
|
|
215
|
+
// Mostrar comando para Copilot Chat con diseño destacado
|
|
216
|
+
console.log(`${colors.bright}${colors.magenta}╔════════════════════════════════════════════════════════════╗${colors.reset}`);
|
|
217
|
+
console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.yellow}📋 COPIAR EN GITHUB COPILOT CHAT:${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
|
|
218
|
+
console.log(`${colors.bright}${colors.magenta}╠════════════════════════════════════════════════════════════╣${colors.reset}`);
|
|
219
|
+
console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
|
|
220
|
+
console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.green}#file:.awc-agents/${agentFileName}${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
|
|
221
|
+
console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.green}actúa como este agente, muestra *help${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
|
|
222
|
+
console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
|
|
223
|
+
console.log(`${colors.bright}${colors.magenta}╚════════════════════════════════════════════════════════════╝${colors.reset}\n`);
|
|
224
|
+
|
|
225
|
+
// Mostrar workflows disponibles
|
|
226
|
+
if (agentData.agent.workflows && agentData.agent.workflows.list) {
|
|
227
|
+
console.log(`${colors.bright}${colors.blue}🎯 WORKFLOWS DISPONIBLES:${colors.reset}\n`);
|
|
228
|
+
const maxToShow = 5;
|
|
229
|
+
agentData.agent.workflows.list.slice(0, maxToShow).forEach(workflow => {
|
|
230
|
+
console.log(` ${colors.green}▸ ${colors.bright}*${workflow.id}${colors.reset}`);
|
|
231
|
+
console.log(` ${colors.dim}${workflow.description}${colors.reset}\n`);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
if (agentData.agent.workflows.list.length > maxToShow) {
|
|
235
|
+
console.log(` ${colors.dim}... y ${agentData.agent.workflows.list.length - maxToShow} workflows más${colors.reset}\n`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Buscar agente por tecnología
|
|
241
|
+
function searchByTech(tech) {
|
|
242
|
+
const config = loadConfig();
|
|
243
|
+
const results = config.module.agents.filter(agent =>
|
|
244
|
+
agent.stack.some(s => s.toLowerCase().includes(tech.toLowerCase())) ||
|
|
245
|
+
agent.whenToUse.toLowerCase().includes(tech.toLowerCase())
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
if (results.length === 0) {
|
|
249
|
+
console.log(`\n${colors.red}❌ No se encontraron agentes para: ${tech}${colors.reset}`);
|
|
250
|
+
console.log(`${colors.yellow}💡 Prueba con: react, java, python, docker, kubernetes, etc.${colors.reset}\n`);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
console.log();
|
|
255
|
+
console.log(`${colors.bright}${colors.bgBlue}${colors.white} 🔍 RESULTADOS PARA: ${tech.toUpperCase()} ${colors.reset} ${colors.dim}${results.length} agentes encontrados${colors.reset}\n`);
|
|
256
|
+
|
|
257
|
+
results.forEach((agent, index) => {
|
|
258
|
+
const agentNumber = config.module.agents.indexOf(agent) + 1;
|
|
259
|
+
const isLast = index === results.length - 1;
|
|
260
|
+
|
|
261
|
+
console.log(`${colors.dim}${isLast ? '╰─' : '├─'}${colors.reset} ${colors.bright}${colors.green}#${agentNumber.toString().padStart(2, '0')}${colors.reset} ${colors.cyan}${agent.id}${colors.reset}`);
|
|
262
|
+
console.log(`${colors.dim}${isLast ? ' ' : '│ '}${colors.reset} ${colors.yellow}↳ ${agent.stack.slice(0, 4).join(' • ')}${colors.reset}`);
|
|
263
|
+
console.log(`${colors.dim}${isLast ? ' ' : '│ '}${colors.reset} ${colors.dim}${agent.workflows} workflows disponibles${colors.reset}`);
|
|
264
|
+
if (!isLast) console.log(`${colors.dim}│${colors.reset}`);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
console.log();
|
|
268
|
+
console.log(`${colors.yellow}💡 Cargar agente:${colors.reset} ${colors.bright}${colors.green}awc-agent load ${config.module.agents.indexOf(results[0]) + 1}${colors.reset}\n`);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Mostrar help
|
|
272
|
+
function showHelp() {
|
|
273
|
+
displayLogo();
|
|
274
|
+
|
|
275
|
+
console.log(`${colors.bright}${colors.cyan}USO:${colors.reset}`);
|
|
276
|
+
console.log(` ${colors.dim}awc-agent <comando> [opciones]${colors.reset}\n`);
|
|
277
|
+
|
|
278
|
+
console.log(`${colors.bright}${colors.cyan}COMANDOS PRINCIPALES:${colors.reset}\n`);
|
|
279
|
+
|
|
280
|
+
console.log(` ${colors.bright}${colors.green}init${colors.reset} ${colors.dim}│${colors.reset} Inicializa workspace (.awc-agents/)`);
|
|
281
|
+
console.log(` ${colors.bright}${colors.green}list${colors.reset} ${colors.dim}│${colors.reset} Lista todos los agentes (22 agentes)`);
|
|
282
|
+
console.log(` ${colors.bright}${colors.green}load <id|#>${colors.reset} ${colors.dim}│${colors.reset} Carga un agente específico`);
|
|
283
|
+
console.log(` ${colors.bright}${colors.green}search <tech>${colors.reset} ${colors.dim}│${colors.reset} Busca agentes por tecnología`);
|
|
284
|
+
console.log(` ${colors.bright}${colors.green}help${colors.reset} ${colors.dim}│${colors.reset} Muestra esta ayuda\n`);
|
|
285
|
+
|
|
286
|
+
console.log(`${colors.bright}${colors.cyan}EJEMPLOS DE USO:${colors.reset}\n`);
|
|
287
|
+
console.log(` ${colors.dim}# Primera vez (inicializar)${colors.reset}`);
|
|
288
|
+
console.log(` ${colors.cyan}$ awc-agent init${colors.reset}\n`);
|
|
289
|
+
|
|
290
|
+
console.log(` ${colors.dim}# Listar todos los agentes${colors.reset}`);
|
|
291
|
+
console.log(` ${colors.cyan}$ awc-agent list${colors.reset}\n`);
|
|
292
|
+
|
|
293
|
+
console.log(` ${colors.dim}# Cargar agente por número${colors.reset}`);
|
|
294
|
+
console.log(` ${colors.cyan}$ awc-agent load 1${colors.reset} ${colors.dim}# Frontend React${colors.reset}`);
|
|
295
|
+
console.log(` ${colors.cyan}$ awc-agent load 3${colors.reset} ${colors.dim}# Backend Java${colors.reset}\n`);
|
|
296
|
+
|
|
297
|
+
console.log(` ${colors.dim}# Cargar agente por ID${colors.reset}`);
|
|
298
|
+
console.log(` ${colors.cyan}$ awc-agent load backend-java-senior${colors.reset}\n`);
|
|
299
|
+
|
|
300
|
+
console.log(` ${colors.dim}# Buscar por tecnología${colors.reset}`);
|
|
301
|
+
console.log(` ${colors.cyan}$ awc-agent search react${colors.reset} ${colors.dim}# Agentes React${colors.reset}`);
|
|
302
|
+
console.log(` ${colors.cyan}$ awc-agent search java${colors.reset} ${colors.dim}# Agentes Java${colors.reset}`);
|
|
303
|
+
console.log(` ${colors.cyan}$ awc-agent search docker${colors.reset} ${colors.dim}# DevOps/Docker${colors.reset}\n`);
|
|
304
|
+
|
|
305
|
+
console.log(`${colors.bright}${colors.cyan}FLUJO DE TRABAJO TÍPICO:${colors.reset}\n`);
|
|
306
|
+
console.log(` ${colors.yellow}1.${colors.reset} ${colors.dim}Inicializar workspace${colors.reset} ${colors.cyan}awc-agent init${colors.reset}`);
|
|
307
|
+
console.log(` ${colors.yellow}2.${colors.reset} ${colors.dim}Ver agentes disponibles${colors.reset} ${colors.cyan}awc-agent list${colors.reset}`);
|
|
308
|
+
console.log(` ${colors.yellow}3.${colors.reset} ${colors.dim}Cargar agente deseado${colors.reset} ${colors.cyan}awc-agent load 3${colors.reset}`);
|
|
309
|
+
console.log(` ${colors.yellow}4.${colors.reset} ${colors.dim}Copiar comando generado${colors.reset} ${colors.green}#file:.awc-agents/...${colors.reset}`);
|
|
310
|
+
console.log(` ${colors.yellow}5.${colors.reset} ${colors.dim}Pegar en Copilot Chat${colors.reset} ${colors.magenta}Ejecutar workflows${colors.reset}\n`);
|
|
311
|
+
|
|
312
|
+
console.log(`${colors.bright}${colors.cyan}CATEGORÍAS DISPONIBLES:${colors.reset}\n`);
|
|
313
|
+
console.log(` 🎨 Frontend (2) ☕ Backend (4) 🛠️ Infrastructure (2)`);
|
|
314
|
+
console.log(` 🏗️ Architecture (4) 🔍 Quality (3) 📊 Business (2)`);
|
|
315
|
+
console.log(` 🤖 AI/Prompts (2) 📄 Documentation (3)\n`);
|
|
316
|
+
|
|
317
|
+
console.log(`${colors.dim}────────────────────────────────────────────────────────────${colors.reset}`);
|
|
318
|
+
console.log(`${colors.bright}${colors.magenta}Framework AWC-ZNS-MTD v1.0.0${colors.reset} ${colors.dim}│ Zen • Neutro • Sistemático${colors.reset}`);
|
|
319
|
+
console.log(`${colors.dim}────────────────────────────────────────────────────────────${colors.reset}\n`);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Main
|
|
323
|
+
function main() {
|
|
324
|
+
const args = process.argv.slice(2);
|
|
325
|
+
const command = args[0];
|
|
326
|
+
|
|
327
|
+
if (!command || command === 'help' || command === '--help' || command === '-h') {
|
|
328
|
+
showHelp();
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
switch (command) {
|
|
333
|
+
case 'init':
|
|
334
|
+
initWorkspace();
|
|
335
|
+
break;
|
|
336
|
+
case 'list':
|
|
337
|
+
case 'ls':
|
|
338
|
+
listAgents();
|
|
339
|
+
break;
|
|
340
|
+
case 'load':
|
|
341
|
+
case 'use':
|
|
342
|
+
if (!args[1]) {
|
|
343
|
+
console.log(`\n${colors.red}❌ Especifica un agente${colors.reset}`);
|
|
344
|
+
console.log(`${colors.yellow}💡 Uso:${colors.reset} ${colors.bright}awc-agent load <número>${colors.reset}`);
|
|
345
|
+
console.log(`${colors.yellow}💡 Ejemplo:${colors.reset} ${colors.cyan}awc-agent load 1${colors.reset}\n`);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
loadAgent(args[1]);
|
|
349
|
+
break;
|
|
350
|
+
case 'search':
|
|
351
|
+
case 'find':
|
|
352
|
+
if (!args[1]) {
|
|
353
|
+
console.log(`\n${colors.red}❌ Especifica una tecnología${colors.reset}`);
|
|
354
|
+
console.log(`${colors.yellow}💡 Uso:${colors.reset} ${colors.bright}awc-agent search <tech>${colors.reset}`);
|
|
355
|
+
console.log(`${colors.yellow}💡 Ejemplo:${colors.reset} ${colors.cyan}awc-agent search react${colors.reset}\n`);
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
searchByTech(args[1]);
|
|
359
|
+
break;
|
|
360
|
+
case 'version':
|
|
361
|
+
case '--version':
|
|
362
|
+
case '-v':
|
|
363
|
+
console.log(`\n${colors.bright}${colors.cyan}awc-agent-cli${colors.reset} ${colors.green}v1.0.0${colors.reset}`);
|
|
364
|
+
console.log(`${colors.dim}AWC-ZNS-MTD Framework${colors.reset}\n`);
|
|
365
|
+
break;
|
|
366
|
+
default:
|
|
367
|
+
console.log(`\n${colors.red}❌ Comando desconocido: ${command}${colors.reset}\n`);
|
|
368
|
+
showHelp();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
main();
|