gpt-5-4-prompting
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGPT-5.4 Prompting
GPT-5.4 提示词编写
Use this skill when needs to ask Codex or another GPT-5.4-based workflow for help.
codex:codex-rescuePrompt Codex like an operator, not a collaborator. Keep prompts compact and block-structured with XML tags. State the task, the output contract, the follow-through defaults, and the small set of extra constraints that matter.
Core rules:
- Prefer one clear task per Codex run. Split unrelated asks into separate runs.
- Tell Codex what done looks like. Do not assume it will infer the desired end state.
- Add explicit grounding and verification rules for any task where unsupported guesses would hurt quality.
- Prefer better prompt contracts over raising reasoning or adding long natural-language explanations.
- Use XML tags consistently so the prompt has stable internal structure.
Default prompt recipe:
- : the concrete job and the relevant repository or failure context.
<task> - or
<structured_output_contract>: exact shape, ordering, and brevity requirements.<compact_output_contract> - : what Codex should do by default instead of asking routine questions.
<default_follow_through_policy> - or
<verification_loop>: required for debugging, implementation, or risky fixes.<completeness_contract> - or
<grounding_rules>: required for review, research, or anything that could drift into unsupported claims.<citation_rules>
When to add blocks:
- Coding or debugging: add ,
completeness_contract, andverification_loop.missing_context_gating - Review or adversarial review: add ,
grounding_rules, andstructured_output_contract.dig_deeper_nudge - Research or recommendation tasks: add and
research_mode.citation_rules - Write-capable tasks: add so Codex stays narrow and avoids unrelated refactors.
action_safety
How to choose prompt shape:
- Use built-in or
reviewcommands when the job is reviewing local git changes. Those prompts already carry the review contract.adversarial-review - Use when the task is diagnosis, planning, research, or implementation and you need to control the prompt more directly.
task - Use for follow-up instructions on the same Codex thread. Send only the delta instruction instead of restating the whole prompt unless the direction changed materially.
task --resume-last
Working rules:
- Prefer explicit prompt contracts over vague nudges.
- Use stable XML tag names that match the block names from the reference file.
- Do not raise reasoning or complexity first. Tighten the prompt and verification rules before escalating.
- Ask Codex for brief, outcome-based progress updates only when the task is long-running or tool-heavy.
- Keep claims anchored to observed evidence. If something is a hypothesis, say so.
Prompt assembly checklist:
- Define the exact task and scope in .
<task> - Choose the smallest output contract that still makes the answer easy to use.
- Decide whether Codex should keep going by default or stop for missing high-risk details.
- Add verification, grounding, and safety tags only where the task needs them.
- Remove redundant instructions before sending the prompt.
Reusable blocks live in references/prompt-blocks.md.
Concrete end-to-end templates live in references/codex-prompt-recipes.md.
Common failure modes to avoid live in references/codex-prompt-antipatterns.md.
当需要向Codex或其他基于GPT-5.4的工作流寻求帮助时,请使用本规范。
codex:codex-rescue像给操作员下达指令一样向Codex发送提示词,而非将其当作协作伙伴。保持提示词简洁紧凑,使用XML标签进行分块结构组织。明确说明任务、输出约定、默认后续执行规则,以及少量重要的额外约束。
核心规则:
- 每次调用Codex尽量只执行一项明确的任务,将不相关的请求拆分到不同的调用中。
- 明确告知Codex任务完成的判定标准,不要假设它会自行推断预期的最终状态。
- 对于任何无依据猜测会影响结果质量的任务,需添加明确的事实锚定与核验规则。
- 优先完善提示词约定,而非增加推理步骤或添加冗长的自然语言解释。
- 统一使用XML标签,确保提示词具备稳定的内部结构。
默认提示词结构模板:
- :具体任务内容,以及相关的代码仓库或故障上下文。
<task> - 或
<structured_output_contract>:对输出格式、排序、简洁度的明确要求。<compact_output_contract> - :Codex无需询问常规问题、默认执行的规则。
<default_follow_through_policy> - 或
<verification_loop>:调试、功能实现或高风险修复场景下必填。<completeness_contract> - 或
<grounding_rules>:评审、研究或任何可能出现无依据表述的场景下必填。<citation_rules>
不同场景需添加的块:
- 编码或调试场景:添加、
completeness_contract和verification_loop。missing_context_gating - 评审或对抗评审场景:添加、
grounding_rules和structured_output_contract。dig_deeper_nudge - 研究或推荐类任务:添加和
research_mode。citation_rules - 具备写入权限的任务:添加,确保Codex的操作范围可控,避免执行无关的重构。
action_safety
如何选择提示词类型:
- 如果任务是评审本地git变更,使用内置的或
review命令,这些命令的提示词已经内置了评审约定。adversarial-review - 如果任务是诊断、规划、研究或实现,且你需要更直接地控制提示词内容,使用。
task - 对同一个Codex会话发送后续指令时使用,除非任务方向发生重大变更,否则仅发送增量指令,无需重述整个提示词。
task --resume-last
执行规则:
- 优先使用明确的提示词约定,而非模糊的引导。
- 使用与参考文件中块名称一致的稳定XML标签名。
- 不要首先增加推理步骤或复杂度,在提升模型能力等级前先优化提示词和核验规则。
- 仅当任务运行时间长或需要调用大量工具时,才要求Codex提供基于结果的简短进度更新。
- 所有表述都要基于可观测的证据,如果是假设需要明确说明。
提示词组装检查清单:
- 在中明确定义具体任务和范围。
<task> - 选择能够保证输出结果易用的最简输出约定。
- 确定Codex在缺少高风险细节时,是默认继续执行还是暂停询问。
- 仅在任务需要时添加核验、事实锚定和安全相关标签。
- 发送提示词前删除冗余的指令。
可复用的块存放在 references/prompt-blocks.md。
完整的端到端模板存放在 references/codex-prompt-recipes.md。
需要避免的常见错误模式存放在 references/codex-prompt-antipatterns.md。