From 328f939f17e44652c1edaffe1fcaa3728f570746 Mon Sep 17 00:00:00 2001 From: Ben Priebe Date: Wed, 20 May 2026 10:21:25 +1000 Subject: [PATCH 1/2] feat: add Gemini Antigravity 2.0 integration --- .gitignore | 1 + integrations/antigravity/README.md | 107 ++++++++ .../antigravity/converter/package.json | 11 + .../converter/src/convert-agents.js | 256 ++++++++++++++++++ .../antigravity/install-antigravity.sh | 118 ++++++++ 5 files changed, 493 insertions(+) create mode 100644 integrations/antigravity/README.md create mode 100644 integrations/antigravity/converter/package.json create mode 100644 integrations/antigravity/converter/src/convert-agents.js create mode 100755 integrations/antigravity/install-antigravity.sh diff --git a/.gitignore b/.gitignore index 1d3339ce..50f03a91 100644 --- a/.gitignore +++ b/.gitignore @@ -225,5 +225,6 @@ tasks/ # Claude Code integration generated files integrations/claude-code/converter/generated/ +integrations/antigravity/converter/generated/ .cursorrules bun.lock diff --git a/integrations/antigravity/README.md b/integrations/antigravity/README.md new file mode 100644 index 00000000..ba7e4ab1 --- /dev/null +++ b/integrations/antigravity/README.md @@ -0,0 +1,107 @@ +# OpenAgents Control ↔ Gemini Antigravity CLI Integration + +A bridge that allows Gemini Antigravity 2.0 (Antigravity CLI 1.0) to use OpenAgents Control standards, subagents, and context files. + +## Overview + +This integration provides a seamless bridge between OpenAgents Control and Gemini Antigravity CLI (`agy`): + +1. **Auto-Convert**: Compiles OpenAgents Control's agent specifications into Antigravity CLI-native plugins +2. **Global & Local Workspaces**: Deploys plugins globally for all projects or locally under repository workspaces + +## Directory Structure + +``` +integrations/antigravity/ +├── README.md # This guide +├── install-antigravity.sh # Build & installation script (Global & Local) +└── converter/ # Conversion subsystem + ├── package.json # Dependencies + └── src/ + └── convert-agents.js # Node-based compiler and YAML mapper +``` + +## Quick Start + +### 1. Compile & Install the Plugin + +To compile OAC agents and install the plugin to your Antigravity environments, run: + +```bash +cd integrations/antigravity +./install-antigravity.sh +``` + +This will automatically: +1. Translate `.opencode/agent/*.md` specifications to Antigravity format in `integrations/antigravity/generated/`. +2. Generate the necessary `plugin.json` manifest. +3. Install the plugin globally to `~/.gemini/antigravity-cli/plugins/openagents-control-bridge`. +4. Install the plugin locally to `.agents/plugins/openagents-control-bridge` for workspace-specific runs. + +### 2. Verify in Antigravity CLI + +Start your Antigravity session and verify that the plugin has loaded correctly: + +```bash +# Start your CLI session +agy + +# Inspect active subagents and skills +/agents +/skills +``` + +You should see `openagents-control-standards` and `context-scout` registered and active. + +--- + +## How It Works + +### Context Discovery & Pre-loading + +1. **Skill Triggers**: The `openagents-control-standards` Skill triggers automatically before any development or architectural task. +2. **Subagent Invocation**: The skill delegates to `context-scout` to search `.opencode/context/` for relevant conventions, naming standards, and workflows. +3. **Upfront Loading**: Discovered files are read and pre-loaded into the prompt context to keep subsequent task execution fast, consistent, and highly token-efficient. + +### Agent Specification Mapping + +The converter translates OAC agent frontmatter properties to Antigravity CLI specifications: + +| OpenAgents Control Field | Gemini Antigravity Field | Notes / Conversions | +|--------------------------|--------------------------|---------------------| +| `id` | `name` | Uniquely names the subagent | +| `description` | `description` | Description used for auto-routing | +| `permissions` | `tools` | Maps `read` ➔ `read_file`, `write` ➔ `write_file`, `edit` ➔ `edit_file`, `bash` ➔ `run_command`, `grep` ➔ `grep_search`, `glob` ➔ `list_dir` | +| `model` | `model` | Translates models to user-approved designations: Grok/Sonnet ➔ `gemini-3.1-pro`, Haiku ➔ `gemini-3.5-flash` | +| `mode: subagent` | `permissionMode: plan` | Restricts executing subagents to planned/approved paths | + +--- + +## Adding Custom Agents & Workflows + +### For Local Workspace Use +Add your customized agent definitions under `.agents/agents/` and skills under `.agents/skills/`. The Antigravity Agent will auto-load them upon starting a session inside the workspace root. + +### For Global Distribution +1. Place the new OAC agent configuration in `.opencode/agent/{category}/{agent}.md`. +2. Run the compiler installer: `./install-antigravity.sh` +3. Your updated agent will instantly be active across all your CLI sessions. + +## Requirements + +- Node.js 18+ +- Gemini Antigravity CLI 1.0+ (with local plugin-loading enabled for repo-level runs) + +--- + +## Command Reference + +| Action | Claude Code CLI | Gemini Antigravity CLI | +|--------|-----------------|------------------------| +| Start interactive run | `claude` | `agy` | +| Browse Active Skills | `/print-plugins` | `/skills` | +| Browse Active Subagents| `/print-plugins` | `/agents` | +| Settings & Config | `~/.claude/settings.json` | `/config` or `/settings` | +| Keybindings Map | `/keybindings` | `/keybindings` | +| Directory Search | `/glob` / `/grep` | `@` (autocomplete) or `/skills` search | +| Run single bash command| `!command` | `!command` | diff --git a/integrations/antigravity/converter/package.json b/integrations/antigravity/converter/package.json new file mode 100644 index 00000000..f705a5a0 --- /dev/null +++ b/integrations/antigravity/converter/package.json @@ -0,0 +1,11 @@ +{ + "name": "oac-antigravity-converter", + "version": "1.0.0", + "description": "Converts OpenAgents Control agents and skills to Antigravity CLI format", + "main": "src/convert-agents.js", + "scripts": { + "convert": "node src/convert-agents.js" + }, + "author": "Antigravity", + "license": "MIT" +} diff --git a/integrations/antigravity/converter/src/convert-agents.js b/integrations/antigravity/converter/src/convert-agents.js new file mode 100644 index 00000000..115de46e --- /dev/null +++ b/integrations/antigravity/converter/src/convert-agents.js @@ -0,0 +1,256 @@ +#!/usr/bin/env node + +/** + * convert-agents.js + * Converts OpenAgents Control to Gemini Antigravity CLI format + * + * Usage: node convert-agents.js + */ + +const fs = require('fs'); +const path = require('path'); + +// Configuration - Use absolute paths from the script location +const SCRIPT_DIR = __dirname; +const REPO_ROOT = path.resolve(path.join(SCRIPT_DIR, '../../../../')); +const SOURCE_DIR = path.join(REPO_ROOT, '.opencode/agent'); +const OUTPUT_DIR = path.join(SCRIPT_DIR, '../generated'); + +const ANTIGRAVITY_AGENTS_DIR = path.join(OUTPUT_DIR, 'agents'); +const ANTIGRAVITY_SKILLS_DIR = path.join(OUTPUT_DIR, 'skills'); + +console.log('🚀 OpenAgents Control → Gemini Antigravity CLI Converter'); +console.log(` Source: ${SOURCE_DIR}`); +console.log(` Output: ${OUTPUT_DIR}\n`); + +/** + * Parses YAML frontmatter from markdown + */ +function parseFrontmatter(content) { + const match = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/); + if (!match) return { frontmatter: null, content }; + + const yaml = match[1]; + const body = match[2]; + + const frontmatter = {}; + yaml.split('\n').forEach(line => { + const colonIndex = line.indexOf(':'); + if (colonIndex > -1) { + const key = line.slice(0, colonIndex).trim(); + let value = line.slice(colonIndex + 1).trim(); + + // Parse arrays + if (value.startsWith('[') && value.endsWith(']')) { + value = value.slice(1, -1).split(',').map(v => v.trim().replace(/"/g, '')); + } + + frontmatter[key] = value; + } + }); + + return { frontmatter, body }; +} + +/** + * Converts OpenCode frontmatter to Antigravity format + */ +function convertFrontmatter(ocFrontmatter) { + const antigravity = {}; + + // Map OpenCode fields to Antigravity fields + antigravity.name = ocFrontmatter.id || ocFrontmatter.name; + antigravity.description = ocFrontmatter.description; + + // Map tools from OpenCode permissions to Antigravity tools + if (ocFrontmatter.tools) { + antigravity.tools = ocFrontmatter.tools; + } else if (ocFrontmatter.permissions || ocFrontmatter.permission) { + const perm = ocFrontmatter.permissions || ocFrontmatter.permission; + const tools = []; + if (perm.read) tools.push('read_file'); + if (perm.grep) tools.push('grep_search'); + if (perm.glob) tools.push('list_dir'); + if (perm.edit) tools.push('edit_file'); + if (perm.write) tools.push('write_file'); + if (perm.bash) tools.push('run_command'); + + // Default fallback if no permissions explicitly matched but has some permission key + if (tools.length === 0) { + tools.push('read_file', 'grep_search', 'list_dir'); + } + + antigravity.tools = tools.join(', '); + } else { + // Default safe tool permissions + antigravity.tools = 'read_file, grep_search, list_dir'; + } + + // Map model to user-specified models + antigravity.model = mapModel(ocFrontmatter.model); + + // Map permissionMode (default to 'default' if not specified) + antigravity.permissionMode = ocFrontmatter.mode === 'subagent' ? 'plan' : 'default'; + + return antigravity; +} + +/** + * Maps OpenCode model names to Gemini model aliases for Antigravity + */ +function mapModel(model) { + const modelMap = { + 'opencode/grok-code': 'gemini-3.1-pro', + 'opencode/grok': 'gemini-3.1-pro', + 'gpt-4': 'gemini-3.1-pro', + 'gpt-4o': 'gemini-3.1-pro', + 'sonnet': 'gemini-3.1-pro', + 'haiku': 'gemini-3.5-flash', + }; + return modelMap[model] || 'gemini-3.1-pro'; +} + +/** + * Generates Antigravity markdown from converted data + */ +function generateAntigravityMarkdown(antigravityFrontmatter, body) { + const fm = Object.entries(antigravityFrontmatter) + .map(([key, value]) => { + if (Array.isArray(value)) { + return `${key}: [${value.map(v => `"${v}"`).join(', ')}]`; + } + let strVal = String(value); + if (strVal.startsWith('"') && strVal.endsWith('"')) { + strVal = strVal.slice(1, -1); + } + return `${key}: "${strVal}"`; + }) + .join('\n'); + + return `---\n${fm}\n---\n\n${body}`; +} + +/** + * Recursively finds all .md files in a directory + */ +function findMarkdownFiles(dir, files = []) { + if (!fs.existsSync(dir)) return files; + const entries = fs.readdirSync(dir, { withFileTypes: true }); + + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + findMarkdownFiles(fullPath, files); + } else if (entry.name.endsWith('.md')) { + files.push(fullPath); + } + } + + return files; +} + +/** + * Processes a single agent file + */ +function processAgent(filePath) { + const content = fs.readFileSync(filePath, 'utf8'); + const { frontmatter, body } = parseFrontmatter(content); + + if (!frontmatter) { + console.log(`⚠️ Skipping ${filePath} (no frontmatter)`); + return; + } + + const antigravityFrontmatter = convertFrontmatter(frontmatter); + const antigravityMarkdown = generateAntigravityMarkdown(antigravityFrontmatter, body); + + // Determine output path + const relativePath = path.relative(SOURCE_DIR, filePath); + const outputPath = path.join(ANTIGRAVITY_AGENTS_DIR, relativePath); + + // Ensure output directory exists + fs.mkdirSync(path.dirname(outputPath), { recursive: true }); + + fs.writeFileSync(outputPath, antigravityMarkdown); + console.log(`✅ Converted: ${relativePath}`); +} + +/** + * Main conversion function + */ +function convert() { + // Clean output directory + if (fs.existsSync(OUTPUT_DIR)) fs.rmSync(OUTPUT_DIR, { recursive: true }); + + fs.mkdirSync(ANTIGRAVITY_AGENTS_DIR, { recursive: true }); + fs.mkdirSync(path.join(ANTIGRAVITY_SKILLS_DIR, 'openagents-control-standards'), { recursive: true }); + + // Create plugin.json at the plugin root + const pluginJson = { + name: "openagents-control-bridge" + }; + fs.writeFileSync( + path.join(OUTPUT_DIR, 'plugin.json'), + JSON.stringify(pluginJson, null, 2) + ); + console.log('📦 Created plugin.json manifest'); + + console.log('📦 Converting agents...\n'); + + // Process category agents + const agentFiles = findMarkdownFiles(SOURCE_DIR); + agentFiles.forEach(processAgent); + + // Create default context-scout subagent + const contextScoutContent = `--- +name: context-scout +description: Discovers and recommends OpenAgents Control context files using list_dir, read_file, and grep_search tools. Use when you need to find OpenAgents Control standards, guides, or domain knowledge in the .opencode/context directory. +tools: read_file, grep_search, list_dir +model: gemini-3.5-flash +permissionMode: plan +--- + +# ContextScout + +You discover and recommend relevant OpenAgents Control context files from \`.opencode/context/\` based on the user's request. + +## Your Process + +1. Use \`list_dir\` or custom glob tools to find files in \`.opencode/context/\`. +2. Use \`read_file\` or \`grep_search\` to verify relevance. +3. Return file paths with brief descriptions. +`; + + fs.writeFileSync( + path.join(ANTIGRAVITY_AGENTS_DIR, 'context-scout.md'), + contextScoutContent + ); + console.log('✅ Created context-scout subagent'); + + // Create openagents-control-standards skill + const skillContent = `--- +name: openagents-control-standards +description: Automatically triggers before any task to ensure OpenAgents Control standards and context are loaded. Use when the user asks to create, modify, or analyze anything in this repository. +--- + +# OpenAgents Control Standards Loader + +Before proceeding with the user's request: + +1. Call the \`context-scout\` subagent with the user's request to find relevant OpenAgents Control context files. +2. Read the returned "Critical" and "High" priority files using \`read_file\`. +3. Apply the OpenAgents Control standards found to your work. +`; + + fs.writeFileSync( + path.join(ANTIGRAVITY_SKILLS_DIR, 'openagents-control-standards/SKILL.md'), + skillContent + ); + console.log('✅ Created openagents-control-standards skill'); + + console.log('\n✨ Conversion complete!'); + console.log(` Output: ${OUTPUT_DIR}`); +} + +// Run conversion +convert(); diff --git a/integrations/antigravity/install-antigravity.sh b/integrations/antigravity/install-antigravity.sh new file mode 100755 index 00000000..85b48b0d --- /dev/null +++ b/integrations/antigravity/install-antigravity.sh @@ -0,0 +1,118 @@ +#!/usr/bin/env bash +# +# install-antigravity.sh +# Installs OpenAgents Control to Gemini Antigravity CLI with automatic conversion +# + +set -euo pipefail + +# Colors +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Determine paths +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" +OPENCODE_DIR="$REPO_ROOT/.opencode/agent" +CONVERTER_DIR="$SCRIPT_DIR/converter" +PLUGIN_DEST="$HOME/.gemini/antigravity-cli/plugins/openagents-control-bridge" +LOCAL_PLUGIN_DEST="$REPO_ROOT/.agents/plugins/openagents-control-bridge" +NODE_BIN="${NODE_BIN:-node}" + +echo -e "${GREEN}🚀 OpenAgents Control → Gemini Antigravity CLI Installer${NC}" +echo -e " Source: $OPENCODE_DIR" +echo -e " Global Destination: $PLUGIN_DEST" +echo -e " Local Workspace Destination: $LOCAL_PLUGIN_DEST" +echo "" + +# Check prerequisites +check_prereqs() { + local missing=() + + # Check for node + if ! command -v "$NODE_BIN" >/dev/null 2>&1; then + missing+=("$NODE_BIN") + fi + + # Check for bash + if ! command -v bash >/dev/null 2>&1; then + missing+=("bash") + fi + + if [ ${#missing[@]} -gt 0 ]; then + echo -e "${RED}✗ Missing required commands: ${missing[*]}${NC}" >&2 + echo -e " Install Node.js: https://nodejs.org/" >&2 + exit 1 + fi +} + +# Run converter +run_converter() { + echo -e "${YELLOW}🔄 Converting agents to Antigravity format...${NC}" + cd "$CONVERTER_DIR" + + if ! "$NODE_BIN" src/convert-agents.js 2>&1 | grep -q "Conversion complete"; then + echo -e "${RED}✗ Conversion failed${NC}" >&2 + exit 1 + fi + + echo -e "${GREEN}✅ Conversion complete${NC}" +} + +# Install plugin +install_plugin() { + # 1. Global Installation + echo -e "${YELLOW}📦 Installing global plugin...${NC}" + mkdir -p "$HOME/.gemini/antigravity-cli/plugins" + + if [ -d "$PLUGIN_DEST" ]; then + echo "🗑️ Removing old global installation..." + rm -rf "$PLUGIN_DEST" + fi + + cp -r "$CONVERTER_DIR/generated" "$PLUGIN_DEST" + echo -e "${GREEN}✅ Global installation complete${NC}" + + # 2. Local/Workspace Installation + echo -e "${YELLOW}📦 Installing workspace plugin...${NC}" + mkdir -p "$REPO_ROOT/.agents/plugins" + + if [ -d "$LOCAL_PLUGIN_DEST" ]; then + echo "🗑️ Removing old workspace installation..." + rm -rf "$LOCAL_PLUGIN_DEST" + fi + + cp -r "$CONVERTER_DIR/generated" "$LOCAL_PLUGIN_DEST" + echo -e "${GREEN}✅ Workspace installation complete${NC}" +} + +# Verify installation +verify() { + if [ ! -f "$PLUGIN_DEST/agents/core/openagent.md" ]; then + echo -e "${RED}✗ Installation verification failed${NC}" >&2 + echo " Expected: $PLUGIN_DEST/agents/core/openagent.md" >&2 + exit 1 + fi + + echo "" + echo -e "${GREEN}✨ Installation successful!${NC}" + echo "" + echo "To use with Gemini Antigravity CLI:" + echo " - View active skills using the: /skills command" + echo " - View active subagents using the: /agents command" + echo "" + echo "Your OAC plug-in is loaded and ready to trigger on your next task!" +} + +# Main workflow +main() { + check_prereqs + run_converter + install_plugin + verify +} + +# Allow specifying custom Node.js binary via NODE_BIN environment variable +main "$@" From ac36e0339a57ce4b9814aeea39ca2fbf26056e1e Mon Sep 17 00:00:00 2001 From: Ben Priebe Date: Wed, 20 May 2026 10:46:16 +1000 Subject: [PATCH 2/2] feat: flatten agents for auto-discovery and add support for converting all repository skills --- .../converter/src/convert-agents.js | 65 +++++++++++++++++-- .../antigravity/install-antigravity.sh | 37 +++++++++-- 2 files changed, 88 insertions(+), 14 deletions(-) diff --git a/integrations/antigravity/converter/src/convert-agents.js b/integrations/antigravity/converter/src/convert-agents.js index 115de46e..80a3dccf 100644 --- a/integrations/antigravity/converter/src/convert-agents.js +++ b/integrations/antigravity/converter/src/convert-agents.js @@ -164,15 +164,38 @@ function processAgent(filePath) { const antigravityFrontmatter = convertFrontmatter(frontmatter); const antigravityMarkdown = generateAntigravityMarkdown(antigravityFrontmatter, body); - // Determine output path - const relativePath = path.relative(SOURCE_DIR, filePath); - const outputPath = path.join(ANTIGRAVITY_AGENTS_DIR, relativePath); + // Determine output path (FLATTENED to level 1 for discovery) + const filename = path.basename(filePath); + const outputPath = path.join(ANTIGRAVITY_AGENTS_DIR, filename); // Ensure output directory exists fs.mkdirSync(path.dirname(outputPath), { recursive: true }); fs.writeFileSync(outputPath, antigravityMarkdown); - console.log(`✅ Converted: ${relativePath}`); + console.log(`✅ Converted agent: ${filename}`); +} + +/** + * Processes and copies a skill folder + */ +function processSkill(skillMdPath) { + const skillDir = path.dirname(skillMdPath); + const skillFolderName = path.basename(skillDir); + + const outputSkillDir = path.join(ANTIGRAVITY_SKILLS_DIR, skillFolderName); + fs.mkdirSync(outputSkillDir, { recursive: true }); + + // Copy all files in the skill directory + const files = fs.readdirSync(skillDir); + files.forEach(file => { + const srcPath = path.join(skillDir, file); + const destPath = path.join(outputSkillDir, file); + if (fs.statSync(srcPath).isFile()) { + fs.copyFileSync(srcPath, destPath); + } + }); + + console.log(`✅ Processed skill: ${skillFolderName}`); } /** @@ -183,7 +206,7 @@ function convert() { if (fs.existsSync(OUTPUT_DIR)) fs.rmSync(OUTPUT_DIR, { recursive: true }); fs.mkdirSync(ANTIGRAVITY_AGENTS_DIR, { recursive: true }); - fs.mkdirSync(path.join(ANTIGRAVITY_SKILLS_DIR, 'openagents-control-standards'), { recursive: true }); + fs.mkdirSync(ANTIGRAVITY_SKILLS_DIR, { recursive: true }); // Create plugin.json at the plugin root const pluginJson = { @@ -227,7 +250,33 @@ You discover and recommend relevant OpenAgents Control context files from \`.ope ); console.log('✅ Created context-scout subagent'); - // Create openagents-control-standards skill + console.log('\n📦 Processing skills...\n'); + + // Find all skill files in .opencode/skills/ and .opencode/skill/ + const skillsDir1 = path.join(REPO_ROOT, '.opencode/skills'); + const skillsDir2 = path.join(REPO_ROOT, '.opencode/skill'); + + const skillFiles = []; + + function findSkillMdFiles(dir) { + if (!fs.existsSync(dir)) return; + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + findSkillMdFiles(fullPath); + } else if (entry.name === 'SKILL.md') { + skillFiles.push(fullPath); + } + } + } + + findSkillMdFiles(skillsDir1); + findSkillMdFiles(skillsDir2); + + skillFiles.forEach(processSkill); + + // Create default openagents-control-standards skill const skillContent = `--- name: openagents-control-standards description: Automatically triggers before any task to ensure OpenAgents Control standards and context are loaded. Use when the user asks to create, modify, or analyze anything in this repository. @@ -242,8 +291,10 @@ Before proceeding with the user's request: 3. Apply the OpenAgents Control standards found to your work. `; + const stdSkillDir = path.join(ANTIGRAVITY_SKILLS_DIR, 'openagents-control-standards'); + fs.mkdirSync(stdSkillDir, { recursive: true }); fs.writeFileSync( - path.join(ANTIGRAVITY_SKILLS_DIR, 'openagents-control-standards/SKILL.md'), + path.join(stdSkillDir, 'SKILL.md'), skillContent ); console.log('✅ Created openagents-control-standards skill'); diff --git a/integrations/antigravity/install-antigravity.sh b/integrations/antigravity/install-antigravity.sh index 85b48b0d..1c82d61f 100755 --- a/integrations/antigravity/install-antigravity.sh +++ b/integrations/antigravity/install-antigravity.sh @@ -63,19 +63,29 @@ run_converter() { # Install plugin install_plugin() { - # 1. Global Installation - echo -e "${YELLOW}📦 Installing global plugin...${NC}" + # 1. Global Installation (antigravity-cli) + echo -e "${YELLOW}📦 Installing global CLI plugin...${NC}" mkdir -p "$HOME/.gemini/antigravity-cli/plugins" if [ -d "$PLUGIN_DEST" ]; then - echo "🗑️ Removing old global installation..." + echo "🗑️ Removing old global CLI installation..." rm -rf "$PLUGIN_DEST" fi cp -r "$CONVERTER_DIR/generated" "$PLUGIN_DEST" - echo -e "${GREEN}✅ Global installation complete${NC}" + echo -e "${GREEN}✅ Global CLI installation complete${NC}" + + # 2. Global Configuration Plugins (Desktop & CLI Auto-Load) + echo -e "${YELLOW}📦 Installing global config plugin...${NC}" + local config_plugin_dest="/Users/benpriebe/.gemini/config/plugins/openagents-control-bridge" + mkdir -p "/Users/benpriebe/.gemini/config/plugins" + if [ -d "$config_plugin_dest" ]; then + rm -rf "$config_plugin_dest" + fi + cp -r "$CONVERTER_DIR/generated" "$config_plugin_dest" + echo -e "${GREEN}✅ Global config installation complete${NC}" - # 2. Local/Workspace Installation + # 3. Local/Workspace Installation (.agents/plugins) echo -e "${YELLOW}📦 Installing workspace plugin...${NC}" mkdir -p "$REPO_ROOT/.agents/plugins" @@ -86,13 +96,26 @@ install_plugin() { cp -r "$CONVERTER_DIR/generated" "$LOCAL_PLUGIN_DEST" echo -e "${GREEN}✅ Workspace installation complete${NC}" + + # 4. Standard Workspace Paths (.agents/skills and .agents/agents) + echo -e "${YELLOW}📦 Installing to standard workspace paths (.agents/skills/ and .agents/agents/)...${NC}" + mkdir -p "$REPO_ROOT/.agents/skills" + mkdir -p "$REPO_ROOT/.agents/agents" + + # Clean old workspace skills/agents directories + rm -rf "$REPO_ROOT/.agents/skills"/* + rm -rf "$REPO_ROOT/.agents/agents"/* + + cp -r "$CONVERTER_DIR/generated/skills"/* "$REPO_ROOT/.agents/skills/" + cp -r "$CONVERTER_DIR/generated/agents"/* "$REPO_ROOT/.agents/agents/" + echo -e "${GREEN}✅ Standard workspace paths installation complete${NC}" } # Verify installation verify() { - if [ ! -f "$PLUGIN_DEST/agents/core/openagent.md" ]; then + if [ ! -f "$PLUGIN_DEST/agents/openagent.md" ]; then echo -e "${RED}✗ Installation verification failed${NC}" >&2 - echo " Expected: $PLUGIN_DEST/agents/core/openagent.md" >&2 + echo " Expected: $PLUGIN_DEST/agents/openagent.md" >&2 exit 1 fi