Files
Jordan Humberto de Souza 720492d632 fix(opencode): support OpenCode 2.x via native tools and commands (#1213)
* fix(opencode): support OpenCode 2.x via native tools and commands

The single-file plugin (open-code-review.ts) cannot load on OpenCode 2.x:
the 2.x loader requires a default-exported { id, effect | setup } and has
no custom-tool registration API. It also fails on 1.x for most users
because nothing installs the @opencode-ai/plugin dependency the file
imports.

Ship the same ocr_review / ocr_health features as 2.x-native custom
tools plus /ocr-review /ocr-health commands, and document the
@opencode-ai/plugin dependency step for both versions.

* fix(opencode): dual V1+V2 plugin entrypoint instead of separate files

Replace the tools/+commands/ split with the documented dual plugin form:
default-export { ...Plugin.define({ id, setup }), server }. V2 registers
ocr_review/ocr_health via ctx.tool.transform and /ocr-review//ocr-health
via ctx.command.transform, reusing the same OCR logic as V1. Add
@opencode/plugin beta devDependency and a test for the default export.

* fix(opencode): review feedback: typeless V2 import, strict schemas, tests

- Import @opencode/plugin as types only and export a plain dual object,
  so OpenCode 1.x never needs the V2 beta package at runtime (verified
  in the built output: only node:*, @opencode-ai/plugin imports remain).
- V2 numeric inputs now require positive integers
  ({ type: integer, minimum: 1 }), matching the V1 zod schema.
- V2 commands keep the V1 sentence break, skip user-defined names like
  the V1 ??= guards, and resolveSessionCwd falls back to the plugin
  location when the session lookup fails.
- README: single download block, corrected 30-minute tool timeout,
  deduped project section.
- Track package-lock.json (drop the local ignore) so npm ci works.
- Move the V2 stub harness into the test suite (+6 tests, 29 passing).
- Verified live on OpenCode 1.18.30 sandbox: plugin loads with no
  errors, single init across sessions, both commands registered once.
2026-09-14 15:31:42 +08:00
..

Coding agent plugins

Open Code Review ships platform-specific integrations for Claude Code, Codex, Cursor, and QCA Forward. Choose your platform below instead of adapting installation instructions written for a different agent.

All integrations require Git 2.41 or later. Install the ocr CLI first:

npm install -g @alibaba-group/open-code-review

Configure and test an OCR LLM before running a review, unless you plan to use Delegation Mode:

ocr config provider
ocr config model
ocr llm test

Claude Code

Run these commands inside Claude Code:

/plugin marketplace add alibaba/open-code-review
/plugin install open-code-review@open-code-review

This installs the /open-code-review:review and /open-code-review:delegate-review slash commands. See the Claude Code guide for manual installation, usage, and behavior.

Codex

Add this repository as a Codex marketplace, then start Codex:

codex plugin marketplace add alibaba/open-code-review
codex

Open /plugins, install and enable Open Code Review, then start a new task. The plugin exposes callable review skills backed by the local ocr CLI. For example:

@Open Code Review review my current changes
@Open Code Review review this branch against main
@Open Code Review review and fix high-confidence issues

Cursor

This repository includes a Cursor plugin manifest at .cursor-plugin/plugin.json. For a local manual installation, copy the entire plugins/open-code-review/ directory to:

~/.cursor/plugins/local/open-code-review/

Verify that the manifest is located at ~/.cursor/plugins/local/open-code-review/.cursor-plugin/plugin.json, then restart Cursor or run Developer: Reload Window. The plugin provides the portable OCR review skills from the bundled skills/ directory.

See the Cursor plugin documentation for plugin loading and management details.

QCA Forward

QCA Forward uses the host model through OCR delegation mode. Publish the open-code-review-delegate Skill, preinstall OCR in the referenced QCA environment, and create a Forward Template from the bundled example. No OCR LLM endpoint is required.

See the QCA Forward integration guide and template example.