OpenParable
Skip to content
← Back to skills

code-review-fix

Testing & Quality

读取当前项目 code-review 文件夹中按分支名生成的审查结果,修复 P0、P1 问题,并继续修复必要问题直到下一次 code-review 评分超过 80 分

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. 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. 定位当前分支对应的审查报告

  1. 运行 git branch --show-current 获取当前分支名
  2. 将分支名中的 / 替换为 -
  3. 读取根目录报告文件:
code-review/{sanitized-branch-name}.md

如果文件不存在:

  • 提示用户先运行 code-review
  • 不要猜测或凭空修复

2. 解析报告

从报告中提取:

  • 当前评分
  • P0 / P1 / P2 问题列表
  • 每个问题的文件路径、行号、问题原因、修复建议

如果报告缺少路径、行号或描述不完整:

  • 先回到代码上下文补齐理解
  • 不要直接跳过 P0 / P1

3. 修复优先级

按以下顺序执行:

  1. 修复全部 P0
  2. 修复全部 P1
  3. 计算修复完 P0 / P1 后的预期评分
  4. 如果预期评分仍然 小于等于 80,继续从高价值 P2 中选择问题修复,直到下一次 code-review 预计可 超过 80

说明:

  • P0 = 🔴严重
  • P1 = 🟡中等
  • P2 = 🟢轻微

4. 修复原则

  • 必须最小化修改:优先按审查意见直达修复,不做无关重构
  • 必须保持一致性:符合当前项目目录边界、代码风格和仓库规则
  • 必须避免误伤:一个问题的修复不能引入新的 P0/P1
  • 同文件合并处理:同一文件的多个问题尽量一次性修复

5. 验证要求

修复后按当前仓库允许的方式执行验证,优先使用:

  • npm run lint
  • npm run type-check
  • 必要时 npm run build-only

禁止:

  • 新增测试代码
  • 修改现有测试代码

6. 重新执行 code-review

修复完成后,必须再次执行 code-review,并检查新生成的报告:

  • P0 数量必须为 0
  • P1 数量必须为 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