fix-coderabbit-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFix CodeRabbit Review
修复CodeRabbit审查问题
Execute PR review remediation in a strict sequence: export issues, fix all issues, commit once, resolve threads.
Core principle: evaluate each review item technically before changing code. Do not apply suggestions blindly.
严格按顺序执行PR审查修复:导出问题、修复所有问题、单次提交、解决线程。
核心原则:修改代码前需从技术层面评估每个审查项,请勿盲目采纳建议。
Required Inputs
所需输入
- PR number (integer).
- in environment.
GITHUB_TOKEN - authenticated for the target repository.
gh
- PR编号(整数)
- 环境变量中的
GITHUB_TOKEN - 已针对目标仓库完成身份认证的
gh
Workflow
工作流
- Export review issues for the PR.
- Triage and validate every unresolved issue.
- Fix every validated issue completely.
- Commit all remediation changes together in one commit.
- Resolve review threads and mark exported issues resolved.
Run commands from repository root.
- 导出该PR的审查问题。
- 对所有未解决问题进行分类校验。
- 完整修复所有校验通过的问题。
- 将所有修复改动合并为单次提交。
- 解决审查线程并将导出的问题标记为已解决。
请在仓库根目录下运行所有命令。
Step 1: Export CodeRabbit Issues
步骤1:导出CodeRabbit问题
Use bundled exporter script:
bash
PR_NUMBER=<pr-number>
pnpm exec tsx .claude/skills/fix-coderabbit-review/scripts/pr-review.ts "$PR_NUMBER" --hide-resolvedRead generated files in:
ai-docs/reviews-pr-<PR_NUMBER>/_summary.mdai-docs/reviews-pr-<PR_NUMBER>/issues/*.md
If shows unresolved issues, continue until all are addressed in code.
_summary.md使用内置的导出脚本:
bash
PR_NUMBER=<pr-number>
pnpm exec tsx .claude/skills/fix-coderabbit-review/scripts/pr-review.ts "$PR_NUMBER" --hide-resolved生成的文件读取路径:
ai-docs/reviews-pr-<PR_NUMBER>/_summary.mdai-docs/reviews-pr-<PR_NUMBER>/issues/*.md
如果显示存在未解决问题,请持续处理直到代码中所有问题都被修复。
_summary.mdStep 2: Triage and Validate Issues
步骤2:问题分类与校验
Review each unresolved issue file before implementation.
For each issue:
- Restate the concrete technical change required.
- Verify against current codebase behavior and tests.
- Decide one of:
- : suggestion is correct and should be implemented.
VALID - : suggestion is incorrect or not actionable for this codebase.
INVALID
Rules:
- If an issue is ambiguous, treat it as , document rationale and assumptions in the issue file, and continue execution.
INVALID - If an issue is , document technical rationale directly in the issue file and do not force a bad change.
INVALID - Prefer technical evidence over agreement language.
实现前请逐一审查所有未解决问题文件。
针对每个问题:
- 明确所需的具体技术改动内容。
- 结合当前代码库行为和测试结果进行验证。
- 选择以下任一处理方式:
- :建议正确,应当实现。
VALID - :建议有误,或不适用于当前代码库。
INVALID
规则:
- 如果问题表述模糊,将其标记为,在问题文件中记录判断依据和假设,再继续后续流程。
INVALID - 如果问题被标记为,直接在问题文件中记录技术层面的判断依据,请勿强行引入不合理的改动。
INVALID - 优先以技术证据为准,而非一致性表述。
Step 3: Fix Issues Completely
步骤3:完整修复所有问题
Process all unresolved issue files under .
ai-docs/reviews-pr-<PR_NUMBER>/issues/- Implement production-quality fixes in source code.
- Add or update tests so each fix is verified.
- Execute fixes one issue at a time and validate each before moving to the next.
- Do not leave partial fixes.
- Do not skip issues unless they are invalid; for invalid issues, keep rationale in the issue file.
After finishing all issue fixes, run full verification before commit:
bash
pnpm run lint
pnpm run typecheck
pnpm run test处理目录下所有未解决的问题文件。
ai-docs/reviews-pr-<PR_NUMBER>/issues/- 在源代码中实现生产级质量的修复。
- 新增或更新测试用例,确保每个修复都得到验证。
- 逐个处理问题,完成单个问题的修复并验证通过后再处理下一个。
- 请勿留下未完成的部分修复。
- 除非问题无效,否则请勿跳过问题;对于无效问题,请在问题文件中保留判断依据。
完成所有问题修复后,提交前运行完整的校验:
bash
pnpm run lint
pnpm run typecheck
pnpm run testStep 4: Commit All Fixes Together
步骤4:将所有修复合并为单次提交
Create exactly one remediation commit containing all related code, test, and issue-tracking changes.
bash
git add -A
git commit -m "fix(repo): resolve PR #<PR_NUMBER> review issues"Do not split fixes across multiple commits.
仅创建一个修复提交,包含所有相关的代码、测试以及问题追踪改动。
bash
git add -A
git commit -m "fix(repo): resolve PR #<PR_NUMBER> review issues"请勿将修复拆分到多个提交中。
Step 5: Resolve Review Threads
步骤5:解决审查线程
After the single commit is created, resolve exported issue threads.
Determine the issue range from issue files (example: to ) and run:
001018bash
bash .claude/skills/fix-coderabbit-review/scripts/resolve_pr_issues.sh \
--pr-dir ai-docs/reviews-pr-<PR_NUMBER> \
--from <first-issue-number> \
--to <last-issue-number>Re-open and confirm unresolved count is .
ai-docs/reviews-pr-<PR_NUMBER>/_summary.md0If thread resolution fails for specific IDs, keep those issues marked unresolved and report exact failures instead of claiming completion.
创建完单次提交后,解决导出的问题对应的审查线程。
从问题文件中确定问题编号范围(示例:到),然后运行:
001018bash
bash .claude/skills/fix-coderabbit-review/scripts/resolve_pr_issues.sh \
--pr-dir ai-docs/reviews-pr-<PR_NUMBER> \
--from <first-issue-number> \
--to <last-issue-number>重新打开,确认未解决问题计数为。
ai-docs/reviews-pr-<PR_NUMBER>/_summary.md0如果特定ID的线程解决失败,保持这些问题的未解决标记,上报具体的失败原因,不要声称已完成。
Output Contract
输出约定
Deliver:
- One commit containing all remediation changes.
- Per-issue technical disposition (or
VALID) recorded during triage.INVALID - Updated statuses.
ai-docs/reviews-pr-<PR_NUMBER>/issues/*.md - Updated counts/checklist.
ai-docs/reviews-pr-<PR_NUMBER>/_summary.md - Resolved review threads for addressed issues.
交付物:
- 包含所有修复改动的单次提交。
- 分类过程中记录的每个问题的技术处理结果(或
VALID)。INVALID - 状态已更新的文件。
ai-docs/reviews-pr-<PR_NUMBER>/issues/*.md - 计数/检查清单已更新的文件。
ai-docs/reviews-pr-<PR_NUMBER>/_summary.md - 已解决的已处理问题对应的审查线程。