OpenWriterControle/integrations/claude-code/install-claude.sh
Darren Hinde 9a58a03284
fix(context): Add frontmatter to context files with missing metadata (#97)
* feat(context): Add project intelligence system

- Add project-intelligence.md standard (what & why)
- Add project-intelligence-management.md guide (how to manage)
- Add project-intelligence/ folder with 6 context files:
  - navigation.md (quick overview & routes)
  - business-domain.md (business context, users, value)
  - technical-domain.md (stack, architecture, decisions)
  - business-tech-bridge.md (business → technical mapping)
  - decisions-log.md (decision history with context)
  - living-notes.md (active issues, debt, questions)
- Update standards navigation with new entries
- Register all new contexts in registry.json

This enables projects to document and maintain business + technical
context for quick onboarding and lasting project understanding.

* fix(registry): Add project-intelligence to profiles

- Add context:project-intelligence/* to developer, business, full, and advanced profiles
- Ensures project intelligence contexts are included when these profiles are selected

This complements commit c731328 which added the context entries.

* docs(core): refine project intelligence system and deprecate legacy context

* feat(claude): simplify Claude Code integration with unified installer

- Create single install-claude.sh script that auto-converts and installs
- Remove redundant bootstrap-install.sh and install.sh scripts
- Delete stale plugin/ directory (now auto-generated from .opencode/)
- Add Claude Code documentation (agent-skills, create-subagents, hooks, plugins)
- Add installation profiles (essential, developer, business, full, advanced)
- Update README with Claude Code beta feature documentation
- Add component-planning.md workflow context
- Clean up demo files (assets/, src/)
- Update registry with new context entries
- Add gitignore rule for converter/generated/

The new installer:
- Converts agents automatically from .opencode/agent/
- Installs fresh converted agents to ~/.claude/plugins/
- Single command: ./integrations/claude-code/install-claude.sh

* fix: update README to use new install-claude.sh script

The Claude Code integration now uses the unified install-claude.sh script
instead of the removed bootstrap-install.sh and install.sh scripts.

* fix(context): Add frontmatter to context files with missing metadata

- Add YAML frontmatter with description to system-builder-templates
- Add frontmatter to ui/web/design context files
- Fixes validation warnings in validate-component.sh

* fix(registry): Remove orphaned context entries for deleted files

- Remove copywriting-frameworks entry (file moved to content-creation/principles/)
- Remove tone-voice entry (file moved to content-creation/principles/)
2026-01-17 21:29:48 +00:00

111 lines
2.7 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# install-claude.sh
# Installs OpenAgents to Claude Code 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/.claude/plugins/openagents-bridge"
NODE_BIN="${NODE_BIN:-node}"
echo -e "${GREEN}🚀 OpenAgents → Claude Code Installer${NC}"
echo -e " Source: $OPENCODE_DIR"
echo -e " Destination: $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 Claude 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() {
echo -e "${YELLOW}📦 Installing plugin...${NC}"
# Create destination
mkdir -p "$HOME/.claude/plugins"
# Remove old installation
if [ -d "$PLUGIN_DEST" ]; then
echo "🗑️ Removing old installation..."
rm -rf "$PLUGIN_DEST"
fi
# Copy from generated (always fresh conversion)
cp -r "$CONVERTER_DIR/generated" "$PLUGIN_DEST"
echo -e "${GREEN}✅ 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 Claude Code:"
echo " claude --plugin-dir $PLUGIN_DEST"
echo ""
echo "Or add to your Claude Code settings for automatic loading:"
echo ' { "plugins": ["openagents-bridge"] }'
echo ""
echo "Verify Claude Code installation:"
echo " claude --version"
}
# Main workflow
main() {
check_prereqs
run_converter
install_plugin
verify
}
# Allow specifying custom Node.js binary via NODE_BIN environment variable
main "$@"