fix: handle agent frontmatter correctly in OpenCode conversion (#981)

convertClaudeToOpencodeFrontmatter() was designed for commands but is
also called for agents. For agents it incorrectly strips name: (needed
by OpenCode agents), keeps color:/skills:/tools: (should strip), and
doesn't add model: inherit / mode: subagent (required by OpenCode).

Add isAgent option to convertClaudeToOpencodeFrontmatter() so agent
installs get correct frontmatter: name preserved, Claude-only fields
stripped, model/mode injected. Command conversion unchanged (default).

Includes 14 test cases covering agent and command conversion paths.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
flongstaff
2026-03-15 18:42:12 +01:00
committed by GitHub
parent 698985feb1
commit 386fc0f40c
3 changed files with 188 additions and 9 deletions

View File

@@ -6,6 +6,9 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [Unreleased]
### Fixed
- OpenCode agent frontmatter conversion — agents now get correct `name:`, `model: inherit`, `mode: subagent` instead of broken command-style conversion that stripped name and kept `color:`/`skills:`/`tools:`
## [1.23.0] - 2026-03-15
### Added