@hybridlabor-api/bdb-antigravity-skills 1.1.2 → 1.1.4

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 (3) hide show
  1. package/installer.js +135 -55
  2. package/package.json +1 -1
  3. package/installer.sh +0 -101
package/installer.js CHANGED
@@ -31,7 +31,6 @@ const globalConfigDir = path.join(geminiDir, 'config', 'skills');
31
31
  const globalLegacyDir = path.join(geminiDir, 'skills');
32
32
  const workspaceDir = path.join(currentDir, '.agents', 'skills');
33
33
 
34
- // Format timestamp like YYYYMMDD_HHMMSS
35
34
  const now = new Date();
36
35
  const timestamp = now.getFullYear().toString() +
37
36
  (now.getMonth()+1).toString().padStart(2, '0') +
@@ -42,8 +41,40 @@ const timestamp = now.getFullYear().toString() +
42
41
 
43
42
  const backupDir = path.join(geminiDir, `skills_backup_${timestamp}`);
44
43
 
45
- console.log(`Creating backup of current skills in ${backupDir}...`);
46
- fs.mkdirSync(backupDir, { recursive: true });
44
+ // Auto-accept flags for CI/CD or autonomous agents
45
+ const isAutoYes = process.argv.includes('-y') || process.argv.includes('--yes');
46
+
47
+ function promptMode(callback) {
48
+ if (isAutoYes) {
49
+ return callback({ mode: '1', platform: '1' });
50
+ }
51
+ console.log("\nTarget AI Platform:");
52
+ console.log(" (1) Google Antigravity (Default)");
53
+ console.log(" (2) Claude Desktop / Claude Code");
54
+ console.log(" (3) Cursor / Generic IDE");
55
+
56
+ rl.question("\nSelect platform [1/2/3]: ", (platformAns) => {
57
+ const platform = platformAns.trim() || '1';
58
+
59
+ console.log("\nInstallation Mode:");
60
+ console.log(" (1) Merge: Keep your existing skills/MCPs and add/update BDB tools.");
61
+ console.log(" (2) Replace: Backup and wipe your existing skills/MCPs, installing ONLY BDB tools.");
62
+ rl.question("\nSelect mode [1/2]: ", (modeAns) => {
63
+ const mode = modeAns.trim() === '2' ? '2' : '1';
64
+ callback({ mode, platform });
65
+ });
66
+ });
67
+ }
68
+
69
+ function promptMCP(callback) {
70
+ if (isAutoYes) {
71
+ return callback('y');
72
+ }
73
+ console.log("");
74
+ rl.question("Do you also want to install the MCP Pack (Unreal, Rhino, Resolve, Grandma3, Resolume, Github, etc)? (y/n): ", (answer) => {
75
+ callback(answer);
76
+ });
77
+ }
47
78
 
48
79
  function moveIfExists(src, dest, label) {
49
80
  if (fs.existsSync(src)) {
@@ -52,16 +83,6 @@ function moveIfExists(src, dest, label) {
52
83
  }
53
84
  }
54
85
 
55
- moveIfExists(globalConfigDir, path.join(backupDir, 'config_skills_backup'), 'global config skills');
56
- moveIfExists(globalLegacyDir, path.join(backupDir, 'legacy_skills_backup'), 'global legacy skills');
57
- moveIfExists(workspaceDir, path.join(backupDir, 'workspace_skills_backup'), 'workspace skills');
58
-
59
- console.log("\nInstalling optimized skills (140 curated skills)...");
60
-
61
- fs.mkdirSync(globalConfigDir, { recursive: true });
62
- fs.mkdirSync(globalLegacyDir, { recursive: true });
63
- fs.mkdirSync(workspaceDir, { recursive: true });
64
-
65
86
  function copyDirRecursiveSync(source, target) {
66
87
  if (!fs.existsSync(source)) return;
67
88
  if (!fs.existsSync(target)) fs.mkdirSync(target, { recursive: true });
@@ -78,52 +99,111 @@ function copyDirRecursiveSync(source, target) {
78
99
  });
79
100
  }
