-
-
Notifications
You must be signed in to change notification settings - Fork 870
Closed
Description
🎯 Feature Request
Create an official Opencode compatibility adapter for Daniel Miessler's Personal AI Infrastructure (PAI) to enable cross-platform AI agent support.
📋 Problem Statement
PAI currently claims platform agnosticism ("works with any AI platform") but is entirely Claude Code-dependent in practice. Opencode users cannot access PAI's powerful personal AI infrastructure due to architectural incompatibilities.
🔍 Research Findings
PAI Current Limitations:
- Hook System: Requires Claude Code's specific TypeScript hooks (
initialize-pai-session.ts,update-tab-titles.ts) - Directory Structure: Hardcoded to
~/.claude/(Claude Code's home directory) - Settings Format: Uses Claude Code's exclusive
settings.jsonschema - Skills Framework: Dependent on Claude Code's natural language routing
- MCP Integration: Designed for Claude Code's MCP implementation
Opencode Capabilities:
- Plugin System: Extensible with event hooks (
tool.execute.before,event, etc.) - Agent Framework: Primary/subagent system with tool permissions
- Configuration: JSON-based with schema validation and environment variables
- MCP Support: Comprehensive MCP server integration
- Client/Server: HTTP server architecture for universal access
No Cross-Platform Evidence:
- Zero documented cases of PAI working with non-Claude platforms
- Community discussions exclusively reference Claude Code usage
- All troubleshooting assumes Claude Code environment
- GitHub issues confirm "PAI needs Claude Code" (Discussion What should I see when finished installation to know PAI is installed. #89)
🛠️ Proposed Solution
Phase 1: Platform Abstraction Layer
Create adapters/ directory in PAI:
adapters/
├── claude-code/ # Current implementation
├── opencode/ # New adapter needed
├── gpt-cli/ # Future adapters
└── platform-agnostic/ # Common interface
Phase 2: Opencode Adapter Implementation
- Translate PAI hooks to Opencode plugin events
- Map PAI skills to Opencode agents
- Convert PAI settings to Opencode JSON format
- Bridge directory structure differences
Phase 3: Configuration Migration
- Automatic detection of Opencode environment
- Transform
.claude/structure to Opencode-compatible format - Maintain backward compatibility with Claude Code
📊 Technical Requirements
PAI Changes Needed:
- Platform Interface: Abstract core PAI functionality from Claude Code dependencies
- Hook Translation: Convert TypeScript hooks to platform-agnostic events
- Config Adapter: Transform settings between formats
- Skill Mapping: Translate PAI skills to agent definitions
Opencode Changes Needed:
- PAI Plugin: Official plugin to load PAI infrastructure
- Configuration Import: Support for PAI configuration files
- Directory Bridge: Map
.claude/to Opencode's structure - Skill Integration: Load PAI skills as Opencode agents
🎯 Expected Benefits
- True Platform Agnosticism: PAI works with Claude Code, Opencode, GPT, Gemini
- Larger User Base: Opencode's open-source nature expands PAI adoption
- Reduced Vendor Lock-in: Users can choose AI platform based on needs
- Community Growth: Cross-platform compatibility drives contributions
📝 Implementation Considerations
- Maintain backward compatibility with existing Claude Code integration
- Follow Opencode's plugin development guidelines
- Ensure security best practices across platforms
- Provide migration tools for existing users
🔗 Related Issues
- Contradictory definitions for PAI_DIR variable - Inconsistency in Setup Instructions #92: Contradictory definitions for PAI_DIR variable
- Automated Documentation needs human supervision #95: Automated Documentation needs human supervision
- stop-hook.ts looks for a config file in iCloud path #96: stop-hook.ts looks for config file in iCloud path
📊 Impact Assessment
High Impact: Enables PAI's mission of "AI for everyone" by supporting truly platform-agnostic operation.
luca-git, WSschaaf, FilipLjubic, AtheeSouhait and requix
Metadata
Metadata
Assignees
Labels
No labels