config-review-bot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseconfig-review-bot
config-review-bot
Audit or configure CodeRabbit for this repository.
Iron Law: no configuration claim or edit is valid without current evidence for its scope and effective behavior.
审计或为此仓库配置 CodeRabbit。
铁律: 任何配置声明或编辑,若没有证明其作用域和实际生效行为的当前证据,均不成立。
Scope
作用域
This skill covers repository-local CodeRabbit configuration. It does not install the CodeRabbit app or CLI, start a paid review, post comments, change branch protection or rulesets, or configure another review bot. Setup changes need explicit authorization.
此 skill 涵盖仓库本地的 CodeRabbit 配置。它不负责安装 CodeRabbit app 或 CLI、启动付费审查、发布评论、更改分支保护或 ruleset,也不负责配置其他 review bot。更改 setup 需要获得明确授权。
Inputs
输入
The request names the mode: , , or . A bare invocation is an audit of the current repository.
audit [PR <n>]set upupdate <change>- Read the repository instructions. Read the repository wiki when one exists; do not require one.
- When the request names a pull request, record its exact head SHA and base branch before making claims.
- Read , repository settings, and evidence of inherited organization or workspace configuration.
.coderabbit.yaml - Read the build, test, and CI configuration that defines repository behavior.
- Take the main branch, the language, and the path layout from evidence, not assumption.
- Preserve explicit user decisions about scope, severity, presets, branches, and enforcement.
- Read the current official CodeRabbit documentation. Treat every default as dated and confirm it there.
Done when: the effective configuration source is named as file, inherited, UI, or unknown, and the pull-request head and base are recorded when a pull request is in scope.
请求会指明模式:、 或 。未指定模式的调用表示审计当前仓库。
audit [PR <n>]set upupdate <change>- 阅读仓库说明。如果仓库存在 wiki,也应阅读;但不应要求 wiki 必须存在。
- 如果请求指定了 pull request,在作出任何结论之前,记录其准确的 head SHA 和 base 分支。
- 阅读 、仓库设置,以及组织或 workspace 继承配置存在的证据。
.coderabbit.yaml - 阅读定义仓库行为的 build、test 和 CI 配置。
- 根据证据确定主分支、语言和路径布局,而不是作出假设。
- 保留用户关于作用域、严重性、preset、分支和强制执行的明确决定。
- 阅读当前的 CodeRabbit 官方文档。所有默认值都应视为可能已经过时,并在文档中确认。
完成条件:实际生效的配置来源被明确标记为文件、继承、UI 或 unknown;如果审查范围包含 pull request,则已记录其 head 和 base。
Audit
审计
Audit mode is read-only. Report three claims separately: schema validity, rule quality, and evidence that a review completed.
Audit 模式为只读模式。需要分别报告三类结论:schema 有效性、规则质量,以及审查已完成的证据。
Schema validity
Schema 有效性
- Prefer when
coderabbit config validate <path>confirms the command.--help - Confirm command and option names against CLI help and the current CLI reference first.
- Else validate against the official JSON Schema with the YAML tooling that the repository already uses.
- Report valid only when a supported validator succeeds. Report cannot validate when no validator or schema evidence exists.
- Audit with the tools already installed. A CLI installation is a setup change, not an audit step.
Done when: the verdict is , , or .
validinvalid: <error>cannot validate: <reason>- 当 确认该命令可用时,优先使用
--help。coderabbit config validate <path> - 先根据 CLI help 和当前的 CLI reference 核对命令及选项名称。
- 否则,使用仓库已有的 YAML 工具,按照官方 JSON Schema 进行验证。
- 仅当受支持的验证器成功时,才报告 valid。没有验证器或 schema 证据时,报告 cannot validate。
- 使用已经安装的工具进行审计。安装 CLI 属于 setup 变更,而不是审计步骤。
完成条件:结论为 、 或 。
validinvalid: <error>cannot validate: <reason>Rule quality
规则质量
| Check | Evidence to gather |
|---|---|
| Feedback vs enforcement | |
| Branch scope | |
| Review cadence | Incremental, draft, auto-pause, and rate-limit defaults from current documentation. |
| Path coverage | Test |
| Test files | Language-specific test files map to the real test commands of the project. |
| Guidelines | Code-guideline auto-discovery, its actual scope, explicit mappings, and UI state. A discovered instruction applies only where its scope is documented or observed. |
| Signal policy | Style-only consistency findings are suppressed. Security and correctness findings stay on. |
| Duplication | Targeted rules do not repeat existing guidelines, formatters, linters, or CI checks. |
| Fixtures | Golden expectations stay reviewable. Disposable generated noise is excluded. |
| Excludes | Report default excludes separately from excludes that this repository added. |
Use CodeRabbit minimatch semantics for path checks, not a schema-only inference. Propose a preset migration only with comparative evidence from this repository.
Done when: every row has a finding or an explicit with its evidence.
no gap| 检查项 | 需要收集的证据 |
|---|---|
| 反馈与强制执行 | |
| 分支范围 | |
| 审查节奏 | 从当前文档确认增量审查、草稿 PR、自动暂停和速率限制的默认值。 |
| 路径覆盖 | 根据实际受跟踪的名称测试 |
| 测试文件 | 特定语言的测试文件需要映射到项目实际使用的 test 命令。 |
| 指南 | 代码指南的自动发现机制、实际作用域、显式映射和 UI 状态。只有在文档说明或实际观察到其作用域时,发现的指令才可适用。 |
| 检查信号策略 | 仅涉及样式一致性的发现会被抑制。安全性和正确性发现仍会保留。 |
| 重复 | 定向规则不得重复已有的指南、formatter、linter 或 CI 检查。 |
| 固定样例 | Golden 预期应保持可审查。一次性生成的噪声应被排除。 |
| 排除项 | 默认排除项需要与仓库自行添加的排除项分别报告。 |
路径检查应采用 CodeRabbit 的 minimatch 语义,而不是仅根据 schema 推断。只有具备来自本仓库的对比证据时,才提出 preset 迁移。
完成条件:表格中的每一项都有发现或基于证据的明确 。
no gapReview completion
审查完成情况
A green status check is a different claim from a completed review. Verify review events, findings, and the exact pull-request head SHA before you report that a review ran.
绿色的状态检查与审查已完成是不同结论。报告审查已经运行之前,需要验证 review events、findings 和准确的 pull request head SHA。
Setup or update
Setup 或 update
- Show the smallest repository-local configuration diff that meets the request.
- Validate the diff with the preferred validator, or report why validation is unavailable.
- Change only the configuration that the user requested. A wholesale template is never the answer.
- Recheck the final diff against the explicit decisions of the user.
An ordinary configuration request ends at the diff. Each of these actions needs an explicit user request: posting comments, triggering paid reviews, changing branch protection or rulesets, removing Copilot review configuration, installing services or CLIs, committing, and pushing.
Done when: the diff is shown, its validation verdict is stated, and every line traces to the request.
- 展示满足请求所需的最小仓库本地配置 diff。
- 使用首选验证器验证 diff,或者报告无法验证的原因。
- 仅更改用户请求的配置。完整模板永远不是正确答案。
- 根据用户的明确决定重新检查最终 diff。
常规配置请求止于 diff。以下每项操作都需要用户明确请求:发布评论、触发付费审查、更改分支保护或 ruleset、移除 Copilot review 配置、安装服务或 CLI、commit 和 push。
完成条件:已展示 diff、已说明验证结论,并且每一行都能追溯到用户请求。
Configuration shape
配置结构
Use the official schema at https://coderabbit.ai/integrations/schema.v2.json. Keep configuration small:
- controls feedback volume. It does not enforce merge policy.
reviews.profile - uses entries shaped as
reviews.path_instructionswith repository-relative minimatch patterns.{path, instructions} - Test representative tracked names, including ,
skills/**/SKILL.md,skills/**/assets/**,skills/**/references/**, andskills/**/evals/**..github/**
使用位于 https://coderabbit.ai/integrations/schema.v2.json 的官方 schema。保持配置精简:
- 控制反馈量,但不强制执行合并策略。
reviews.profile - 使用形如
reviews.path_instructions的条目,其中包含相对于仓库的 minimatch pattern。{path, instructions} - 测试具有代表性的受跟踪名称,包括 、
skills/**/SKILL.md、skills/**/assets/**、skills/**/references/**和skills/**/evals/**。.github/**
Safety rules
安全规则
- Audit and explain before editing.
- Never add credentials or tokens.
- Never infer effective UI or inherited settings when they are unavailable. Report the evidence gap.
- Never claim schema validity, path coverage, or review completion from another result.
- Never imply that a review ran from or a status check alone.
.coderabbit.yaml - Ask before changing an existing policy that differs from the request.
- 编辑前先进行审计和解释。
- 绝不添加凭据或 token。
- 如果实际生效的 UI 或继承设置不可用,绝不推断其内容。应报告证据缺口。
- 绝不能根据其他结果声称 schema 有效、路径覆盖完整或审查已完成。
- 绝不能仅凭 或状态检查就暗示审查已经运行。
.coderabbit.yaml - 如果现有策略与请求不同,在更改之前先询问用户。
Red flags
危险信号
Stop and investigate when:
- a green status is treated as proof that a review completed;
- a schema pass is treated as proof of path or guideline coverage;
- a discovered instruction is applied outside its documented or observed scope;
- a profile level is treated as merge enforcement without workflow and branch-rule evidence;
- a setup request grows into comments, paid reviews, branch rules, installations, or commits;
- a repository-wide preset migration appears without comparative evidence.
| Rationalization | Why it fails | Required action |
|---|---|---|
| "The check is green, so CodeRabbit completed its review." | Status checks and completed-review evidence are different claims. | Verify review events, findings, and the exact pull-request head. |
| "The schema is valid, so coverage is adequate." | Syntax constraints do not prove path or guideline coverage. | Test representative tracked paths and report gaps. |
| "The old bot is retired, so its guidance is inactive." | Guidance can remain in files, inherited settings, or UI state. | Search sources and effective settings before you remove or ignore it. |
出现以下情况时,应停止操作并调查:
- 把绿色状态视为审查已完成的证明;
- 把 schema 验证通过视为路径或指南覆盖完整的证明;
- 在已记录或实际观察到的作用域之外应用发现的指令;
- 在没有工作流和分支规则证据的情况下,把 profile level 视为合并强制执行;
- 配置 setup 请求扩大为发布评论、付费审查、分支规则、安装或 commit;
- 没有对比证据时进行仓库范围的 preset 迁移。
| 理由 | 失败原因 | 必需操作 |
|---|---|---|
| “检查为绿色,所以 CodeRabbit 已完成审查。” | 状态检查与审查已完成的证据属于不同结论。 | 验证 review events、findings 和准确的 pull request head。 |
| “Schema 有效,所以覆盖范围充分。” | 语法约束无法证明路径或指南覆盖完整。 | 测试具有代表性的受跟踪路径并报告缺口。 |
| “旧 bot 已停用,因此其指导内容不再生效。” | 指导内容可能仍保留在文件、继承设置或 UI 状态中。 | 移除或忽略之前,先搜索各个来源和实际生效的设置。 |
Output
输出
markdown
undefinedmarkdown
undefinedCodeRabbit <audit | setup>: <repo> [PR <n> @ <head-sha>]
CodeRabbit <audit | setup>: <repo> [PR <n> @ <head-sha>]
- Schema: valid | invalid: <error> | cannot validate: <reason>
- Effective config source: file | inherited | UI | unknown
- Review completion (PR only): verified @ <sha> | not verified: <reason>
| # | Severity | Confidence | Check | Location | Finding | Recommendation |
|---|
- Schema: valid | invalid: <error> | cannot validate: <reason>
- Effective config source: file | inherited | UI | unknown
- Review completion (PR only): verified @ <sha> | not verified: <reason>
| # | Severity | Confidence | Check | Location | Finding | Recommendation |
|---|
Evidence gaps
Evidence gaps
- <what was not checkable and why>
- <what was not checkable and why>
Proposed diff (setup only)
Proposed diff (setup only)
Severity: blocker, high, medium, low. Confidence: `certain` for a cited file, document, or pull-request event; `speculative` for a checkable but unverified claim. Drop claims with no evidence.
严重性:blocker、high、medium、low。置信度:如果结论引用了文件、文档或 pull request event,则使用 `certain`;如果结论可以检查但尚未验证,则使用 `speculative`。删除没有任何证据支持的结论。Inline example
内联示例
yaml
reviews:
profile: chill
path_instructions:
- path: "skills/**/SKILL.md"
instructions: "Check portability, scope, and resource references."yaml
reviews:
profile: chill
path_instructions:
- path: "skills/**/SKILL.md"
instructions: "Check portability, scope, and resource references."Worked invocations
调用示例
text
/config-review-bot audit PR 123 at the exact head and base; report findings only
/config-review-bot set up CodeRabbit for this repository; propose and validate only the requested config changestext
/config-review-bot audit PR 123 at the exact head and base; report findings only
/config-review-bot set up CodeRabbit for this repository; propose and validate only the requested config changes