solmate-skills 2.0.0 → 2.0.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.
Files changed (2) hide show
  1. package/bin/cli.js +20 -0
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -2,10 +2,17 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { execSync } = require('child_process');
5
6
 
6
7
  const IGNORED_FOLDERS = ['bin', 'node_modules', '.git', '.github', '.gemini', '.agent'];
7
8
  const IGNORED_FILES = ['package.json', 'package-lock.json', 'AGENTS.md', 'SKILL.md', 'init-skills.sh', 'README.md', '.DS_Store', 'old_AGENTS.md'];
8
9
 
10
+ // Skills that require a post-install script to be executed after copying.
11
+ // Key: skill name, Value: path relative to the skill folder.
12
+ const POST_INSTALL_SCRIPTS = {
13
+ 'hooks': 'install.sh',
14
+ };
15
+
9
16
  const packageRoot = path.join(__dirname, '..');
10
17
  const targetProjectRoot = process.cwd();
11
18
  const targetSkillsDir = path.join(targetProjectRoot, '.agent', 'skills');
@@ -58,6 +65,19 @@ function installSkill(skillName) {
58
65
  console.log(`Installing ${skillName}...`);
59
66
  copyFolderSync(sourcePath, destPath);
60
67
  console.log(`Successfully installed ${skillName} to .agent/skills/${skillName}`);
68
+
69
+ // Run post-install script if defined for this skill
70
+ if (POST_INSTALL_SCRIPTS[skillName]) {
71
+ const scriptPath = path.join(destPath, POST_INSTALL_SCRIPTS[skillName]);
72
+ if (fs.existsSync(scriptPath)) {
73
+ console.log(`Running post-install for ${skillName}...`);
74
+ try {
75
+ execSync(`bash "${scriptPath}"`, { stdio: 'inherit', cwd: targetProjectRoot });
76
+ } catch (err) {
77
+ console.error(`Warning: post-install script for ${skillName} exited with an error.`);
78
+ }
79
+ }
80
+ }
61
81
  }
62
82
 
63
83
  const args = process.argv.slice(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solmate-skills",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Curated skills for Solmate projects",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {