Conversation
Bee now runs on opencode the same way it runs on Claude Code: 35 subagents,
12 commands, 20 skills, full SDD lifecycle. Approach is to keep the
Claude-side files in bee/{agents,commands}/ as the single source of truth
and generate opencode twins under bee/.opencode/ via two Python scripts.
The installer symlinks each file into ~/.config/opencode/ so opencode's
discovery model picks them up without a JS plugin.
Key transformations the generators apply:
- bee:foo cross-references → bee-foo (matches the prefixed install names)
- frontmatter rewritten to opencode's schema (description, mode, category)
- Claude-specific tools mapped to opencode equivalents
(AskUserQuestion → question, TodoWrite/Task* → todowrite, etc.)
- Deferred Tool Loading preamble stripped (opencode has no equivalent)
- $CLAUDE_PLUGIN_ROOT/scripts → $HOME/.config/opencode/bee/scripts
- Skills get an explicit load preamble (no frontmatter auto-load on opencode)
Foot-gun resolved: opencode's ConfigAgent reads frontmatter via
{ name, ...md.data, prompt }, so writing a name: field clobbers the
filename-derived name and breaks the bee- prefix. Generator no longer
emits name:.
Bundled: refactor of /bee:review (175 → 36 lines). Orchestration logic
moved into a new review-orchestration skill, matching the pattern Bee
already uses for brainstorming, clean-code, etc. Pilot validation in
docs/brainstorms/pilot-phase-0-findings.md.
Tested end-to-end on opencode web with Kimi K2.6: install → restart →
/bee-help → /bee-brainstorm → /bee-sdd → 29 passing tests on the demo
project. Subagent dispatch (the original blocker) resolves cleanly.
Add an "On opencode" section pointing to the symlink installer (bash bee/.opencode/bin/install.sh) with the restart-required gotcha called out, and link to the full INSTALL.md and ARCHITECTURE notes for details. Also refresh the Bee plugin description: notes both Claude Code and opencode, updates counts (12 commands, 35 agents, 20 skills) which had drifted from the prior 10/26.
Removes opencode-advanced-integration-brainstorm.md and pilot-phase-0-findings.md. Both were session artifacts (working notes from earlier exploration) that didn't add reviewable value to the PR and referenced a since-renamed branch. Keeping docs/opencode-port-findings.md as the consolidated reference.
Per review feedback: keep the bee/ folder for plugin code (agents, commands, scripts, generators) and put user-facing docs in the repo's top-level docs/ directory. - bee/.opencode/INSTALL.md → docs/opencode-install.md - Updated all internal links (README.md, opencode-port-findings.md, ARCHITECTURE.md tree diagram)
Most of the doc was forward-looking — Phase 2 routing, future migration paths, open questions, contributor guides for hypothetical patterns. What's actually shipped is described in docs/opencode-port-findings.md (discovery surfaces, generators, install mechanism, gotchas). Updated all internal links: README, docs/opencode-install.md, and docs/opencode-port-findings.md (removed stale tree entries for ARCHITECTURE.md, the deleted brainstorms, and demos/ that we already moved out of the repo).
- Add .claude/ -> .opencode/ substitution to all generators - Add bare CLAUDE.md -> AGENTS.md substitution for opencode convention file - Create generate-opencode-skills.py to transform skills for opencode - Extract shared BODY_SUBS to opencode_subs.py module - Parameterize update-bee-state.sh with BEE_DIR env var - Fix install.sh to symlink generated skills instead of raw source - Add .idea/ and __pycache__/ to .gitignore
9ee9d0d to
0bafdd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add opencode support
Bee now runs on opencode the same way it runs on Claude Code: 35 subagents, 12 commands, 20 skills, full SDD lifecycle (brainstorm → spec → architecture → slice loop → review). No runtime bridge, no JS plugin — just generated markdown twins under
bee/.opencode/and a per-file symlink installer.Demo
30s walkthrough: fresh opencode session →
/bee-brainstorm→/bee-sdd→ SDD complete with 29 passing tests, all driven through the opencode web UI on Kimi K2.6.https://github.com/incubyte/ai-plugins/releases/download/untagged-02385493534a294c71e2/bee-opencode-demo.mp4
The demo builds a small CLI URL shortener (
tinyurl) end-to-end: brainstorm decides on SHA-256 hex slugs + functional split, SDD triages it as SMALL, slice-coder/slice-tester/sdd-verifier deliver two slices, and the final test suite is green.What ships
bee/scripts/generate-opencode-{agents,commands}.pybee/{agents,commands}/*.mdinto opencode twins underbee/.opencode/. Single source of truth stays on the Claude side.bee/.opencode/agents/*.md(×35)description,mode: subagent,category). Body has skill-load preamble,bee:foo→bee-foocross-references, and Claude-specific tool names mapped to opencode equivalents.bee/.opencode/commands/*.md(×12)bee/.opencode/bin/install.shbee-<name>cleanly), directory symlinks for skills and scripts. Refuses to overwrite anything not already pointing into the plugin.docs/opencode-install.mddocs/opencode-port-findings.mdname:clobbering filename), and the runtime gotchas. Useful background for the next person extending this.How it works (the short version)
Opencode discovers agents/commands/skills from a small set of fixed config directories (
~/.config/opencode/, walked-up.opencode/,$OPENCODE_CONFIG_DIR). Plugin paths are not scanned. So instead of fighting the discovery model, we symlink each markdown file individually from the plugin into~/.config/opencode/{agent,command,skill}/. Agents and commands get abee-prefix from the filename (cross-references likeTask(subagent_type=bee:foo)are rewritten tobee-fooby the generator); skills keep their bare names.The Claude-side files in
bee/{agents,commands}/remain the single source of truth. Re-run the generator after editing.Full discovery walk-through, foot-guns hit, and rationale: see
docs/opencode-port-findings.md.Notes on the model side
The demo was built using Kimi K2.6 through opencode's
kimi-for-codingprovider. It executed the full SDD pipeline — context-gather, slice-coder, slice-tester, sdd-verifier — with parallel subagent dispatch working correctly and returning clean structured output. The interesting bit isn't really the model: it's that Bee's prompts (skill-loading discipline, agent role separation, AC-driven verification) translate cleanly to whatever model the developer is using. With detailed instructions, an open-source model holds its own on a multi-step structured task.Bundled refactor: review-orchestration
bee/commands/review.mdwas 175 lines of orchestration logic. Extracted the body (scope detection, parallel agent spawn, merging, hotspot-prioritized roadmap, dedup rules, output format) into a newbee/skills/review-orchestration/SKILL.md. The command is now ~36 lines of wiring: load skill, spawn 7 specialists, follow skill instructions.This is the same pattern Bee already uses for
brainstorming,clean-code, etc. — keeping commands thin and putting the methodology in skills.Bundled because it's small, doesn't conflict with the opencode work, and shipping two PRs for one branch felt like extra ceremony. Happy to split if reviewers prefer.
Tested
End-to-end on opencode web (default model: Kimi K2.6):
bash bee/.opencode/bin/install.shsymlinks 35 agents, 12 commands, 20 skills, scripts dir/bee-helpruns and lists all commands/skills/bee-brainstormruns full diverge/converge loop withquestiontool/bee-sdd "build a CLI URL shortener..."triages, codes, tests, verifies — 29/29 tests passing on the demo projectTask(subagent_type=bee-context-gatherer)resolves and runs (the original blocker)/bee-review(the refactored one) loadsreview-orchestrationskill and spawns 7 reviewers in parallelClaude Code side: unchanged. Source-of-truth files in
bee/{agents,commands}/were edited only where the change benefits both platforms (e.g., the platform-aware skill-loading instructions inhelp.md).Out of scope (intentional v1)
bee/.opencode/plugins/*.js). The opencodeHooksinterface has no agent/command registration hook, so a plugin can't help discovery. v2 could add one for skill-aware autoload or intercepting subagent dispatch — open question, not blocking v1.clean-code, notbee-clean-code). Renaming would mean ~50 cross-reference updates across both Claude and opencode files. Cosmetic inconsistency accepted; help text was updated to be platform-aware.