Opus 5.5 — 通用难度: Advanced制作路径: Coding & simulation

深度重构与不变量分析

在改动支付/积分等生产代码前,让 Opus 5.5 提取循环不变量、前后条件与安全重构步骤。

提示词

91 words · 637 characters
Analyze the supplied module for a safe refactor.

Steps (show work):
1. List public entrypoints and side effects (DB, HTTP, filesystem).
2. For each non-trivial loop/recursion: state invariant, variant function, and termination argument.
3. Identify hidden coupling (shared mutable state, implicit ordering).
4. Propose refactor as small steps; each step must preserve observational equivalence for listed entrypoints.
5. Flag race conditions under concurrent calls.
6. Output test cases that would fail if invariants break (table: input, expected, property checked).

Do NOT rewrite code until step 6 is approved. Use markdown headings.

工作流说明

每次粘贴一个 module 服务文件;对照现有测试;FIFO 积分逻辑特别适合分步推理。

看清楚,再上 Fable5

先算清成本、弄懂安全回退、选对模型档位,再做决定。注册免费账号,规格、价格或渠道一有变化就通知你。