Architecture Overview
The conversion system has three main layers:1. Targets (src/targets/)
Target handlers define the conversion and output strategy for each platform.
src/targets/index.ts (registry) and src/targets/<provider>.ts (implementation)
2. Converters (src/converters/)
Converters transform Claude plugin structure into target-specific format.
Responsibilities:
- Map agents to target’s agent/prompt format
- Convert commands to target-specific commands
- Transform tool names and permissions
- Translate hooks/events to target’s event system
- Normalize model names for target’s supported models
src/converters/claude-to-codex.ts
3. Types (src/types/)
Type definitions for each platform’s configuration format.
Example structure:
Adding a New Provider
Define the target entry
Add a new handler in Create a dedicated writer module in
src/targets/index.ts with implemented: false until complete.src/targets/<provider>.ts.Define types and mapping
Add provider-specific types under Implement conversion logic in Keep mappings explicit:
src/types/<provider>.ts.src/converters/claude-to-<provider>.ts.- Tool name mappings (bash, read, write, etc.)
- Permission modes
- Hook/event equivalents
- Model naming conventions
Wire the CLI
Ensure
convert and install commands support the new provider:--to <provider>flag--also <provider>for multi-target output- Consistent behavior with existing providers
src/targets/index.ts. The CLI automatically picks up new targets from the registry.Add custom home directory support if needed:Tests (required)
Add comprehensive test coverage before marking 2. Add converter tests3. Add writer tests4. Add CLI integration testRun tests:
implemented: true.1. Extend fixturesAdd sample content in tests/fixtures/sample-plugin/:When to Add a Provider
Add a new provider when at least one of these is true:A real user or workflow needs it now
The target format is stable and documented
There’s a clear mapping for tools, permissions, and hooks
You can write fixtures and tests that validate the mapping
Real-World Example
The Codex target demonstrates the full implementation: Files:src/types/codex.ts- Type definitions (src/types/codex.ts:1)src/converters/claude-to-codex.ts- Conversion logic (src/converters/claude-to-codex.ts:1)src/targets/codex.ts- Writer implementation (src/targets/codex.ts:1)src/targets/index.ts- Registry entry (src/targets/index.ts:77-82)tests/codex-converter.test.ts- Converter teststests/codex-writer.test.ts- Writer teststests/cli.test.ts- CLI integration tests
- Claude agents → Codex skills
- Claude commands → Codex prompts + command skills
- Tool mappings for Codex’s tool system
- MCP server pass-through