A TypeScript CLI tool to convert base-agents, commands, and skills to OpenCode format.
- Agent Conversion: Convert base-agents to OpenCode agent format
- Command Conversion: Convert commands to OpenCode command format
- Skill Conversion: Convert skills to OpenCode skill format
- Validation: Comprehensive validation of converted files
- Batch Processing: Convert all files at once
- Dry Run Mode: Preview conversions without writing files
- Plugin Compatibility Research: Analysis and strategies for Claude Code ↔ OpenCode plugin integration
We've researched how Claude Code plugins can work with OpenCode. Key findings:
- ✅ Commands are directly compatible - Both systems use the same markdown format!
⚠️ Agents/Skills need conversion - Can be wrapped as OpenCode custom tools- 🔴 Hooks require code generation - JSON configs → TypeScript event handlers
- 📋 Full plugin conversion planned - Coming soon to CodeFlow CLI
Documentation:
- Quick Start Guide - Use commands today
- Integration Guide - Complete technical analysis
- Implementation Roadmap - Future development plans
Try it now:
# Convert Claude Code commands for OpenCode
codeflow convert commands --output .opencode/command/POC Available: See examples/poc-anthropic-plugins/ for complete conversion examples using official Anthropic plugins (explanatory-output-style and learning-output-style).
npm install -g codeflow-cliConvert base-agents to OpenCode format:
codeflow convert agents --output ./opencode-agentsConvert commands to OpenCode format:
codeflow convert commands --output ./opencode-commandsConvert skills to OpenCode format:
codeflow convert skills --output ./opencode-skillsConvert all agents, commands, and skills:
codeflow migrate --output ./convertedValidate converted files:
codeflow validate ./opencode-agents --format opencode-agentPreview conversions without writing files:
codeflow convert agents --dry-run-v, --version: Show version-h, --help: Show help
-o, --output <dir>: Output directory (default: ./converted)-d, --dry-run: Show what would be converted without writing files-v, --validation <level>: Validation level (strict, lenient, off)
-o, --output <dir>: Output directory (default: ./converted)-d, --dry-run: Show what would be migrated without writing files-v, --validation <level>: Validation level (strict, lenient, off)--agents-only: Only migrate agents--commands-only: Only migrate commands--skills-only: Only migrate skills
-f, --format <type>: Format type (opencode-agent, opencode-command, opencode-skill)-r, --report <file>: Save validation report to file
.
├── base-agents/ # Source agent definitions
├── commands/ # Source command definitions
├── skills/ # Source skill definitions
└── converted/ # Output directory
├── agents/ # Converted OpenCode agents
├── commands/ # Converted OpenCode commands
└── skills/ # Converted OpenCode skills
Maps base-agent fields to OpenCode format:
name→namedescription→descriptionmode→modetemperature→temperaturetools→tools(with mapping)permission→permission- Additional fields → integrated into prompt
Converts command definitions to OpenCode command format:
- Frontmatter becomes command metadata
- Body becomes command template
- Preserves agent and model assignments
Converts skill definitions to OpenCode skill format:
- Frontmatter becomes skill metadata
- Body becomes skill prompt
- Preserves noReply setting
The CLI validates converted files for:
- Required fields presence
- Data type correctness
- Format compliance
- Best practices
# Convert agents with default settings
codeflow convert agents
# Convert to specific output directory
codeflow convert agents --output ./my-agents
# Dry run to preview changes
codeflow convert agents --dry-run# Migrate everything
codeflow migrate
# Migrate only agents
codeflow migrate --agents-only
# Migrate with strict validation
codeflow migrate --validation strict# Validate agent files
codeflow validate ./converted/agents --format opencode-agent
# Save validation report
codeflow validate ./converted --format opencode-agent --report report.json# Install dependencies
npm install
# Build
npm run build
# Run in development
npm run dev
# Test
npm testMIT