code-review
スター16
フォーク6
更新日2026年6月14日 15:01
Cloe Desktop 终端代码走查功能——逐段展示代码、bat 语法高亮、键盘导航、评论收集
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SKILL.md
readonlyメニュー
Cloe Desktop 终端代码走查功能——逐段展示代码、bat 语法高亮、键盘导航、评论收集
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | code-review |
| description | Cloe Desktop 终端代码走查功能——逐段展示代码、bat 语法高亮、键盘导航、评论收集 |
在 Cloe Desktop 的 Terminal 里逐段展示代码,用户可键盘导航、输入评论,走查结束后 agent 拉取评论并执行修复。
curl -s http://localhost:19851/status
# 期望: {"ws_port":19850,"http_port":19851,"clients":1}
POST http://localhost:19851/terminal/walk
Content-Type: application/json
{
"action": "start",
"steps": [
{
"file": "/path/to/file.js",
"start": 10,
"end": 30,
"title": "功能标题",
"highlight": [12, 15],
"note": "这段代码的作用说明"
}
]
}
每个 step 用 bat 异步预渲染 ANSI 语法高亮,base64 编码传给前端渲染。
{"action": "next"}
{"action": "prev"}
{"action": "stop"}
走查结束后调用,拉取用户在终端里留下的评论:
{"action": "get-comments"}
返回:
{
"ok": true,
"comments": [
{
"stepIndex": 0,
"stepTitle": "功能标题",
"file": "/path/to/file.js",
"lines": "10-30",
"text": "这里有个bug",
"timestamp": "2026-06-13T03:30:00.000Z"
}
]
}
| 按键 | 功能 |
|---|---|
n / Space | 下一段代码 |
p | 上一段 |
c | 进入评论模式(弹出输入框) |
d | 切换 Diff 模式(git diff HEAD → working tree) |
j | 向下滚动3行(vim 风格) |
k | 向上滚动3行(vim 风格) |
↑ / ↓ | 滚动(3行) |
PgUp / PgDn | 翻页 |
Home / End | 跳顶/底 |
q / Esc | 退出回到 shell |
c → 弹出 HTML input 浮层,输入文字后 Enter 提交get-comments 获取评论数据每个 step 同时预渲染代码高亮和 git diff,用户按 d 键切换:
git diff HEAD 彩色输出,显示当前工作区改动[DIFF] 标识当前模式bat --style=numbers --force-colorization --highlight-line {lines} \
--line-range {start}:{end} --wrap=never --terminal-width=120 {file}
\n 必须替换为 \r\n,否则 xterm.js 光标不回行首TextDecoder('utf-8'),不能用 atob() 直接转字符串(会乱码):const bytes = Uint8Array.from(atob(base64String), c => c.charCodeAt(0));
const text = new TextDecoder().decode(bytes);
git diff)action=start 推送到终端c 对有疑问的地方写评论get-comments 拉取评论