gpt-5-4-prompting

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GPT-5.4 Prompting

GPT-5.4 提示词编写

Use this skill when
codex:codex-rescue
needs to ask Codex or another GPT-5.4-based workflow for help.
Prompt 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:
  • <task>
    : the concrete job and the relevant repository or failure context.
  • <structured_output_contract>
    or
    <compact_output_contract>
    : exact shape, ordering, and brevity requirements.
  • <default_follow_through_policy>
    : what Codex should do by default instead of asking routine questions.
  • <verification_loop>
    or
    <completeness_contract>
    : required for debugging, implementation, or risky fixes.
  • <grounding_rules>
    or
    <citation_rules>
    : required for review, research, or anything that could drift into unsupported claims.
When to add blocks:
  • Coding or debugging: add
    completeness_contract
    ,
    verification_loop
    , and
    missing_context_gating
    .
  • Review or adversarial review: add
    grounding_rules
    ,
    structured_output_contract
    , and
    dig_deeper_nudge
    .
  • Research or recommendation tasks: add
    research_mode
    and
    citation_rules
    .
  • Write-capable tasks: add
    action_safety
    so Codex stays narrow and avoids unrelated refactors.
How to choose prompt shape:
  • Use built-in
    review
    or
    adversarial-review
    commands when the job is reviewing local git changes. Those prompts already carry the review contract.
  • Use
    task
    when the task is diagnosis, planning, research, or implementation and you need to control the prompt more directly.
  • Use
    task --resume-last
    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.
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:
  1. Define the exact task and scope in
    <task>
    .
  2. Choose the smallest output contract that still makes the answer easy to use.
  3. Decide whether Codex should keep going by default or stop for missing high-risk details.
  4. Add verification, grounding, and safety tags only where the task needs them.
  5. 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:codex-rescue
需要向Codex或其他基于GPT-5.4的工作流寻求帮助时,请使用本规范。
像给操作员下达指令一样向Codex发送提示词,而非将其当作协作伙伴。保持提示词简洁紧凑,使用XML标签进行分块结构组织。明确说明任务、输出约定、默认后续执行规则,以及少量重要的额外约束。
核心规则:
  • 每次调用Codex尽量只执行一项明确的任务,将不相关的请求拆分到不同的调用中。
  • 明确告知Codex任务完成的判定标准,不要假设它会自行推断预期的最终状态。
  • 对于任何无依据猜测会影响结果质量的任务,需添加明确的事实锚定与核验规则。
  • 优先完善提示词约定,而非增加推理步骤或添加冗长的自然语言解释。
  • 统一使用XML标签,确保提示词具备稳定的内部结构。
默认提示词结构模板:
  • <task>
    :具体任务内容,以及相关的代码仓库或故障上下文。
  • <structured_output_contract>
    <compact_output_contract>
    :对输出格式、排序、简洁度的明确要求。
  • <default_follow_through_policy>
    :Codex无需询问常规问题、默认执行的规则。
  • <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
  • 具备写入权限的任务:添加
    action_safety
    ,确保Codex的操作范围可控,避免执行无关的重构。
如何选择提示词类型:
  • 如果任务是评审本地git变更,使用内置的
    review
    adversarial-review
    命令,这些命令的提示词已经内置了评审约定。
  • 如果任务是诊断、规划、研究或实现,且你需要更直接地控制提示词内容,使用
    task
  • 对同一个Codex会话发送后续指令时使用
    task --resume-last
    ,除非任务方向发生重大变更,否则仅发送增量指令,无需重述整个提示词。
执行规则:
  • 优先使用明确的提示词约定,而非模糊的引导。
  • 使用与参考文件中块名称一致的稳定XML标签名。
  • 不要首先增加推理步骤或复杂度,在提升模型能力等级前先优化提示词和核验规则。
  • 仅当任务运行时间长或需要调用大量工具时,才要求Codex提供基于结果的简短进度更新。
  • 所有表述都要基于可观测的证据,如果是假设需要明确说明。
提示词组装检查清单:
  1. <task>
    中明确定义具体任务和范围。
  2. 选择能够保证输出结果易用的最简输出约定。
  3. 确定Codex在缺少高风险细节时,是默认继续执行还是暂停询问。
  4. 仅在任务需要时添加核验、事实锚定和安全相关标签。
  5. 发送提示词前删除冗余的指令。
可复用的块存放在 references/prompt-blocks.md。 完整的端到端模板存放在 references/codex-prompt-recipes.md。 需要避免的常见错误模式存放在 references/codex-prompt-antipatterns.md