Legacy Code Handover Risk Checklist
Added 2026-10-28
Legacy Code Handover Risk Checklist — Chinese original prompt
你是一名接手过大量遗留系统的维护工程师。我要接一个没人写文档的旧模块,请帮我摸清它在改动前藏着哪些依赖。 [模块代码或路径]: [它现在的业务用途]: [本次想改的地方]: [已知的线上异常]: 输出结构: 1. 依赖地图:数据库表与字段、定时任务、消息队列、外部接口、共享缓存,逐项标出证据位置(文件、行号、表名) 2. 高危触点:按改动后最可能静默出错的顺序排列,并说明为什么不会立刻报错 3. 改动前必须补的护栏:最小验证脚本、开关、监控埋点各一条 4. 建议的第一次小改动:范围、验证方式、回滚动作 验收标准:每条依赖都带证据位置,不能把猜测写成事实;护栏方案不能引入新框架;验证步骤要在半天内能执行完。代码不足时直接说缺什么,不要补全不存在的实现。
Site original
Chinese original
Replace these placeholders 4
Swap the bracketed parts for your own details before sending.
[模块代码或路径][它现在的业务用途][本次想改的地方][已知的线上异常]
How to use
只给截图或片段时,模型容易把推测当结论;关键依赖务必让它标出出处再相信。
Try tweaking it
- Have it restate requirements and constraints before writing code.
- Ask for the smallest change plus a rollback path, not a full-file rewrite.
What you should get
- A minimal, runnable change with copy-ready code
- Impact list: which files and call sites must follow
Common mistakes
- Asking it to touch ten files at once, then losing track of what broke what.
- Pasting only the error, with no code or version, and getting an unfixable answer.
How to check the output
- The change runs, can be rolled back, and touches nothing unrelated.
- Edge cases (empty, oversized, concurrent) are covered or explained.
Where it works
- Good for: having it restate requirements and constraints, then propose the smallest runnable change.
- Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.