Skip to content

adopt(opencode): needs owner decision: opencode-genclass plugin for OpenCode 1.x and 2.x, and the OpenCode install surface - #147

Open
MeharPro wants to merge 1 commit into
mainfrom
claude/inspiring-johnson-2iwads
Open

MeharPro wants to merge 1 commit into
mainfrom
claude/inspiring-johnson-2iwads

Conversation

@MeharPro

@MeharPro MeharPro commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Status: needs owner decision (a new workspace package changes the root lockfile, AGENTS.md rule 7; a new release workflow and the first npm publish are the owner's, rule 9; the upstream row waits for that publish).

What

  • Package. A new package, opencode-genclass (packages/opencode-plugin/, unpublished, no dependencies). It has one default export that OpenCode 2.x loads through setup and OpenCode 1.18.29+ loads through server. When you have no server named genclass, it adds npx -y @genclass/mcp@0.2.1 (your own entry wins). Before each prompt it also adds the findings recorded since the last prompt, using genclass-mcp hook's logic and exact wording.
  • Install lines. GenClass's OpenCode install block gains the opencode mcp add command and the two skill paths. init now writes an /genclass-explore OpenCode command when .opencode/ exists.
  • Upstream entry. A one-row entry for OpenCode's ecosystem page is drafted, to send once the package is on npm.

Branch note: the session's harness required pushing to claude/inspiring-johnson-2iwads, not adopt/opencode.

Files

  • packages/opencode-plugin/: src/index.ts, src/digest.ts, src/ids.ts, tests (digest, v1, v2, parity with the real hookCmd, package), test/smoke/run.mjs (real binaries), README, CHANGELOG, LICENSE.
  • packages/mcp/src/clients.ts and the regenerated README.md block; packages/mcp/src/cli.ts (init writes .opencode/commands/genclass-explore.md); test/cli.test.ts (+1 test); test/manifests.test.ts (3 new PINS); CHANGELOG.md.
  • .github/workflows/opencode-plugin.yml (CI, separate from ci.yml) and .github/workflows/release-opencode.yml (tag opencode-v*, mirrors release-mcp.yml).
  • package-lock.json: the two workspace entries only (18 lines).
  • docs/adoption/contributions/opencode/ (README report, upstream.patch against anomalyco/opencode dev 79c80c7c, PR.md, types/check.sh conformance) and docs/adoption/listings/opencode.md.

Checks

  • opencode-genclass: typecheck, build, vitest 26 passed
  • @genclass/mcp: typecheck, build, vitest 154 passed, 3 skipped; npm run sync -w @genclass/mcp clean
  • Type conformance with no casts against @opencode-ai/plugin 1.19.5 (PluginModule, Plugin, Hooks) and @opencode/plugin 2.2.5 (Plugin.define): tsc exit 0
  • Real binaries (opencode-ai 1.19.5, @opencode/cli 2.2.5), node packages/opencode-plugin/test/smoke/run.mjs: 10 of 10 checks pass on the final run:
    • controls show no genclass server without the plugin;
    • with the plugin, genclass is listed and connected on both lines;
    • a project's own genclass entry wins on both lines;
    • on 1.19.5 end to end, a local stub model received the user's message with the digest appended, the race line kept and the intervention filtered out, and the cursor advanced.
  • Install lines run with the binaries:
    • opencode mcp add genclass -- npx -y @genclass/mcp@0.2.1 writes the global opencode.jsonc on 1.19.5 and the project's mcp.servers.genclass on 2.2.5;
    • the flat JSON block loads on 2.2.5;
    • npx skills add genclass-dev/genclass-plugin -a opencode and init's .claude/skills both show up in opencode debug skill (1.19.5);
    • the init command shows in opencode debug config (1.19.5).
  • No runtime source, no review test and no model-visible text changed. Runtime CI steps were not re-run because nothing under packages/runtime changed.

To send (a person)

  1. Owner: release opencode-genclass 0.1.0. Push tag opencode-v0.1.0, publish the workflow's opencode-tarball once by hand, then set up npm trusted publishing (steps are in the workflow header).
  2. Sender: install it in OpenCode yourself and see findings arrive with a prompt. Check that https://github.com/genclass-dev/GenClass/tree/main/packages/opencode-plugin resolves.
  3. Fork anomalyco/opencode and branch from dev. Apply upstream.patch and run npx prettier@3.6.2 --check packages/web/src/content/docs/ecosystem.mdx.
  4. Open the PR from a personal account, titled docs: add opencode-genclass to the ecosystem plugins. Use PR.md's template body rewritten in your own words, because OpenCode's CONTRIBUTING.md warns against long AI-generated descriptions. Keep the AI-assistance line. No issue is needed for a docs PR.

Notes for the reviewer

  • Look first at: packages/opencode-plugin/src/index.ts (both hook paths, never throws) and src/digest.ts (a copy of hookCmd; test/parity.test.ts keeps them byte-equal).
  • Not run end to end: the 2.x prompt hook. 2.2.5's provider config shape for a stub model wasn't set up within the time box. It is covered by unit tests on a fake context and by the type conformance check.
  • Problem found in harness setup: the first smoke runs inherited this container's AWS credentials. OpenCode then picked Bedrock for one opencode run and sent the stub prompt there, and AWS refused it (invalid token). The prompt held no real data. The script now passes a minimal environment.
  • Left alone: AGENTS.md (outside the brief). It could take one repo-map row for packages/opencode-plugin/.
  • Time: about two hours.

Generated by Claude Code

…l surface

- packages/opencode-plugin (opencode-genclass 0.1.0, unpublished): one default export
  { id, setup, server } that OpenCode 2.x loads as a Plugin.define definition and
  OpenCode 1.18.29+ as an object entrypoint. It adds the genclass MCP server when
  none is configured (2.x mcp.transform, 1.x config ??=) and brings up to 5
  findings recorded since the last prompt into each prompt (2.x prompt hook,
  1.x chat.message text part), with genclass-mcp hook's logic and wording
  (parity test against hookCmd). No dependencies; 26 unit tests; a real-binary
  check (test/smoke/run.mjs) against opencode-ai 1.19.5 and @opencode/cli 2.2.5.
- @genclass/mcp: the OpenCode block adds `opencode mcp add genclass -- npx ...`
  and the skill paths; init writes .opencode/commands/genclass-explore.md when
  .opencode/ exists; CHANGELOG; new pinned files in test/manifests.test.ts.
- Workflows: opencode-plugin.yml (CI) and release-opencode.yml (tag opencode-v*).
- docs/adoption: contributions/opencode (report, upstream.patch for OpenCode's
  ecosystem page, PR.md, type-conformance script) and listings/opencode.md.
- package-lock.json: the two workspace entries only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fqwfq1mcsGAzqmb6d7VwmD

This branch has not been deployed

No deployments
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.

2 participants