file-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFile Review
文件审查
Unified skill for the file-review plugin. Routes to the correct workflow based on user intent.
Note: Theand/file-reviewcommands are simple shortcuts for backward compatibility. They trigger the Review and Process workflows below. This skill is the canonical entry point./process-comments
这是file-review插件的统一技能,可根据用户意图路由到正确的工作流。
注意:和/file-review命令是为了向后兼容而设的快捷方式,它们会触发下方的审查和处理工作流。本技能是标准入口点。/process-comments
Intent Router
意图路由
Match the user's request to one of three workflows:
| Intent signals | Workflow |
|---|---|
| "install file-review", "set up file-review", "file-review not found" | Install |
"review this file", "file-review | Review a File |
| "I left comments", "process comments", "done reviewing", "address feedback" | Process Comments |
If the intent is ambiguous, use AskUserQuestion:
| Question | Options |
|---|---|
| "What would you like to do with file-review?" | 1. Review a file (open GUI), 2. Process existing review comments, 3. Install file-review |
将用户的请求匹配到以下三个工作流之一:
| 意图信号 | 工作流 |
|---|---|
| "install file-review"、"set up file-review"、"file-review not found" | 安装 |
"review this file"、"file-review | 审查文件 |
| "I left comments"、"process comments"、"done reviewing"、"address feedback" | 处理评论 |
如果意图不明确,使用AskUserQuestion:
| 问题 | 选项 |
|---|---|
| "你想使用file-review做什么?" | 1. 审查文件(打开GUI),2. 处理现有审查意见,3. 安装file-review |
Install
安装
Quick Install (Homebrew)
快速安装(Homebrew)
bash
brew tap desplega-ai/tap
brew install file-reviewVerify:
which file-reviewbash
brew tap desplega-ai/tap
brew install file-review验证:
which file-reviewManual Install (from source)
手动安装(从源码)
Prerequisites: bun, Rust
bash
git clone https://github.com/desplega-ai/ai-toolbox.git
cd ai-toolbox/file-review
bun install
bun run install:appThis symlinks to . Ensure that's in PATH.
~/.local/bin/file-review前置依赖:bun、Rust
bash
git clone https://github.com/desplega-ai/ai-toolbox.git
cd ai-toolbox/file-review
bun install
bun run install:app此操作会创建指向的符号链接,请确保该路径在你的PATH中。
~/.local/bin/file-reviewTroubleshooting
故障排除
- Command not found: Ensure in PATH, restart terminal
~/.local/bin - Rust not found: Restart terminal after installing Rust
- Build fails on macOS:
xcode-select --install
- 命令未找到:确保在PATH中,重启终端
~/.local/bin - 未找到Rust:安装Rust后重启终端
- macOS上构建失败:执行
xcode-select --install
Uninstall
卸载
bash
cd ai-toolbox/file-review && bun run uninstall:appbash
cd ai-toolbox/file-review && bun run uninstall:appReview a File
审查文件
If no path provided
未提供路径时
Check for recently created or modified files in the current session:
- Plan files in
thoughts/<username|shared>/plans/ - Research documents in
thoughts/<username|shared>/research/ - Any markdown files created or updated during the conversation
Propose candidates to the user via AskUserQuestion.
检查当前会话中最近创建或修改的文件:
- 下的计划文件
thoughts/<username|shared>/plans/ - 下的研究文档
thoughts/<username|shared>/research/ - 对话期间创建或更新的所有markdown文件
通过AskUserQuestion向用户推荐候选文件。
If path provided
提供路径时
-
Verify the file exists and is readable.
-
Check if file-review is installed:bash
which file-reviewIf not found, jump to the Install section above. -
Launch the GUI:bash
file-review "<absolute_path>"Wait for the process to complete.CLI flags:(background),--bg(no comment output),--silent(JSON output).--json -
Inform the user:
I've opened file-review for <filename>. Shortcuts: Cmd+K (add comment), Cmd+S (save), Cmd+Q (quit), Cmd+/ (help) -
After the app closes, it outputs review comments to stdout:
=== Review Comments (N) === [abc123] Line 15 (inline): "highlighted code" -> Comment text herePresent the output, then proceed to Process Comments below.
-
验证文件存在且可读
-
检查file-review是否已安装:bash
which file-review如果未找到,跳转到上方的安装部分。 -
启动GUI:bash
file-review "<absolute_path>"等待进程完成。CLI参数:(后台运行)、--bg(不输出评论)、--silent(JSON格式输出)。--json -
通知用户:
我已为<filename>打开file-review。 快捷键:Cmd+K(添加评论)、Cmd+S(保存)、Cmd+Q(退出)、Cmd+/(查看帮助) -
应用关闭后,会将审查意见输出到标准输出:
=== 审查意见(N条) === [abc123] 第15行(行内): "高亮代码" -> 评论内容展示输出内容,然后进入下方的处理评论环节。
Keyboard Shortcuts
键盘快捷键
| Shortcut | Action |
|---|---|
| Cmd+K | Add comment to selection |
| Cmd+S | Save file |
| Cmd+Q | Quit application |
| Cmd+/ | Show all shortcuts |
| Cmd+T | Toggle theme |
| Cmd+Shift+V | Toggle vim mode |
| Cmd+O | Open file |
| 快捷键 | 操作 |
|---|---|
| Cmd+K | 为选中内容添加评论 |
| Cmd+S | 保存文件 |
| Cmd+Q | 退出应用 |
| Cmd+/ | 查看所有快捷键 |
| Cmd+T | 切换主题 |
| Cmd+Shift+V | 切换Vim模式 |
| Cmd+O | 打开文件 |
Process Comments
处理评论
Comment Format
评论格式
The file-review tool embeds comments as HTML markers:
Inline comments:
html
<!-- review-start(ID) -->highlighted text<!-- review-end(ID): reviewer feedback -->Line comments:
html
<!-- review-line-start(ID) -->
content spanning
multiple lines
<!-- review-line-end(ID): reviewer feedback -->IDfile-review工具会将评论嵌入为HTML标记:
行内评论:
html
<!-- review-start(ID) -->高亮文本<!-- review-end(ID): 审查者意见 -->整行评论:
html
<!-- review-line-start(ID) -->
跨多行的内容
<!-- review-line-end(ID): 审查者意见 -->IDExtraction Patterns
提取规则
javascript
// Inline - captures: [full, id, highlighted, feedback]
/<!--\s*review-start\(([a-zA-Z0-9-]+)\)\s*-->([\s\S]*?)<!--\s*review-end\(\1\):\s*([\s\S]*?)\s*-->/g
// Line - captures: [full, id, highlighted, feedback]
/<!--\s*review-line-start\(([a-zA-Z0-9-]+)\)\s*-->\n?([\s\S]*?)\n?<!--\s*review-line-end\(\1\):\s*([\s\S]*?)\s*-->/gjavascript
// 行内 - 捕获:[完整内容, id, 高亮文本, 意见]
/<!--\s*review-start\(([a-zA-Z0-9-]+)\)\s*-->([\s\S]*?)<!--\s*review-end\(\1\):\s*([\s\S]*?)\s*-->/g
// 整行 - 捕获:[完整内容, id, 高亮文本, 意见]
/<!--\s*review-line-start\(([a-zA-Z0-9-]+)\)\s*-->\n?([\s\S]*?)\n?<!--\s*review-line-end\(\1\):\s*([\s\S]*?)\s*-->/gWorkflow
工作流
Step 1: Read and Parse
Read the file, extract all comments, present a summary:
Found 3 review comments in <filename>:
1. [inline] "implement caching" -> "Consider using Redis"
2. [line] "function fetchData()..." -> "Add error handling"
3. [inline] "TODO" -> "Please complete this"Step 2: Process Each Comment
For each comment, show context and use AskUserQuestion:
| Question | Options |
|---|---|
| "Comment N of M: <feedback summary>" | 1. Apply edit, 2. Acknowledge (remove markers only), 3. Skip |
- Apply edit: Propose changes, apply after confirmation, remove markers.
- Acknowledge: Remove markers, preserve content. Recommend this for praise/FYI.
- Skip: Leave as-is, move on.
Step 3: Remove Markers
- Inline: replace with
<!-- review-start(ID) -->text<!-- review-end(ID): feedback -->text - Line: replace the full block with just the content lines
Step 4: Final Summary
Processing complete!
- Applied edits: 2
- Acknowledged: 1
- Skipped: 0
File saved.步骤1:读取与解析
读取文件,提取所有评论,展示摘要:
在<filename>中找到3条审查意见:
1. [行内] "实现缓存" -> "考虑使用Redis"
2. [整行] "function fetchData()..." -> "添加错误处理"
3. [行内] "TODO" -> "请完成此项"步骤2:处理每条评论
针对每条评论,展示上下文并使用AskUserQuestion:
| 问题 | 选项 |
|---|---|
| "第N条评论(共M条):<意见摘要>" | 1. 应用修改,2. 确认(仅移除标记),3. 跳过 |
- 应用修改:提出修改建议,确认后应用并移除标记。
- 确认:移除标记,保留内容。对于表扬/告知类意见推荐此选项。
- 跳过:保持原样,继续处理下一条。
步骤3:移除标记
- 行内:将替换为
<!-- review-start(ID) -->文本<!-- review-end(ID): 意见 -->文本 - 整行:将整个块替换为仅保留内容行
步骤4:最终摘要
处理完成!
- 已应用修改:2条
- 已确认:1条
- 已跳过:0条
文件已保存。Special Cases
特殊情况
- FYI/Praise ("LGTM", "Nice work"): Recommend Acknowledge as default
- Empty feedback: Ask if user wants to remove markers
- Unclear feedback: Use AskUserQuestion to clarify reviewer intent
- 告知/表扬类意见("LGTM"、"做得好"):默认推荐选择“确认”
- 空意见:询问用户是否要移除标记
- 不明确的意见:使用AskUserQuestion明确审查者意图