GPT-5.6 Luna · prompt
把“Apply Occam’s Razor:减少 Luna/Codex 过度设计的提示词”整理为可执行的任务入口,明确输入、运行环境、交付格式和验收边界;使用前确认模型版本与来源限制。
审查 {{REPO_CONTEXT}},围绕 {{CHANGE_REQUEST}} 提出最小改动;遵守 {{STOP_RULE}},运行 {{TEST_COMMAND}} 并报告未验证假设。运行前仍需替换: {{CHANGE_REQUEST}}, {{REPO_CONTEXT}}, {{STOP_RULE}}, {{TEST_COMMAND}}
用最小实现原则约束 Codex/Luna 的代码改动,同时保留清晰模块边界。
需要代码库、当前需求、现有测试和不可改变的接口;先确认 skills/plugins 是否冲突。
阅读相关代码;列出复用、删除或合并选项;提出最小补丁;运行 {{TEST_COMMAND}};逐项报告行为是否改变。
示例交付包含根因、触及文件、补丁范围和测试结果;验收不新增无关依赖、不删掉必要边界、测试可复现。
若最小方案无法满足需求,说明缺口并升级方案;不要把“简单”解释成跳过测试或模块职责。
来源是社区工作流,不是官方 Codex 默认设置;编辑块避免复制原帖长指令,需按客户端版本复核。
发帖者建议在 Codex 中明确要求使用 Occam’s Razor,以减少 Sol 的过度工程;这套规则同样可作为 Luna 处理代码任务时的边界提示。评论区补充了重要限制:简单不等于取消模块边界,仍要保持清晰职责;如果已有大量 skills、plugins 或互相冲突的规则,单独增加这段提示未必能解决 harness 问题。
Apply Occam's Razor
- Prefer the simplest design and implementation that fully satisfies the
current, demonstrated requirements.
- Do not add abstractions, layers, configuration, extension points, dependencies,
or infrastructure for hypothetical future needs. Introduce them only when
concrete requirements or repeated patterns justify their cost.
- Before adding code, consider whether the goal can be met by deleting,
consolidating, or reusing existing code.
- When multiple approaches are correct, choose the one with fewer concepts,
moving parts, and maintenance obligations, unless evidence shows that a more
complex approach is necessary.
- Treat patterns and principles as tools, not goals. Do not apply SOLID, design
patterns, or architectural boundaries in ways that make a small solution more
complicated than the problem requires.The goal should be the simplest design that still preserves clear responsibilities and boundaries.
A lot of these prompts work fine in isolation because it’s good advice, doesn’t mean the agent won’t wander or get conte… 以上为必要节选,完整内容请查看原文。
You have to tell it specifically to use Occam's razor. Otherwise, it may still over-engineer even if the instructions ar… 以上为必要节选,完整内容请查看原文。
这段提示词只约束复杂度,不替代项目规范、测试和安全检查。使用时应追加任务级完成标准,例如“先检查现有实现、列出受影响文件、完成测试后停止”,防止模型把“最简单”误解为删除必要的职责边界。
Reddit,r/codex · 原文日期: 2026-07-30 · 编辑日期: 2026-09-20
阅读原始来源GPT-5.6 Luna
请在上方所列环境中运行本指南。下载不会自动传入模板,也不代表账户已开放该模型。