@qubiit/lmagent 3.0.7 → 3.0.10
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/.agents/scripts/create_skill.js +1 -1
- package/.agents/scripts/validate_skills.js +2 -2
- package/install.js +100 -67
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* LMAgent Skills Validator — v3.0.
|
|
4
|
+
* LMAgent Skills Validator — v3.0.10
|
|
5
5
|
*
|
|
6
6
|
* Valida la integridad de todos los skills del framework.
|
|
7
7
|
* Verifica: frontmatter YAML, campos obligatorios, estructura de directorio.
|
|
@@ -29,7 +29,7 @@ const SKILLS_DIR = join(ROOT, 'skills');
|
|
|
29
29
|
// ─── Configuración ────────────────────────────────────────────
|
|
30
30
|
const REQUIRED_FIELDS = ['name', 'description', 'role', 'type', 'version', 'icon', 'expertise', 'activates_on', 'triggers'];
|
|
31
31
|
const VALID_TYPES = ['agent_persona', 'methodology'];
|
|
32
|
-
const CURRENT_VERSION = '3.0.
|
|
32
|
+
const CURRENT_VERSION = '3.0.10';
|
|
33
33
|
const OPTIONAL_DIRS = ['scripts', 'references', 'assets'];
|
|
34
34
|
|
|
35
35
|
// ─── Colores (sin dependencias) ───────────────────────────────
|
package/install.js
CHANGED
|
@@ -343,7 +343,7 @@ const IDE_CONFIGS = [
|
|
|
343
343
|
program
|
|
344
344
|
.name('lmagent')
|
|
345
345
|
.description('CLI para instalar skills y reglas de LMAgent')
|
|
346
|
-
.version('3.0.
|
|
346
|
+
.version('3.0.10');
|
|
347
347
|
|
|
348
348
|
program.command('install')
|
|
349
349
|
.description('Instalar skills, rules y workflows en el IDE del proyecto')
|
|
@@ -444,6 +444,7 @@ async function runInstall(options) {
|
|
|
444
444
|
const SOURCE_SKILLS = PACKAGE_SKILLS_DIR;
|
|
445
445
|
const SOURCE_RULES = PACKAGE_RULES_DIR;
|
|
446
446
|
const SOURCE_WORKFLOWS = PACKAGE_WORKFLOWS_DIR;
|
|
447
|
+
const SOURCE_MEMORY = PACKAGE_MEMORY_DIR;
|
|
447
448
|
|
|
448
449
|
let targetIdes = [];
|
|
449
450
|
let selectedSkills = [];
|
|
@@ -486,13 +487,24 @@ async function runInstall(options) {
|
|
|
486
487
|
console.log('');
|
|
487
488
|
|
|
488
489
|
// 3. Auto-Detect IDEs
|
|
489
|
-
const detectedIdes = IDE_CONFIGS.filter(ide =>
|
|
490
|
-
ide.value
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
)
|
|
494
|
-
|
|
495
|
-
|
|
490
|
+
const detectedIdes = IDE_CONFIGS.filter(ide => {
|
|
491
|
+
if (ide.value === 'custom') return false; // Custom is never auto-detected
|
|
492
|
+
|
|
493
|
+
// Check Project Root
|
|
494
|
+
const inProject = (ide.rulesDir && fs.existsSync(path.join(projectRoot, ide.rulesDir.split('/')[0]))) ||
|
|
495
|
+
(ide.markerFile && fs.existsSync(path.join(projectRoot, ide.markerFile)));
|
|
496
|
+
|
|
497
|
+
// Check User Home (Heuristic for installed IDEs)
|
|
498
|
+
const inHome = (ide.markerFile && fs.existsSync(path.join(userHome, ide.markerFile))) ||
|
|
499
|
+
(ide.value === 'vscode' && fs.existsSync(path.join(userHome, '.vscode'))) ||
|
|
500
|
+
(ide.value === 'cursor' && fs.existsSync(path.join(userHome, '.cursor'))) ||
|
|
501
|
+
(ide.value === 'windsurf' && fs.existsSync(path.join(userHome, '.windsurf'))) ||
|
|
502
|
+
(ide.value === 'trae' && fs.existsSync(path.join(userHome, '.trae'))) ||
|
|
503
|
+
(ide.value === 'cline' && fs.existsSync(path.join(userHome, '.cline'))) ||
|
|
504
|
+
(ide.value === 'roo' && fs.existsSync(path.join(userHome, '.roo')));
|
|
505
|
+
|
|
506
|
+
return inProject || inHome;
|
|
507
|
+
});
|
|
496
508
|
// 4. Smart Prompt
|
|
497
509
|
let defaultChoice = detectedIdes.length > 0 ? detectedIdes.map(i => i.value) : ['cursor']; // Default to Cursor if nothing found
|
|
498
510
|
|
|
@@ -563,7 +575,7 @@ async function runInstall(options) {
|
|
|
563
575
|
selectedSkills = availableSkills;
|
|
564
576
|
selectedRules = availableRules;
|
|
565
577
|
selectedWorkflows = availableWorkflows;
|
|
566
|
-
//
|
|
578
|
+
options.installMemory = true; // Flag to install memory
|
|
567
579
|
} else {
|
|
568
580
|
// Manual selection...
|
|
569
581
|
// Seleccionar Skills
|
|
@@ -598,12 +610,24 @@ async function runInstall(options) {
|
|
|
598
610
|
{
|
|
599
611
|
type: 'checkbox',
|
|
600
612
|
name: 'workflows',
|
|
601
|
-
message: 'Selecciona:',
|
|
613
|
+
message: 'Selecciona (Espacio para elegir, Enter para confirmar):',
|
|
602
614
|
choices: availableWorkflows.map(w => ({ name: w, checked: true })),
|
|
603
615
|
pageSize: 15
|
|
604
616
|
}
|
|
605
617
|
]);
|
|
606
618
|
selectedWorkflows = workflowsAnswer.workflows;
|
|
619
|
+
|
|
620
|
+
// Seleccionar Memory
|
|
621
|
+
console.log(chalk.bold('\n🔹 Memoria (Contexto):'));
|
|
622
|
+
const memoryAnswer = await inquirer.prompt([
|
|
623
|
+
{
|
|
624
|
+
type: 'confirm',
|
|
625
|
+
name: 'memory',
|
|
626
|
+
message: '¿Instalar estructura de Memoria (.agents/memory)?',
|
|
627
|
+
default: true
|
|
628
|
+
}
|
|
629
|
+
]);
|
|
630
|
+
options.installMemory = memoryAnswer.memory;
|
|
607
631
|
}
|
|
608
632
|
|
|
609
633
|
console.log('');
|
|
@@ -865,52 +889,46 @@ Use estos comandos para activar su rol. Para detalles, consulte \`AGENTS.md\`.
|
|
|
865
889
|
}
|
|
866
890
|
}
|
|
867
891
|
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
let SOURCE_MEMORY = '';
|
|
871
|
-
if (fs.existsSync(path.join(SOURCE_SKILLS, '../memory'))) {
|
|
872
|
-
SOURCE_MEMORY = path.join(SOURCE_SKILLS, '../memory');
|
|
873
|
-
} else if (typeof PACKAGE_MEMORY_DIR !== 'undefined' && fs.existsSync(PACKAGE_MEMORY_DIR)) {
|
|
874
|
-
SOURCE_MEMORY = PACKAGE_MEMORY_DIR;
|
|
875
|
-
}
|
|
892
|
+
SOURCE_MEMORY = PACKAGE_MEMORY_DIR;
|
|
893
|
+
}
|
|
876
894
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
895
|
+
if (SOURCE_MEMORY && ide.skillsDir) {
|
|
896
|
+
// We use skillsDir parent or a specific memory dir if we had one in config.
|
|
897
|
+
// For now, let's put it alongside skills/rules/workflows.
|
|
898
|
+
// Ideally IDE_CONFIGS should have memoryDir, but we'll default to parent of skillsDir + /memory
|
|
899
|
+
const parentDir = path.dirname(ide.skillsDir);
|
|
900
|
+
const targetDir = path.join(targetRoot, parentDir, 'memory');
|
|
883
901
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
902
|
+
if (arePathsEqual(targetDir, path.join(globalAgentDir, 'memory'))) {
|
|
903
|
+
// console.log(chalk.blue(` ℹ ${ide.name}: Memory updated via Global Sync`));
|
|
904
|
+
} else {
|
|
905
|
+
// console.log(chalk.bold(`\nInstalling Memory to ${chalk.cyan(targetDir)}:`));
|
|
906
|
+
try {
|
|
907
|
+
if (!fs.existsSync(targetDir)) fs.mkdirSync(targetDir, { recursive: true });
|
|
908
|
+
// Copy all contents of memory
|
|
909
|
+
copyRecursiveSync(SOURCE_MEMORY, targetDir, true); // Always copy/overwrite for now, or use applyFile for items if we want symlinks
|
|
910
|
+
console.log(` ${chalk.cyan('✔')} Memory (Context) optimized.`);
|
|
911
|
+
} catch (e) {
|
|
912
|
+
console.error(chalk.red(`❌ Error installing memory for ${ide.name}: ${e.message}`));
|
|
896
913
|
}
|
|
897
914
|
}
|
|
898
915
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
916
|
+
}
|
|
917
|
+
console.log(gradient.pastel.multiline('\n✨ Instalación Finalizada ✨'));
|
|
918
|
+
|
|
919
|
+
console.log(chalk.gray('================================================================'));
|
|
920
|
+
console.log(chalk.bold.green('🎉 ¡Todo listo! Aquí tienes cómo usar tus nuevos superpoderes:'));
|
|
921
|
+
console.log('');
|
|
922
|
+
console.log(chalk.cyan('🤖 Para Cursor / Windsurf / Trae:'));
|
|
923
|
+
console.log(chalk.white(' 1. Tus skills aparecen como Reglas (.cursorrules, etc.)'));
|
|
924
|
+
console.log(chalk.white(' 2. En el Chat (Ctrl+L) o Composer (Ctrl+I), simplemente pídelo.'));
|
|
925
|
+
console.log(chalk.gray(' Ej: "Crea un nuevo componente de React" (El agente usará frontend-engineer automáticamente)'));
|
|
926
|
+
console.log('');
|
|
927
|
+
console.log(chalk.magenta('🧠 Para Antigravity / Claude Code / Agentes Autónomos:'));
|
|
928
|
+
console.log(chalk.white(' 1. El agente lee automáticamente tu carpeta .agent/ o configuración local.'));
|
|
929
|
+
console.log(chalk.white(' 2. Escribe tu petición en lenguaje natural.'));
|
|
930
|
+
console.log(chalk.gray(' Ej: "Analiza la base de datos" (El agente buscará y usará backend-engineer/data-engineer)'));
|
|
931
|
+
console.log(chalk.gray('================================================================'));
|
|
914
932
|
}
|
|
915
933
|
|
|
916
934
|
async function applyFile(source, dest, method) {
|
|
@@ -1116,23 +1134,38 @@ async function runInit(options) {
|
|
|
1116
1134
|
// Crear directorio root si no existe
|
|
1117
1135
|
if (!fs.existsSync(agentRootDir)) fs.mkdirSync(agentRootDir, { recursive: true });
|
|
1118
1136
|
|
|
1119
|
-
//
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
if (fs.existsSync(path.join(__dirname, file.src))) {
|
|
1125
|
-
fs.copyFileSync(path.join(__dirname, file.src), dest);
|
|
1126
|
-
console.log(` ${chalk.green('✔')} ${file.src} (Project Root)`);
|
|
1127
|
-
}
|
|
1128
|
-
continue;
|
|
1129
|
-
}
|
|
1137
|
+
// 5. Install Root Configs (CLAUDE.md, AGENTS.md) with Prompt
|
|
1138
|
+
console.log(chalk.bold('\nChecking Root Configurations:'));
|
|
1139
|
+
for (const file of INIT_FILES) {
|
|
1140
|
+
const srcPath = path.join(__dirname, file.src);
|
|
1141
|
+
const destPath = path.join(targetRoot, file.src);
|
|
1130
1142
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1143
|
+
if (fs.existsSync(srcPath)) {
|
|
1144
|
+
if (!fs.existsSync(destPath)) {
|
|
1145
|
+
fs.copyFileSync(srcPath, destPath);
|
|
1146
|
+
console.log(` ${chalk.green('✔')} ${file.src} (Created)`);
|
|
1147
|
+
} else {
|
|
1148
|
+
// Exists: Ask to overwrite (unless force/yes)
|
|
1149
|
+
let shouldOverwrite = false;
|
|
1150
|
+
if (options.force) {
|
|
1151
|
+
shouldOverwrite = true;
|
|
1152
|
+
} else if (!options.yes) {
|
|
1153
|
+
const answer = await inquirer.prompt([{
|
|
1154
|
+
type: 'confirm',
|
|
1155
|
+
name: 'overwrite',
|
|
1156
|
+
message: `⚠️ ${file.src} ya existe. ¿Sobrescribir?`,
|
|
1157
|
+
default: false
|
|
1158
|
+
}]);
|
|
1159
|
+
shouldOverwrite = answer.overwrite;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
if (shouldOverwrite) {
|
|
1163
|
+
fs.copyFileSync(srcPath, destPath);
|
|
1164
|
+
console.log(` ${chalk.yellow('✎')} ${file.src} (Overwritten)`);
|
|
1165
|
+
} else {
|
|
1166
|
+
console.log(` ${chalk.gray('SKIP')} ${file.src} (Kept existing)`);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1136
1169
|
}
|
|
1137
1170
|
}
|
|
1138
1171
|
|