跳到正文
返回提示词列表
编程codex.danielvaughan.com · 收录于

重构指定 TypeScript 文件,将每个函数的圈复杂度降到 10 以下,同时保持行为不变并确保测试通过。

完整提示词

Refactor @src/utils/parser.ts to reduce cyclomatic complexity below 10 per function. Preserve identical behaviour — run the existing test suite before and after to confirm. Constraints: no new dependencies. British English in comments. Done when: all functions score below 10 and tests pass.

使用说明

复制全文后,按自己的场景替换占位变量(方括号 / 双花括号包裹的字段)再使用。 部分提示词依赖特定模型或工具(如 GPT / Claude / Copilot),请根据实际情况调整。