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 拉取评论