kf-fix-bug

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fix Bug

修复Bug

Correct the root cause with the smallest safe change while preserving unaffected behavior.
在保留未受影响功能的前提下,以最小且安全的修改纠正问题的根本原因。

Workflow

工作流程

  1. Identify the reported symptom, expected behavior, scope, and available evidence.
  2. Reproduce the defect when practical, or establish the strongest observable proxy when the original environment is unavailable.
  3. Trace the relevant execution and data paths. Compare nearby working paths and analogous implementations.
  4. Form and test hypotheses until the evidence distinguishes root cause from downstream symptoms.
  5. Implement the smallest root-cause fix that follows repository conventions.
  6. Add or update focused regression coverage when practical and proportionate.
  7. Run targeted validation, then broader checks only when risk or repository practice justifies them.
  8. Inspect failures and the final diff. Fix failures caused by the change; disclose unrelated or unrun checks.
  1. 确认报告的症状、预期行为、影响范围以及可用证据。
  2. 尽可能复现缺陷;若原始环境不可用,则建立最可靠的可观测替代方案。
  3. 追踪相关的执行路径和数据路径。对比相近的正常路径及类似实现。
  4. 提出并验证假设,直到证据能区分根本原因与下游症状。
  5. 遵循仓库规范,实现针对根本原因的最小修复。
  6. 在可行且合理的情况下,添加或更新针对性的回归测试覆盖。
  7. 先执行针对性验证,仅当风险或仓库实践要求时再进行更广泛的检查。
  8. 检查失败情况及最终差异。修复由本次修改导致的失败;披露无关或未执行的检查项。

Constraints

约束条件

  • Do not begin with a refactor unless it is necessary to make the correction safe.
  • Treat feedback that asks Codex to undo or revise its current-task changes as a continuation of that task, not as a newly discovered product defect.
  • Do not suppress exceptions, weaken assertions, disable checks, or patch output merely to hide the symptom.
  • Avoid unrelated cleanup, dependency additions, and behavior changes.
  • If reproduction is impossible, state the evidence, diagnosis, confidence, and residual uncertainty rather than claiming certainty.
Unlike
kf-investigate-issue
, this skill includes implementing and validating the correction.
  • 除非为了确保修复的安全性,否则不要从重构开始。
  • 将要求Codex撤销或修改当前任务中更改的反馈视为任务的延续,而非新发现的产品缺陷。
  • 请勿通过抑制异常、弱化断言、禁用检查或修补输出来掩盖症状。
  • 避免进行无关的清理、依赖项添加或行为变更。
  • 若无法复现缺陷,请说明证据、诊断结果、置信度及剩余不确定性,而非声称已确定原因。
kf-investigate-issue
不同,此技能包含修复方案的实现与验证环节。