coderabbit-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodeRabbit Workflow
CodeRabbit 工作流
Address CodeRabbit review comments systematically. Workflows for local CLI usage, PR thread processing, and commit attribution.
系统化处理CodeRabbit评审评论。包含本地CLI使用、PR线程处理与提交归因的工作流。
When to use this skill
何时使用此技能
- When addressing CodeRabbit review comments on a PR
- Before push, to get early feedback with local CLI
- When asked to "fix coderabbit issues" or "address coderabbit comments"
- 在PR上处理CodeRabbit评审评论时
- 推送代码前,使用本地CLI获取早期反馈时
- 被要求"修复coderabbit问题"或"处理coderabbit评论"时
Skill Contents
技能内容
Sections
章节
Available Resources
可用资源
📚 references/ - Detailed documentation
- cli integration
- commit formats
- setup
- workflow examples
🔧 scripts/ - Automation scripts
- batch reply
- export comments
- lib
- monitor approval
- parse review body
- reply to threads
- run local review
📚 references/ - 详细文档
- cli integration
- commit formats
- setup
- workflow examples
🔧 scripts/ - 自动化脚本
- batch reply
- export comments
- lib
- monitor approval
- parse review body
- reply to threads
- run local review
Two Review Modes
两种评审模式
| Mode | When | Reference |
|---|---|---|
| Local CLI | Before push, get early feedback | |
| PR Threads | After CodeRabbit reviews your PR | |
| 模式 | 适用场景 | 参考资料 |
|---|---|---|
| 本地CLI | 推送代码前,获取早期反馈 | |
| PR线程 | CodeRabbit评审你的PR之后 | |
Quick Start
快速开始
- Export comments:
node .claude/skills/coderabbit-workflow/scripts/export-comments.ts --pr <number> - Review by severity: critical, major, minor
- Apply fixes following patterns in
references/workflow-examples.md - Commit with CodeRabbit co-author attribution (see below)
- Update exported JSON to mark comments as fixed (set )
status: 'fixed' - Push and reply to threads:
node .claude/skills/coderabbit-workflow/scripts/reply-to-threads.ts --file .tmp/coderabbit-*.json
Note: The reply script only processes comments with . After applying fixes, update the JSON file to change status from to before running the reply script.
status !== 'pending''pending''fixed'- 导出评论:
node .claude/skills/coderabbit-workflow/scripts/export-comments.ts --pr <number> - 按严重程度评审:严重、主要、次要
- 按照中的模式修复问题
references/workflow-examples.md - 提交时添加CodeRabbit共同作者归因(见下文)
- 更新导出的JSON文件,将评论标记为已修复(设置)
status: 'fixed' - 推送代码并回复线程:
node .claude/skills/coderabbit-workflow/scripts/reply-to-threads.ts --file .tmp/coderabbit-*.json
注意: 回复脚本仅处理的评论。修复问题后,运行回复脚本前请更新JSON文件,将状态从改为。
status !== 'pending''pending''fixed'Scripts
脚本
| Script | Purpose |
|---|---|
| Run CodeRabbit CLI and save findings |
| Export PR comments to local JSON |
| Batch reply to threads after fixes |
| Poll for approval, request review/approval automatically |
| 脚本 | 用途 |
|---|---|
| 运行CodeRabbit CLI并保存评审结果 |
| 将PR评论导出到本地JSON文件 |
| 修复问题后批量回复线程 |
| 轮询审批状态,自动请求评审/审批 |
References
参考资料
| Reference | Content |
|---|---|
| Installation, authentication, troubleshooting |
| CLI commands and async workflow |
| All commit message templates |
| Complete workflow examples |
| 参考资料 | 内容 |
|---|---|
| 安装、认证、故障排除 |
| CLI命令与异步工作流 |
| 所有提交消息模板 |
| 完整工作流示例 |
Key Requirement: Co-Author
关键要求:共同作者
All CodeRabbit fix commits must include:
text
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>See for all templates.
references/commit-formats.md所有CodeRabbit修复提交必须包含:
text
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>查看获取所有模板。
references/commit-formats.mdWaiting for CodeRabbit Review
等待CodeRabbit评审
Use the monitor script to automatically wait for and request CodeRabbit approval:
bash
undefined使用监控脚本自动等待并请求CodeRabbit审批:
bash
undefinedMonitor PR and automatically request review/approval when appropriate
监控PR并在合适时机自动请求评审/审批
node scripts/monitor-approval.ts --pr <number>
node scripts/monitor-approval.ts --pr <number>
With custom poll interval (default: 60s)
自定义轮询间隔(默认:60秒)
node scripts/monitor-approval.ts --pr <number> --interval 30
node scripts/monitor-approval.ts --pr <number> --interval 30
Dry-run mode (show what would be done)
试运行模式(显示将要执行的操作)
node scripts/monitor-approval.ts --pr <number> --dry-run
The monitor script:
- Polls every 60 seconds (configurable via `--interval`)
- Checks for open CodeRabbit comments that need addressing
- Waits 15 minutes before requesting a review if none received
- Waits 30 minutes before requesting approval if not approved
- Exits with code 0 on approval, code 2 if comments need addressing
**Timing requirements (automated by monitor script):**
| Time Since Last Commit | Action |
|------------------------|--------|
| 0-15 minutes | Wait for CodeRabbit to review automatically |
| 15+ minutes (no review) | Request review: `@coderabbitai review` |
| 30+ minutes (no approval) | Request approval: `@coderabbitai approve` |
**Manual commands (if not using monitor script):**
```bashnode scripts/monitor-approval.ts --pr <number> --dry-run
监控脚本:
- 每60秒轮询一次(可通过`--interval`配置)
- 检查是否有需要处理的未关闭CodeRabbit评论
- 如果未收到评审,等待15分钟后请求评审
- 如果未获得审批,等待30分钟后请求审批
- 审批通过时以代码0退出,若有评论需要处理则以代码2退出
**时间要求(由监控脚本自动执行):**
| 距离上次提交的时间 | 操作 |
|------------------------|--------|
| 0-15分钟 | 等待CodeRabbit自动评审 |
| 15+分钟(无评审) | 请求评审:`@coderabbitai review` |
| 30+分钟(无审批) | 请求审批:`@coderabbitai approve` |
**手动命令(若不使用监控脚本):**
```bashCheck time of last commit
查看上次提交的时间
git log -1 --format='%ci'
git log -1 --format='%ci'
Request review (after 15 min with no activity)
请求评审(15分钟无活动后)
gh pr comment <PR_NUMBER> --body "@coderabbitai review"
gh pr comment <PR_NUMBER> --body "@coderabbitai review"
Request approval (after 30 min with no approval)
请求审批(30分钟无审批后)
gh pr comment <PR_NUMBER> --body "@coderabbitai approve"
undefinedgh pr comment <PR_NUMBER> --body "@coderabbitai approve"
undefinedRelated
相关内容
- pr-workflow - PR lifecycle including CodeRabbit integration
- CodeRabbit CLI Docs
- Cursor Integration
- pr-workflow - 包含CodeRabbit集成的PR生命周期管理
- CodeRabbit CLI 文档
- Cursor 集成