80
101
 
81
- copyDirRecursiveSync(path.join(srcDir, 'skills', 'global_config'), globalConfigDir);
82
- console.log(" -> Installed global config skills.");
102
+ promptMode(({ mode, platform }) => {
103
+ fs.mkdirSync(backupDir, { recursive: true });
104
+
105
+ let targetSkillDir = globalConfigDir;
106
+ let targetLegacyDir = globalLegacyDir;
107
+ let targetWorkspaceDir = workspaceDir;
108
+ let targetMcpDir = path.join(geminiDir, 'config');
109
+ let mcpConfigPath = path.join(targetMcpDir, 'mcp_config.json');
110
+
111
+ if (platform === '2') {
112
+ // Claude Desktop
113
+ console.log("\n[Platform: Claude Desktop] Adapting installation paths...");
114
+ targetSkillDir = path.join(homeDir, '.bdb-skills');
115
+ targetLegacyDir = path.join(homeDir, '.bdb-skills', 'legacy');
116
+
117
+ let claudeAppSupport = process.platform === 'win32'
118
+ ? path.join(process.env.APPDATA || homeDir, 'Claude')
119
+ : path.join(homeDir, 'Library', 'Application Support', 'Claude');
120
+
121
+ targetMcpDir = claudeAppSupport;
122
+ mcpConfigPath = path.join(claudeAppSupport, 'claude_desktop_config.json');
123
+ } else if (platform === '3') {
124
+ // Cursor / Generic
125
+ console.log("\n[Platform: Cursor / Generic IDE] Adapting installation paths...");
126
+ targetSkillDir = path.join(currentDir, '.cursor', 'bdb-skills');
127
+ targetLegacyDir = path.join(currentDir, '.cursor', 'bdb-skills', 'legacy');
128
+ targetWorkspaceDir = path.join(currentDir, '.cursor', 'workspace_skills');
129
+ targetMcpDir = path.join(currentDir, '.cursor');
130
+ mcpConfigPath = path.join(targetMcpDir, 'mcp.json');
131
+ }
83
132
 
84
- copyDirRecursiveSync(path.join(srcDir, 'skills', 'global_legacy'), globalLegacyDir);
85
- console.log(" -> Installed global legacy skills.");
133
+ if (mode === '2') {
134
+ console.log(`\n[Replace Mode] Creating backup of current skills in ${backupDir}...`);
135
+ moveIfExists(targetSkillDir, path.join(backupDir, 'config_skills_backup'), 'global config skills');
136
+ moveIfExists(targetLegacyDir, path.join(backupDir, 'legacy_skills_backup'), 'global legacy skills');
137
+ moveIfExists(targetWorkspaceDir, path.join(backupDir, 'workspace_skills_backup'), 'workspace skills');
138
+ } else {
139
+ console.log(`\n[Merge Mode] Installing over existing directories. Existing skills will not be deleted.`);
140
+ }
86
141
 
87
- copyDirRecursiveSync(path.join(srcDir, 'skills', 'workspace_agents'), workspaceDir);
88
- console.log(" -> Installed workspace skills.");
142
+ console.log("\nInstalling optimized skills (140 curated skills)...");
143
+ fs.mkdirSync(targetSkillDir, { recursive: true });
144
+ fs.mkdirSync(targetLegacyDir, { recursive: true });
145
+ fs.mkdirSync(targetWorkspaceDir, { recursive: true });
89
146
 
90
- console.log("");
91
- const geminiMdSrc = path.join(srcDir, 'GEMINI.md');
92
- if (fs.existsSync(geminiMdSrc)) {
93
- fs.copyFileSync(geminiMdSrc, path.join(geminiDir, 'GEMINI.md'));
94
- console.log(` -> Installed GEMINI.md to ${path.join(geminiDir, 'GEMINI.md')}`);
95
- }
147
+ copyDirRecursiveSync(path.join(srcDir, 'skills', 'global_config'), targetSkillDir);
148
+ console.log(" -> Installed global config skills.");
96
149
 
97
- console.log("");
98
- rl.question("Do you also want to install the MCP Pack (Unreal, Rhino, Resolve, Grandma3, Resolume, Github, Chrome DevTools)? (y/n): ", function(answer) {
99
- if (answer.toLowerCase().startsWith('y')) {
100
- const configDir = path.join(geminiDir, 'config');
101
- fs.mkdirSync(configDir, { recursive: true });
102
-
103
- // Copy MCP servers code
104
- const mcpCodeTarget = path.join(configDir, 'mcps');
105
- copyDirRecursiveSync(path.join(srcDir, 'mcps'), mcpCodeTarget);
106
- console.log(` -> Installed local MCP servers to ${mcpCodeTarget}`);
107
-
108
- const mcpTarget = path.join(configDir, 'mcp_config.json');
109
- if (fs.existsSync(mcpTarget)) {
110
- fs.copyFileSync(mcpTarget, path.join(backupDir, 'mcp_config_backup.json'));
111
- console.log(" -> Backed up existing mcp_config.json");
150
+ copyDirRecursiveSync(path.join(srcDir, 'skills', 'global_legacy'), targetLegacyDir);
151
+ console.log(" -> Installed global legacy skills.");
152
+
153
+ copyDirRecursiveSync(path.join(srcDir, 'skills', 'workspace_agents'), targetWorkspaceDir);
154
+ console.log(" -> Installed workspace skills.");
155
+
156
+ const geminiMdSrc = path.join(srcDir, 'GEMINI.md');
157
+ if (platform === '1' && fs.existsSync(geminiMdSrc)) {
158
+ fs.copyFileSync(geminiMdSrc, path.join(geminiDir, 'GEMINI.md'));
159
+ console.log(` -> Installed GEMINI.md to ${path.join(geminiDir, 'GEMINI.md')}`);
160
+ }
161
+
162
+ promptMCP((answer) => {
163
+ if (answer.toLowerCase().startsWith('y')) {
164
+ fs.mkdirSync(targetMcpDir, { recursive: true });
165
+
166
+ const mcpCodeTarget = path.join(targetMcpDir, 'mcps');
167
+ copyDirRecursiveSync(path.join(srcDir, 'mcps'), mcpCodeTarget);
168
+ console.log(` -> Installed local MCP servers to ${mcpCodeTarget}`);
169
+
170
+ if (fs.existsSync(mcpConfigPath)) {
171
+ fs.copyFileSync(mcpConfigPath, path.join(backupDir, 'mcp_config_backup.json'));
172
+ console.log(` -> Backed up existing ${path.basename(mcpConfigPath)}`);
173
+ }
174
+
175
+ let mcpConfigStr = fs.readFileSync(path.join(srcDir, 'mcp_config.json'), 'utf8');
176
+ mcpConfigStr = mcpConfigStr.replace(/__MCPS_DIR__/g, mcpCodeTarget);
177
+ mcpConfigStr = mcpConfigStr.replace(/\{\{HOME\}\}/g, homeDir);
178
+
179
+ if (mode === '1' && fs.existsSync(mcpConfigPath)) {
180
+ try {
181
+ const oldConfig = JSON.parse(fs.readFileSync(mcpConfigPath, 'utf8'));
182
+ const newConfig = JSON.parse(mcpConfigStr);
183
+ oldConfig.mcpServers = Object.assign({}, oldConfig.mcpServers || {}, newConfig.mcpServers || {});
184
+ fs.writeFileSync(mcpConfigPath, JSON.stringify(oldConfig, null, 2));
185
+ console.log(` -> Merged BDB MCPs into existing ${path.basename(mcpConfigPath)}`);
186
+ } catch (e) {
187
+ console.log(` -> Failed to parse existing JSON, overwriting ${path.basename(mcpConfigPath)}`);
188
+ fs.writeFileSync(mcpConfigPath, mcpConfigStr);
189
+ }
190
+ } else {
191
+ if (platform === '2' && !fs.existsSync(mcpConfigPath)) {
192
+ const wrapper = { mcpServers: JSON.parse(mcpConfigStr).mcpServers };
193
+ fs.writeFileSync(mcpConfigPath, JSON.stringify(wrapper, null, 2));
194
+ } else {
195
+ fs.writeFileSync(mcpConfigPath, mcpConfigStr);
196
+ }
197
+ console.log(` -> Installed optimized MCP config to ${targetMcpDir}`);
198
+ }
199
+ } else {
200
+ console.log(" -> Skipping MCP installation.");
112
201
  }
113
202
 
114
- // Read and replace template
115
- let mcpConfigStr = fs.readFileSync(path.join(srcDir, 'mcp_config.json'), 'utf8');
116
- mcpConfigStr = mcpConfigStr.replace(/__MCPS_DIR__/g, mcpCodeTarget);
117
- mcpConfigStr = mcpConfigStr.replace(/\{\{HOME\}\}/g, homeDir);
118
- fs.writeFileSync(mcpTarget, mcpConfigStr);
119
- console.log(` -> Installed optimized mcp_config.json to ${configDir}`);
120
- } else {
121
- console.log(" -> Skipping MCP installation.");
122
- }
123
-
124
- console.log("=========================================================");
125
- console.log(" Installation complete! The environment now has the ");
126
- console.log(" optimized skill configuration.");
127
- console.log("=========================================================");
128
- rl.close();
203
+ console.log("=========================================================");
204
+ console.log(" Installation complete! The environment now has the ");
205
+ console.log(" optimized skill configuration.");
206
+ console.log("=========================================================");
207
+ rl.close();
208
+ });
129
209
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridlabor-api/bdb-antigravity-skills",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Optimized Antigravity skills and MCP pack for BDB DEV",
5
5
  "main": "installer.js",
6
6
  "bin": {
package/installer.sh DELETED
@@ -1,101 +0,0 @@
1
- #!/bin/bash
2
- # Installer for BDB DEV - OPTIMIZED ANTIGRAVITY SKILLS
3
-
4
- echo "========================================================="
5
- echo " Starting BDB Optimized Antigravity Skills Installation"
6
- echo "========================================================="
7
-
8
- # Resolve actual script directory (handles symlinks for Homebrew)
9
- TARGET="${BASH_SOURCE[0]}"
10
- while [ -h "$TARGET" ]; do
11
- DIR="$(cd -P "$(dirname "$TARGET")" && pwd)"
12
- TARGET="$(readlink "$TARGET")"
13
- [[ $TARGET != /* ]] && TARGET="$DIR/$TARGET"
14
- done
15
- SCRIPT_DIR="$(cd -P "$(dirname "$TARGET")" && pwd)"
16
-
17
- # Locate the source directory for skills/configs
18
- if [ -d "$SCRIPT_DIR/skills" ]; then
19
- SRC_DIR="$SCRIPT_DIR"
20
- elif [ -d "$SCRIPT_DIR/../skills" ]; then
21
- SRC_DIR="$SCRIPT_DIR/.."
22
- else
23
- echo "Error: Cannot find skills payload directory."
24
- exit 1
25
- fi
26
-
27
- # Define target paths
28
- GLOBAL_CONFIG_DIR="$HOME/.gemini/config/skills"
29
- GLOBAL_LEGACY_DIR="$HOME/.gemini/skills"
30
- WORKSPACE_DIR="$PWD/.agents/skills"
31
- BACKUP_DIR="$HOME/.gemini/skills_backup_$(date +%Y%m%d_%H%M%S)"
32
-
33
- echo "Creating backup of current skills in $BACKUP_DIR..."
34
- mkdir -p "$BACKUP_DIR"
35
-
36
- if [ -d "$GLOBAL_CONFIG_DIR" ]; then
37
- mv "$GLOBAL_CONFIG_DIR" "$BACKUP_DIR/config_skills_backup"
38
- echo " -> Backed up global config skills."
39
- fi
40
-
41
- if [ -d "$GLOBAL_LEGACY_DIR" ]; then
42
- mv "$GLOBAL_LEGACY_DIR" "$BACKUP_DIR/legacy_skills_backup"
43
- echo " -> Backed up global legacy skills."
44
- fi
45
-
46
- if [ -d "$WORKSPACE_DIR" ]; then
47
- mv "$WORKSPACE_DIR" "$BACKUP_DIR/workspace_skills_backup"
48
- echo " -> Backed up workspace skills."
49
- fi
50
-
51
- echo ""
52
- echo "Installing optimized skills (140 curated skills)..."
53
-
54
- mkdir -p "$GLOBAL_CONFIG_DIR"
55
- mkdir -p "$GLOBAL_LEGACY_DIR"
56
- mkdir -p "$WORKSPACE_DIR"
57
-
58
- if [ -d "$SRC_DIR/skills/global_config" ]; then
59
- cp -R "$SRC_DIR/skills/global_config/"* "$GLOBAL_CONFIG_DIR/" 2>/dev/null || true
60
- echo " -> Installed global config skills."
61
- fi
62
-
63
- if [ -d "$SRC_DIR/skills/global_legacy" ]; then
64
- cp -R "$SRC_DIR/skills/global_legacy/"* "$GLOBAL_LEGACY_DIR/" 2>/dev/null || true
65
- echo " -> Installed global legacy skills."
66
- fi
67
-
68
- if [ -d "$SRC_DIR/skills/workspace_agents" ]; then
69
- cp -R "$SRC_DIR/skills/workspace_agents/"* "$WORKSPACE_DIR/" 2>/dev/null || true
70
- echo " -> Installed workspace skills."
71
- fi
72
-
73
- echo ""
74
- # Copy GEMINI.md
75
- if [ -f "$SRC_DIR/GEMINI.md" ]; then
76
- cp "$SRC_DIR/GEMINI.md" "$HOME/.gemini/GEMINI.md"
77
- echo " -> Installed GEMINI.md to $HOME/.gemini/GEMINI.md"
78
- fi
79
-
80
- echo ""
81
- read -p "Do you also want to install the BDB MCP Pack (Unreal, Rhino, Resolve, Grandma3, Resolume, Github, Chrome DevTools)? (y/n): " install_mcp
82
- if [[ "$install_mcp" =~ ^[Yy]$ ]]; then
83
- mkdir -p "$HOME/.gemini/config"
84
- if [ -f "$HOME/.gemini/config/mcp_config.json" ]; then
85
- cp "$HOME/.gemini/config/mcp_config.json" "$BACKUP_DIR/mcp_config_backup.json"
86
- echo " -> Backed up existing mcp_config.json"
87
- fi
88
- sed "s|__MCPS_DIR__|$HOME/.gemini/config/mcps|g" "$SRC_DIR/mcp_config.json" > "$HOME/.gemini/config/mcp_config.json"
89
- echo " -> Installed optimized mcp_config.json to $HOME/.gemini/config/"
90
-
91
- mkdir -p "$HOME/.gemini/config/mcps"
92
- cp -R "$SRC_DIR/mcps/"* "$HOME/.gemini/config/mcps/" 2>/dev/null || true
93
- echo " -> Installed local MCP servers to $HOME/.gemini/config/mcps/"
94
- else
95
- echo " -> Skipping MCP installation."
96
- fi
97
-
98
- echo "========================================================="
99
- echo " Installation complete! The environment now has the "
100
- echo " optimized BDB DEV skill configuration."
101
- echo "========================================================="