Skip to content

feat(converter): add Claude Code to OpenCode content transformation#36

Merged
marcusrbrown merged 1 commit into
mainfrom
feat/improve-cc-to-oc-conversion
Jan 31, 2026
Merged

feat(converter): add Claude Code to OpenCode content transformation#36
marcusrbrown merged 1 commit into
mainfrom
feat/improve-cc-to-oc-conversion

Conversation

@marcusrbrown
Copy link
Copy Markdown
Owner

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.

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.
@marcusrbrown marcusrbrown enabled auto-merge (squash) January 31, 2026 18:32
@marcusrbrown marcusrbrown self-assigned this Jan 31, 2026
@marcusrbrown marcusrbrown merged commit 9a4270e into main Jan 31, 2026
8 checks passed
@marcusrbrown marcusrbrown deleted the feat/improve-cc-to-oc-conversion branch January 31, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant