code-review-fix
Testing & Quality读取当前项目 code-review 文件夹中按分支名生成的审查结果,修复 P0、P1 问题,并继续修复必要问题直到下一次 code-review 评分超过 80 分
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/LAIJiangFeng/resume-builder/blob/HEAD/.claude/skills/code-review-fix/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/code-review-fix, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Code Review 结果修复技能
本技能用于读取当前项目根目录 code-review/ 下由 code-review 技能生成的审查结果,并按优先级修复问题:
- P0:必须修复
- P1:必须修复
- P2:为达到目标评分可选择性修复
目标约束:
- 必须修复全部
P0、P1 - 修复完成后,下一次
code-review评分必须 大于 80 分
使用前提
- 仓库根目录存在
code-review/ - 已运行过
code-review并生成当前分支对应的.md审查报告
执行步骤
1. 定位当前分支对应的审查报告
- 运行
git branch --show-current获取当前分支名 - 将分支名中的
/替换为- - 读取根目录报告文件:
code-review/{sanitized-branch-name}.md
如果文件不存在:
- 提示用户先运行
code-review - 不要猜测或凭空修复
2. 解析报告
从报告中提取:
- 当前评分
P0 / P1 / P2问题列表- 每个问题的文件路径、行号、问题原因、修复建议
如果报告缺少路径、行号或描述不完整:
- 先回到代码上下文补齐理解
- 不要直接跳过
P0 / P1
3. 修复优先级
按以下顺序执行:
- 修复全部
P0 - 修复全部
P1 - 计算修复完
P0 / P1后的预期评分 - 如果预期评分仍然 小于等于 80,继续从高价值
P2中选择问题修复,直到下一次code-review预计可 超过 80
说明:
P0 = 🔴严重P1 = 🟡中等P2 = 🟢轻微
4. 修复原则
- 必须最小化修改:优先按审查意见直达修复,不做无关重构
- 必须保持一致性:符合当前项目目录边界、代码风格和仓库规则
- 必须避免误伤:一个问题的修复不能引入新的 P0/P1
- 同文件合并处理:同一文件的多个问题尽量一次性修复
5. 验证要求
修复后按当前仓库允许的方式执行验证,优先使用:
npm run lintnpm run type-check- 必要时
npm run build-only
禁止:
- 新增测试代码
- 修改现有测试代码
6. 重新执行 code-review
修复完成后,必须再次执行 code-review,并检查新生成的报告:
P0数量必须为0P1数量必须为0- 评分必须 大于 80 分
如果仍未达到目标:
- 继续根据最新报告修复问题
- 直到满足上述条件为止
输出要求
修复阶段的汇总至少包含:
## Code Review Fix Summary
- Branch: `{branch-name}`
- Source Report: `code-review/{sanitized-branch-name}.md`
- Fixed P0: X
- Fixed P1: X
- Fixed P2: X
- Next Review Target: `> 80`
注意事项
- 如果某个
P0 / P1问题已经在当前代码中不存在,必须说明原因,并重新执行code-review验证,而不是静默跳过 - 如果报告建议与当前仓库规则冲突,优先遵守仓库规则,再选择最接近的安全修复方案
- 若
P0 / P1全部修完但分数仍无法超过80,必须继续处理足够数量的P2