@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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * LMAgent Skill Generator — v3.0.7
4
+ * LMAgent Skill Generator — v3.0.10
5
5
  *
6
6
  * Genera la estructura completa de un nuevo skill interactivamente.
7
7
  *
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * LMAgent Skills Validator — v3.0.7
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.7';
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.7');
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 !== 'custom' && (
491
- (ide.rulesDir && fs.existsSync(path.join(projectRoot, ide.rulesDir.split('/')[0]))) ||
492
- (ide.markerFile && fs.existsSync(path.join(projectRoot, ide.markerFile)))
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
- // flag to install memory
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
- // 4. Install MEMORY (Directory) - Always install if "Quick Install" or implicitly required
869
- // We assume memory is located at ../memory relative to skills source or PACKAGE_MEMORY_DIR
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
- if (SOURCE_MEMORY && ide.skillsDir) {
878
- // We use skillsDir parent or a specific memory dir if we had one in config.
879
- // For now, let's put it alongside skills/rules/workflows.
880
- // Ideally IDE_CONFIGS should have memoryDir, but we'll default to parent of skillsDir + /memory
881
- const parentDir = path.dirname(ide.skillsDir);
882
- const targetDir = path.join(targetRoot, parentDir, 'memory');
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
- if (arePathsEqual(targetDir, path.join(globalAgentDir, 'memory'))) {
885
- // console.log(chalk.blue(` ℹ ${ide.name}: Memory updated via Global Sync`));
886
- } else {
887
- // console.log(chalk.bold(`\nInstalling Memory to ${chalk.cyan(targetDir)}:`));
888
- try {
889
- if (!fs.existsSync(targetDir)) fs.mkdirSync(targetDir, { recursive: true });
890
- // Copy all contents of memory
891
- copyRecursiveSync(SOURCE_MEMORY, targetDir, true); // Always copy/overwrite for now, or use applyFile for items if we want symlinks
892
- console.log(` ${chalk.cyan('✔')} Memory (Context) optimized.`);
893
- } catch (e) {
894
- console.error(chalk.red(`❌ Error installing memory for ${ide.name}: ${e.message}`));
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
- console.log(gradient.pastel.multiline('\n✨ Instalación Finalizada ✨'));
900
-
901
- console.log(chalk.gray('================================================================'));
902
- console.log(chalk.bold.green('🎉 ¡Todo listo! Aquí tienes cómo usar tus nuevos superpoderes:'));
903
- console.log('');
904
- console.log(chalk.cyan('🤖 Para Cursor / Windsurf / Trae:'));
905
- console.log(chalk.white(' 1. Tus skills aparecen como Reglas (.cursorrules, etc.)'));
906
- console.log(chalk.white(' 2. En el Chat (Ctrl+L) o Composer (Ctrl+I), simplemente pídelo.'));
907
- console.log(chalk.gray(' Ej: "Crea un nuevo componente de React" (El agente usará frontend-engineer automáticamente)'));
908
- console.log('');
909
- console.log(chalk.magenta('🧠 Para Antigravity / Claude Code / Agentes Autónomos:'));
910
- console.log(chalk.white(' 1. El agente lee automáticamente tu carpeta .agent/ o configuración local.'));
911
- console.log(chalk.white(' 2. Escribe tu petición en lenguaje natural.'));
912
- console.log(chalk.gray(' Ej: "Analiza la base de datos" (El agente buscará y usará backend-engineer/data-engineer)'));
913
- console.log(chalk.gray('================================================================'));
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
- // Copiar Archivos (AGENTS.md, CLAUDE.md van a root)
1120
- for (const file of filesToCopy) {
1121
- if (file.src === 'CLAUDE.md' || file.src === 'AGENTS.md') {
1122
- // Se copian a projectRoot para visibilidad inmediata
1123
- const dest = path.join(projectRoot, file.src);
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
- const src = path.join(__dirname, file.src);
1132
- const dest = path.join(agentRootDir, file.src);
1133
- if (fs.existsSync(src)) {
1134
- fs.copyFileSync(src, dest);
1135
- console.log(` ${chalk.green('✔')} ${file.src} -> ${path.dirname(ide.skillsDir)}/${file.src}`);
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
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.0.7",
6
+ "version": "3.0.10",
7
7
  "files": [
8
8
  "install.js",
9
9
  "README.md",