fix(opencode): use native agents/ and commands/ layout instead of skills/#2056
fix(opencode): use native agents/ and commands/ layout instead of skills/#2056arnoe wants to merge 1 commit intobmad-code-org:mainfrom
Conversation
…lls/ OpenCode does not have a native 'skills' concept. It uses .opencode/agents/ for agent persona definitions and .opencode/commands/ for slash commands. The installer was incorrectly placing everything into .opencode/skills/ as SKILL.md directories, which duplicated content from _bmad/ and prevented workflows from appearing as native opencode commands. Switch opencode to a multi-target layout: - .opencode/agents/ — flat agent launcher files (opencode-agent template) - .opencode/commands/ — flat workflow/task/tool command files This matches the output that older installations (e.g. v6.0.4) produced and aligns with how opencode actually discovers and surfaces agents and commands. Also update detect() and findAncestorConflict() in the config-driven handler to support multi-target platforms, so detection and ancestor conflict checks work correctly for all target directories.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe OpenCode installer is refactored to support a multi-target configuration instead of a single target. Installation now routes agents to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
|
Sorry, not doing that anymore. BMAD (and just about everybody else in this space) has switched from 20 custom, constantly changing installers to shipping skills. If you want some sort of wrapper around them for your own platform, it usually takes about 15 minutes to make one. And if you decide to publish that, please advertise it on BMAD's Discord! |
Summary
.opencode/agents/for agent persona definitions and.opencode/commands/for slash commands.opencode/skills/asSKILL.mddirectories, which duplicated content from_bmad/and prevented workflows from appearing as native opencode commandstargetsmechanism in_config-driven.js:.opencode/agents/— flat agent launcher files (usingopencode-agenttemplate withmode: allfrontmatter).opencode/commands/— flat workflow/task/tool command files (thin loaders pointing to_bmad/canonical sources)What changed
platform-codes.yamltarget_dir: .opencode/skills+skill_format: truewith atargetsarray containing two entries (agents + commands).opencode/skillsintolegacy_targetsso existing skill-based installations are cleaned up on upgrade.opencode/agentsand.opencode/commandsfromlegacy_targetssince they are now active output targets_config-driven.jsdetect(): Added multi-target detection — checks alltargets[].target_dirdirectories for bmad-prefixed entries (previously only worked for singletarget_dirwithskill_format)findAncestorConflict(): Now collects target directories from bothtarget_dirandtargets[]for ancestor conflict checking, so platforms with multiple output directories are fully coveredtest-installation-components.js.opencode/agents/, commands directory created, opencode-specificmode: allfrontmatter.opencode/agents/instead of.opencode/skills/Motivation
This was discovered by comparing a v6.0.4 installation (
poc-create-brief) — which correctly used.opencode/agents/+.opencode/commands/— against a v6.2.0 installation which placed everything in.opencode/skills/. The v6.0.4 output was the correct structure for opencode's native concepts, and this PR restores that behavior using the config-driven architecture.