Purpose: Enable bidirectional translation between OpenAgents Control and other AI coding tools
Last Updated: 2026-02-04
Adapter pattern that translates agent configurations between OAC format and tool-specific formats (Cursor IDE, Claude Code, Windsurf). Enables seamless migration and multi-tool workflows through bidirectional mapping with graceful degradation.
Adapters: Tool-specific translation classes inheriting from BaseAdapter
Mappers: Pure functions for feature translation
Core Services:
OAC Agent File (.md)
↓ (parse)
AgentLoader → OpenAgent object (validated with Zod)
↓ (convert)
BaseAdapter.fromOAC()
↓ (map features)
Mappers (tools, permissions, models, contexts)
↓ (output)
Tool-specific config files
Reverse direction: Tool config → toOAC() → OpenAgent → OAC .md file
| Feature | OAC | Claude | Cursor | Windsurf |
|---|---|---|---|---|
| Multiple agents | ✅ | ✅ | ❌ Single | ✅ |
| Granular permissions | ✅ | ⚠️ Simplified | ❌ | ⚠️ Partial |
| Temperature | ✅ | ❌ | ⚠️ Partial | ⚠️ Partial |
| Skills | ✅ | ✅ | ❌ | ⚠️ Partial |
| Hooks | ✅ | ✅ | ❌ | ❌ |
| Context files | ✅ | ✅ Skills | ✅ .cursorrules | ✅ |
// Load OAC agent
const agent = await AgentLoader.loadAgent('.opencode/agent/openagent.md')
// Get Claude adapter
const adapter = AdapterRegistry.get('claude')
// Convert to Claude format
const result = await adapter.fromOAC(agent)
// Outputs: .claude/config.json, .claude/skills/[...]
console.log(result.configs) // Array of files to write
console.log(result.warnings) // Feature degradation warnings
Single-File Tools (Cursor): Merge multiple OAC agents into one .cursorrules file Permission Mapping: OAC granular permissions → simplified tool permissions Model IDs: Different tools use different model identifiers (requires mapping table) Context Paths: OAC uses .opencode/context/, tools use various paths
Issue #141: https://github.com/darrenhinde/OpenAgentsControl/issues/141
Progress: 28.13% (9/32 subtasks)
Location: packages/compatibility-layer/src/