Skip to content

Commit 9a4270e

Browse files
authored
feat(converter): add Claude Code to OpenCode content transformation (#36)
Add comprehensive CC→OC migration capabilities to the converter module: - Transform skill/command frontmatter by removing CC-only fields (model, allowed-tools, disable-model-invocation, user-invocable, context, agent) - Transform command frontmatter: remove argument-hint, normalize model field - Transform body content: convert tool names (Task→delegate_task, TodoWrite→todowrite, etc.), update path references (.claude/→.opencode/), replace prefix patterns - Add skipBodyTransform option to disable body transformations - Include skipBodyTransform in cache key for proper invalidation - Widen frontmatter typing (Record<string, unknown>) to preserve arrays/objects - Use js-yaml dump for robust frontmatter serialization (prevents corruption of non-scalar YAML values) - Add comprehensive test coverage for all transformation scenarios Also adds: - docs/CONVERSION-GUIDE.md: Complete CC→OC migration reference for humans and AI agents - Test cleanup: Replace non-null assertions with explicit guards to satisfy Biome lint rules Fixes an edge case where formatFrontmatter() would corrupt complex YAML structures (arrays/objects) by switching from string interpolation to proper YAML serialization.
1 parent 505b0d8 commit 9a4270e

5 files changed

Lines changed: 840 additions & 34 deletions

File tree

0 commit comments

Comments
 (0)