mirror of
https://github.com/Heretek-AI/open-code-review.git
synced 2026-11-07 10:56:07 -10:00
feat(plugin): add kimi code plugin (#1355)
* add kimi code plugin Signed-off-by: Isotr0py <[email protected]> * feat: Apply suggestion from @lizhengfeng101 --------- Signed-off-by: Isotr0py <[email protected]> Co-authored-by: Kite <[email protected]>
This commit is contained in:
1 parent
127c443778
commit
24a2c2da73
13 files changed
+200
-4
No files matched your search
@@ -26,6 +26,7 @@ on:
|
||||
paths:
|
||||
- ".claude-plugin/**"
|
||||
- ".agents/**"
|
||||
- ".kimi-plugin/**"
|
||||
- "plugins/**"
|
||||
- "skills/**"
|
||||
- "pages/src/content/docs/**"
|
||||
@@ -39,6 +40,7 @@ on:
|
||||
paths:
|
||||
- ".claude-plugin/**"
|
||||
- ".agents/**"
|
||||
- ".kimi-plugin/**"
|
||||
- "plugins/**"
|
||||
- "skills/**"
|
||||
- "pages/src/content/docs/**"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "open-code-review",
|
||||
"version": "1.0.0",
|
||||
"description": "Use Alibaba Open Code Review from Kimi Code.",
|
||||
"author": { "name": "Alibaba" },
|
||||
"homepage": "https://github.com/alibaba/open-code-review",
|
||||
"repository": "https://github.com/alibaba/open-code-review",
|
||||
"license": "Apache-2.0",
|
||||
"keywords": ["code-review", "kimi-code", "ocr", "open-code-review"],
|
||||
"skills": "./plugins/open-code-review/skills/",
|
||||
"commands": "./plugins/open-code-review/kimi-code/commands/",
|
||||
"interface": {
|
||||
"displayName": "Open Code Review",
|
||||
"shortDescription": "Run structured code reviews from Kimi Code.",
|
||||
"longDescription": "Adds Kimi Code skills and slash commands that invoke the local Open Code Review CLI to review Git workspace changes, commits, and branch comparisons.",
|
||||
"developerName": "Alibaba",
|
||||
"websiteURL": "https://github.com/alibaba/open-code-review"
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@
|
||||
<a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Kimi Code" src="https://img.shields.io/badge/Kimi_Code-supported-blueviolet.svg" /></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
English | <a href="docs/i18n/README.zh-CN.md">简体中文</a> | <a href="docs/i18n/README.ja-JP.md">日本語</a> | <a href="docs/i18n/README.ko-KR.md">한국어</a> | <a href="docs/i18n/README.ru-RU.md">Русский</a>
|
||||
@@ -180,6 +181,7 @@ Full documentation lives at **[open-codereview.ai/docs](https://open-codereview.
|
||||
- [Claude Code](plugins/open-code-review/README.md#claude-code) — install a plugin with review slash commands
|
||||
- [Codex](plugins/open-code-review/README.md#codex) — install a plugin with callable review skills
|
||||
- [Cursor](plugins/open-code-review/README.md#cursor) — install a plugin with portable review skills
|
||||
- [Kimi Code](plugins/open-code-review/README.md#kimi-code) — install a plugin with review slash commands and skills
|
||||
- [OpenCode](plugins/open-code-review/opencode/README.md) — install native review tools and slash commands
|
||||
- [QCA Forward](plugins/open-code-review/qca/README.md) — run delegation mode with the QCA host model and a ready-to-publish template
|
||||
- [Skill-compatible agents](https://open-codereview.ai/docs/agent-skill) — install the portable agent skill
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ OpenCodeReview currently provides:
|
||||
- A CLI tool (`ocr`) for AI-powered code review with deterministic
|
||||
engineering and agent hybrid architecture.
|
||||
- Integration with coding agents: Claude Code (plugin/skill), Codex
|
||||
(plugin), and Cursor (plugin).
|
||||
(plugin), Cursor (plugin), and Kimi Code (plugin).
|
||||
- A VSCode extension for in-editor code review.
|
||||
- CI/CD integration (GitHub Actions, GitLab CI, etc.).
|
||||
- Multi-provider LLM support (OpenAI-compatible, Anthropic, Google Gemini,
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Kimi Code" src="https://img.shields.io/badge/Kimi_Code-supported-blueviolet.svg" /></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="../../README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | 日本語 | <a href="README.ko-KR.md">한국어</a> | <a href="README.ru-RU.md">Русский</a>
|
||||
@@ -180,6 +181,7 @@ ocr delegate rule src/main.go src/handler.go
|
||||
- [Claude Code](../../plugins/open-code-review/README.md#claude-code) — レビュー用スラッシュコマンドを含むプラグインをインストール
|
||||
- [Codex](../../plugins/open-code-review/README.md#codex) — 呼び出し可能なレビュースキルを含むプラグインをインストール
|
||||
- [Cursor](../../plugins/open-code-review/README.md#cursor) — 移植可能なレビュースキルを含むプラグインをインストール
|
||||
- [Kimi Code](../../plugins/open-code-review/README.md#kimi-code) — レビュー用スラッシュコマンドとスキルを含むプラグインをインストール
|
||||
- [OpenCode](../../plugins/open-code-review/opencode/README.md) — ネイティブレビュー・ツールとスラッシュコマンドをインストール
|
||||
- [QCA Forward](../../plugins/open-code-review/qca/README.md) — QCA ホストモデルと公開可能なテンプレートで委任モードを実行
|
||||
- [Skill 対応エージェント](https://open-codereview.ai/docs/agent-skill) — 移植可能なエージェントスキルをインストール
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Kimi Code" src="https://img.shields.io/badge/Kimi_Code-supported-blueviolet.svg" /></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="../../README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | 한국어 | <a href="README.ru-RU.md">Русский</a>
|
||||
@@ -180,6 +181,7 @@ ocr delegate rule src/main.go src/handler.go
|
||||
- [Claude Code](../../plugins/open-code-review/README.md#claude-code) — 리뷰 슬래시 명령이 포함된 플러그인 설치
|
||||
- [Codex](../../plugins/open-code-review/README.md#codex) — 호출 가능한 리뷰 스킬이 포함된 플러그인 설치
|
||||
- [Cursor](../../plugins/open-code-review/README.md#cursor) — 이식 가능한 리뷰 스킬이 포함된 플러그인 설치
|
||||
- [Kimi Code](../../plugins/open-code-review/README.md#kimi-code) — 리뷰 슬래시 명령과 스킬이 포함된 플러그인 설치
|
||||
- [OpenCode](../../plugins/open-code-review/opencode/README.md) — 네이티브 리뷰 도구와 슬래시 명령 설치
|
||||
- [QCA Forward](../../plugins/open-code-review/qca/README.md) — QCA 호스트 모델과 게시 가능한 템플릿으로 위임 모드 실행
|
||||
- [Skill 호환 에이전트](https://open-codereview.ai/docs/agent-skill) — 이식 가능한 에이전트 스킬 설치
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Kimi Code" src="https://img.shields.io/badge/Kimi_Code-supported-blueviolet.svg" /></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="../../README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.ja-JP.md">日本語</a> | <a href="README.ko-KR.md">한국어</a> | Русский
|
||||
@@ -180,6 +181,7 @@ ocr delegate rule src/main.go src/handler.go
|
||||
- [Claude Code](../../plugins/open-code-review/README.md#claude-code) — установка плагина со slash-командами для ревью
|
||||
- [Codex](../../plugins/open-code-review/README.md#codex) — установка плагина с вызываемыми навыками ревью
|
||||
- [Cursor](../../plugins/open-code-review/README.md#cursor) — установка плагина с переносимыми навыками ревью
|
||||
- [Kimi Code](../../plugins/open-code-review/README.md#kimi-code) — установка плагина со slash-командами и навыками ревью
|
||||
- [OpenCode](../../plugins/open-code-review/opencode/README.md) — установка нативных инструментов ревью и slash-команд
|
||||
- [QCA Forward](../../plugins/open-code-review/qca/README.md) — запуск режима делегирования с хост-моделью QCA и готовым к публикации шаблоном
|
||||
- [Агенты с поддержкой Skill](https://open-codereview.ai/docs/agent-skill) — установка переносимого навыка агента
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<a href="#supported-agents"><img alt="Claude Code" src="https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Codex" src="https://img.shields.io/badge/Codex-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-blueviolet.svg" /></a>
|
||||
<a href="#supported-agents"><img alt="Kimi Code" src="https://img.shields.io/badge/Kimi_Code-supported-blueviolet.svg" /></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="../../README.md">English</a> | 简体中文 | <a href="README.ja-JP.md">日本語</a> | <a href="README.ko-KR.md">한국어</a> | <a href="README.ru-RU.md">Русский</a>
|
||||
@@ -180,6 +181,7 @@ ocr delegate rule src/main.go src/handler.go
|
||||
- [Claude Code](../../plugins/open-code-review/README.md#claude-code) —— 安装包含评审斜杠命令的插件
|
||||
- [Codex](../../plugins/open-code-review/README.md#codex) —— 安装包含可调用评审 Skill 的插件
|
||||
- [Cursor](../../plugins/open-code-review/README.md#cursor) —— 安装包含可移植评审 Skill 的插件
|
||||
- [Kimi Code](../../plugins/open-code-review/README.md#kimi-code) —— 安装包含评审斜杠命令与 Skill 的插件
|
||||
- [OpenCode](../../plugins/open-code-review/opencode/README.md) —— 安装原生评审工具和斜杠命令
|
||||
- [QCA Forward](../../plugins/open-code-review/qca/README.md) —— 使用 QCA 宿主模型运行委托模式,并提供可发布的模板
|
||||
- [兼容 Skill 的 Agent](https://open-codereview.ai/docs/agent-skill) —— 安装可移植的 Agent Skill
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# 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.
|
||||
Cursor, Kimi Code, 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:
|
||||
|
||||
@@ -70,6 +70,31 @@ portable OCR review skills from the bundled `skills/` directory.
|
||||
See the [Cursor plugin documentation](https://cursor.com/docs/plugins) for
|
||||
plugin loading and management details.
|
||||
|
||||
## Kimi Code
|
||||
|
||||
This repository is itself a Kimi Code plugin. The manifest lives at the
|
||||
repository root ([`.kimi-plugin/plugin.json`](../../.kimi-plugin/plugin.json))
|
||||
because Kimi Code treats the repository root as the plugin root when installing
|
||||
from GitHub; its `skills` and `commands` paths point down into this directory.
|
||||
|
||||
Run this inside Kimi Code:
|
||||
|
||||
```text
|
||||
/plugins install https://github.com/alibaba/open-code-review
|
||||
```
|
||||
|
||||
Then run `/reload` (or start a new session) to activate the plugin. It
|
||||
provides the `/open-code-review:review` and `/open-code-review:delegate-review`
|
||||
slash commands plus the portable OCR review skills, backed by the local `ocr`
|
||||
CLI.
|
||||
|
||||
Plugins are installed per-user and apply to every project. Manage the
|
||||
installation with `/plugins list`, `/plugins info open-code-review`,
|
||||
`/plugins disable open-code-review`, and `/plugins remove open-code-review`.
|
||||
See the
|
||||
[Kimi Code plugin documentation](https://www.kimi.com/code/docs/en/kimi-code-cli/customization/plugins.html)
|
||||
for details.
|
||||
|
||||
## QCA Forward
|
||||
|
||||
QCA Forward uses the host model through OCR delegation mode. Publish the
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
description: Run OCR in delegation mode — OCR handles file selection and rules, the host agent performs the actual review.
|
||||
---
|
||||
|
||||
Invoke OpenCodeReview (OCR) in delegation mode. OCR determines which files to review and provides review rules; you perform the actual code review using your own capabilities.
|
||||
|
||||
## Workflow
|
||||
|
||||
### Step 1: Preview
|
||||
|
||||
```bash
|
||||
ocr delegate preview [user-args]
|
||||
```
|
||||
|
||||
- Default (no user arguments): workspace mode (staged + unstaged + untracked).
|
||||
- If the user provides `--commit` or `-c`: pass through as-is.
|
||||
- If the user provides `--from` and `--to`: pass through as-is.
|
||||
- (Optional) Provide `--background "context"` or `-b "context"` for business context.
|
||||
- If `ocr` is not found, install it: `npm i -g @alibaba-group/open-code-review`.
|
||||
|
||||
This outputs mode/ref metadata and the reviewable file list.
|
||||
|
||||
### Step 2: Get Rules
|
||||
|
||||
Pass all reviewable file paths to get their review checklists:
|
||||
|
||||
```bash
|
||||
ocr delegate rule <path1> <path2> ...
|
||||
```
|
||||
|
||||
### Step 3: Get Diffs and Review
|
||||
|
||||
For each reviewable file, get its diff using git (based on mode/ref from Step 1):
|
||||
- Range: `git diff <merge_base>..<to> -- <path>`
|
||||
- Commit: `git show <commit> -- <path>`
|
||||
- Workspace: `git diff HEAD -- <path>` (or read directly for untracked files)
|
||||
|
||||
Then review focusing on: correctness, security, performance, error handling, concurrency, maintainability. Only comment on changed code (+ lines).
|
||||
|
||||
### Step 4: Report and Fix
|
||||
|
||||
Classify each issue by severity:
|
||||
|
||||
- **High**: Obvious bugs, security issues, data loss, or clear mistakes with precise fix proposals
|
||||
- **Medium**: Reasonable concerns, performance suggestions, or fixes requiring manual work
|
||||
- **Low**: Discard silently (likely false positives, nitpicks, or insufficient context)
|
||||
|
||||
Automatically fix High and Medium issues that are safe and well-defined.
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
description: Run OpenCodeReview (OCR) to review code changes and autonomously apply fixes.
|
||||
---
|
||||
|
||||
Invoke the professional code review Agent CLI tool OpenCodeReview (OCR) to review current code changes, and let the Agent autonomously decide whether to apply fixes.
|
||||
|
||||
## Workflow
|
||||
|
||||
### Step 1: Run Code Review
|
||||
|
||||
Run the OCR command:
|
||||
|
||||
```bash
|
||||
ocr review --audience agent [user-args]
|
||||
```
|
||||
- Default (no user arguments): reviews staged, unstaged, and untracked changes (workspace mode).
|
||||
- If the user provides `--commit` or `-c`: pass through as-is.
|
||||
- If the user provides `--from` and `--to`: pass through as-is.
|
||||
- (Optional) Provide `--background "requirement context"` to review whether the requirements are correctly implemented.
|
||||
- (Optional) Provide `--background-file ./requirements.md` to load the same context from a Markdown file (sanitised and limited to 8000 characters). Takes precedence over `--background` when both are set.
|
||||
- Capture full stdout. Set a 5-minute timeout.
|
||||
- If the `ocr` command is not found, install it by running `npm i -g @alibaba-group/open-code-review`.
|
||||
|
||||
### Step 2: Filter and Evaluate
|
||||
|
||||
For each comment, assess its validity and quality:
|
||||
|
||||
- **High**: Obvious bugs, security issues, clear mistakes, or well-founded suggestions with precise fix proposals
|
||||
- **Medium**: Reasonable concerns but context-dependent, style/performance suggestions, or fixes that require manual implementation
|
||||
- **Low**: Likely false positives, lacking sufficient context, nitpicks, or meaningless suggestions
|
||||
|
||||
Silently discard low-confidence comments. Display the remaining comments.
|
||||
|
||||
### Step 3: Fix
|
||||
|
||||
Automatically fix issues and suggestions that are worth adopting.
|
||||
@@ -178,6 +178,30 @@ const PLUGIN_DECLARATIONS = [
|
||||
kind: "skills",
|
||||
host: "Cursor",
|
||||
},
|
||||
{
|
||||
file: ".kimi-plugin/plugin.json",
|
||||
field: "skills",
|
||||
// Kimi Code installs a GitHub repository with the repo root as the plugin
|
||||
// root and only looks for the manifest at <root>/kimi.plugin.json or
|
||||
// <root>/.kimi-plugin/plugin.json — it cannot address a subdirectory of a
|
||||
// repo. The manifest therefore lives at the repo root and its
|
||||
// plugin-root-relative paths point down into the shared plugin tree.
|
||||
base: "plugin-root",
|
||||
target: "plugins/open-code-review/skills",
|
||||
kind: "skills",
|
||||
host: "Kimi Code",
|
||||
},
|
||||
{
|
||||
file: ".kimi-plugin/plugin.json",
|
||||
field: "commands",
|
||||
// Same resolution base as the skills entry; commands live under the
|
||||
// kimi-code/ subtree so the Kimi plugin never references the
|
||||
// claude-code/ tree.
|
||||
base: "plugin-root",
|
||||
target: "plugins/open-code-review/kimi-code/commands",
|
||||
kind: "commands",
|
||||
host: "Kimi Code",
|
||||
},
|
||||
];
|
||||
|
||||
// Skill trees. Each direct subdirectory must hold a SKILL.md whose frontmatter
|
||||
@@ -187,7 +211,10 @@ const SKILL_ROOTS = ["skills", "plugins/open-code-review/skills"];
|
||||
|
||||
// Command prompt directories. Each `.md` needs a `description` for the host to
|
||||
// render it in the slash-command list.
|
||||
const COMMAND_DIRS = ["plugins/open-code-review/claude-code/commands"];
|
||||
const COMMAND_DIRS = [
|
||||
"plugins/open-code-review/claude-code/commands",
|
||||
"plugins/open-code-review/kimi-code/commands",
|
||||
];
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Check 1: in-repo path links
|
||||
|
||||
@@ -466,6 +466,34 @@ function testRealCursorEntryCarriesTheUnverifiedFlag() {
|
||||
);
|
||||
}
|
||||
|
||||
function testRealKimiEntriesResolveFromTheRepoRoot() {
|
||||
// Guards the layout the Kimi plugin depends on: Kimi's GitHub install makes
|
||||
// the repository root the plugin root, so the manifest must live at the repo
|
||||
// root and its paths must resolve from there down into plugins/.
|
||||
const kimi = PLUGIN_DECLARATIONS.filter((d) => d.host === "Kimi Code");
|
||||
assert.strictEqual(kimi.length, 2);
|
||||
for (const d of kimi) {
|
||||
assert.strictEqual(d.file, ".kimi-plugin/plugin.json");
|
||||
assert.strictEqual(d.base, "plugin-root");
|
||||
}
|
||||
assert.strictEqual(
|
||||
resolveDeclaredPath(
|
||||
".kimi-plugin/plugin.json",
|
||||
"plugin-root",
|
||||
"./plugins/open-code-review/skills/"
|
||||
),
|
||||
"plugins/open-code-review/skills"
|
||||
);
|
||||
assert.strictEqual(
|
||||
resolveDeclaredPath(
|
||||
".kimi-plugin/plugin.json",
|
||||
"plugin-root",
|
||||
"./plugins/open-code-review/kimi-code/commands/"
|
||||
),
|
||||
"plugins/open-code-review/kimi-code/commands"
|
||||
);
|
||||
}
|
||||
|
||||
function testCheckPluginDeclarationsCatchesDrift() {
|
||||
const specs = [CODEX_SPEC];
|
||||
// Someone renamed the tree in the manifest but not on disk (or vice versa).
|
||||
@@ -803,6 +831,7 @@ function main_() {
|
||||
testCheckPluginDeclarationsHappyPath();
|
||||
testUnverifiedBaseAlwaysWarnsButNeverBlocks();
|
||||
testRealCursorEntryCarriesTheUnverifiedFlag();
|
||||
testRealKimiEntriesResolveFromTheRepoRoot();
|
||||
testCheckPluginDeclarationsCatchesDrift();
|
||||
testPluginEntriesToleratesMalformedShapes();
|
||||
testMarketplaceReadersDoNotThrowOnMalformedInput();
|
||||
|
||||
Reference in new issue
Block a user