Add OpenCode plugin support alongside Claude Code#8
Conversation
OpenCode auto-discovers skills under .claude/skills/ as well as .opencode/skills/, so the skill content stays in one place and both runtimes see it. Adds a thin OpenCode glue layer: 10 flat hyphenated commands, 9 pre-declared persona/phase agents, a host adapter documenting OpenCode-specific tool name mappings, and a structural validator script. Zero changes to the Claude Code tree (claude-plugin/, .claude/, .claude-plugin/, scripts/sync.sh, install.sh, .github/). New: - .opencode/host-adapter.md — OpenCode override contract - .opencode/commands/*.md (10) — /autodecision + 9 hyphenated subcommands - .opencode/agents/ad-*.md (9) — 5 personas, critique, adversary, sensitivity, decide - scripts/sync-check-opencode.sh — structural validator (executable) - OPENCODE.md — host-specific reference doc Modified: - README.md — OpenCode install section + dual command examples - CLAUDE.md — OpenCode install path + .opencode/ tree in Architecture Implementation plan: ~/.plannotator/plans/port-autodecision-to-opencode-2026-04-23-approved.md
|
Thanks for putting this together — the PR description is thorough, the "zero diffs to the Claude Code tree" discipline is exactly right, and the structural validator is a nice touch. One bigger rework I'd want before this can merge, though. Right now What I'd want here:
Also: Codex support is out of scope here, but worth noting as a follow-up if OpenCode lands cleanly. The overall direction (additive, non-invasive, skill content shared via autodiscovery) is sound. The rework is the execution model. |
Summary
Adds first-class support for OpenCode alongside the existing Claude Code plugin. The skill content (protocols, personas, templates, Python validator) is shared between both hosts — OpenCode auto-discovers skills under
.claude/skills/as well as.opencode/skills/. Only the glue layer (commands + pre-declared agents + a host adapter) is OpenCode-specific.Key properties
claude-plugin/,.claude/,.claude-plugin/,scripts/sync.sh,install.sh, and.github/are bit-identical before/after.What ships
New files
.opencode/host-adapter.md— the single contract every OpenCode command reads alongside SKILL.md. Covers tool name map (Agent→task,WebSearch→websearch, etc.), pre-declared agent roster, parallel spawn pattern, Rule 13 runtime check, websearch caveat, context-file handling, publish chain overrides..opencode/commands/*.md(10) —autodecision.mdplus 9 hyphenated subcommands. OpenCode has no namespace/colon support, so commands are flat:/autodecision,/autodecision-quick,/autodecision-compare,/autodecision-revise,/autodecision-challenge,/autodecision-summarize,/autodecision-publish,/autodecision-plan,/autodecision-review,/autodecision-export..opencode/agents/ad-*.md(9) — 5 persona agents (ad-optimist,ad-pessimist,ad-competitor,ad-regulator,ad-customer), plusad-critique,ad-adversary,ad-sensitivity,ad-decide. Allmode: subagent, hidden: true. OpenCode's Task tool requires pre-declared agent files (unlike Claude Code's inline-prompt Agent tool).scripts/sync-check-opencode.sh— structural validator. Confirms every command exists with valid frontmatter, every agent hasmode: subagent+hidden: true, every command references the host adapter and the skill path, no orchestrator setssubtask: true.OPENCODE.md— host-specific reference doc (install, command map, how subagents work differently, known limitations, troubleshooting).Modified files
README.md— adds the OpenCode install section; dual command examples (colon vs hyphen) in Quick Start.CLAUDE.md— notes OpenCode install path under Installation; adds.opencode/tree to Architecture diagram.Key research findings that shaped this design
SKILL.md+references/skilltool; auto-discovers.claude/skills/AND.opencode/skills/Tasktool, inline promptstasktool, but agents must be pre-declared as named files/autodecision:quick)plugin.json.opencode/files OR npm JS-only plugin (npm cannot ship .md files).opencode/into your project"subtask: trueValidator output
Testing
/autodecision "Should we cut pricing by 20%?"inside an OpenCode install and verify Phase 3 spawns all 5 persona subagents in parallel (deferred — requires OpenCode running on the machine)Deferred (follow-up PR)
.opencode/plugin.tswith custom tools:autodecision_journal_append(schema-validated JSONL writes),autodecision_read_brief(slug resolver). Not required — thebash-based file I/O path works.sync-check-opencode.shinto.github/workflows/sync-check.yml.Draft PR
This is a draft PR because the live end-to-end test against a real OpenCode install hasn't run yet. Once someone confirms
/autodecisionruns the full 10-phase loop inside OpenCode and spawns all 5 personas in parallel, this can be marked ready.